diff --git a/.genignore b/.genignore index 3ef32897..6bd11b26 100644 --- a/.genignore +++ b/.genignore @@ -1,5 +1,6 @@ pyproject.toml examples/* /utils/* -src/mistral/extra/* -pylintrc \ No newline at end of file +src/mistralai/extra/* +pylintrc +scripts/prepare_readme.py diff --git a/.github/workflows/lint_custom_code.yaml b/.github/workflows/lint_custom_code.yaml index 0bbf7126..da520486 100644 --- a/.github/workflows/lint_custom_code.yaml +++ b/.github/workflows/lint_custom_code.yaml @@ -14,21 +14,33 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 with: python-version: '3.12' - - name: Install Poetry - uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1 + - name: Install uv + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 - name: Install dependencies run: | - touch README-PYPI.md - poetry install --all-extras + uv sync --all-extras # The init, sdkhooks.py and types.py files in the _hooks folders are generated by Speakeasy hence the exclusion - name: Run all linters run: scripts/lint_custom_code.sh + + lint_custom_code_required: + runs-on: ubuntu-latest + needs: lint + if: ${{ always() }} + + steps: + - name: Require custom code lint to pass + run: | + if [ "${{ needs.lint.result }}" != "success" ]; then + echo "Expected custom code lint to pass, got: ${{ needs.lint.result }}" + exit 1 + fi diff --git a/.github/workflows/run_example_scripts.yaml b/.github/workflows/run_example_scripts.yaml index 7d8eb792..35ec1def 100644 --- a/.github/workflows/run_example_scripts.yaml +++ b/.github/workflows/run_example_scripts.yaml @@ -14,19 +14,19 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python-version }} - - name: Install Poetry - uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1 + - name: Install uv + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 - name: Set VERSION run: | @@ -39,25 +39,25 @@ jobs: - name: Build the package run: | - touch README-PYPI.md # Create this file since the client is not built by Speakeasy - poetry build + uv build - - name: For python 3.9, install the client and run examples without extra dependencies. - if: matrix.python-version == '3.9' - run: | - PACKAGE="dist/$(ls dist | grep whl | head -n 1)" - python3 -m pip install "$PACKAGE" - ./scripts/run_examples.sh --no-extra-dep - env: - MISTRAL_AGENT_ID: ${{ secrets.CI_AGENT_ID }} - MISTRAL_API_KEY: ${{ env.MISTRAL_API_KEY }} - - - name: For python 3.10+, install client with extras and run all examples. - if: matrix.python-version != '3.9' + - name: Install client with extras and run all examples. run: | PACKAGE="dist/$(ls dist | grep whl | head -n 1)[agents]" - python3 -m pip install "$PACKAGE" + uv pip install --system "$PACKAGE" ./scripts/run_examples.sh env: - MISTRAL_AGENT_ID: ${{ secrets.CI_AGENT_ID }} MISTRAL_API_KEY: ${{ env.MISTRAL_API_KEY }} + + run_examples_required: + runs-on: ubuntu-latest + needs: run_examples + if: ${{ always() }} + + steps: + - name: Require all example jobs to pass + run: | + if [ "${{ needs.run_examples.result }}" != "success" ]; then + echo "Expected all run_examples matrix jobs to pass, got: ${{ needs.run_examples.result }}" + exit 1 + fi diff --git a/.github/workflows/sdk_generation_mistralai_azure_sdk.yaml b/.github/workflows/sdk_generation_mistralai_azure_sdk.yaml index 7ec5bb8d..7b412a4c 100644 --- a/.github/workflows/sdk_generation_mistralai_azure_sdk.yaml +++ b/.github/workflows/sdk_generation_mistralai_azure_sdk.yaml @@ -15,15 +15,98 @@ permissions: description: optionally set a specific SDK version type: string jobs: + resolve-speakeasy-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.resolve.outputs.version }} + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Resolve Speakeasy version from workflow config + id: resolve + run: | + set -euo pipefail + VERSION=$(awk '/^speakeasyVersion:/{print $2; exit}' .speakeasy/workflow.yaml | tr -d '"') + if [ -z "${VERSION:-}" ]; then + echo "Could not resolve speakeasyVersion from .speakeasy/workflow.yaml" + exit 1 + fi + echo "Resolved Speakeasy version: $VERSION" + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + generate: - uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 + needs: resolve-speakeasy-version + uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@7951d9dce457425b900b2dd317253499d98c2587 # v15 with: force: ${{ github.event.inputs.force }} mode: pr set_version: ${{ github.event.inputs.set_version }} - speakeasy_version: latest - target: mistral-python-sdk-azure + speakeasy_version: ${{ needs.resolve-speakeasy-version.outputs.version }} + target: mistralai-azure-sdk + feature_branch: speakeasy-sdk-regen-${{ github.run_id }} secrets: - github_access_token: ${{ secrets.GITHUB_TOKEN }} + github_access_token: ${{ secrets.CLIENT_PIPELINE }} pypi_token: ${{ secrets.PYPI_TOKEN }} speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + + align-version: + needs: generate + runs-on: ubuntu-latest + steps: + - name: Find PR branch + id: find-pr + env: + GH_TOKEN: ${{ secrets.CLIENT_PIPELINE }} + SPEAKEASY_BRANCH: speakeasy-sdk-regen-${{ github.run_id }} + run: | + set -euo pipefail + PR_BRANCH="$SPEAKEASY_BRANCH" + echo "Using Speakeasy generated branch: $PR_BRANCH" + echo "branch=$PR_BRANCH" >> "$GITHUB_OUTPUT" + + - name: Checkout PR branch + if: steps.find-pr.outputs.branch != '' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + ref: ${{ steps.find-pr.outputs.branch }} + token: ${{ secrets.CLIENT_PIPELINE }} + + - name: Install uv + if: steps.find-pr.outputs.branch != '' + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 + + - name: Align version using uv + if: steps.find-pr.outputs.branch != '' + run: | + set -euo pipefail + + VERSION=$(grep 'releaseVersion:' packages/azure/.speakeasy/gen.lock | head -1 | awk '{print $2}' | tr -d '"') + if [ -z "$VERSION" ]; then + echo "No releaseVersion found in gen.lock" + exit 0 + fi + echo "Found version: $VERSION" + + CURRENT=$(grep '^version = ' packages/azure/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + if [ "$CURRENT" = "$VERSION" ]; then + echo "Version already aligned to $VERSION" + exit 0 + fi + + echo "Updating version from $CURRENT to $VERSION" + uv version "$VERSION" --directory packages/azure + + - name: Commit and push + if: steps.find-pr.outputs.branch != '' + run: | + git config user.email "action@github.com" + git config user.name "GitHub Action" + git add packages/azure/pyproject.toml packages/azure/uv.lock + if git diff --cached --quiet; then + echo "No changes to commit" + else + VERSION=$(grep '^version = ' packages/azure/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + git commit -m "chore: align Azure pyproject.toml and uv.lock to version $VERSION" + git push + fi diff --git a/.github/workflows/sdk_generation_mistralai_gcp_sdk.yaml b/.github/workflows/sdk_generation_mistralai_gcp_sdk.yaml index c4da64f7..5d200ae0 100644 --- a/.github/workflows/sdk_generation_mistralai_gcp_sdk.yaml +++ b/.github/workflows/sdk_generation_mistralai_gcp_sdk.yaml @@ -15,15 +15,98 @@ permissions: description: optionally set a specific SDK version type: string jobs: + resolve-speakeasy-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.resolve.outputs.version }} + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Resolve Speakeasy version from workflow config + id: resolve + run: | + set -euo pipefail + VERSION=$(awk '/^speakeasyVersion:/{print $2; exit}' .speakeasy/workflow.yaml | tr -d '"') + if [ -z "${VERSION:-}" ]; then + echo "Could not resolve speakeasyVersion from .speakeasy/workflow.yaml" + exit 1 + fi + echo "Resolved Speakeasy version: $VERSION" + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + generate: - uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 + needs: resolve-speakeasy-version + uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@7951d9dce457425b900b2dd317253499d98c2587 # v15 with: force: ${{ github.event.inputs.force }} mode: pr set_version: ${{ github.event.inputs.set_version }} - speakeasy_version: latest - target: mistral-python-sdk-google-cloud + speakeasy_version: ${{ needs.resolve-speakeasy-version.outputs.version }} + target: mistralai-gcp-sdk + feature_branch: speakeasy-sdk-regen-${{ github.run_id }} secrets: - github_access_token: ${{ secrets.GITHUB_TOKEN }} + github_access_token: ${{ secrets.CLIENT_PIPELINE }} pypi_token: ${{ secrets.PYPI_TOKEN }} speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + + align-version: + needs: generate + runs-on: ubuntu-latest + steps: + - name: Find PR branch + id: find-pr + env: + GH_TOKEN: ${{ secrets.CLIENT_PIPELINE }} + SPEAKEASY_BRANCH: speakeasy-sdk-regen-${{ github.run_id }} + run: | + set -euo pipefail + PR_BRANCH="$SPEAKEASY_BRANCH" + echo "Using Speakeasy generated branch: $PR_BRANCH" + echo "branch=$PR_BRANCH" >> "$GITHUB_OUTPUT" + + - name: Checkout PR branch + if: steps.find-pr.outputs.branch != '' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + ref: ${{ steps.find-pr.outputs.branch }} + token: ${{ secrets.CLIENT_PIPELINE }} + + - name: Install uv + if: steps.find-pr.outputs.branch != '' + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 + + - name: Align version using uv + if: steps.find-pr.outputs.branch != '' + run: | + set -euo pipefail + + VERSION=$(grep 'releaseVersion:' packages/gcp/.speakeasy/gen.lock | head -1 | awk '{print $2}' | tr -d '"') + if [ -z "$VERSION" ]; then + echo "No releaseVersion found in gen.lock" + exit 0 + fi + echo "Found version: $VERSION" + + CURRENT=$(grep '^version = ' packages/gcp/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + if [ "$CURRENT" = "$VERSION" ]; then + echo "Version already aligned to $VERSION" + exit 0 + fi + + echo "Updating version from $CURRENT to $VERSION" + uv version "$VERSION" --directory packages/gcp + + - name: Commit and push + if: steps.find-pr.outputs.branch != '' + run: | + git config user.email "action@github.com" + git config user.name "GitHub Action" + git add packages/gcp/pyproject.toml packages/gcp/uv.lock + if git diff --cached --quiet; then + echo "No changes to commit" + else + VERSION=$(grep '^version = ' packages/gcp/pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + git commit -m "chore: align GCP pyproject.toml and uv.lock to version $VERSION" + git push + fi diff --git a/.github/workflows/sdk_generation_mistralai_sdk.yaml b/.github/workflows/sdk_generation_mistralai_sdk.yaml index 1d80cddc..251cfdde 100644 --- a/.github/workflows/sdk_generation_mistralai_sdk.yaml +++ b/.github/workflows/sdk_generation_mistralai_sdk.yaml @@ -15,15 +15,98 @@ permissions: description: optionally set a specific SDK version type: string jobs: + resolve-speakeasy-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.resolve.outputs.version }} + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Resolve Speakeasy version from workflow config + id: resolve + run: | + set -euo pipefail + VERSION=$(awk '/^speakeasyVersion:/{print $2; exit}' .speakeasy/workflow.yaml | tr -d '"') + if [ -z "${VERSION:-}" ]; then + echo "Could not resolve speakeasyVersion from .speakeasy/workflow.yaml" + exit 1 + fi + echo "Resolved Speakeasy version: $VERSION" + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + generate: - uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 + needs: resolve-speakeasy-version + uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@7951d9dce457425b900b2dd317253499d98c2587 # v15 with: force: ${{ github.event.inputs.force }} mode: pr set_version: ${{ github.event.inputs.set_version }} - speakeasy_version: latest + speakeasy_version: ${{ needs.resolve-speakeasy-version.outputs.version }} target: mistralai-sdk + feature_branch: speakeasy-sdk-regen-${{ github.run_id }} secrets: - github_access_token: ${{ secrets.SPEAKEASY_WORKFLOW_GITHUB_PAT }} + github_access_token: ${{ secrets.CLIENT_PIPELINE }} pypi_token: ${{ secrets.PYPI_TOKEN }} speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + + align-version: + needs: generate + runs-on: ubuntu-latest + steps: + - name: Find PR branch + id: find-pr + env: + GH_TOKEN: ${{ secrets.CLIENT_PIPELINE }} + SPEAKEASY_BRANCH: speakeasy-sdk-regen-${{ github.run_id }} + run: | + set -euo pipefail + PR_BRANCH="$SPEAKEASY_BRANCH" + echo "Using Speakeasy generated branch: $PR_BRANCH" + echo "branch=$PR_BRANCH" >> "$GITHUB_OUTPUT" + + - name: Checkout PR branch + if: steps.find-pr.outputs.branch != '' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + ref: ${{ steps.find-pr.outputs.branch }} + token: ${{ secrets.CLIENT_PIPELINE }} + + - name: Install uv + if: steps.find-pr.outputs.branch != '' + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 + + - name: Align version using uv + if: steps.find-pr.outputs.branch != '' + run: | + set -euo pipefail + + VERSION=$(grep 'releaseVersion:' .speakeasy/gen.lock | head -1 | awk '{print $2}' | tr -d '"') + if [ -z "$VERSION" ]; then + echo "No releaseVersion found in gen.lock" + exit 0 + fi + echo "Found version: $VERSION" + + CURRENT=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + if [ "$CURRENT" = "$VERSION" ]; then + echo "Version already aligned to $VERSION" + exit 0 + fi + + echo "Updating version from $CURRENT to $VERSION" + uv version "$VERSION" + + - name: Commit and push + if: steps.find-pr.outputs.branch != '' + run: | + git config user.email "action@github.com" + git config user.name "GitHub Action" + git add pyproject.toml uv.lock + if git diff --cached --quiet; then + echo "No changes to commit" + else + VERSION=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + git commit -m "chore: align pyproject.toml and uv.lock to version $VERSION" + git push + fi diff --git a/.github/workflows/sdk_publish_mistralai_sdk.yaml b/.github/workflows/sdk_publish_mistralai_sdk.yaml index 46af0ad3..3fa424df 100644 --- a/.github/workflows/sdk_publish_mistralai_sdk.yaml +++ b/.github/workflows/sdk_publish_mistralai_sdk.yaml @@ -5,6 +5,12 @@ permissions: pull-requests: write statuses: write "on": + workflow_dispatch: + inputs: + confirm_publish: + description: 'Type "publish" to confirm.' + required: false + type: string push: branches: - main @@ -13,8 +19,12 @@ permissions: - "*/RELEASES.md" jobs: publish: - uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15 + # Auto-publish on push to main branch; require manual confirmation for workflow_dispatch + if: | + (github.event_name == 'push' && github.ref == 'refs/heads/main') || + (github.event_name == 'workflow_dispatch' && github.event.inputs.confirm_publish == 'publish') + uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@7951d9dce457425b900b2dd317253499d98c2587 # v15 secrets: - github_access_token: ${{ secrets.GITHUB_TOKEN }} + github_access_token: ${{ secrets.CLIENT_PIPELINE }} pypi_token: ${{ secrets.PYPI_TOKEN }} speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} diff --git a/.github/workflows/test_custom_code.yaml b/.github/workflows/test_custom_code.yaml index 230066cb..33cc3d5a 100644 --- a/.github/workflows/test_custom_code.yaml +++ b/.github/workflows/test_custom_code.yaml @@ -14,35 +14,36 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 - name: Set up Python id: setup-python - uses: actions/setup-python@v4 + uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 with: python-version: '3.12' - - name: Install Poetry - uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - virtualenvs-path: .venv - installer-parallel: true - - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Install uv + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 - name: Install dependencies - # Install dependencies if cache does not exist - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --no-root + run: | + uv sync --all-extras - name: Run the 'src/mistralai/extra' package unit tests + run: uv run python3.12 -m unittest discover -s src/mistralai/extra/tests -t src + + - name: Run pytest for repository tests + run: uv run pytest tests/ + + test_custom_code_required: + runs-on: ubuntu-latest + needs: lint + if: ${{ always() }} + + steps: + - name: Require custom code tests to pass run: | - source .venv/bin/activate - python3.12 -m unittest discover -s src/mistralai/extra/tests -t src + if [ "${{ needs.lint.result }}" != "success" ]; then + echo "Expected custom code tests to pass, got: ${{ needs.lint.result }}" + exit 1 + fi diff --git a/.github/workflows/update_speakeasy.yaml b/.github/workflows/update_speakeasy.yaml index 06449cf1..f0179686 100644 --- a/.github/workflows/update_speakeasy.yaml +++ b/.github/workflows/update_speakeasy.yaml @@ -27,23 +27,20 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + token: ${{ secrets.CLIENT_PIPELINE }} - name: Set up Python uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.11' - - name: Install Poetry - uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1 - with: - version: latest - virtualenvs-create: true - virtualenvs-in-project: true + - name: Install uv + uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 - name: Install dependencies run: | - cp README.md README-PYPI.md - poetry install --with dev + uv sync --group dev --group lint --no-default-groups - name: Install Speakeasy CLI run: | @@ -70,7 +67,7 @@ jobs: TARGETS_ARGS="$TARGETS_ARGS --targets $target" done - poetry run inv update-speakeasy \ + uv run inv update-speakeasy \ --version "${{ github.event.inputs.version }}" \ $TARGETS_ARGS env: @@ -107,7 +104,7 @@ jobs: --label speakeasy-update \ --assignee ${{ github.actor }} env: - GITHUB_TOKEN: ${{ secrets.SPEAKEASY_WORKFLOW_GITHUB_PAT }} + GITHUB_TOKEN: ${{ secrets.CLIENT_PIPELINE }} - name: Comment on workflow run if: steps.check-changes.outputs.has_changes == 'false' diff --git a/.gitignore b/.gitignore index 954adb7c..7ead1d0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ +.env.local +.idea **/__pycache__/ **/.speakeasy/temp/ **/.speakeasy/logs/ .vscode/ .speakeasy/reports -README-PYPI.md .venv/ pyrightconfig.json src/*.egg-info/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39e850eb..7517b816 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,17 +4,18 @@ repos: hooks: - id: ruff args: [--fix] - files: ^(example/|src/mistralai/).*\.py$ + files: ^(examples/|src/mistralai/|packages/(azure|gcp)/src/mistralai/).*\.py$ exclude: ^src/mistralai/(__init__|sdkhooks|types)\.py$ - repo: https://github.com/RobertCraigie/pyright-python rev: v1.1.401 hooks: - id: pyright - files: ^(example/|src/mistralai/).*\.py$ + files: ^(examples/|src/mistralai/|packages/(azure|gcp)/src/mistralai/).*\.py$ exclude: ^src/mistralai/(__init__|sdkhooks|types)\.py$ - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.15.0 hooks: - id: mypy - files: ^(example/|src/mistralai/).*\.py$ + additional_dependencies: [httpx, pydantic] + files: ^(examples/|src/mistralai/|packages/(azure|gcp)/src/mistralai/).*\.py$ exclude: ^src/mistralai/(__init__|sdkhooks|types)\.py$ diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 05e0840c..5587955b 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,1404 +1,9461 @@ lockVersion: 2.0.0 id: 2d045ec7-2ebb-4f4d-ad25-40953b132161 management: - docChecksum: c3693e4872a0785b2ed46c59a8464804 + docChecksum: a0fa9ebdce4c9ca7549f9dce826a2169 docVersion: 1.0.0 - speakeasyVersion: 1.606.10 - generationVersion: 2.687.13 - releaseVersion: 1.9.11 - configChecksum: d84e605ef7a3265972f6695049243759 + speakeasyVersion: 1.761.1 + generationVersion: 2.879.6 + releaseVersion: 2.4.5 + configChecksum: f6852fb59e3bcc9a7750210521f2c2d4 repoURL: https://github.com/mistralai/client-python.git installationURL: https://github.com/mistralai/client-python.git published: true +persistentEdits: + generation_id: bcab0c88-1877-4209-a77d-49b4681f030e + pristine_commit_hash: 56d30233849b5a3cb3d207e646ee849c77835f70 + pristine_tree_hash: 3feb3429dfead0d0228262509f23a6c5e9c9c7a2 features: python: + acceptHeaders: 3.0.0 additionalDependencies: 1.0.0 additionalProperties: 1.0.1 - constsAndDefaults: 1.0.5 - core: 5.20.1 + configurableModuleName: 0.2.0 + constsAndDefaults: 1.0.7 + core: 6.0.21 customCodeRegions: 0.1.1 defaultEnabledRetries: 0.2.0 + deprecations: 3.0.2 downloadStreams: 1.0.1 - enumUnions: 0.1.0 + enumUnions: 0.1.1 envVarSecurityUsage: 0.3.2 - examples: 3.0.2 + errors: 3.3.5 + examples: 3.0.3 flatRequests: 1.0.1 flattening: 3.1.1 - globalSecurity: 3.0.3 + globalSecurity: 3.0.7 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 - globalServerURLs: 3.1.1 + globalServerURLs: 3.2.1 + includes: 3.0.0 methodArguments: 1.0.2 multipartFileContentType: 1.0.0 - nameOverrides: 3.0.1 - nullables: 1.0.1 - openEnums: 1.0.1 - responseFormat: 1.0.1 - retries: 3.0.2 - sdkHooks: 1.1.0 - serverEvents: 1.0.8 + nameOverrides: 3.0.3 + nullables: 1.0.2 + openEnums: 1.0.4 + operationTimeout: 0.3.1 + pagination: 3.0.9 + responseFormat: 1.1.0 + retries: 3.0.4 + sdkHooks: 1.2.1 + serverEvents: 1.0.15 serverEventsSentinels: 0.1.0 serverIDs: 3.0.0 - unions: 3.0.4 + unions: 3.1.4 uploadStreams: 1.0.0 -generatedFiles: - - .gitattributes - - .vscode/settings.json - - USAGE.md - - docs/models/agent.md - - docs/models/agentconversation.md - - docs/models/agentconversationobject.md - - docs/models/agentcreationrequest.md - - docs/models/agentcreationrequesttools.md - - docs/models/agenthandoffdoneevent.md - - docs/models/agenthandoffdoneeventtype.md - - docs/models/agenthandoffentry.md - - docs/models/agenthandoffentryobject.md - - docs/models/agenthandoffentrytype.md - - docs/models/agenthandoffstartedevent.md - - docs/models/agenthandoffstartedeventtype.md - - docs/models/agentobject.md - - docs/models/agentsapiv1agentsgetrequest.md - - docs/models/agentsapiv1agentslistrequest.md - - docs/models/agentsapiv1agentsupdaterequest.md - - docs/models/agentsapiv1agentsupdateversionrequest.md - - docs/models/agentsapiv1conversationsappendrequest.md - - docs/models/agentsapiv1conversationsappendstreamrequest.md - - docs/models/agentsapiv1conversationsgetrequest.md - - docs/models/agentsapiv1conversationsgetresponsev1conversationsget.md - - docs/models/agentsapiv1conversationshistoryrequest.md - - docs/models/agentsapiv1conversationslistrequest.md - - docs/models/agentsapiv1conversationsmessagesrequest.md - - docs/models/agentsapiv1conversationsrestartrequest.md - - docs/models/agentsapiv1conversationsrestartstreamrequest.md - - docs/models/agentscompletionrequest.md - - docs/models/agentscompletionrequestmessages.md - - docs/models/agentscompletionrequeststop.md - - docs/models/agentscompletionrequesttoolchoice.md - - docs/models/agentscompletionstreamrequest.md - - docs/models/agentscompletionstreamrequestmessages.md - - docs/models/agentscompletionstreamrequeststop.md - - docs/models/agentscompletionstreamrequesttoolchoice.md - - docs/models/agenttools.md - - docs/models/agentupdaterequest.md - - docs/models/agentupdaterequesttools.md - - docs/models/apiendpoint.md - - docs/models/archiveftmodelout.md - - docs/models/archiveftmodeloutobject.md - - docs/models/arguments.md - - docs/models/assistantmessage.md - - docs/models/assistantmessagecontent.md - - docs/models/assistantmessagerole.md - - docs/models/audiochunk.md - - docs/models/audiochunktype.md - - docs/models/audiotranscriptionrequest.md - - docs/models/audiotranscriptionrequeststream.md - - docs/models/basemodelcard.md - - docs/models/basemodelcardtype.md - - docs/models/batcherror.md - - docs/models/batchjobin.md - - docs/models/batchjobout.md - - docs/models/batchjoboutobject.md - - docs/models/batchjobsout.md - - docs/models/batchjobsoutobject.md - - docs/models/batchjobstatus.md - - docs/models/builtinconnectors.md - - docs/models/chatclassificationrequest.md - - docs/models/chatcompletionchoice.md - - docs/models/chatcompletionrequest.md - - docs/models/chatcompletionrequesttoolchoice.md - - docs/models/chatcompletionresponse.md - - docs/models/chatcompletionstreamrequest.md - - docs/models/chatcompletionstreamrequestmessages.md - - docs/models/chatcompletionstreamrequeststop.md - - docs/models/chatcompletionstreamrequesttoolchoice.md - - docs/models/chatmoderationrequest.md - - docs/models/chatmoderationrequestinputs.md - - docs/models/checkpointout.md - - docs/models/classificationrequest.md - - docs/models/classificationrequestinputs.md - - docs/models/classificationresponse.md - - docs/models/classificationtargetresult.md - - docs/models/classifierdetailedjobout.md - - docs/models/classifierdetailedjoboutintegrations.md - - docs/models/classifierdetailedjoboutjobtype.md - - docs/models/classifierdetailedjoboutobject.md - - docs/models/classifierdetailedjoboutstatus.md - - docs/models/classifierftmodelout.md - - docs/models/classifierftmodeloutmodeltype.md - - docs/models/classifierftmodeloutobject.md - - docs/models/classifierjobout.md - - docs/models/classifierjoboutintegrations.md - - docs/models/classifierjoboutjobtype.md - - docs/models/classifierjoboutobject.md - - docs/models/classifierjoboutstatus.md - - docs/models/classifiertargetin.md - - docs/models/classifiertargetout.md - - docs/models/classifiertrainingparameters.md - - docs/models/classifiertrainingparametersin.md - - docs/models/codeinterpretertool.md - - docs/models/codeinterpretertooltype.md - - docs/models/completionargs.md - - docs/models/completionargsstop.md - - docs/models/completionchunk.md - - docs/models/completiondetailedjobout.md - - docs/models/completiondetailedjoboutintegrations.md - - docs/models/completiondetailedjoboutjobtype.md - - docs/models/completiondetailedjoboutobject.md - - docs/models/completiondetailedjoboutrepositories.md - - docs/models/completiondetailedjoboutstatus.md - - docs/models/completionevent.md - - docs/models/completionftmodelout.md - - docs/models/completionftmodeloutobject.md - - docs/models/completionjobout.md - - docs/models/completionjoboutobject.md - - docs/models/completionresponsestreamchoice.md - - docs/models/completionresponsestreamchoicefinishreason.md - - docs/models/completiontrainingparameters.md - - docs/models/completiontrainingparametersin.md - - docs/models/content.md - - docs/models/contentchunk.md - - docs/models/conversationappendrequest.md - - docs/models/conversationappendrequesthandoffexecution.md - - docs/models/conversationappendstreamrequest.md - - docs/models/conversationappendstreamrequesthandoffexecution.md - - docs/models/conversationevents.md - - docs/models/conversationeventsdata.md - - docs/models/conversationhistory.md - - docs/models/conversationhistoryobject.md - - docs/models/conversationinputs.md - - docs/models/conversationmessages.md - - docs/models/conversationmessagesobject.md - - docs/models/conversationrequest.md - - docs/models/conversationresponse.md - - docs/models/conversationresponseobject.md - - docs/models/conversationrestartrequest.md - - docs/models/conversationrestartrequesthandoffexecution.md - - docs/models/conversationrestartstreamrequest.md - - docs/models/conversationrestartstreamrequesthandoffexecution.md - - docs/models/conversationstreamrequest.md - - docs/models/conversationstreamrequesthandoffexecution.md - - docs/models/conversationstreamrequesttools.md - - docs/models/conversationusageinfo.md - - docs/models/data.md - - docs/models/deletefileout.md - - docs/models/deletemodelout.md - - docs/models/deletemodelv1modelsmodeliddeleterequest.md - - docs/models/deltamessage.md - - docs/models/document.md - - docs/models/documentlibrarytool.md - - docs/models/documentlibrarytooltype.md - - docs/models/documentout.md - - docs/models/documenttextcontent.md - - docs/models/documentupdatein.md - - docs/models/documenturlchunk.md - - docs/models/documenturlchunktype.md - - docs/models/embeddingdtype.md - - docs/models/embeddingrequest.md - - docs/models/embeddingrequestinputs.md - - docs/models/embeddingresponse.md - - docs/models/embeddingresponsedata.md - - docs/models/encodingformat.md - - docs/models/entitytype.md - - docs/models/entries.md - - docs/models/eventout.md - - docs/models/file.md - - docs/models/filechunk.md - - docs/models/filepurpose.md - - docs/models/filesapiroutesdeletefilerequest.md - - docs/models/filesapiroutesdownloadfilerequest.md - - docs/models/filesapiroutesgetsignedurlrequest.md - - docs/models/filesapirouteslistfilesrequest.md - - docs/models/filesapiroutesretrievefilerequest.md - - docs/models/filesapiroutesuploadfilemultipartbodyparams.md - - docs/models/fileschema.md - - docs/models/filesignedurl.md - - docs/models/fimcompletionrequest.md - - docs/models/fimcompletionrequeststop.md - - docs/models/fimcompletionresponse.md - - docs/models/fimcompletionstreamrequest.md - - docs/models/fimcompletionstreamrequeststop.md - - docs/models/finetuneablemodeltype.md - - docs/models/finishreason.md - - docs/models/ftclassifierlossfunction.md - - docs/models/ftmodelcapabilitiesout.md - - docs/models/ftmodelcard.md - - docs/models/ftmodelcardtype.md - - docs/models/function.md - - docs/models/functioncall.md - - docs/models/functioncallentry.md - - docs/models/functioncallentryarguments.md - - docs/models/functioncallentryobject.md - - docs/models/functioncallentrytype.md - - docs/models/functioncallevent.md - - docs/models/functioncalleventtype.md - - docs/models/functionname.md - - docs/models/functionresultentry.md - - docs/models/functionresultentryobject.md - - docs/models/functionresultentrytype.md - - docs/models/functiontool.md - - docs/models/functiontooltype.md - - docs/models/githubrepositoryin.md - - docs/models/githubrepositoryintype.md - - docs/models/githubrepositoryout.md - - docs/models/githubrepositoryouttype.md - - docs/models/handoffexecution.md - - docs/models/httpvalidationerror.md - - docs/models/hyperparameters.md - - docs/models/imagegenerationtool.md - - docs/models/imagegenerationtooltype.md - - docs/models/imageurl.md - - docs/models/imageurlchunk.md - - docs/models/imageurlchunkimageurl.md - - docs/models/imageurlchunktype.md - - docs/models/inputentries.md - - docs/models/inputs.md - - docs/models/instructrequest.md - - docs/models/instructrequestinputs.md - - docs/models/instructrequestinputsmessages.md - - docs/models/instructrequestmessages.md - - docs/models/integrations.md - - docs/models/jobin.md - - docs/models/jobinintegrations.md - - docs/models/jobinrepositories.md - - docs/models/jobmetadataout.md - - docs/models/jobsapiroutesbatchcancelbatchjobrequest.md - - docs/models/jobsapiroutesbatchgetbatchjobrequest.md - - docs/models/jobsapiroutesbatchgetbatchjobsrequest.md - - docs/models/jobsapiroutesfinetuningarchivefinetunedmodelrequest.md - - docs/models/jobsapiroutesfinetuningcancelfinetuningjobrequest.md - - docs/models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md - - docs/models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md - - docs/models/jobsapiroutesfinetuninggetfinetuningjobrequest.md - - docs/models/jobsapiroutesfinetuninggetfinetuningjobresponse.md - - docs/models/jobsapiroutesfinetuninggetfinetuningjobsrequest.md - - docs/models/jobsapiroutesfinetuningstartfinetuningjobrequest.md - - docs/models/jobsapiroutesfinetuningstartfinetuningjobresponse.md - - docs/models/jobsapiroutesfinetuningunarchivefinetunedmodelrequest.md - - docs/models/jobsapiroutesfinetuningupdatefinetunedmodelrequest.md - - docs/models/jobsapiroutesfinetuningupdatefinetunedmodelresponse.md - - docs/models/jobsout.md - - docs/models/jobsoutdata.md - - docs/models/jobsoutobject.md - - docs/models/jobtype.md - - docs/models/jsonschema.md - - docs/models/legacyjobmetadataout.md - - docs/models/legacyjobmetadataoutobject.md - - docs/models/librariesdeletev1request.md - - docs/models/librariesdocumentsdeletev1request.md - - docs/models/librariesdocumentsgetextractedtextsignedurlv1request.md - - docs/models/librariesdocumentsgetsignedurlv1request.md - - docs/models/librariesdocumentsgetstatusv1request.md - - docs/models/librariesdocumentsgettextcontentv1request.md - - docs/models/librariesdocumentsgetv1request.md - - docs/models/librariesdocumentslistv1request.md - - docs/models/librariesdocumentsreprocessv1request.md - - docs/models/librariesdocumentsupdatev1request.md - - docs/models/librariesdocumentsuploadv1documentupload.md - - docs/models/librariesdocumentsuploadv1request.md - - docs/models/librariesgetv1request.md - - docs/models/librariessharecreatev1request.md - - docs/models/librariessharedeletev1request.md - - docs/models/librariessharelistv1request.md - - docs/models/librariesupdatev1request.md - - docs/models/libraryin.md - - docs/models/libraryinupdate.md - - docs/models/libraryout.md - - docs/models/listdocumentout.md - - docs/models/listfilesout.md - - docs/models/listlibraryout.md - - docs/models/listsharingout.md - - docs/models/loc.md - - docs/models/messageentries.md - - docs/models/messageinputcontentchunks.md - - docs/models/messageinputentry.md - - docs/models/messageinputentrycontent.md - - docs/models/messageinputentryrole.md - - docs/models/messageinputentrytype.md - - docs/models/messageoutputcontentchunks.md - - docs/models/messageoutputentry.md - - docs/models/messageoutputentrycontent.md - - docs/models/messageoutputentryobject.md - - docs/models/messageoutputentryrole.md - - docs/models/messageoutputentrytype.md - - docs/models/messageoutputevent.md - - docs/models/messageoutputeventcontent.md - - docs/models/messageoutputeventrole.md - - docs/models/messageoutputeventtype.md - - docs/models/messages.md - - docs/models/metricout.md - - docs/models/mistralpromptmode.md - - docs/models/modelcapabilities.md - - docs/models/modelconversation.md - - docs/models/modelconversationobject.md - - docs/models/modelconversationtools.md - - docs/models/modellist.md - - docs/models/modeltype.md - - docs/models/moderationobject.md - - docs/models/moderationresponse.md - - docs/models/object.md - - docs/models/ocrimageobject.md - - docs/models/ocrpagedimensions.md - - docs/models/ocrpageobject.md - - docs/models/ocrrequest.md - - docs/models/ocrresponse.md - - docs/models/ocrusageinfo.md - - docs/models/one.md - - docs/models/outputcontentchunks.md - - docs/models/outputs.md - - docs/models/paginationinfo.md - - docs/models/prediction.md - - docs/models/processingstatusout.md - - docs/models/queryparamstatus.md - - docs/models/referencechunk.md - - docs/models/referencechunktype.md - - docs/models/repositories.md - - docs/models/response1.md - - docs/models/responsebody.md - - docs/models/responsedoneevent.md - - docs/models/responsedoneeventtype.md - - docs/models/responseerrorevent.md - - docs/models/responseerroreventtype.md - - docs/models/responseformat.md - - docs/models/responseformats.md - - docs/models/responsestartedevent.md - - docs/models/responsestartedeventtype.md - - docs/models/retrievefileout.md - - docs/models/retrievemodelv1modelsmodelidgetrequest.md - - docs/models/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md - - docs/models/role.md - - docs/models/sampletype.md - - docs/models/security.md - - docs/models/shareenum.md - - docs/models/sharingdelete.md - - docs/models/sharingin.md - - docs/models/sharingout.md - - docs/models/source.md - - docs/models/ssetypes.md - - docs/models/status.md - - docs/models/stop.md - - docs/models/systemmessage.md - - docs/models/systemmessagecontent.md - - docs/models/systemmessagecontentchunks.md - - docs/models/textchunk.md - - docs/models/textchunktype.md - - docs/models/thinkchunk.md - - docs/models/thinkchunktype.md - - docs/models/thinking.md - - docs/models/timestampgranularity.md - - docs/models/tool.md - - docs/models/toolcall.md - - docs/models/toolchoice.md - - docs/models/toolchoiceenum.md - - docs/models/toolexecutiondeltaevent.md - - docs/models/toolexecutiondeltaeventtype.md - - docs/models/toolexecutiondoneevent.md - - docs/models/toolexecutiondoneeventtype.md - - docs/models/toolexecutionentry.md - - docs/models/toolexecutionentryobject.md - - docs/models/toolexecutionentrytype.md - - docs/models/toolexecutionstartedevent.md - - docs/models/toolexecutionstartedeventtype.md - - docs/models/toolfilechunk.md - - docs/models/toolfilechunktype.md - - docs/models/toolmessage.md - - docs/models/toolmessagecontent.md - - docs/models/toolmessagerole.md - - docs/models/toolreferencechunk.md - - docs/models/toolreferencechunktype.md - - docs/models/tools.md - - docs/models/tooltypes.md - - docs/models/trainingfile.md - - docs/models/transcriptionresponse.md - - docs/models/transcriptionsegmentchunk.md - - docs/models/transcriptionstreamdone.md - - docs/models/transcriptionstreamdonetype.md - - docs/models/transcriptionstreamevents.md - - docs/models/transcriptionstreameventsdata.md - - docs/models/transcriptionstreameventtypes.md - - docs/models/transcriptionstreamlanguage.md - - docs/models/transcriptionstreamlanguagetype.md - - docs/models/transcriptionstreamsegmentdelta.md - - docs/models/transcriptionstreamsegmentdeltatype.md - - docs/models/transcriptionstreamtextdelta.md - - docs/models/transcriptionstreamtextdeltatype.md - - docs/models/two.md - - docs/models/type.md - - docs/models/unarchiveftmodelout.md - - docs/models/unarchiveftmodeloutobject.md - - docs/models/updateftmodelin.md - - docs/models/uploadfileout.md - - docs/models/usageinfo.md - - docs/models/usermessage.md - - docs/models/usermessagecontent.md - - docs/models/usermessagerole.md - - docs/models/utils/retryconfig.md - - docs/models/validationerror.md - - docs/models/wandbintegration.md - - docs/models/wandbintegrationout.md - - docs/models/wandbintegrationouttype.md - - docs/models/wandbintegrationtype.md - - docs/models/websearchpremiumtool.md - - docs/models/websearchpremiumtooltype.md - - docs/models/websearchtool.md - - docs/models/websearchtooltype.md - - docs/sdks/accesses/README.md - - docs/sdks/agents/README.md - - docs/sdks/audio/README.md - - docs/sdks/batch/README.md - - docs/sdks/beta/README.md - - docs/sdks/chat/README.md - - docs/sdks/classifiers/README.md - - docs/sdks/conversations/README.md - - docs/sdks/documents/README.md - - docs/sdks/embeddings/README.md - - docs/sdks/files/README.md - - docs/sdks/fim/README.md - - docs/sdks/finetuning/README.md - - docs/sdks/jobs/README.md - - docs/sdks/libraries/README.md - - docs/sdks/mistral/README.md - - docs/sdks/mistralagents/README.md - - docs/sdks/mistraljobs/README.md - - docs/sdks/models/README.md - - docs/sdks/ocr/README.md - - docs/sdks/transcriptions/README.md - - poetry.toml - - py.typed - - scripts/prepare_readme.py - - scripts/publish.sh - - src/mistralai/__init__.py - - src/mistralai/_hooks/__init__.py - - src/mistralai/_hooks/sdkhooks.py - - src/mistralai/_hooks/types.py - - src/mistralai/_version.py - - src/mistralai/accesses.py - - src/mistralai/agents.py - - src/mistralai/audio.py - - src/mistralai/basesdk.py - - src/mistralai/batch.py - - src/mistralai/beta.py - - src/mistralai/chat.py - - src/mistralai/classifiers.py - - src/mistralai/conversations.py - - src/mistralai/documents.py - - src/mistralai/embeddings.py - - src/mistralai/files.py - - src/mistralai/fim.py - - src/mistralai/fine_tuning.py - - src/mistralai/httpclient.py - - src/mistralai/jobs.py - - src/mistralai/libraries.py - - src/mistralai/mistral_agents.py - - src/mistralai/mistral_jobs.py - - src/mistralai/models/__init__.py - - src/mistralai/models/agent.py - - src/mistralai/models/agentconversation.py - - src/mistralai/models/agentcreationrequest.py - - src/mistralai/models/agenthandoffdoneevent.py - - src/mistralai/models/agenthandoffentry.py - - src/mistralai/models/agenthandoffstartedevent.py - - src/mistralai/models/agents_api_v1_agents_getop.py - - src/mistralai/models/agents_api_v1_agents_listop.py - - src/mistralai/models/agents_api_v1_agents_update_versionop.py - - src/mistralai/models/agents_api_v1_agents_updateop.py - - src/mistralai/models/agents_api_v1_conversations_append_streamop.py - - src/mistralai/models/agents_api_v1_conversations_appendop.py - - src/mistralai/models/agents_api_v1_conversations_getop.py - - src/mistralai/models/agents_api_v1_conversations_historyop.py - - src/mistralai/models/agents_api_v1_conversations_listop.py - - src/mistralai/models/agents_api_v1_conversations_messagesop.py - - src/mistralai/models/agents_api_v1_conversations_restart_streamop.py - - src/mistralai/models/agents_api_v1_conversations_restartop.py - - src/mistralai/models/agentscompletionrequest.py - - src/mistralai/models/agentscompletionstreamrequest.py - - src/mistralai/models/agentupdaterequest.py - - src/mistralai/models/apiendpoint.py - - src/mistralai/models/archiveftmodelout.py - - src/mistralai/models/assistantmessage.py - - src/mistralai/models/audiochunk.py - - src/mistralai/models/audiotranscriptionrequest.py - - src/mistralai/models/audiotranscriptionrequeststream.py - - src/mistralai/models/basemodelcard.py - - src/mistralai/models/batcherror.py - - src/mistralai/models/batchjobin.py - - src/mistralai/models/batchjobout.py - - src/mistralai/models/batchjobsout.py - - src/mistralai/models/batchjobstatus.py - - src/mistralai/models/builtinconnectors.py - - src/mistralai/models/chatclassificationrequest.py - - src/mistralai/models/chatcompletionchoice.py - - src/mistralai/models/chatcompletionrequest.py - - src/mistralai/models/chatcompletionresponse.py - - src/mistralai/models/chatcompletionstreamrequest.py - - src/mistralai/models/chatmoderationrequest.py - - src/mistralai/models/checkpointout.py - - src/mistralai/models/classificationrequest.py - - src/mistralai/models/classificationresponse.py - - src/mistralai/models/classificationtargetresult.py - - src/mistralai/models/classifierdetailedjobout.py - - src/mistralai/models/classifierftmodelout.py - - src/mistralai/models/classifierjobout.py - - src/mistralai/models/classifiertargetin.py - - src/mistralai/models/classifiertargetout.py - - src/mistralai/models/classifiertrainingparameters.py - - src/mistralai/models/classifiertrainingparametersin.py - - src/mistralai/models/codeinterpretertool.py - - src/mistralai/models/completionargs.py - - src/mistralai/models/completionargsstop.py - - src/mistralai/models/completionchunk.py - - src/mistralai/models/completiondetailedjobout.py - - src/mistralai/models/completionevent.py - - src/mistralai/models/completionftmodelout.py - - src/mistralai/models/completionjobout.py - - src/mistralai/models/completionresponsestreamchoice.py - - src/mistralai/models/completiontrainingparameters.py - - src/mistralai/models/completiontrainingparametersin.py - - src/mistralai/models/contentchunk.py - - src/mistralai/models/conversationappendrequest.py - - src/mistralai/models/conversationappendstreamrequest.py - - src/mistralai/models/conversationevents.py - - src/mistralai/models/conversationhistory.py - - src/mistralai/models/conversationinputs.py - - src/mistralai/models/conversationmessages.py - - src/mistralai/models/conversationrequest.py - - src/mistralai/models/conversationresponse.py - - src/mistralai/models/conversationrestartrequest.py - - src/mistralai/models/conversationrestartstreamrequest.py - - src/mistralai/models/conversationstreamrequest.py - - src/mistralai/models/conversationusageinfo.py - - src/mistralai/models/delete_model_v1_models_model_id_deleteop.py - - src/mistralai/models/deletefileout.py - - src/mistralai/models/deletemodelout.py - - src/mistralai/models/deltamessage.py - - src/mistralai/models/documentlibrarytool.py - - src/mistralai/models/documentout.py - - src/mistralai/models/documenttextcontent.py - - src/mistralai/models/documentupdatein.py - - src/mistralai/models/documenturlchunk.py - - src/mistralai/models/embeddingdtype.py - - src/mistralai/models/embeddingrequest.py - - src/mistralai/models/embeddingresponse.py - - src/mistralai/models/embeddingresponsedata.py - - src/mistralai/models/encodingformat.py - - src/mistralai/models/entitytype.py - - src/mistralai/models/eventout.py - - src/mistralai/models/file.py - - src/mistralai/models/filechunk.py - - src/mistralai/models/filepurpose.py - - src/mistralai/models/files_api_routes_delete_fileop.py - - src/mistralai/models/files_api_routes_download_fileop.py - - src/mistralai/models/files_api_routes_get_signed_urlop.py - - src/mistralai/models/files_api_routes_list_filesop.py - - src/mistralai/models/files_api_routes_retrieve_fileop.py - - src/mistralai/models/files_api_routes_upload_fileop.py - - src/mistralai/models/fileschema.py - - src/mistralai/models/filesignedurl.py - - src/mistralai/models/fimcompletionrequest.py - - src/mistralai/models/fimcompletionresponse.py - - src/mistralai/models/fimcompletionstreamrequest.py - - src/mistralai/models/finetuneablemodeltype.py - - src/mistralai/models/ftclassifierlossfunction.py - - src/mistralai/models/ftmodelcapabilitiesout.py - - src/mistralai/models/ftmodelcard.py - - src/mistralai/models/function.py - - src/mistralai/models/functioncall.py - - src/mistralai/models/functioncallentry.py - - src/mistralai/models/functioncallentryarguments.py - - src/mistralai/models/functioncallevent.py - - src/mistralai/models/functionname.py - - src/mistralai/models/functionresultentry.py - - src/mistralai/models/functiontool.py - - src/mistralai/models/githubrepositoryin.py - - src/mistralai/models/githubrepositoryout.py - - src/mistralai/models/httpvalidationerror.py - - src/mistralai/models/imagegenerationtool.py - - src/mistralai/models/imageurl.py - - src/mistralai/models/imageurlchunk.py - - src/mistralai/models/inputentries.py - - src/mistralai/models/inputs.py - - src/mistralai/models/instructrequest.py - - src/mistralai/models/jobin.py - - src/mistralai/models/jobmetadataout.py - - src/mistralai/models/jobs_api_routes_batch_cancel_batch_jobop.py - - src/mistralai/models/jobs_api_routes_batch_get_batch_jobop.py - - src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py - - src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py - - src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py - - src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py - - src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py - - src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py - - src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py - - src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py - - src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py - - src/mistralai/models/jobsout.py - - src/mistralai/models/jsonschema.py - - src/mistralai/models/legacyjobmetadataout.py - - src/mistralai/models/libraries_delete_v1op.py - - src/mistralai/models/libraries_documents_delete_v1op.py - - src/mistralai/models/libraries_documents_get_extracted_text_signed_url_v1op.py - - src/mistralai/models/libraries_documents_get_signed_url_v1op.py - - src/mistralai/models/libraries_documents_get_status_v1op.py - - src/mistralai/models/libraries_documents_get_text_content_v1op.py - - src/mistralai/models/libraries_documents_get_v1op.py - - src/mistralai/models/libraries_documents_list_v1op.py - - src/mistralai/models/libraries_documents_reprocess_v1op.py - - src/mistralai/models/libraries_documents_update_v1op.py - - src/mistralai/models/libraries_documents_upload_v1op.py - - src/mistralai/models/libraries_get_v1op.py - - src/mistralai/models/libraries_share_create_v1op.py - - src/mistralai/models/libraries_share_delete_v1op.py - - src/mistralai/models/libraries_share_list_v1op.py - - src/mistralai/models/libraries_update_v1op.py - - src/mistralai/models/libraryin.py - - src/mistralai/models/libraryinupdate.py - - src/mistralai/models/libraryout.py - - src/mistralai/models/listdocumentout.py - - src/mistralai/models/listfilesout.py - - src/mistralai/models/listlibraryout.py - - src/mistralai/models/listsharingout.py - - src/mistralai/models/messageentries.py - - src/mistralai/models/messageinputcontentchunks.py - - src/mistralai/models/messageinputentry.py - - src/mistralai/models/messageoutputcontentchunks.py - - src/mistralai/models/messageoutputentry.py - - src/mistralai/models/messageoutputevent.py - - src/mistralai/models/metricout.py - - src/mistralai/models/mistralerror.py - - src/mistralai/models/mistralpromptmode.py - - src/mistralai/models/modelcapabilities.py - - src/mistralai/models/modelconversation.py - - src/mistralai/models/modellist.py - - src/mistralai/models/moderationobject.py - - src/mistralai/models/moderationresponse.py - - src/mistralai/models/no_response_error.py - - src/mistralai/models/ocrimageobject.py - - src/mistralai/models/ocrpagedimensions.py - - src/mistralai/models/ocrpageobject.py - - src/mistralai/models/ocrrequest.py - - src/mistralai/models/ocrresponse.py - - src/mistralai/models/ocrusageinfo.py - - src/mistralai/models/outputcontentchunks.py - - src/mistralai/models/paginationinfo.py - - src/mistralai/models/prediction.py - - src/mistralai/models/processingstatusout.py - - src/mistralai/models/referencechunk.py - - src/mistralai/models/responsedoneevent.py - - src/mistralai/models/responseerrorevent.py - - src/mistralai/models/responseformat.py - - src/mistralai/models/responseformats.py - - src/mistralai/models/responsestartedevent.py - - src/mistralai/models/responsevalidationerror.py - - src/mistralai/models/retrieve_model_v1_models_model_id_getop.py - - src/mistralai/models/retrievefileout.py - - src/mistralai/models/sampletype.py - - src/mistralai/models/sdkerror.py - - src/mistralai/models/security.py - - src/mistralai/models/shareenum.py - - src/mistralai/models/sharingdelete.py - - src/mistralai/models/sharingin.py - - src/mistralai/models/sharingout.py - - src/mistralai/models/source.py - - src/mistralai/models/ssetypes.py - - src/mistralai/models/systemmessage.py - - src/mistralai/models/systemmessagecontentchunks.py - - src/mistralai/models/textchunk.py - - src/mistralai/models/thinkchunk.py - - src/mistralai/models/timestampgranularity.py - - src/mistralai/models/tool.py - - src/mistralai/models/toolcall.py - - src/mistralai/models/toolchoice.py - - src/mistralai/models/toolchoiceenum.py - - src/mistralai/models/toolexecutiondeltaevent.py - - src/mistralai/models/toolexecutiondoneevent.py - - src/mistralai/models/toolexecutionentry.py - - src/mistralai/models/toolexecutionstartedevent.py - - src/mistralai/models/toolfilechunk.py - - src/mistralai/models/toolmessage.py - - src/mistralai/models/toolreferencechunk.py - - src/mistralai/models/tooltypes.py - - src/mistralai/models/trainingfile.py - - src/mistralai/models/transcriptionresponse.py - - src/mistralai/models/transcriptionsegmentchunk.py - - src/mistralai/models/transcriptionstreamdone.py - - src/mistralai/models/transcriptionstreamevents.py - - src/mistralai/models/transcriptionstreameventtypes.py - - src/mistralai/models/transcriptionstreamlanguage.py - - src/mistralai/models/transcriptionstreamsegmentdelta.py - - src/mistralai/models/transcriptionstreamtextdelta.py - - src/mistralai/models/unarchiveftmodelout.py - - src/mistralai/models/updateftmodelin.py - - src/mistralai/models/uploadfileout.py - - src/mistralai/models/usageinfo.py - - src/mistralai/models/usermessage.py - - src/mistralai/models/validationerror.py - - src/mistralai/models/wandbintegration.py - - src/mistralai/models/wandbintegrationout.py - - src/mistralai/models/websearchpremiumtool.py - - src/mistralai/models/websearchtool.py - - src/mistralai/models_.py - - src/mistralai/ocr.py - - src/mistralai/py.typed - - src/mistralai/sdk.py - - src/mistralai/sdkconfiguration.py - - src/mistralai/transcriptions.py - - src/mistralai/types/__init__.py - - src/mistralai/types/basemodel.py - - src/mistralai/utils/__init__.py - - src/mistralai/utils/annotations.py - - src/mistralai/utils/datetimes.py - - src/mistralai/utils/enums.py - - src/mistralai/utils/eventstreaming.py - - src/mistralai/utils/forms.py - - src/mistralai/utils/headers.py - - src/mistralai/utils/logger.py - - src/mistralai/utils/metadata.py - - src/mistralai/utils/queryparams.py - - src/mistralai/utils/requestbodies.py - - src/mistralai/utils/retries.py - - src/mistralai/utils/security.py - - src/mistralai/utils/serializers.py - - src/mistralai/utils/unmarshal_json_response.py - - src/mistralai/utils/url.py - - src/mistralai/utils/values.py +trackedFiles: + .gitattributes: + id: 24139dae6567 + last_write_checksum: sha1:53134de3ada576f37c22276901e1b5b6d85cd2da + pristine_git_object: 4d75d59008e4d8609876d263419a9dc56c8d6f3a + .vscode/settings.json: + id: 89aa447020cd + last_write_checksum: sha1:f84632c81029fcdda8c3b0c768d02b836fc80526 + pristine_git_object: 8d79f0abb72526f1fb34a4c03e5bba612c6ba2ae + deleted: true + USAGE.md: + id: 3aed33ce6e6f + last_write_checksum: sha1:d172deb3ee1630f16b279de22aec1f8f68d7565f + pristine_git_object: 9d32240a60c8885479c95388bb81c8024b5604ff + docs/errors/httpvalidationerror.md: + id: 7fe2e5327e07 + last_write_checksum: sha1:277a46811144643262651853dc6176d21b33573e + pristine_git_object: 712a148c3e2305dca4c702851865f9f8c8e674cc + docs/errors/observabilityerror.md: + id: 750ead4ce7ee + last_write_checksum: sha1:a3fa64f01329ca02fdd8d7a6470c3d2f051985e5 + pristine_git_object: 615552c32013c702b3e7476b1691952b0a4a65df + docs/models/activitytaskcompletedattributesresponse.md: + id: 972b526f8415 + last_write_checksum: sha1:ac33517d238733a00d938ed19c7b30ba2b3f7955 + pristine_git_object: 43c92fe262f8e8657d337420526959424889d5dd + docs/models/activitytaskcompletedresponse.md: + id: 6aade3f8c26c + last_write_checksum: sha1:944b923aa932452372abebfe6d61ab739555109f + pristine_git_object: 56a646311c1f9f7bb9dcd8187c9e4f937f19e6cb + docs/models/activitytaskfailedattributes.md: + id: a69d5f4b0b99 + last_write_checksum: sha1:e5371dae85ec79f485b5e3afc1ac8c29a2424163 + pristine_git_object: 5cb9cafe9ce235ff996c3f1529babedfc6ebe239 + docs/models/activitytaskfailedresponse.md: + id: 325e821a4d2f + last_write_checksum: sha1:165eb54c023c8d29fa1093542cf62b69cbc4657b + pristine_git_object: 0853f68d3413dead9b67b3183b287a08f9339faa + docs/models/activitytaskretryingattributes.md: + id: 4d2e278266f7 + last_write_checksum: sha1:a79f27b4272efab1378a0f2d7de12939dfb7a933 + pristine_git_object: 9216607678cc149d446bf30ba92a6cf9b3d4d3d2 + docs/models/activitytaskretryingresponse.md: + id: ca0fb7b72379 + last_write_checksum: sha1:0ede54e73f1c5c77e585e8c9f3892c626bede7cf + pristine_git_object: 8b7bdd42e45eb8b3c5ad33a2de5ac2d15d8b3453 + docs/models/activitytaskstartedattributesresponse.md: + id: b0d2e886ad19 + last_write_checksum: sha1:89068691379007eb892b4d81bfaeeb8f889771fd + pristine_git_object: dd97ff85fb14f03afb8e3b390d7000cd3c308e64 + docs/models/activitytaskstartedresponse.md: + id: c25113506e99 + last_write_checksum: sha1:3cd53ec4c3c8bdc389c55cf527c960b3b8a91c30 + pristine_git_object: 1aee1533fc92116e79a13b338dd6e6e74fcab800 + docs/models/agent.md: + id: ffdbb4c53c87 + last_write_checksum: sha1:a4438b1b0db1d00df3aacfc432acc523a3ca57da + pristine_git_object: 94e8b035a5a9f61d3a0e345daf977a83e352ba07 + docs/models/agentaliasresponse.md: + id: 5ac4721d8947 + last_write_checksum: sha1:15dcc6820e89d2c6bb799e331463419ce29ec167 + pristine_git_object: aa531ec5d1464f95e3938f148c1e88efc30fa6a6 + docs/models/agentconversation.md: + id: 3590c1a566fa + last_write_checksum: sha1:43e7c1ed2b43aca2794d89f2e6d6aa5f1478cc3e + pristine_git_object: 451f6fb8f700dddd54c69593c316bf562b5cbc93 + docs/models/agentconversationagentversion.md: + id: 468e0d1614bb + last_write_checksum: sha1:6e60bf4a18d791d694e90c89bdb8cc38e43c324b + pristine_git_object: 668a8dc0f0c51a231a73aed51b2db13de243a038 + docs/models/agenthandoffdoneevent.md: + id: dcf166a3c3b0 + last_write_checksum: sha1:9e95c09f724827f5e9c202fd634bdfa2baef1b6e + pristine_git_object: 6bfcc3d83457edf05d0f13957d34ead0f260599b + docs/models/agenthandoffentry.md: + id: 39d54f489b84 + last_write_checksum: sha1:a93a604ced2303eb6f93cfe0f1360224d3298b37 + pristine_git_object: 2b689ec720c02b7289ec462d7acca64a82b23570 + docs/models/agenthandoffstartedevent.md: + id: b620102af460 + last_write_checksum: sha1:33732e0465423348c2ace458506a597a3dadf9b2 + pristine_git_object: 518b5a0c4521ec55a5a28ba3ef0ad1c1fce52792 + docs/models/agentsapiv1agentscreateorupdatealiasrequest.md: + id: c09ec9946094 + last_write_checksum: sha1:0883217b4bad21f5d4f8162ca72005bf9105a93f + pristine_git_object: 79406434cc6ff3d1485089f35639d6284f66d6cb + docs/models/agentsapiv1agentsdeletealiasrequest.md: + id: 429307ab315d + last_write_checksum: sha1:8e0a8388bb51c234aa1eb5566cb68389ebe57574 + pristine_git_object: 8e95c0c31e8ac92b374c153d622d7806b9e59a8d + docs/models/agentsapiv1agentsdeleterequest.md: + id: 0faaaa59add9 + last_write_checksum: sha1:2a34269e682bb910b83814b4d730ba2ce07f8cb2 + pristine_git_object: 2799f41817ab0f7a22b49b4ff895c8308525953c + docs/models/agentsapiv1agentsgetagentversion.md: + id: 3316961b40c4 + last_write_checksum: sha1:e4f4c6a64b1c2ec9465b7ad008df4d7859098e59 + pristine_git_object: 7fb9f2d578c4901ca1b41aaada6acc3a5ee94fa1 + docs/models/agentsapiv1agentsgetrequest.md: + id: 01740ae62cff + last_write_checksum: sha1:bc86e90289ec09b40212083a82455b4fe71c7194 + pristine_git_object: ceffe0096ffd6db97a6018d34870c29cec4fb0d3 + docs/models/agentsapiv1agentsgetversionrequest.md: + id: 88ed22b85cde + last_write_checksum: sha1:0ef23807c8efa2662144da66745045abdd2cb60a + pristine_git_object: 96a7358943a69e871a2bb7f0f30d6fe2bb8dff3d + docs/models/agentsapiv1agentslistrequest.md: + id: c2720c209527 + last_write_checksum: sha1:99502da34d868f1563ad1e3ea256f3becdbefa11 + pristine_git_object: 4785a54c561f5f9e1eb7ffd3317c5faa9b8b56dd + docs/models/agentsapiv1agentslistversionaliasesrequest.md: + id: 69c8bce2c017 + last_write_checksum: sha1:4083fc80627b2cc04fd271df21393944730ef1ba + pristine_git_object: 3083bf92641404738948cd57306eac978b701551 + docs/models/agentsapiv1agentslistversionsrequest.md: + id: 0bc44ed8d6bb + last_write_checksum: sha1:315790552fc5b2b3a6c4f7be2eb33100133abe18 + pristine_git_object: 91831700bed92cb4f609f8c412dcb0ee98b544ca + docs/models/agentsapiv1agentsupdaterequest.md: + id: 7692812cd677 + last_write_checksum: sha1:aaccaa13eeb0d775b0c6a0b23c328d3f3c2c2dbf + pristine_git_object: 7ef60becfcdde09c8ce0366361306c5661d67e24 + docs/models/agentsapiv1agentsupdateversionrequest.md: + id: a001251b1624 + last_write_checksum: sha1:0ee9e0fc55fd969f2b8f2c55dec93bf10e0e5b2f + pristine_git_object: e937acc9b1d3f50eee69495b1305f7aee1c960ac + docs/models/agentsapiv1conversationsappendrequest.md: + id: 70f76380e810 + last_write_checksum: sha1:d428dc114b60362d269b5ae50a57ea60b9edee1a + pristine_git_object: ac8a00ecab30305de8eb8c7c08cda1b1c04148c3 + docs/models/agentsapiv1conversationsappendstreamrequest.md: + id: f6ada9a592c5 + last_write_checksum: sha1:8a806ca2e5bad75d9d0cf50726dc0d5b8e7e3eab + pristine_git_object: dbc330f11aa3039c9cea2dd7d477d56d5c4969d0 + docs/models/agentsapiv1conversationsdeleterequest.md: + id: c2c9f084ed93 + last_write_checksum: sha1:9ecca93f8123cebdd1f9e74cf0f4a104b46402a8 + pristine_git_object: c6eed281331cb4d2cac4470de5e04935d22eca5a + docs/models/agentsapiv1conversationsgetrequest.md: + id: d6acce23f92c + last_write_checksum: sha1:b5d5529b72c16293d3d9b5c45dcb2e3798405bcf + pristine_git_object: 67d450c88778cb27d7d0ba06d49d9f419840b32e + docs/models/agentsapiv1conversationshistoryrequest.md: + id: e3efc36ea8b5 + last_write_checksum: sha1:4155100eaed6d3b7410b3f4476f000d1879576be + pristine_git_object: 7e5d39e9a11ac437a24b8c059db56527fa93f8b0 + docs/models/agentsapiv1conversationslistrequest.md: + id: 406c3e92777a + last_write_checksum: sha1:d5c5effcf2ca32900678d20b667bdaf8ca908194 + pristine_git_object: 62c9011faf26b3a4268186f01caf98c186e7d5b4 + docs/models/agentsapiv1conversationslistresponse.md: + id: 394c37d2203f + last_write_checksum: sha1:1144f41f8a97daacfb75c11fdf3575e553cf0859 + pristine_git_object: b233ee203ff5da0c65d6e9f87b2925d6802d2c0a + docs/models/agentsapiv1conversationsmessagesrequest.md: + id: 2c749c6620d4 + last_write_checksum: sha1:781e526b030653dc189d94ca04cdc4742f9506d2 + pristine_git_object: a91ab0466d57379eacea9d475c72db9cb228a649 + docs/models/agentsapiv1conversationsrestartrequest.md: + id: 6955883f9a44 + last_write_checksum: sha1:99c1455c7fde9b82b6940e6e1ed4f363d7c38de9 + pristine_git_object: a18a41f5395adae3942573792c86ddf7c3812ff4 + docs/models/agentsapiv1conversationsrestartstreamrequest.md: + id: 0c39856fd70e + last_write_checksum: sha1:d03475c088c059077049270c69be01c67a17f178 + pristine_git_object: 7548286af5d1db51fbfd29c893eb8afdc3c97c4d + docs/models/agentscompletionrequest.md: + id: 906b82c214dc + last_write_checksum: sha1:972940e9ba4133d7956167a071733751e2120bbd + pristine_git_object: 3253fee1b9cb5608cdd7c261e1b65895d3d3f7f9 + docs/models/agentscompletionrequestmessage.md: + id: 5337f0644b40 + last_write_checksum: sha1:ecf7b7cdf0d24a5e97b520366cf816b8731734bb + pristine_git_object: 957703b528d3da6f57576064d7cb9b2af63c362a + docs/models/agentscompletionrequeststop.md: + id: ad1e0e74b6b8 + last_write_checksum: sha1:b2422d4dada80d54b2dd499a6659a3894318d2c9 + pristine_git_object: 21ce6fb539238168e6d1dfc5a8206d55d33018d3 + docs/models/agentscompletionrequesttool.md: + id: 242b6dce104d + last_write_checksum: sha1:1ba227813be0c1047edfaf41b00bc14506374878 + pristine_git_object: c20358664c677d0e6c4179a7ac44c7e633125352 + docs/models/agentscompletionrequesttoolchoice.md: + id: bd8a6f9fbb47 + last_write_checksum: sha1:f3d9ec3c82b6bbd2c3cbc320a71b927edcc292b1 + pristine_git_object: 63b9dca9fbb8d829f93d8327a77fbc385a846c76 + docs/models/agentscompletionstreamrequest.md: + id: 21d09756447b + last_write_checksum: sha1:286562c88d085a713d100aaaaec82254fc44d96c + pristine_git_object: 29659238932a07f23da8a3a0d469927e4451af07 + docs/models/agentscompletionstreamrequestmessage.md: + id: b309ade92081 + last_write_checksum: sha1:98744c9646969250242cbbfbdf428dbd7030e4bb + pristine_git_object: 6ccf4244a709de7bedbf75042efb935129a6ca01 + docs/models/agentscompletionstreamrequeststop.md: + id: 4925b6b8fbca + last_write_checksum: sha1:c9d0d73ca46643ffdf02e6c6cd35de5c39460c20 + pristine_git_object: 981005f3ff2277eae57c56787edb5f1f62d1fe46 + docs/models/agentscompletionstreamrequesttool.md: + id: 03d75b677f51 + last_write_checksum: sha1:3e9ef8be5631387c05584ba64f66f5b6fe2d4386 + pristine_git_object: 6a11b0420d94f7c42ea1ffa6b7577552f1d3c0d1 + docs/models/agentscompletionstreamrequesttoolchoice.md: + id: b1f76f7a4e1c + last_write_checksum: sha1:843c4946d5cab61df2cba458af40835c4e8bcafe + pristine_git_object: 4354523a7d0d21721a96e91938b89236169ccced + docs/models/agenttool.md: + id: 513b8b7bc0b7 + last_write_checksum: sha1:8dedf7bcaa05492689ce0828e5644380258d5a7e + pristine_git_object: 0722e955359c8569a219f3c2c9b3d9dbb7449ee0 + docs/models/and_.md: + id: a4692aa4d8e7 + last_write_checksum: sha1:86773c7178b6c04a7adc487d860c39a51116b0cb + pristine_git_object: 591b7bb362df8c1544b51c935c78be2111c0e18a + docs/models/annotations.md: + id: f3368d2e0511 + last_write_checksum: sha1:2ffa9e219b9cf7b28e8591ddbc7c27d92d07022e + pristine_git_object: 2a23157c270b9f7a5fa4872aae5b541a3fa25051 + docs/models/answer.md: + id: 9ac735faad2d + last_write_checksum: sha1:4364632d9aad9c1a5ff2dfb7381d2b0db01efbb9 + pristine_git_object: 324a8e4e8656b3eef77355cc24c70ac0a2e1aa9c + docs/models/apiendpoint.md: + id: be613fd9b947 + last_write_checksum: sha1:843ebd98df60194f823ddcebeb1f1d334c2b16ce + pristine_git_object: e049d40ab3995e3442a009a9781ac98b4614091c + docs/models/apikeyauth.md: + id: 529789e1b079 + last_write_checksum: sha1:edb801076d411a5d6c1f7a3f4fdb4c3612b12ab1 + pristine_git_object: 1fbff10e21eb51df061790f0215cb4916318ebc1 + docs/models/archivemodelresponse.md: + id: 133f4af8058f + last_write_checksum: sha1:95fa73ebd765cbd244c847218df6d31e18dc5e85 + pristine_git_object: 276656d1d00ca174e78aa9102f7f576575daa818 + docs/models/archiveworkflowv1workflowsworkflowidentifierarchiveputrequest.md: + id: 782799cd1e0b + last_write_checksum: sha1:c4e29a286d05af9de794a7b955dd5443c8ee58bc + pristine_git_object: 6ebe540af990f5a52dbd236e6d29fd138a2fae22 + docs/models/arguments.md: + id: 7ea5e33709a7 + last_write_checksum: sha1:09eea126210d7fd0353e60a76bf1dbed173f13ec + pristine_git_object: 2e54e27e0ca97bee87918b2ae38cc6c335669a79 + docs/models/assistantmessage.md: + id: 7e0218023943 + last_write_checksum: sha1:47d5cd1a1bef9e398c12c207f5b3d8486d94f359 + pristine_git_object: 9ef638379aee1198742743800e778409c47a9b9d + docs/models/assistantmessagecontent.md: + id: 9f1795bbe642 + last_write_checksum: sha1:1ce4066623a8d62d969e5ed3a088d73a9ba26643 + pristine_git_object: 047b7cf95f4db203bf2c501680b73ca0562a122d + docs/models/attributes.md: + id: ececf40457de + last_write_checksum: sha1:9f23adf16a682cc43346d157f7e971c596b416ef + pristine_git_object: 147708d9238e40e1cdb222beee15fbe8c1603050 + docs/models/audience.md: + id: 6a718c512c7f + last_write_checksum: sha1:67de107cad15a11c0edb9b6bc0d6a79fe85a6258 + pristine_git_object: 186d913ec0e78ad9f4ddf762e7aa24ec2c8122b4 + docs/models/audiochunk.md: + id: 88315a758fd4 + last_write_checksum: sha1:b47b295122cea28d66212d75a1f0eccd70a248cc + pristine_git_object: 1ba8b0f578fa94b4f8dddf559798e033a1704e7b + docs/models/audiocontent.md: + id: f0b2c5004edf + last_write_checksum: sha1:ce23944b8c8556d20c1b3a9b7a7715dea232e124 + pristine_git_object: 64ab6d26b5561e15722cab1eab3134c5a0688a91 + docs/models/audioencoding.md: + id: 1e0dfee9c2a0 + last_write_checksum: sha1:d3f61fdb79969e41b9925f5788246d691ba39f39 + pristine_git_object: 34b80490a315851da7e8b9e1b5e32108d40609cc + docs/models/audioformat.md: + id: 41973dd397de + last_write_checksum: sha1:b81fbaf4f8aa03937c91f76d371ad5860836a772 + pristine_git_object: d174ab9959cadde659f76db94ed87c743e0f6783 + docs/models/audiotranscriptionrequest.md: + id: ebf59641bc84 + last_write_checksum: sha1:a478d0656a0f69d4c426e548e2236b99730e2084 + pristine_git_object: 80bd53015ddee1bcecc7aeecc75152a19afc22c1 + docs/models/audiotranscriptionrequeststream.md: + id: 79b5f721b753 + last_write_checksum: sha1:df6825c05b5a02dcf904ebaa40fb97e9186248cc + pristine_git_object: 5d64964d1a635da912f2553c306fb8654ebfca2e + docs/models/authdata.md: + id: e510ac107a56 + last_write_checksum: sha1:1cfbc35a6112a6eca7b4199c37959a0fef390ca8 + pristine_git_object: d0784e66112b8f79036d1acff2a7fc242058e4a0 + docs/models/authenticationconfiguration.md: + id: b470496ac0ad + last_write_checksum: sha1:650e1e889d037f79a87c8ab0a679e245c2ddbb4b + pristine_git_object: 6644875efdc48b462a98193b391dc23e1f31b2c3 + docs/models/authorization.md: + id: dec4d9809e25 + last_write_checksum: sha1:6bf766a7b49ca2b706bb4eb88ba2d56406e06e1e + pristine_git_object: 11ea5c6a700e7b92f5cbd29e88e41b834f8b8ef4 + docs/models/authurlresponse.md: + id: df05a2481f48 + last_write_checksum: sha1:6e6e74a9ee75bf37dd08703aca9f8e6a5f95a431 + pristine_git_object: f8401a8e26c3d54aa47a1a6cc265050f0a4afc80 + docs/models/basefielddefinition.md: + id: f9e0bbae859b + last_write_checksum: sha1:fea96b146e5696ff3b93e6b6529fe4ace90616aa + pristine_git_object: 3d721d91572e4cdb8d5de5a2cdd294693f552d73 + docs/models/basefielddefinitiontype.md: + id: e0678603f859 + last_write_checksum: sha1:057a88127fff9b9cbee409cf28c865bc22c46d69 + pristine_git_object: 355242b9982ce817900b3f51418ee629775efcf1 + docs/models/basemodelcard.md: + id: 2f62bfbd650e + last_write_checksum: sha1:d42dfe36b103ee95f55e91ac306e3179060dfb3f + pristine_git_object: 2a5e7515a0edc3f1a5de68ba28eae8bdec988bb1 + docs/models/basetaskstatus.md: + id: b709621d5c71 + last_write_checksum: sha1:19fd9c3fc71627d758635f9840be4508ffe8e361 + pristine_git_object: bb781fd1afc2b7a3587f1048e8d84d7814c21e51 + docs/models/batcherror.md: + id: 8053e29a3f26 + last_write_checksum: sha1:23a12dc2e95f92a7a3691bd65a1b05012c669f0f + pristine_git_object: 95016cdc4c6225d23edc4436e11e4a7feacf1fe6 + docs/models/batchexecutionbody.md: + id: eb5f0e359ea6 + last_write_checksum: sha1:1501d090c7bcb631f0c4ec0e07417eea8277d632 + pristine_git_object: 9c31e334d7b44a1fea834f14f84945ea69d4a55b + docs/models/batchexecutionresponse.md: + id: 77f8c97e0418 + last_write_checksum: sha1:3dc72435fc7dcf31172ab0f4a5301b25e950fda2 + pristine_git_object: 394b6d86517e1339bbab6a629289b52cbc237684 + docs/models/batchexecutionresult.md: + id: a04ce80759e1 + last_write_checksum: sha1:c595f3e603609a9e676bf253f3935a74f9bed27a + pristine_git_object: 57107bbaa5a544f473a1e5d268ba7ed89dd27ebd + docs/models/batchjob.md: + id: de2a00d0f739 + last_write_checksum: sha1:1160822c4032e1745dfaf37abcac02e78cbc4fb4 + pristine_git_object: 162e2cff3a1132f2b89e57dcf1bf8b4c403b6453 + docs/models/batchjobstatus.md: + id: 7e6f034d3c91 + last_write_checksum: sha1:42bf12df19501db1809543e898e7cf73e3cf2aad + pristine_git_object: 7473cb1f83e47b14598347d7909968b38cfe2b54 + docs/models/batchrequest.md: + id: b113ca846594 + last_write_checksum: sha1:f9dc702c27b8257e008390519df744290e09c4b4 + pristine_git_object: 6ee3b394a8b1125769a355359b5a44bc7c3224ea + docs/models/blobresourcecontents.md: + id: 19b9f897373e + last_write_checksum: sha1:0a40334024da0f41ccab87e10add590ea87a8b01 + pristine_git_object: c862e53730393d65a061ed63a96640859fe74adc + docs/models/builtinconnectors.md: + id: 9d14e972f08a + last_write_checksum: sha1:ad790344ffc177d10a7eff06482c39d722cd7b95 + pristine_git_object: 11dfd48a87d5341883fbcdf2aad1cfff8aed5587 + docs/models/campaign.md: + id: cc1272bc909c + last_write_checksum: sha1:291f6152431f3f14c16df9005a4392907dbf03e2 + pristine_git_object: 1f2a7a365ac4a3811ccf9760e56eabbf9106638d + docs/models/cancelworkflowexecutionv1workflowsexecutionsexecutionidcancelpostrequest.md: + id: 69e393daf019 + last_write_checksum: sha1:51a5c5fa815093aa1e91ec0f41567066b025abf3 + pristine_git_object: 4968d664d1f4d34c300bc6a6dec18c992652999f + docs/models/chatclassificationrequest.md: + id: 57b86771c870 + last_write_checksum: sha1:bfd2fb8e2c83578ca0cea5209ea3f18c3bcd2ae5 + pristine_git_object: ba9c95eab2c1e4f080e39e8804a5de222e052ee6 + docs/models/chatcompletionchoice.md: + id: 0d15c59ab501 + last_write_checksum: sha1:f3c9fa3cc092674a36bf28552b6900d62871b789 + pristine_git_object: 79d24a335c7ca1acb1469213d60ced2ec4987461 + docs/models/chatcompletionchoicefinishreason.md: + id: 225764da91d3 + last_write_checksum: sha1:160ff1297bfbaa9158e575b8bd7ab573533c8f9f + pristine_git_object: c289272622b137541843bb4ba9654d0e1405ffec + docs/models/chatcompletionevent.md: + id: fc1097c5bfe2 + last_write_checksum: sha1:ef1f417581e943503acb38b503aedde3e157d934 + pristine_git_object: 500192f661b0657f594f85da4d38896954426db5 + docs/models/chatcompletioneventextrafields.md: + id: 686e5af33206 + last_write_checksum: sha1:1e967d85aa59349a84245be37fa627890f51162d + pristine_git_object: d63b251dc62850c425a889881eda8272e0699543 + docs/models/chatcompletioneventpreview.md: + id: 89dcfcc3bd32 + last_write_checksum: sha1:ea5a4776fd299a1c8208392e54061615ddb19ad2 + pristine_git_object: 855e8ab0ccf2851aad23067cc6386211bd1e80f0 + docs/models/chatcompletioneventpreviewextrafields.md: + id: 6562107fac56 + last_write_checksum: sha1:2c5107faed8463f40d265da2e0907fb24d854ef4 + pristine_git_object: 5bcec6a085b8fe921efb44ab5f040faf99cff7a3 + docs/models/chatcompletionrequest.md: + id: adffe90369d0 + last_write_checksum: sha1:3e240059856e4445d9b76934806b172021174889 + pristine_git_object: ad1b3d3912f04750172ebb0c5776215b716b96f9 + docs/models/chatcompletionrequestmessage.md: + id: 3f5e170d418c + last_write_checksum: sha1:7921c5a508a9f88adc01caab34e26182b8035607 + pristine_git_object: 91e9e062d0ef0cb69235c4ae4516548733ce28a9 + docs/models/chatcompletionrequeststop.md: + id: fcaf5bbea451 + last_write_checksum: sha1:71a25f84f0d88c7acf72e801ced6159546201851 + pristine_git_object: 749296d420c0671d2a1d6d22483b51f577a86485 + docs/models/chatcompletionrequesttool.md: + id: 01554a1b158a + last_write_checksum: sha1:e7259e65ba3c614e5e70d0d55c88db03e90097d0 + pristine_git_object: 572d12ca006caead244387a5e91000ac33b0aa0e + docs/models/chatcompletionrequesttoolchoice.md: + id: b97041b2f15b + last_write_checksum: sha1:7ad7eb133f70e07d0d6a9def36aadd08b35cf861 + pristine_git_object: dc82a8ef91e7bfd44f1d2d9d9a4ef61b6e76cc34 + docs/models/chatcompletionresponse.md: + id: 7c53b24681b9 + last_write_checksum: sha1:a56581c0846638cfe6df26d3045fb4f874ccd931 + pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b + docs/models/chatcompletionstreamrequest.md: + id: cf8f29558a68 + last_write_checksum: sha1:0d243eb67aa8e905e88463d9b745bda2030d415c + pristine_git_object: 7288c818d03f0c672d99a2c61ea19cce4fd39654 + docs/models/chatcompletionstreamrequestmessage.md: + id: 053a98476cd2 + last_write_checksum: sha1:8270692463fab1243d9de4bbef7162daa64e52c5 + pristine_git_object: 2e4e93acca8983a3ea27b391d4606518946e13fe + docs/models/chatcompletionstreamrequeststop.md: + id: d0e89a4dca78 + last_write_checksum: sha1:a889e9580fa94bda7c848682d6ba501b7f5c0f41 + pristine_git_object: a48460a92ac47fec1de2188ba46b238229736d32 + docs/models/chatcompletionstreamrequesttool.md: + id: cbfb16fb3b03 + last_write_checksum: sha1:163ad1e31d7ba4eaef7797b399d1323465e97110 + pristine_git_object: 48998fcbb16a8ce5f5a4fd8b2794125d97e935ac + docs/models/chatcompletionstreamrequesttoolchoice.md: + id: 210d5e5b1413 + last_write_checksum: sha1:0543164caf3f4fb2bef3061dbd1a5e6b34b17ae9 + pristine_git_object: 43f3ca3809bf1a2a040e2ad7c19a2b22db0b73f8 + docs/models/chatmoderationrequest.md: + id: 22862d4d20ec + last_write_checksum: sha1:9bbe510ee67515092bd953ad7f84ae118398af54 + pristine_git_object: f252482db0e404e21a61aafba0d09d9561610c11 + docs/models/chatmoderationrequestinputs1.md: + id: 89311e3e440d + last_write_checksum: sha1:8d4c2dbd9207589aabf9c00cf60c61d2d3eef452 + pristine_git_object: e15b8a844110fae68c02da040cd0122be5afc09a + docs/models/chatmoderationrequestinputs2.md: + id: 4daa876da841 + last_write_checksum: sha1:e34eb6557e06e7783ed14d959c2a29959c26fd4c + pristine_git_object: f40a4ebe0780c493e8bd7a322aec31893669a181 + docs/models/chatmoderationrequestinputs3.md: + id: aec173bca43b + last_write_checksum: sha1:14ce49ace5845bc467fe1559b12374bfd36bc9a7 + pristine_git_object: ff1c6ea32233d5c5e8d6292c62f9e8eacd3340c3 + docs/models/chattranscriptionevent.md: + id: 3932410b4664 + last_write_checksum: sha1:db91f483894b9dadc0baa66358c3b81874fea59c + pristine_git_object: c2a38ed5a167c698a22b332bca4bf3dc3b69f204 + docs/models/checkpoint.md: + id: 9c97119961cf + last_write_checksum: sha1:0e7732d9c30f67d59fe4d9ad1d165ad0cd80c790 + pristine_git_object: f7f35530c0d57aca02b2503e968a9a262bb1a10d + docs/models/classificationrequest.md: + id: 6f79e905a3fa + last_write_checksum: sha1:3e083210e1cfdd3539e714928688648673767ae8 + pristine_git_object: 99cdc4a0863577d523e8921af31a179f109bc9fb + docs/models/classificationrequestinputs.md: + id: aff99510c85a + last_write_checksum: sha1:c4b52dd83924f56bef1f54c4fbbdf3cd62e96dbe + pristine_git_object: 69d75d11276f6101452a9debfa2cbcdd39333849 + docs/models/classificationresponse.md: + id: 21227dec49f2 + last_write_checksum: sha1:56756a6c0c36ce94653b676eba1f648907a87a79 + pristine_git_object: d1633ae779850cba0eac4a9c26b5b776a7b789e0 + docs/models/classificationtargetresult.md: + id: 97a5eab5eb54 + last_write_checksum: sha1:41269d1372be3523f46cb57bd19292af4971f7c0 + pristine_git_object: f3b10727b023dd83a207d955b3d0f3cd4b7479a1 + docs/models/classifierfinetunedmodel.md: + id: b67a370e0ef1 + last_write_checksum: sha1:d2fee635b135b4728a7966dd62c7ddea3f2d0c1c + pristine_git_object: 9fa69cbb27a53456fd359ba8650d3510264926b9 + docs/models/classifierfinetuningjob.md: + id: 5bf35c25183f + last_write_checksum: sha1:e26e4f2fb93f1111d2e2ec8563f0677a4f0651b3 + pristine_git_object: 123a51d83e1ab12abab08d32e591d4f39852cfad + docs/models/classifierfinetuningjobdetails.md: + id: c91d53e010d5 + last_write_checksum: sha1:c828f982f03db4a14c9a2e24c6ff2c1692c45524 + pristine_git_object: d4a17ecaf29bb4831728f03b2714c9e96f6c672a + docs/models/classifierfinetuningjobdetailsintegration.md: + id: e6c161ac2a44 + last_write_checksum: sha1:6450686e7f92ac8c1c02fcea82d5855ca6738b46 + pristine_git_object: 438a35d9eb0e4250a9e6bcbb7dafeb26d74e018a + docs/models/classifierfinetuningjobdetailsstatus.md: + id: 87737e85b845 + last_write_checksum: sha1:4b26849973572cd836a9ccd180de41bb77196279 + pristine_git_object: 589d37a139b0a820f2f41b111191f4cc261335cb + docs/models/classifierfinetuningjobintegration.md: + id: 91de20176a8c + last_write_checksum: sha1:e49a7c082300eb4d3106e96b21ebc6860060b8c3 + pristine_git_object: 820aee4c6fcf899341d869d796b1a61d4d4eab42 + docs/models/classifierfinetuningjobstatus.md: + id: e3c4e672dc88 + last_write_checksum: sha1:7e33e8aa5e3c859ad992f198ae5789160874ef94 + pristine_git_object: c25d73a64d76a9cfded403a1ba84f2d3c5771a39 + docs/models/classifiertarget.md: + id: 4c5c0b3e0bc7 + last_write_checksum: sha1:ad16823def0acb267543c4189df32406a27685aa + pristine_git_object: f8c99e2e7e6653d0e809506861ec4c25571cb5c9 + docs/models/classifiertargetresult.md: + id: c78d27aec276 + last_write_checksum: sha1:17c37c10385019953d6085fff6681808f950693f + pristine_git_object: ccadc623493bfa946dc2cccf894364b1e6b8b452 + docs/models/classifiertrainingparameters.md: + id: 9370e1ccd3d5 + last_write_checksum: sha1:31a490471292a397e7e7526f2f724fcb743e65d1 + pristine_git_object: 6c6da1bd74aa8c67cc40307a88ffac1db1957f3a + docs/models/codeinterpretertool.md: + id: f009740c6e54 + last_write_checksum: sha1:a2114d61a98a48b4365a77c0c75c06ca834367ad + pristine_git_object: 6302fc627d7c49442b6c9aec19c70fdceaf7c519 + docs/models/completionargs.md: + id: 3b54534f9830 + last_write_checksum: sha1:3629a70a095750b82bc60a80c0a2b3e3496bafba + pristine_git_object: 51f7ff3070cb6d6e79c17dadff2340b028958563 + docs/models/completionargsstop.md: + id: 40b0f0c81dc8 + last_write_checksum: sha1:2a576618c62d4818af0048ed3a79080149a88642 + pristine_git_object: b93f993e44a18fb0f3711163277f538cfedbf828 + docs/models/completionchunk.md: + id: 60cb30423c60 + last_write_checksum: sha1:61b976fe2e71236cf7941ee1635decc31bd304b2 + pristine_git_object: 7f8ab5e631e2c6d1d9830325e591a7e434b83a35 + docs/models/completionevent.md: + id: e57cd17cb9dc + last_write_checksum: sha1:4f59c67af0b11c77b80d2b9c7aca36484d2be219 + pristine_git_object: 7a66e8fee2bb0f1c58166177653893bb05b98f1d + docs/models/completionfinetunedmodel.md: + id: 23a7705a9c89 + last_write_checksum: sha1:43b1d576afd2da43e8a97f374b09c6a5ed236ec1 + pristine_git_object: 26bcdb1700c8e8ce52c93da302e7c05e97935091 + docs/models/completionfinetuningjob.md: + id: 13c69dd18690 + last_write_checksum: sha1:6fe9defa896540ae0c92af5a15f2b8f16bd1c680 + pristine_git_object: c022fbfacf251008fb8dd3400e9ca3d718eac89e + docs/models/completionfinetuningjobdetails.md: + id: b285f80afd59 + last_write_checksum: sha1:7c6bff4e32e3699fb5bfac86292c6606bb47c953 + pristine_git_object: e092e51022fcc6c6a9329d14ab2c3ed8a15fd4e3 + docs/models/completionfinetuningjobdetailsintegration.md: + id: 27662795c95f + last_write_checksum: sha1:655f03341ad1b590ec451288607cec61024bfefc + pristine_git_object: 38f6a34963db4a653ec7aa7f0c85b68e837ebafc + docs/models/completionfinetuningjobdetailsrepository.md: + id: 023920eecc9e + last_write_checksum: sha1:2b8ba6ff115fda4cc6ed74825fb09b9500d915f6 + pristine_git_object: c6bd67cde1d1628aa3efc4a53fa8487a009aa129 + docs/models/completionfinetuningjobdetailsstatus.md: + id: b1b717a4e256 + last_write_checksum: sha1:41fdb748129168280171af63e18e6ca1f525872a + pristine_git_object: 6de580b814933cbb51646e859cc6f8369072cba0 + docs/models/completionfinetuningjobintegration.md: + id: 392ffc2cdef2 + last_write_checksum: sha1:53540da44e0edbad5d4085f81ded159dbc582a6c + pristine_git_object: dbe57417d78f1de798c6eaea7e56984e3b002cb9 + docs/models/completionfinetuningjobrepository.md: + id: deb47b72e8e4 + last_write_checksum: sha1:c0fd43a01c2f763c7945311741ee3c2b9c7520f6 + pristine_git_object: 54225e27204b703a6b33d2d66492e272559c3b3c + docs/models/completionfinetuningjobstatus.md: + id: 2ac420312815 + last_write_checksum: sha1:9cd1aec6125060ed45296636592818bf2ce2f2a8 + pristine_git_object: 1fd78b9dd551168e6dc32d737dfd3d5731002725 + docs/models/completionresponsestreamchoice.md: + id: d56824d615a6 + last_write_checksum: sha1:0296a490df009dbfd04893fdebcc88dd6102a872 + pristine_git_object: 1532c25b8fc065d486f52d4610a7f757e5340875 + docs/models/completionresponsestreamchoicefinishreason.md: + id: 5f1fbfc90b8e + last_write_checksum: sha1:892588ab61324c6328100e402f1b219959ff4097 + pristine_git_object: 3e8c30ec1199363880991e0f8c631d32bb84a980 + docs/models/completiontrainingparameters.md: + id: b716b0195d39 + last_write_checksum: sha1:e143de81ddb8411db75c7b83c503c7bd444aea6d + pristine_git_object: 9228221e4d6a15ffdeb1b8eeae229bee97c7f1e2 + docs/models/confidencescoresgranularity.md: + id: 76a175c65878 + last_write_checksum: sha1:5287635d80d2f4e285cacfd0f571d3f06c01e962 + pristine_git_object: 29646c918aa6090b4b08c349c6de04c06d57387b + docs/models/confirmation.md: + id: 19b9e48a3c2e + last_write_checksum: sha1:6e199c756ce35e2bff3b67df5d97b4520518b271 + pristine_git_object: c87093846ca27940a08318fb090c60ce56a00651 + docs/models/connectioncredentials.md: + id: 1aa13b29ae25 + last_write_checksum: sha1:1fbc7ca6daa21f093853cda8385fd63b031bb653 + pristine_git_object: 7e89239996c86952aa3ddf7520c0a73858b31725 + docs/models/connector.md: + id: cbf7c2c53983 + last_write_checksum: sha1:933fcdfbded00c65d36e46d6b2e18e56540802fe + pristine_git_object: 29f8ad0771bf8da6999345b78322001c3821a6ca + docs/models/connectorauthenticationheader.md: + id: bb5e842caa63 + last_write_checksum: sha1:7c721f916ed1ce2d4155734bb8190e11de6bf4ac + pristine_git_object: c545b571f921874f7d4a9ffda9331a73eacb6c3f + docs/models/connectorcalltoolrequest.md: + id: d0f10cee6826 + last_write_checksum: sha1:81fa16df68355ba258c66189a2c9b6d0cdb2dfb8 + pristine_git_object: 9ef7a35154327673593f323a142fe63ec706e799 + docs/models/connectorcalltoolv1request.md: + id: a7a294c4280c + last_write_checksum: sha1:0d8983932c2f4eb6f19e7a81c1e76eeb7ee9bb2f + pristine_git_object: dea7083dabf1fe9f5470a5b13d6e65ae234d8aa8 + docs/models/connectorcreateorupdateorganizationcredentialsv1request.md: + id: 215e752e803b + last_write_checksum: sha1:cc72d358588bae1001e4076c77d5e0065977b441 + pristine_git_object: 2797bebf5d8b711bcd7a69f193d40f33ad66d640 + docs/models/connectorcreateorupdateusercredentialsv1request.md: + id: 53bf0f40ddbc + last_write_checksum: sha1:a20627b02d5057def7e491f3af04fcf6770389a9 + pristine_git_object: 3e763722a0ad765af38fffbf938a0b228015c3ae + docs/models/connectorcreateorupdateworkspacecredentialsv1request.md: + id: 10c159720bae + last_write_checksum: sha1:e86b1952360e4f41550603b9dc16fddeff6127e7 + pristine_git_object: 310cdcde0039e9fdb4faa53644265a6a614d9b20 + docs/models/connectordeleteorganizationcredentialsv1request.md: + id: 922f5267f2c0 + last_write_checksum: sha1:23af2d809a20c093ece79bcd1e6ebc551be4b368 + pristine_git_object: eaf4d00cc70f2d15e29634ff99f1cfedcdeea189 + docs/models/connectordeleteusercredentialsv1request.md: + id: 294334281c1c + last_write_checksum: sha1:2dfb1be1e57d3c48c0a5df7c642212e572731b34 + pristine_git_object: fd52cf921a5db428757407e216c918853f5e67cb + docs/models/connectordeletev1request.md: + id: 8d5621ba6395 + last_write_checksum: sha1:881b88b2e0788f7c16938115a6cada5f0ebe144b + pristine_git_object: e50c7296f28bbf48daf724af3c848a50e8424ad7 + docs/models/connectordeleteworkspacecredentialsv1request.md: + id: 058a4c7be62f + last_write_checksum: sha1:c5185ed84e0f26596bcc1c573009d694a064f21f + pristine_git_object: 3bc3d7c9e7f25bb3ee716e0fc9011dfa40b844c5 + docs/models/connectorgetauthenticationmethodsv1request.md: + id: 50edde04fff0 + last_write_checksum: sha1:78305fe0052b6b90036ca72302a42dcf9093e3d3 + pristine_git_object: 3a62c0106481edc9d8137689c4d7d7649f812397 + docs/models/connectorgetauthurlv1request.md: + id: 8a02a6af19ab + last_write_checksum: sha1:517c82f877bbcb4b5a34404cfa9cc51897fc14ed + pristine_git_object: 7d6b94ff09be0d4bf2f062fa039551ab0735fc13 + docs/models/connectorgetv1request.md: + id: 844c1f489684 + last_write_checksum: sha1:e36ac8ff28ee258340868f8aa4f3172ed3b82ef3 + pristine_git_object: c45148b97aad128744e0e6ccebb00bf22d400eff + docs/models/connectorlistorganizationcredentialsv1request.md: + id: cc1870566c72 + last_write_checksum: sha1:633bb13df6fa25f746a9aa905da3f3beb75ff91a + pristine_git_object: 53ce36db49acb994ac1bbc6899d50035409a13f4 + docs/models/connectorlisttoolsv1request.md: + id: 43698382d3c4 + last_write_checksum: sha1:e2ec4a2b6b595941890d400817ca38f996a441e8 + pristine_git_object: e9c2137429509ea9edf43a5f9329208103c2bd11 + docs/models/connectorlistusercredentialsv1request.md: + id: 721da447813a + last_write_checksum: sha1:b6a1ed55ec98439880f0a5274df2a6d3ac6c009d + pristine_git_object: 2c9547d51753c63f68fd8919e83ae26e38aa7748 + docs/models/connectorlistv1request.md: + id: 68b7a11faff6 + last_write_checksum: sha1:e08effc0f17a95383c3ba96b06b1dba80f4dc767 + pristine_git_object: 6b9a287ead2996c402ade5c18368eaff92c76b2a + docs/models/connectorlistworkspacecredentialsv1request.md: + id: c7f5827917c6 + last_write_checksum: sha1:dfe772567d14a0552eec2e53ebf9c1ed6c39ab3e + pristine_git_object: 573869b2483b15da829b25e1863652680deb6a36 + docs/models/connectorsqueryfilters.md: + id: d6fb981cad1e + last_write_checksum: sha1:3a33088e1e9332318aff437fba7d01239d417d84 + pristine_git_object: aea47e14f02b61dbbd726bc11f6197b6854bb358 + docs/models/connectortool.md: + id: 1c640bab9aeb + last_write_checksum: sha1:ab4ad137330bda6699043da2337aea477c33241e + pristine_git_object: af5cc03b98b973030b6e037165ce725d25293284 + docs/models/connectortoolcallmetadata.md: + id: 9ce26ae7e772 + last_write_checksum: sha1:e43e147bd2729139d6186ade29b851570797c9c0 + pristine_git_object: 4d44a2d0a8d1d4ffa8f66075391e514623c55278 + docs/models/connectortoolcallresponse.md: + id: 7d00da4bf949 + last_write_checksum: sha1:3bbbeffaba03f8eaf98725c7cd8e1d20ff1f3de6 + pristine_git_object: 1c51b9ac1fed0e1993f9d794fe07784d898ccf27 + docs/models/connectortoolcallresponsecontent.md: + id: 0bfb1af7b63a + last_write_checksum: sha1:d1d7453c72a0eb79ccb8e2b36e0963067ce13487 + pristine_git_object: d7f93edac88369164136b3eeb3a707adda9489bd + docs/models/connectortoollocale.md: + id: 44c1e21a5647 + last_write_checksum: sha1:7901679d8cc601169927e1b7e5808456149145de + pristine_git_object: b882c419a94971d7b8c8041ffca4a6b640b06751 + docs/models/connectortoolresultmetadata.md: + id: 18ff112e8af2 + last_write_checksum: sha1:f4d7703c0a1ce40ebd8434e96f1758a5c0b24b45 + pristine_git_object: 77a327dc7782d538c467095c9e15fdcf575334ad + docs/models/connectorupdatev1request.md: + id: fdbeb5fee83e + last_write_checksum: sha1:9082d8f0cfe9f950d129971b152d37f936f7aaea + pristine_git_object: db9cc9b4c4379865ad15292c5385dce864b5935b + docs/models/contentchunk.md: + id: d2d3a32080cd + last_write_checksum: sha1:b253e4b802adb5b66d896bfc6245ac4d21a0c67c + pristine_git_object: cb7e51d3a6e05f197fceff4a4999594f3e340dac + docs/models/context.md: + id: e8f2f9e54b8e + last_write_checksum: sha1:4c14b386f9f89d98f4dd9487ab030f10478c0e63 + pristine_git_object: 107f1bd428b1f39b36f75e5a10532bc462967ce5 + docs/models/conversationappendrequest.md: + id: 722746e5065c + last_write_checksum: sha1:dbf638146381f10f00f8391fb6c7dac7f7cfb860 + pristine_git_object: 471fcc31a964e7aa6fbd3db59fd4a892f5a8a67e + docs/models/conversationappendrequesthandoffexecution.md: + id: e3f56d558037 + last_write_checksum: sha1:1290b8ac33f16e1cb22314469f2d739b3c525eae + pristine_git_object: 70cef2ede8392519f4c50cd695f8788cc6f81200 + docs/models/conversationappendstreamrequest.md: + id: e9f8131435e8 + last_write_checksum: sha1:9a65015064014693b30ad789af8052fc99bca730 + pristine_git_object: a54d5d3e91c9fcb3819a93dee8ef177ff745e5aa + docs/models/conversationappendstreamrequesthandoffexecution.md: + id: 5739ea777905 + last_write_checksum: sha1:f341a41c54f52a06f5ce748f7210cd33b3d0474d + pristine_git_object: dea519789f6493687a3f67a972757435ebf236b2 + docs/models/conversationevents.md: + id: be63cc7c526e + last_write_checksum: sha1:1667c767ef53fd7aef90452fde2a8245ed2b2ae6 + pristine_git_object: f1e2c4e90181ff729d3fdb37b0135e9bbd095c04 + docs/models/conversationeventsdata.md: + id: d4907b066f4b + last_write_checksum: sha1:f58b7f3e738c2d0146b228076a5dc0c6cf84ffb1 + pristine_git_object: 5452d7d5ce2aa59a6d89c7b7363290e91ed8a0a3 + docs/models/conversationhistory.md: + id: 7e97e8e6d6e9 + last_write_checksum: sha1:719a7c0722f3ad2e9f428dd31abf7bd0bad197d2 + pristine_git_object: daefe3363fb57d9a7d2737d3ea3d6e6f61021d49 + docs/models/conversationinputs.md: + id: 23e3160b457d + last_write_checksum: sha1:0c6abaa34575ee0eb22f12606de3eab7f4b7fbaf + pristine_git_object: 86db40ea1390e84c10a31155b3cde9066eac23b0 + docs/models/conversationmessages.md: + id: 46684ffdf874 + last_write_checksum: sha1:5b10a9f3f19591a2675979c21dd8383d5249d728 + pristine_git_object: 8fa51571697ee375bfbc708de854bc0b1129eec7 + docs/models/conversationpayload.md: + id: df641edf7b7e + last_write_checksum: sha1:ffb2c51b5e7d06dcffd41cede9fd24b6aee34518 + pristine_git_object: 481f18e67f70226c928522726c73b3e07b2a7c4c + docs/models/conversationrequest.md: + id: dd7f4d6807f2 + last_write_checksum: sha1:fff53e06f2409c4de6fa8f6a56efad5c165b7685 + pristine_git_object: 6a5dc206ecd4bb115647270adfebcc955b59dcb8 + docs/models/conversationrequestagentversion.md: + id: 68aad87b1459 + last_write_checksum: sha1:fd2e9cd7ed2499b5843c592505ec5e0596a50b33 + pristine_git_object: 9f2518211256762d03dec12c4c4464d48f7ed52c + docs/models/conversationrequesthandoffexecution.md: + id: 9733b1e121d1 + last_write_checksum: sha1:a272071fc088868920874ac89efc6b2f320a8044 + pristine_git_object: de9dc287e1f885ad247b2b79517f127b1b147a38 + docs/models/conversationrequesttool.md: + id: bd1bb6fcea8b + last_write_checksum: sha1:9c04dc1c7401b775671130cce7a1d85fbdf35957 + pristine_git_object: 5a58e6d139fd902bb810088221e036001d7690d2 + docs/models/conversationresponse.md: + id: 2eccf42d48af + last_write_checksum: sha1:519eed0bd9b45ac7c5ccd72f0e56d0a10308aa19 + pristine_git_object: 414755d3f7db0a27e73ef174c8d8c4714c19774e + docs/models/conversationresponseoutput.md: + id: b4663dc32fc3 + last_write_checksum: sha1:5f188564b4b1fd9460a5155bc433c9adf7df031a + pristine_git_object: fe8ad1b5f8f3a48b48b9e2d09814af7df0ed3788 + docs/models/conversationrestartrequest.md: + id: 558e9daa00bd + last_write_checksum: sha1:0f7b4fdb5c945bbe8e49857965756c6bdc6f5ce4 + pristine_git_object: be0f2289b02395c888391b6f7e8e657c49343d47 + docs/models/conversationrestartrequestagentversion.md: + id: e6ea289c6b23 + last_write_checksum: sha1:a5abf95a81b7e080bd3cadf65c2db38ca458573f + pristine_git_object: 019ba301411729ec2c8078404adae998b3b9dacd + docs/models/conversationrestartrequesthandoffexecution.md: + id: faee86c7832c + last_write_checksum: sha1:1e94d552a7f00bbfa4ca2847b927ee0cd11b64f1 + pristine_git_object: 4e202d69ae83fa11798c8b88a34a0246a3d764fe + docs/models/conversationrestartstreamrequest.md: + id: 01b92ab1b56d + last_write_checksum: sha1:768a1d573b5fa034fefcf74e0ae9bc16f6558025 + pristine_git_object: f99a6e3404aea78062d2fd86652649ffd0f03d98 + docs/models/conversationrestartstreamrequestagentversion.md: + id: 395265f34ff6 + last_write_checksum: sha1:ebf4e89a478ab40e1f8cd3f9a000e179426bda47 + pristine_git_object: 9e0063003f1d8acce61cf4edda91ddbc23a3c69d + docs/models/conversationrestartstreamrequesthandoffexecution.md: + id: 3e9c4a9ab94d + last_write_checksum: sha1:41587c4d9516da340a0d55f79cdf9370bca9f4fa + pristine_git_object: 9d2c5633820affc1e265367f7e392ec5ffc35468 + docs/models/conversationsource.md: + id: b50fdc875f45 + last_write_checksum: sha1:9c5bbff0c90b33609939b6455be62e85e682eebc + pristine_git_object: ee88d9d4631c62e2845294950cc7e787316bf461 + docs/models/conversationstreamrequest.md: + id: 833f266c4f96 + last_write_checksum: sha1:5e9f0e779acc11017dbce26e1a4d2be179cdca99 + pristine_git_object: af50989c156f08ea1781d2767be422662945e9c2 + docs/models/conversationstreamrequestagentversion.md: + id: e99ccc842929 + last_write_checksum: sha1:0ba5fca217681cdc5e08e0d82db67884bed076a6 + pristine_git_object: 52ee96720abbb3fec822d0792dbde7020f9fb189 + docs/models/conversationstreamrequesthandoffexecution.md: + id: e6701e5f9f0c + last_write_checksum: sha1:05c7e19550d5c79d59a180422b49e710415fbf46 + pristine_git_object: 247bfd23c034c3e4c5c497e9e372c7ea8fea0dc0 + docs/models/conversationstreamrequesttool.md: + id: 71df6212ff44 + last_write_checksum: sha1:04f89a30daec9bad78f99d0bcf28c8a717fc7833 + pristine_git_object: 82ef640a0026772728b84abe22544f9cf7d5d03c + docs/models/conversationusageinfo.md: + id: 57ef89d3ab83 + last_write_checksum: sha1:d92408ad37d7261b0f83588e6216871074a50225 + pristine_git_object: 57e260335959c605a0b9b4eaa8bf1f8272f73ae0 + docs/models/createagentrequest.md: + id: 9484bab389c1 + last_write_checksum: sha1:5c24b11438c77dbbdb3a6e5275952889e4da7cb9 + pristine_git_object: e9665545ae14415bb0c61dc0312136dd2930ee13 + docs/models/createagentrequesttool.md: + id: 72e5f99878c5 + last_write_checksum: sha1:4b4ab1566b3c82a14ace1c141538d7ad6b7192f7 + pristine_git_object: e45d57bc9eea6f192d0cc0258e5d31e8409dd00d + docs/models/createbatchjobrequest.md: + id: e79afe8f495c + last_write_checksum: sha1:35f67b131b7027d9d62bb829cb2bbfcb5b22b066 + pristine_git_object: 1f27a56351f8dc2eb31a8a7dca3777cb9fc9abcd + docs/models/createcampaignrequest.md: + id: fe54d07fe49b + last_write_checksum: sha1:fa1ea12391459548b455fb5ad22c4704415d6e5c + pristine_git_object: 2e81d26d19950ef6c1bc7186b8497e1f739e8f0b + docs/models/createconnectorrequest.md: + id: 7a0ef9d82658 + last_write_checksum: sha1:f28eb17d562ab9b881f4c0c640f0b16163ada6dc + pristine_git_object: 111c460a711c1d971a300afda6afe4da608e6d21 + docs/models/createdatasetrecordrequest.md: + id: e2c8a858a8e6 + last_write_checksum: sha1:6848c7398d763f7a046dbb41cda8bc33cbb98230 + pristine_git_object: 3ea0d68db2cc15e0dcdb51ca77a90823557604f2 + docs/models/createdatasetrecordv1observabilitydatasetsdatasetidrecordspostrequest.md: + id: 599b04b8f392 + last_write_checksum: sha1:022456acf96559cefa8cdec2c006e13107241261 + pristine_git_object: 7fe42faac9ff2f46fb8e7c0a62068cd2e8f674eb + docs/models/createdatasetrequest.md: + id: ff55db5edd8c + last_write_checksum: sha1:840cddba3faaee46a0a65a92e3f09b6079ac410d + pristine_git_object: d4c166436a4d3cdafcc5990215b0ee2ea2ff9571 + docs/models/createfileresponse.md: + id: ea1396cebae8 + last_write_checksum: sha1:cdda40f3d8165c27ac40a0548b79a9ffafaef4e0 + pristine_git_object: 84be4dc64637998c25005d98ef335576a3db7f00 + docs/models/createfinetuningjobrequest.md: + id: 36824ba035ff + last_write_checksum: sha1:78f019530e9f5deace91c454c91ec6c4d0d23a20 + pristine_git_object: a93e323d5dd474c6d287e1203e85b79d11d762f0 + docs/models/createfinetuningjobrequestintegration.md: + id: e41b5575b494 + last_write_checksum: sha1:06dab95269f4a571a4c62a7f956fbf0250a0e8b3 + pristine_git_object: 0054a4a683a88fe67f92c1659bcb8c792ca8d286 + docs/models/createfinetuningjobrequestrepository.md: + id: e113eb1929b5 + last_write_checksum: sha1:41eee36f6a027638e2c2cf087734d4dd91ac3839 + pristine_git_object: 42b6c6cab36dc523926e319cdfbb3937bfdbd3f6 + docs/models/creategithubrepositoryrequest.md: + id: c12cba110d76 + last_write_checksum: sha1:38c125d3aff11137dbab5b6b1c430c892ff897cb + pristine_git_object: 502afa7b708f40698f443dc76e504cc6324916a9 + docs/models/createingestionpipelineconfigurationrequest.md: + id: fec0e339a487 + last_write_checksum: sha1:1a3dad0fa0f5ac30494c6207a11e027c3bf1a349 + pristine_git_object: f6aeb2105adebedd85c3242c693616b14816ec63 + docs/models/createjudgerequest.md: + id: 13683829ce5d + last_write_checksum: sha1:84122cf178b65c87a11a9c012d8d066441e2401d + pristine_git_object: ccb1119a99d87cc229681d75fde017e8917642a3 + docs/models/createjudgerequestoutput.md: + id: afddf2bb224f + last_write_checksum: sha1:64b6a44de253d40c4e3f0e133b31b4c5a9cd13a5 + pristine_git_object: a72676719b90a7b840a2b21d043c61bdf83ce294 + docs/models/createlibraryrequest.md: + id: 8935b2ed9d13 + last_write_checksum: sha1:14480a2eb03a9e5076a866a21bff0dfd80bb585d + pristine_git_object: 07ff97d0cbaf4f3e260cce4b80fcbd637cc6b488 + docs/models/credentialscreateorupdate.md: + id: b2a0e87b0a91 + last_write_checksum: sha1:6b778120a84c08601b4f2fbba368d3454204d939 + pristine_git_object: c544d7c60332c29fe2c91e8af17282ca689537e2 + docs/models/credentialsresponse.md: + id: 20dd6478c581 + last_write_checksum: sha1:c87e14ea27c52f670a5bf7e33b5e84180b91ab83 + pristine_git_object: 1c9a8596b0021eeaad2872faa02cc72b85c0d760 + docs/models/customconnector.md: + id: 7bcc77607afa + last_write_checksum: sha1:ce9e8ffac3f83e08269fbed5d2dffbfeb9f8649a + pristine_git_object: 0a0b69217abb0fbcbe30fad32c239aea070d3740 + docs/models/customtaskcanceledattributes.md: + id: 5a2768dda295 + last_write_checksum: sha1:0a1df1ffa17cd0857bf3e0ac884406d7dfeb07f0 + pristine_git_object: 3a5facdd3be90098f0f22bcf05215472cf2d4ec9 + docs/models/customtaskcanceledresponse.md: + id: 79e4f2bbf720 + last_write_checksum: sha1:c65ddfa80c6bd5ce96fcd0de194f1dbb68423dea + pristine_git_object: 0bcee2279755656a624d626acea0a157fa3b381c + docs/models/customtaskcompletedattributesresponse.md: + id: c12961b43e1c + last_write_checksum: sha1:e549b58f4d1a544e3c453a9ec454930d342f5adf + pristine_git_object: 4c7cbfa21dcdcf91ceac8f1ca5d84413eefc4bbb + docs/models/customtaskcompletedresponse.md: + id: 81d843216312 + last_write_checksum: sha1:0439d35a428e5d8d321da8b710ce72c188802085 + pristine_git_object: 6871184f3d850a628ed71cbef9c98ec3e742dbfe + docs/models/customtaskfailedattributes.md: + id: cd0cdf6bd8d8 + last_write_checksum: sha1:71cf249d1b1bd2df1cf3ec4426da9b8c9bb82c37 + pristine_git_object: f4e3ab2d57ec9d447c3570e6832f911c93c94f96 + docs/models/customtaskfailedresponse.md: + id: 16c047b0f70f + last_write_checksum: sha1:639353633a2fd6f383896673750338235a1c442e + pristine_git_object: e14e4afa4b1fe76d10a2f8505ce88e9a828d845e + docs/models/customtaskinprogressattributesresponse.md: + id: 8482e22b58c4 + last_write_checksum: sha1:0681737168dc45c08b085a4cf084903fedc127e3 + pristine_git_object: d55b81379969289edd586c03cfc8eda46a615fb2 + docs/models/customtaskinprogressresponse.md: + id: a181c7602b7f + last_write_checksum: sha1:43caaf16e8ef772ab4a4b1f2cd926a59c87b627f + pristine_git_object: 72afa91fb2baadd7dd8cf32aad2b2812316a6953 + docs/models/customtaskstartedattributesresponse.md: + id: 272cf75ac5d3 + last_write_checksum: sha1:bc09d8da2636e28821260a08235fcf69d577758a + pristine_git_object: 41cd66a9e59dbfdb9c0574001a4a12f2ac499f93 + docs/models/customtaskstartedresponse.md: + id: 6ccd9fe137bc + last_write_checksum: sha1:031eac9a01bc24b36a9cf2eb4ea864c89ba709e5 + pristine_git_object: 80b1b08b02b219ef714e44d0853df4c992db84eb + docs/models/customtasktimedoutattributes.md: + id: b941e1c031db + last_write_checksum: sha1:db82046ed2aa47a5c206a9e5cea7f7ab066a3329 + pristine_git_object: b302b07666ad0b807990d42d6ef67a3c9c213bc8 + docs/models/customtasktimedoutresponse.md: + id: b4f8e7f006e7 + last_write_checksum: sha1:9b167994685d056179122eeed0df39c6b52c9cf4 + pristine_git_object: 75d497434c80a29a3010c451fb6b94d32d213863 + docs/models/dataset.md: + id: 31af4d237e19 + last_write_checksum: sha1:073fa9a0b7891ccd9b6ae64ba960d74eeb5c9007 + pristine_git_object: 9d235433850f4024ea920e85567d5c2d6df13fb0 + docs/models/datasetimporttask.md: + id: 32402ad24d69 + last_write_checksum: sha1:8a41338cc24d1a48d4495e1be3124960bad09fef + pristine_git_object: 21e6130fcd7d2e1e4c303b4bc4292491fcd9ce81 + docs/models/datasetpreview.md: + id: 5e080239e3e1 + last_write_checksum: sha1:5914284c85165976de7d53ac06fd30ebdc5a8c15 + pristine_git_object: f729908d470767dd2bde499fcfb198e5587c7d40 + docs/models/datasetrecord.md: + id: 449ed69d3872 + last_write_checksum: sha1:55a649fc627e297da420482599680da87989c297 + pristine_git_object: dbc7c3d0046af0423eebab4d0d982e55a3ed1d38 + docs/models/deletebatchjobresponse.md: + id: 077483bb3832 + last_write_checksum: sha1:2789ca6f7663b82731201d9439d949c8dfd1077c + pristine_git_object: d0df2d193f18773ba758545127e0322b76a7b6cf + docs/models/deletecampaignv1observabilitycampaignscampaigniddeleterequest.md: + id: "853118278484" + last_write_checksum: sha1:b8dc39c31de60ed218a063efd7e8f07fcbb1c63f + pristine_git_object: 4114509d79e30e560f0fe2fb02bb37742bf68acd + docs/models/deletedatasetrecordsrequest.md: + id: eb3d7e70be8c + last_write_checksum: sha1:71a7cbb957cf75206f4e5783bf7b2ff11294d5c2 + pristine_git_object: 1afc46d6a9ff00ff2f002a1671809bbe9a677280 + docs/models/deletedatasetrecordv1observabilitydatasetrecordsdatasetrecordiddeleterequest.md: + id: 6ec026edf3f3 + last_write_checksum: sha1:c23fce1ecb41e7d523b9ad2d9145d72c6ae94ff2 + pristine_git_object: b2425068d8d53047c0f74b316ad456dfdcb5b18c + docs/models/deletedatasetv1observabilitydatasetsdatasetiddeleterequest.md: + id: 1324ff11f62a + last_write_checksum: sha1:b4e444986d7185513653466f232ce378a45ea98e + pristine_git_object: 4557d3c603d6a0b6ae2873e2ac11cca58604849b + docs/models/deletefileresponse.md: + id: ab3aa44589a0 + last_write_checksum: sha1:6d6ff32f1a9a6caf26eaf590fa78c0f9efb2be9d + pristine_git_object: 2c3e1c2373f89425d1782d902313974a264533d3 + docs/models/deletejudgev1observabilityjudgesjudgeiddeleterequest.md: + id: 9031fd7f46f4 + last_write_checksum: sha1:6879788359096a08d1adc32320e63f3657f1a2dd + pristine_git_object: 44042efca294d38b53502e18fc574cf5dc67ab8a + docs/models/deletemodelresponse.md: + id: a5a703ee49a7 + last_write_checksum: sha1:37f9728cb9dcb2d1c6aa44b24000e197997b08c0 + pristine_git_object: 3a9f853b774c50ed29557294c58758149caa6728 + docs/models/deletemodelv1modelsmodeliddeleterequest.md: + id: c838cee0f093 + last_write_checksum: sha1:e5b6d18b4f8ab91630ae34a4f50f01e536e08d99 + pristine_git_object: d9bc15fe393388f7d0c41abce97ead17e35e2ba4 + docs/models/deletevoicev1audiovoicesvoiceiddeleterequest.md: + id: aaf676347dbb + last_write_checksum: sha1:b54fcfcfb0d1e528380ca273ecb6e84349ca9cd6 + pristine_git_object: 0afc04f2ce115a8f48aa5f2e99b0fe02facce90e + docs/models/deltamessage.md: + id: 6c5ed6b60968 + last_write_checksum: sha1:c49575abe1bb581db1ae497b7a3b1ff2820abfbc + pristine_git_object: c2395e1bb06f983a2f56ab5900f126ed99ae9c11 + docs/models/deltamessagecontent.md: + id: 7307bedc8733 + last_write_checksum: sha1:a1211b8cb576ad1358e68983680ee326c3920a5e + pristine_git_object: 8142772d7ea33ad8a75cf9cf822564ba3f630de2 + docs/models/deploymentdetailresponse.md: + id: 712f7bbc8cc0 + last_write_checksum: sha1:29649c52cfba597bc6597671a8d1c8aa758ccdd0 + pristine_git_object: 1f09589953513dd3ac340678628c30b9023e1f51 + docs/models/deploymentlistresponse.md: + id: 45a11caf1008 + last_write_checksum: sha1:aa393b5a879506970c6d27342168d8f5f50d700c + pristine_git_object: 22868512ffd2c564c8a8ab02fbb9f324d2ecf013 + docs/models/deploymentlocation.md: + id: 7fdeb81116eb + last_write_checksum: sha1:04a70c678d2db359baf203947539672d039b08b2 + pristine_git_object: a0cbe6bc1cbbdf5ee4a3a6f97c5cc594a464a20d + docs/models/deploymentresponse.md: + id: a9da842850c4 + last_write_checksum: sha1:f53b4b5dd01ddf7f73b2e2918aca0a56521f9684 + pristine_git_object: 853ebbce11026209d75e6744fd33396550d81637 + docs/models/deploymentworkerresponse.md: + id: 07cd9c89237a + last_write_checksum: sha1:1f8b60ad6e17714100626106c2de16f6aca273e4 + pristine_git_object: afdcca834da74cc33711b1aa229f5ccf66eceefd + docs/models/document.md: + id: cd1d2a444370 + last_write_checksum: sha1:c10641b02547bedcc982b8997097083dfc562598 + pristine_git_object: 42c639a6a9b235ab4c754286486fa7e8872a0e7e + docs/models/documentlibrarytool.md: + id: 68083b0ef8f3 + last_write_checksum: sha1:76b9f47c399915a338abe929cb10c1b37282eadf + pristine_git_object: 95c3fa52ee3ff29e72bc0240a98c0afaa0cd5f62 + docs/models/documenttextcontent.md: + id: 29587399f346 + last_write_checksum: sha1:93382da0228027a02501abbcf681f247814d3d68 + pristine_git_object: 989f49e9bcb29f4127cb11df683c76993f14eba8 + docs/models/documentunion.md: + id: c65f9e42375c + last_write_checksum: sha1:249043e03067f79b27dc6eac410fb937920e8cdb + pristine_git_object: e573bd4632493ca648ad61307c70148366625d4b + docs/models/documentupload.md: + id: 7ff809a25eb0 + last_write_checksum: sha1:aea0f81009be09b153019abbc01b2918a1ecc1f9 + pristine_git_object: 4e58a475f1776431c9c27a0fcdd00dd96257801f + docs/models/documenturlchunk.md: + id: 48437d297408 + last_write_checksum: sha1:5f9294355929d66834c52c67990ba36a7f81387d + pristine_git_object: 9dbfbe5074de81b9fcf6f5bae8a0423fb2c82f71 + docs/models/embeddedresource.md: + id: f7ea3888f520 + last_write_checksum: sha1:8f0869b4403767c45c464cdd7b6c640994c65ab9 + pristine_git_object: 102fca261d4ada514a7df14415383c1da9e59782 + docs/models/embeddingdtype.md: + id: 22786e732e28 + last_write_checksum: sha1:1f348c1b3dba72dd710c1eee3953556d051366f8 + pristine_git_object: 301585b20b8e5c433dbff021782a543c599e6115 + docs/models/embeddingrequest.md: + id: bebee24421b4 + last_write_checksum: sha1:087230e81cfbbc539edc7cc1c0a490728276d217 + pristine_git_object: 71d139cdf5c556a1224d707be70f3fabe032fc27 + docs/models/embeddingrequestinputs.md: + id: 6a35f3b1910a + last_write_checksum: sha1:f3bf6b89f279f59010124aa402e282c7c691eb03 + pristine_git_object: a3f82c1c67c726d3ef8e5e5ea5513386acc7c2f4 + docs/models/embeddingresponse.md: + id: 31cd0f6b7bb5 + last_write_checksum: sha1:1d7351c68b075aba8e91e53d29bdab3c6dd5c3a2 + pristine_git_object: 2bd85b4d245978ec396da067060cfe892f19c64f + docs/models/embeddingresponsedata.md: + id: 89b078acdc42 + last_write_checksum: sha1:e3e9200948f864382e0ecd3e04240b13d013141a + pristine_git_object: 20b50618ac99c63f7cf57fe4377840bfc1f85823 + docs/models/encodedpayloadoptions.md: + id: 033bd880796d + last_write_checksum: sha1:7047a8dee852e5dea9d05f872f92a15ef0860f7c + pristine_git_object: 51fcfdc497db0f7cf17e413c4b5c04bf7d15bc7b + docs/models/encodingformat.md: + id: 066e154e4d43 + last_write_checksum: sha1:cc98abdb803d374146f58a6811c9e3f2b58ff5f3 + pristine_git_object: 8bc9e8c6bd3fdc8bd5a28edb381c662e74c86e72 + docs/models/entitytype.md: + id: 130a2f7038b0 + last_write_checksum: sha1:506be1dd51ec1f429246390757cbc0676677bd82 + pristine_git_object: 44fb9d6b281bd052273db94cbd60230e732e98a1 + docs/models/entry.md: + id: da9a99ab48ab + last_write_checksum: sha1:4971db390327db09f88feff5d2b8a0b1e6c5b933 + pristine_git_object: d934b6774b25713afe923154d7709755426ec2cf + docs/models/event.md: + id: 311c22a8574a + last_write_checksum: sha1:627793d6aed5e378e3f2eeb4087808eb50e948d5 + pristine_git_object: 3eebffca874b8614a5be3d75be3cb7b0e52c2339 + docs/models/eventprogressstatus.md: + id: af5980e18511 + last_write_checksum: sha1:83557558fb755cbdba7b8cfce5610f2f13f69a58 + pristine_git_object: 02033178750aea0683ffac8323b94d8caa7d07a1 + docs/models/eventsource.md: + id: 0a07100b20e9 + last_write_checksum: sha1:2bf03c62a99d16df8523e35110be9f4ec679689f + pristine_git_object: 6c2143d039b36b064db05b61e2ebdd77f573e2d6 + docs/models/eventtype.md: + id: bfe6f1477d8b + last_write_checksum: sha1:7932d1d96baca16e3858c2be7c35d406fafe9ebf + pristine_git_object: 6add793e64b13b0a6adbd78f7ee165ef7d91c26f + docs/models/executeworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepostrequest.md: + id: 33e258603a49 + last_write_checksum: sha1:f156d7d837872e5b33f19b385a650a547ad39436 + pristine_git_object: 54de12a2b578e1d81e2b16d6bf27d2fb865014f7 + docs/models/executeworkflowv1workflowsworkflowidentifierexecutepostrequest.md: + id: e4a5c891d180 + last_write_checksum: sha1:d47a7d1b9d89462c346c54edd7c0dcbbeae25765 + pristine_git_object: 29c55a770e232a65565b342ea700e53ab36318cb + docs/models/executionconfig.md: + id: c96b31c33dcd + last_write_checksum: sha1:971187596dde6a53f9e7f4c26cb0f37d5cbafb40 + pristine_git_object: 1033b7ea323917f0ffadb8cb3854426a1956f904 + docs/models/exportdatasetresponse.md: + id: f4594898de85 + last_write_checksum: sha1:2e68bd840ee44b5b61aac0945d608060bd6506f4 + pristine_git_object: 7187ee5c0121f42e1ebbb490563e7e11afb1f812 + docs/models/exportdatasettojsonlv1observabilitydatasetsdatasetidexportstojsonlgetrequest.md: + id: 16660f92d7d1 + last_write_checksum: sha1:fa22e53a929291e6b057283482ca7871fb6d2062 + pristine_git_object: efe4bbb058c168ad531be27cc135f09464d0da13 + docs/models/failure.md: + id: 3f79c7d64eac + last_write_checksum: sha1:344f1cea9b786a399a0dd974d4df010714031b2a + pristine_git_object: 259d7bcf2d03d3f26e4a760e92eeb5c039e4aee8 + docs/models/feedresultchatcompletioneventpreview.md: + id: 5ed9f0e8db01 + last_write_checksum: sha1:c5950602d174d49f293cb85047d871d360e6af16 + pristine_git_object: 08a6e2f837872ee058b2c73089cf151fa944ff90 + docs/models/fetchcampaignstatusresponse.md: + id: 175907eb768d + last_write_checksum: sha1:537f33701542d6cbab3d9bb9fc661339a9e9c748 + pristine_git_object: 7aac0f2537d4282f9a75ece71e57f2a71ce66af3 + docs/models/fetchchatcompletionfieldoptionsresponse.md: + id: f8cabbbafbbe + last_write_checksum: sha1:5e7731de2cc4fa729599a77809970675697d2823 + pristine_git_object: 86beebc1aedaa03019136eeb8842ec31354f32ac + docs/models/fetchfieldoptioncountsrequest.md: + id: 88e23bf278ee + last_write_checksum: sha1:019472cecf84c50fb2a23ff25598dfb075b4505c + pristine_git_object: b13f6312e98e8a2e59b9c0890880a06cf496ea9d + docs/models/fetchfieldoptioncountsresponse.md: + id: 0de8d989349c + last_write_checksum: sha1:800612d664838b6cc7330f5c1430a4b8a83bf830 + pristine_git_object: dabf6b5ebfe86b50a80f4986efb05fea6256bc6b + docs/models/fieldgroup.md: + id: 792d72891fc5 + last_write_checksum: sha1:599b1c695c4a0d4be6a090f06ded45be41392bc7 + pristine_git_object: 8fff281d48e4ccc4b870adb66a4b63dcac1aa853 + docs/models/fieldoptioncountitem.md: + id: "945553556487" + last_write_checksum: sha1:b18c6c530c025bebd9fa0ecb121cf34c3f2b714d + pristine_git_object: 92bc971fc5a0244482ca6107e3751dd75f923ea7 + docs/models/file.md: + id: 4ad31355bd1c + last_write_checksum: sha1:ade4d3c908c664a07a3c333cc24bc1bfb43ab88b + pristine_git_object: 37cc418f9e5189c18f312c42060fd702e2963765 + docs/models/filechunk.md: + id: edc076728e9d + last_write_checksum: sha1:07ab5db503211adba2fa099e66d12ac3c4bbf680 + pristine_git_object: 18217114060ac4e4b45fefabace4628684f27e5c + docs/models/filepurpose.md: + id: ed6216584490 + last_write_checksum: sha1:c38460a32b8a0a21aab0a298d62e5a26cde2339b + pristine_git_object: af6dc9fa4e02b1d385595a76b62721e214fb0c85 + docs/models/filesapiroutesdeletefilerequest.md: + id: 7fdf9a97320b + last_write_checksum: sha1:411e38d0e08a499049796d1557f79d669fc65107 + pristine_git_object: 1b02c2dbb7b3ced86ddb49c2323d1d88732b480c + docs/models/filesapiroutesdownloadfilerequest.md: + id: b9c13bb26345 + last_write_checksum: sha1:1f41dad5ba9bd63881de04d24ef49a0650d30421 + pristine_git_object: 8b28cb0e5c60ac9676656624eb3c2c6fdc8a3e88 + docs/models/filesapiroutesgetsignedurlrequest.md: + id: 08f3772db370 + last_write_checksum: sha1:7d1577169ca1d22b3088ab1157cb49192515e6f3 + pristine_git_object: 794f25f78338baae371ebd7c653ceba2d280fdfe + docs/models/filesapirouteslistfilesrequest.md: + id: 04bdf7c654bd + last_write_checksum: sha1:0a99755150c2ded8e5d59a96527021d29326b980 + pristine_git_object: 57d11722f1dba2640df97c22be2a91317c240608 + docs/models/filesapiroutesretrievefilerequest.md: + id: 2783bfd9c4b9 + last_write_checksum: sha1:a1249ef0aedb3056e613078488832c96b91f8cab + pristine_git_object: 961bae1f51a4ae9df21b28fd7a5ca91dc7b3888b + docs/models/filesapiroutesuploadfilefilevisibility.md: + id: 7b934c9d9d25 + last_write_checksum: sha1:5ae94156f76a9fc6aab082c29c0163eb8e182e11 + pristine_git_object: c1f89309c4233d5af34b6f2b71cc48bc8e94e487 + docs/models/fileschema.md: + id: 9a05a660399d + last_write_checksum: sha1:e69c38d738bfba7e1d7cb5938c17fcbc56fecf4c + pristine_git_object: 154548404d257f0b7339e2e3e74d2dcc23a98a4d + docs/models/filevisibility.md: + id: 2cdcd7761007 + last_write_checksum: sha1:b63a786a0f73b0271e9eb2c70200939ebd9f13a7 + pristine_git_object: 4e6c9ed95a982f198a9efab4a841a41a23f0aad9 + docs/models/filtercondition.md: + id: dd561c647715 + last_write_checksum: sha1:5ead258c0e3905e8a10b16e4e5b9b267e3a12747 + pristine_git_object: ba2eea6046e66d6d8101917120aef5e966aa40bd + docs/models/filtergroup.md: + id: abf06b0bda42 + last_write_checksum: sha1:a1bfdc1c9127d8cd3474ec1fccd60fe5cfaac79f + pristine_git_object: 974c724cdf274a3ba70fb7dc140395e24dd0572c + docs/models/filterpayload.md: + id: 770a71875018 + last_write_checksum: sha1:f8328419c79b46907206e7c810ad192f6dfc9154 + pristine_git_object: 49f273c0b46c968ce7097611001b097d383c52a7 + docs/models/filters.md: + id: 1370bfdd2199 + last_write_checksum: sha1:684f242882f17c17766db11e5a21bae1b5c74dcd + pristine_git_object: 4595b82b40fe37dc093bee73a4ffa9c8ac61d77d + docs/models/fimcompletionrequest.md: + id: b44677ecc293 + last_write_checksum: sha1:b8bd917220bec15149c384b70bf2818c83926b49 + pristine_git_object: d25d45f64f081e90cc2fd3a4e5665af7c4184a8b + docs/models/fimcompletionrequeststop.md: + id: ea5475297a83 + last_write_checksum: sha1:a6cdb4bda01ac58016a71f35da48a5d10df11623 + pristine_git_object: a0dbb00a82a03acc8b62b81d7597722a6ca46118 + docs/models/fimcompletionresponse.md: + id: 050d62ba2fac + last_write_checksum: sha1:a6101a69e83b7a5bcf96ec77ba1cab8748f734f4 + pristine_git_object: cd62d0349503fd8b13582d0ba47ab9cff40f6b28 + docs/models/fimcompletionstreamrequest.md: + id: c881d7e27637 + last_write_checksum: sha1:31cf266310e1f303a4d2c352a8fdd27460f0d281 + pristine_git_object: 15718c7c22b81f3a311023ea9e58d9f77d712d5a + docs/models/fimcompletionstreamrequeststop.md: + id: c97a11b764e9 + last_write_checksum: sha1:958d5087050fdeb128745884ebcf565b4fdc3886 + pristine_git_object: 5a9e2ff020d4939f7fd42c0673ea7bdd16cca99d + docs/models/finetuneablemodeltype.md: + id: e16926b57814 + last_write_checksum: sha1:8a107793e370a8dfc1e85e165dc9b18aeefc9460 + pristine_git_object: 9ec9634f0b486728071c4c360119508408c1d316 + docs/models/finetunedmodelcapabilities.md: + id: 3a6a0498ccf7 + last_write_checksum: sha1:82fc7d3f4e0b591b757f202699bb645bc61c69ff + pristine_git_object: d3203a2adccb7eb89c58395952c3e5a123a5b31b + docs/models/format_.md: + id: a17c22228eda + last_write_checksum: sha1:72d2d0549cd18ea564007a268c13bfd1eba219ec + pristine_git_object: 5bf1ed0cfa19f2edd4c6a1a7c66c7f093043a700 + docs/models/ftclassifierlossfunction.md: + id: b546cfde5aa6 + last_write_checksum: sha1:6d0c38aeb4e69eae579b0e65e2769c6ae8dcb30d + pristine_git_object: 36d3db18679569d21e6bacfe13bcd22715372297 + docs/models/ftmodelcard.md: + id: 15ed6f94deea + last_write_checksum: sha1:5873780bc2a828f1164818eb9c64c3f69c6618cc + pristine_git_object: f65ff6e888a460ac5f3ad3a4556ccdd8366960c0 + docs/models/function.md: + id: 416a80fba031 + last_write_checksum: sha1:a9485076d430a7753558461ce87bf42d09e34511 + pristine_git_object: b2bdb3fe82520ea79d0cf1a10ee41c844f90b859 + docs/models/functioncall.md: + id: a78cd1d7f605 + last_write_checksum: sha1:65bf78744b8531cdefb6a288f1af5cbf9d9e2395 + pristine_git_object: 7ccd90dca4868db9b6e178712f95d375210013c8 + docs/models/functioncallentry.md: + id: 016986b7d6b0 + last_write_checksum: sha1:373eb3a2d72596fcbb8933b28426896d5ac6b6f4 + pristine_git_object: 2843db9d36d8b82a15ebfce0833c8b0832609b4a + docs/models/functioncallentryarguments.md: + id: c4c609e52680 + last_write_checksum: sha1:ae88aa697e33d60f351a30052aa3d6e2a8a3e188 + pristine_git_object: f1f6e39e724673556a57059a4dbda24f31a4d4b9 + docs/models/functioncallentryconfirmationstatus.md: + id: 18f36160d744 + last_write_checksum: sha1:3dc2f763ea0d74ebc781de4bf9e1b4e8d50382fc + pristine_git_object: 91231a0afa9b107636ca1446886ff2939d8dba5a + docs/models/functioncallevent.md: + id: cc9f2e603464 + last_write_checksum: sha1:58c6ee00af0c63614fd7506345977f9f2d8838ec + pristine_git_object: 0e3a36d6045a69e96c40836cdb586424225775af + docs/models/functioncalleventconfirmationstatus.md: + id: a33cc7957407 + last_write_checksum: sha1:8cdbace8d072cd259dd11cc306b8c077065780a6 + pristine_git_object: 95bebe968adb78710b68ef68a3bee86b16673a9a + docs/models/functionname.md: + id: 4b3bd62c0f26 + last_write_checksum: sha1:754fe32bdffe53c1057b302702f5516f4e551cfb + pristine_git_object: 87d7b4852de629015166605b273deb9341202dc0 + docs/models/functionresultentry.md: + id: 24d4cb18998c + last_write_checksum: sha1:1758992e30517b505b8d0622a54545dc9ae19163 + pristine_git_object: 6a77abfd27e3e46de950646d7f89777dca11300e + docs/models/functiontool.md: + id: 5fb499088cdf + last_write_checksum: sha1:a9a3b6530b1c48a8575402b48cde7b65efb33a7d + pristine_git_object: 0226b7045c9d82186e1111bb2025e96a4de90bd6 + docs/models/getcampaignbyidv1observabilitycampaignscampaignidgetrequest.md: + id: 159acf508d84 + last_write_checksum: sha1:e26a519f087140a799466e9fb530d1d37211dd7e + pristine_git_object: 9e781961e6894d501e781e829291b8b60c780555 + docs/models/getcampaignselectedeventsv1observabilitycampaignscampaignidselectedeventsgetrequest.md: + id: 81929b823585 + last_write_checksum: sha1:b21949b1919bd150dba84dd40ef9162014edc7d5 + pristine_git_object: 18de3f10971bf6a9e9232d357a8217cb64306ec5 + docs/models/getcampaignstatusbyidv1observabilitycampaignscampaignidstatusgetrequest.md: + id: cc2d0a9ea54a + last_write_checksum: sha1:a84735430e0c59c05cc729442a035e8f13b4223c + pristine_git_object: 947c4d64a47021cebd5daafd00e6686e890431d2 + docs/models/getcampaignsv1observabilitycampaignsgetrequest.md: + id: 58b33ee9275c + last_write_checksum: sha1:d2bba9d68540a37ee5f29843d74ba0a54f3d1503 + pristine_git_object: f83c3b64f5d8086e0c718c49d1c82481143810cb + docs/models/getchatcompletioneventsv1observabilitychatcompletioneventssearchpostrequest.md: + id: 20e3ca9fea94 + last_write_checksum: sha1:b845ba4a23ca227905dd67d7c29dec16085093c0 + pristine_git_object: b7b92279a6210655a82d5e4c773c3577a151c22c + docs/models/getchatcompletioneventv1observabilitychatcompletioneventseventidgetrequest.md: + id: 85fe583b6dfe + last_write_checksum: sha1:a186d8c7c77536e9df6bbb851497fbab0de86578 + pristine_git_object: 8fe18c47ee45a040a6118da180ea580ae1edef94 + docs/models/getchatcompletionfieldoptionscountsv1observabilitychatcompletionfieldsfieldnameoptionscountspostrequest.md: + id: d76d58e32375 + last_write_checksum: sha1:b878094387e88d9ec1d5916e3eb373e92bc8d956 + pristine_git_object: 339a1de84030de59425436a670578e3713d5a9d5 + docs/models/getchatcompletionfieldoptionsv1observabilitychatcompletionfieldsfieldnameoptionsgetrequest.md: + id: 38d3a71b425c + last_write_checksum: sha1:f8bd7fc9913588f4883cb6ecad475fcbaaa467f9 + pristine_git_object: 973a1a4bbb1502b566ff2edd221dfa24e309257f + docs/models/getdatasetbyidv1observabilitydatasetsdatasetidgetrequest.md: + id: a5811667ed1e + last_write_checksum: sha1:91f96f1449ad0adf83fccf11fdf270682a3e3cb4 + pristine_git_object: 60f2d162d96fe498dc01d844973236130d5eead1 + docs/models/getdatasetimporttasksv1observabilitydatasetsdatasetidtasksgetrequest.md: + id: d02f57214a55 + last_write_checksum: sha1:0e9ee3c15dba7d6e2081f75174ff6bdac73cbc67 + pristine_git_object: d4226eca158b7d346e49c1982a200c7fb65a35c8 + docs/models/getdatasetimporttaskv1observabilitydatasetsdatasetidtaskstaskidgetrequest.md: + id: 04bc3bb2be8f + last_write_checksum: sha1:6400ca140ed4d79169abdae516fb82423f83f018 + pristine_git_object: 98ffc3c62fa10a89ab5fbd7fad53d11dc489b13d + docs/models/getdatasetrecordsv1observabilitydatasetsdatasetidrecordsgetrequest.md: + id: 544765ca9499 + last_write_checksum: sha1:030efa16a9ec71b6adf325d8a7e083611e345e43 + pristine_git_object: 82453f0c4169758ccb48c465bf95677f712dc257 + docs/models/getdatasetrecordv1observabilitydatasetrecordsdatasetrecordidgetrequest.md: + id: fedf1584cb11 + last_write_checksum: sha1:1f6ad7fd1efccb3bdef3748bec748d23d00e3821 + pristine_git_object: 6b9eb3bc4793595d73416994c3537bfad4d7ab70 + docs/models/getdatasetsv1observabilitydatasetsgetrequest.md: + id: c8c1559b454f + last_write_checksum: sha1:98b580deaae5c4720cf905907db49e966b5e294a + pristine_git_object: 073ab76999d4f1b8b0b6b89feacc5137b156c4e5 + docs/models/getdeploymentv1workflowsdeploymentsnamegetrequest.md: + id: 655b59bc906d + last_write_checksum: sha1:2a98869f76afaf5be8d93482613027600f0d4039 + pristine_git_object: 6af056b16a647cf9e4e541cf433cf5ee2d3a8a80 + docs/models/getfileresponse.md: + id: a983b3c8acd6 + last_write_checksum: sha1:643a3c92ce26f21a915bd485fc4af7817e79f864 + pristine_git_object: 38ad49438c06b48ed8eeecf773d4bed51cdb1c9d + docs/models/getjudgebyidv1observabilityjudgesjudgeidgetrequest.md: + id: 06b097dd2a61 + last_write_checksum: sha1:089d9b646a90f2180dbfc85271804e0857204b34 + pristine_git_object: f9f1a2487032af6a3b9a0f7a4d7d4da61a4b854d + docs/models/getjudgesv1observabilityjudgesgetrequest.md: + id: 5a7a03200f1f + last_write_checksum: sha1:f9bbebd7b36957b6d9807063f2926b4a37c73a7e + pristine_git_object: 154ece82c1932053d4764d7d8fb2ab0f394027b2 + docs/models/getrunhistoryv1workflowsrunsrunidhistorygetrequest.md: + id: d0010e389ace + last_write_checksum: sha1:9083de20179b09071ac9f5ded13a15b70d4fea87 + pristine_git_object: a2d1f1b4aa6663e205dfd98ecac7c6964ec68188 + docs/models/getrunv1workflowsrunsrunidgetrequest.md: + id: ac9de7c67a5f + last_write_checksum: sha1:40fa492321f18e77792d49cb9142b0293be7ffe3 + pristine_git_object: 6b03369064e2bb2fedffa606d8bff20d9fceae00 + docs/models/getsignedurlresponse.md: + id: 5539e5d7c3d4 + last_write_checksum: sha1:7198474f48bfba6d47326cd436e4a00a8ba70ce3 + pristine_git_object: bde693236406fe092f48c315e3b68a2fbbe6f9a4 + docs/models/getsimilarchatcompletioneventsv1observabilitychatcompletioneventseventidsimilareventsgetrequest.md: + id: 38d58bb7d102 + last_write_checksum: sha1:63b80dff98aa4fc959f71d1e41faa0eeec4801aa + pristine_git_object: cf276b5e4297eec4d5d4c6996fde7144d54dd8c0 + docs/models/getstreameventsv1workflowseventsstreamgetrequest.md: + id: c4f4986768d9 + last_write_checksum: sha1:e3c15d6f54d2d24040eb0d7cf76e435b50d04965 + pristine_git_object: 9b5ae17446b4b959c7ab47751921313864ddaf2e + docs/models/getstreameventsv1workflowseventsstreamgetresponsebody.md: + id: 5d958d2ebde1 + last_write_checksum: sha1:58ffec3d780d35a688634d273588e0209afd4f72 + pristine_git_object: 18f9b63939e1110145d3201d45b584a0c155a964 + docs/models/getvoicesampleaudiov1audiovoicesvoiceidsamplegetrequest.md: + id: fa1b72f3aa6b + last_write_checksum: sha1:10b8897bf884ac876559ef574a76bee6df3b7afb + pristine_git_object: 618465e9626133a3a189644f758e6b0b011f6a65 + docs/models/getvoicev1audiovoicesvoiceidgetrequest.md: + id: ff2e9c3966c2 + last_write_checksum: sha1:83baeac8591dbf035dd1c04fbe9c06e0e65afcd8 + pristine_git_object: 09caf65c1d4f3415ccf2a1095a54748a7f6ca2df + docs/models/getworkfloweventsv1workflowseventslistgetrequest.md: + id: cb48ac6b32b0 + last_write_checksum: sha1:7194b7cd11b927fefdf242e651d8cdc705680f30 + pristine_git_object: 5594402ce103f05e902b33c465fbaa225a3e5eb6 + docs/models/getworkflowexecutionhistoryv1workflowsexecutionsexecutionidhistorygetrequest.md: + id: 7524ddab7997 + last_write_checksum: sha1:39f74888b1cc5ff5257f890f2d17725ec313d57f + pristine_git_object: 1934b7f961625c636fa020a655b61b0302e2b725 + docs/models/getworkflowexecutiontraceeventsrequest.md: + id: 6722ae5f7115 + last_write_checksum: sha1:2764ba45e55fe648e50f8d397826cebbf3a3dced + pristine_git_object: 4a1d8021877186295dcdaedea6a40429267f0668 + docs/models/getworkflowexecutiontraceotelrequest.md: + id: b74d60dc0f0a + last_write_checksum: sha1:48145598f7e45876a30bf3018a7da8c1bdfacaab + pristine_git_object: 8c4f9be70233a49cd0d74051a44756e030c2bc1a + docs/models/getworkflowexecutiontracesummaryrequest.md: + id: 692ff7296f7d + last_write_checksum: sha1:208b98b98c00754861017b97072bd2a321f1047b + pristine_git_object: a4524bbcf83fd9df132fbcb3cf983d3a72e998a1 + docs/models/getworkflowexecutionv1workflowsexecutionsexecutionidgetrequest.md: + id: 24a42f780b20 + last_write_checksum: sha1:9f3215cad08d84b5888d5cd30011bed0c37adfe3 + pristine_git_object: f9566f1c0050c4e66f5985761b6cbc56ec0a73cd + docs/models/getworkflowmetricsv1workflowsworkflownamemetricsgetrequest.md: + id: bf5300598ee8 + last_write_checksum: sha1:719dbcd2d7c28d159741ed3c64876c31f82c2691 + pristine_git_object: a6e623dd847551f7d96b4b90ef8e9d504529112a + docs/models/getworkflowregistrationsv1workflowsregistrationsgetrequest.md: + id: 4b699772bee5 + last_write_checksum: sha1:48bda785e6bfbd91350db70db13b523e3eaf0f09 + pristine_git_object: ee53e5a252a2869330da4b9e2d68358587f4c54b + docs/models/getworkflowregistrationv1workflowsregistrationsworkflowregistrationidgetrequest.md: + id: 597766b7d51b + last_write_checksum: sha1:5c58fbed3af8d08dd94eaba0ae8ed41d61fb6c52 + pristine_git_object: ec43ad56a6698eaec7a89e015f42154a7a97dea8 + docs/models/getworkflowsv1workflowsgetrequest.md: + id: e61c93d9ecc7 + last_write_checksum: sha1:60f1aae6819e058272ce854a0ca6aa2a1c202ecd + pristine_git_object: c361f02781c8663685d513acd6f13f46793e7b46 + docs/models/getworkflowsv1workflowsgetresponse.md: + id: a6375877d4dd + last_write_checksum: sha1:26401f0edf76e787a8ca780eb97724a4c6ca37a7 + pristine_git_object: 6ec4f4e79cbc377f6b1eb4fff720425cda6b731e + docs/models/getworkflowv1workflowsworkflowidentifiergetrequest.md: + id: ddc86b6b1bf9 + last_write_checksum: sha1:63f5d6e78e90572125d1b366ccc0c75a897210e7 + pristine_git_object: 2f5c2b4dc84095a1b00bac6c728c86dd1f80c2b2 + docs/models/githubrepository.md: + id: 66c120df624b + last_write_checksum: sha1:045e538dd7faffc1c6c6e6816563c5c8e776a276 + pristine_git_object: 827b6f34ae68ace7b8b4811764f59de2e0fcdd22 + docs/models/guardrailconfig.md: + id: f60bf2eefb45 + last_write_checksum: sha1:e8dd384d2fd18d731753ba8d45a2975379c97052 + pristine_git_object: 1276462cc43fbd940f12282b1dca05e6fc7a16f9 + docs/models/hyperparameters.md: + id: c167bad5b302 + last_write_checksum: sha1:e391cf72690e6cd01a2878081b8d87938e1c6639 + pristine_git_object: b6c00c3647d21789c92ad7d32dd29c3089ca134f + docs/models/imagecontent.md: + id: afb5d93d3b4a + last_write_checksum: sha1:bde8cb2d1020d49ef07d97d2b4503add29f8fe2c + pristine_git_object: 5145469e26759e7df9477dce921c800b70af424b + docs/models/imagedetail.md: + id: f8217529b496 + last_write_checksum: sha1:f19cce37f0bdaa8c4e797690de19f01374ee4086 + pristine_git_object: bd7ea1fe08f2fcc737d6951a44584e22578ed9ba + docs/models/imagegenerationtool.md: + id: d5deb6b06d28 + last_write_checksum: sha1:a1813ef99e4a0990fd073bb2311c475e88072029 + pristine_git_object: b476b6f2733a49767d7f7a4ad091fc321ab514f4 + docs/models/imageurl.md: + id: e75dd23cec1d + last_write_checksum: sha1:a5cf621ce58a9cc7c96afa7de53367eac7b4cb0b + pristine_git_object: 6358e0acb2dea4816203413842243704ca955783 + docs/models/imageurlchunk.md: + id: 4407097bfff3 + last_write_checksum: sha1:05e0c3053720c6ad6c663237a3f3621e0e9fed9f + pristine_git_object: 6d238e255d368c1b12ddc231dc5f8dc11279d47e + docs/models/imageurlunion.md: + id: 9d3c691a9db0 + last_write_checksum: sha1:4e32bcd7d44746d2ddbfafbef96152bb2bdb2a15 + pristine_git_object: db97130f26199dcb354ecb7469d09530b035daa2 + docs/models/importdatasetfromcampaignrequest.md: + id: 11d5444a3e05 + last_write_checksum: sha1:33c9d7848282c89068abc219f1a208f1fa17d4e5 + pristine_git_object: aa1ecc85ed49d1c20391ff4e6c9e98328e64494d + docs/models/importdatasetfromdatasetrequest.md: + id: aae16ea119a6 + last_write_checksum: sha1:5e2ac86cbab1183ef936a75d4c903be1fb227b1d + pristine_git_object: cf8d373fea2e3e0403ba1e048d4466fdd5b36c08 + docs/models/importdatasetfromexplorerrequest.md: + id: b6aefe9a5761 + last_write_checksum: sha1:e49a21dce39376c4ecbf6df8a178f668f26fa7ce + pristine_git_object: 668cdcbf88b1d0d0f506f4166fb97ee97b685527 + docs/models/importdatasetfromfilerequest.md: + id: 72ced1c6e5e8 + last_write_checksum: sha1:8c59196fc4645fbaf5c735f26f2fbb2e1f6109a2 + pristine_git_object: a05e97258f266440456381634538cb6d97ac015f + docs/models/importdatasetfromplaygroundrequest.md: + id: 74bd521abc26 + last_write_checksum: sha1:a4efe4ff8c52137af47d6ab750d1d2f7cba77e7c + pristine_git_object: 72a586bc65f6219abed50105d9df9cb8b6ec8d02 + docs/models/ingestionpipelineconfiguration.md: + id: 95a1d6bf413b + last_write_checksum: sha1:ba9e052c6ab8b13b4108ff395ac0e20181326f0b + pristine_git_object: 16fde9c6a161526de8a86ccd330803f590285586 + docs/models/inputentries.md: + id: a5c647d5ad90 + last_write_checksum: sha1:4231bb97837bdcff4515ae1b00ff5e7712256e53 + pristine_git_object: b44a467d258cfa8cc3d2a3236330471dbc3af109 + docs/models/inputs.md: + id: 4b0a7fb87af8 + last_write_checksum: sha1:c5f0c21c25fd5a698398a9e4ddf6261add60740c + pristine_git_object: d5771207d9725f04ca2ab1be692fc089360a58f4 + docs/models/instructrequest.md: + id: a0034d7349a2 + last_write_checksum: sha1:34a81411110cbb7a099c45e482f5d1702ae48fd3 + pristine_git_object: 5f0cdfff135fb72d3b1a81999a30b720c044e3d4 + docs/models/instructrequestmessage.md: + id: 380503708a09 + last_write_checksum: sha1:551b5d6dd3ba0b39cad32478213a9eb7549f0023 + pristine_git_object: 57ed27ab3b1430514797dd0073bc87b31e5e3815 + docs/models/jobmetadata.md: + id: 1f8e4c2f49e5 + last_write_checksum: sha1:f5365977a4874f5ea142c80274f79d2cdaddee67 + pristine_git_object: 2c289a3bda1a37a35853c176f5cd9a28dc6a42c2 + docs/models/jobsapiroutesbatchcancelbatchjobrequest.md: + id: 798cb1ca1385 + last_write_checksum: sha1:67e8bda117608aee0e09a702a1ef8a4b03c40b68 + pristine_git_object: c19d0241784ff69bc68a11f405437400057d6f62 + docs/models/jobsapiroutesbatchdeletebatchjobrequest.md: + id: 2e077aebc6a1 + last_write_checksum: sha1:cdc193bac69847c56040e5e2e514578d3bd9a4e1 + pristine_git_object: 02f1ec244b3751b07149cbd13c681e6f77ef897d + docs/models/jobsapiroutesbatchgetbatchjobrequest.md: + id: e83a7ec84f8a + last_write_checksum: sha1:d661875832b4b9d5f545262216c9fcb9a77c8cd0 + pristine_git_object: 8c259bea9bef11f779fd609f1212565d574457e2 + docs/models/jobsapiroutesbatchgetbatchjobsrequest.md: + id: 5b9c44ad4d31 + last_write_checksum: sha1:1d7c05337b7cfe68f85a36576d060e1a890f9f96 + pristine_git_object: 5ceb0b2c40f079ffbe2cc4c82f6c3f94276980b4 + docs/models/jobsapiroutesfinetuningarchivefinetunedmodelrequest.md: + id: 8eb8c127091e + last_write_checksum: sha1:2b93a6bed5743461bb03c8337fb25dfc5a15522e + pristine_git_object: f9700df50b8f512c4139c1830aba18989d022b8e + docs/models/jobsapiroutesfinetuningcancelfinetuningjobrequest.md: + id: deff83b39b78 + last_write_checksum: sha1:dac8d8f2e95aed2db9b46711e6e80816881d5d14 + pristine_git_object: 883cbac685563d2e0959b63638f6b967ebdf1ee9 + docs/models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md: + id: c45757ba1ed9 + last_write_checksum: sha1:4931469b58d454264f1e8d32df6a07d3f6f01022 + pristine_git_object: fb62eb62027c8151d597544fcaf27b972aeb78b3 + docs/models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md: + id: 8aa8030f26d7 + last_write_checksum: sha1:4aada0d2297479d8276f5a422cb4dd6b56b1e176 + pristine_git_object: 7b52e2ca6365f17ac3b19d128937783d87c7fa37 + docs/models/jobsapiroutesfinetuninggetfinetuningjobrequest.md: + id: a9b75762e534 + last_write_checksum: sha1:8f1395447928e089c88dce8c0ced1030ec5f0eba + pristine_git_object: fde19800303a901149bf39c5330ef8c4da87df62 + docs/models/jobsapiroutesfinetuninggetfinetuningjobresponse.md: + id: c0b31f4fc621 + last_write_checksum: sha1:4ceb9df28082bf5d496cd222a0f45dc81a576367 + pristine_git_object: f770532776a13860e697da7478d1677d16f0ec36 + docs/models/jobsapiroutesfinetuninggetfinetuningjobsrequest.md: + id: 52078f097503 + last_write_checksum: sha1:fc134fdc7e229b8df373b77096c8299c214171a7 + pristine_git_object: 23c52c342358ea889b25ee7b18b381b68519c6cf + docs/models/jobsapiroutesfinetuninggetfinetuningjobsstatus.md: + id: 8545ffb587d6 + last_write_checksum: sha1:97fd42195fa792d504b5adc89e4fd159ac5416b9 + pristine_git_object: 1436f6aef8b2a3c26bd084e7916f6a104bf9ddcb + docs/models/jobsapiroutesfinetuningstartfinetuningjobrequest.md: + id: b4e2b814d8c3 + last_write_checksum: sha1:f13b5c8f2e74cc73b58a30d366032c764603f95e + pristine_git_object: 4429fe480ab9486de98940a119ac63f40045313b + docs/models/jobsapiroutesfinetuningstartfinetuningjobresponse.md: + id: cfd848845787 + last_write_checksum: sha1:a165279fa0c9e051458ea4333dfdd31ef0440426 + pristine_git_object: 1a7e71d4479369f13c391a9782278557bc4531ae + docs/models/jobsapiroutesfinetuningunarchivefinetunedmodelrequest.md: + id: 75b5dd1bcbaa + last_write_checksum: sha1:dd30e7ff8748d26497458f3398c0547113dc058f + pristine_git_object: 95c1734daa7164bedeeb1fa58dd792939f25bc17 + docs/models/jobsapiroutesfinetuningupdatefinetunedmodelrequest.md: + id: 60bd2e28993a + last_write_checksum: sha1:58835c28cccaf90e99bbb72bf7c5a5ce42498824 + pristine_git_object: dbe49a86ca2bf64901133fd58a342d30909c35b2 + docs/models/jobsapiroutesfinetuningupdatefinetunedmodelresponse.md: + id: c265a30fd4cf + last_write_checksum: sha1:410c62a884aae902cdfbfcab33779e62487de13b + pristine_git_object: f40350bf9d74d09ca3a2ec6d91d9068bda631ef5 + docs/models/jsonpatch.md: + id: 629a76c95cc5 + last_write_checksum: sha1:8f4e93adfbf15a92cfed990a7b603b00807a9ec9 + pristine_git_object: eb8d934774c3e860a07e6a9a8eb61541dea1a4bd + docs/models/jsonpatchadd.md: + id: 07cac5b1f9b2 + last_write_checksum: sha1:74f0bea77f7e1dfebdc686e709a6be90bbda7228 + pristine_git_object: 2a091c8ac8bfb57bfada1ce173c75543c9431fd0 + docs/models/jsonpatchappend.md: + id: 5d68c9614b70 + last_write_checksum: sha1:c1d5ac89195b6712b8a4b61450450a4f9b0e910e + pristine_git_object: 684cc896b4ba80ba1bbc278e119fc9fc1dbbf924 + docs/models/jsonpatchpayloadresponse.md: + id: fb6daf532ebb + last_write_checksum: sha1:b896fa130e63bfc0831bb8067669df89a8342314 + pristine_git_object: 3436bee34833e304f47453a8d0c92e613484869d + docs/models/jsonpatchpayloadvalueresponse.md: + id: 27f4583c18d6 + last_write_checksum: sha1:1d068499c19f0ccb80f26befcedd7ef63245e579 + pristine_git_object: f12623e5727cae5f12d1c97bcf394e37b9843644 + docs/models/jsonpatchremove.md: + id: 8a64b68498b3 + last_write_checksum: sha1:9619b20ac7d2b69e034fd7e549d2469e2369985a + pristine_git_object: 735305cf06722f055065e64b23be040f40bfa96f + docs/models/jsonpatchreplace.md: + id: c7115b07e32f + last_write_checksum: sha1:698ad1a5ce80a06bdcd5e7c6dc582f9f05d94e31 + pristine_git_object: 382b7d93925d0d68af43c4a745144a71d1f61dcf + docs/models/jsonpayloadresponse.md: + id: ce61786a7c2e + last_write_checksum: sha1:24183d30f65d4cfacacc8df713feacc145df9dab + pristine_git_object: 2976dea591a3c7a18220fcd4b9e5799811320b62 + docs/models/jsonschema.md: + id: a6b15ed6fac8 + last_write_checksum: sha1:523465666ad3c292252b3fe60f345c7ffb29053f + pristine_git_object: 7ff7c070353c58290416aff5b01d1dfc43905269 + docs/models/judge.md: + id: adc2c7c01fd5 + last_write_checksum: sha1:f248bf99d7d0a2087facec363c59c9d7718b575b + pristine_git_object: 34bcce9ba75ec20bcd3bb990df2a52be55cbbeb8 + docs/models/judgechatcompletioneventrequest.md: + id: dade3360cf3e + last_write_checksum: sha1:22fbf9ccc5ace7a491a119d6db7638a2f642d49c + pristine_git_object: b91a649246eae2ecdc25f30b560d30d20f626eb8 + docs/models/judgechatcompletioneventv1observabilitychatcompletioneventseventidlivejudgingpostrequest.md: + id: 7c7732afc4a2 + last_write_checksum: sha1:c61572bd803bcf7b65858f1e3c45c8896ec8daa0 + pristine_git_object: 6a9d93c95ba59811f58494685090d2f8a0cd37d1 + docs/models/judgeclassificationoutput.md: + id: 387d35df2462 + last_write_checksum: sha1:668c821fa926cef50a53d0de38c281b72040dd88 + pristine_git_object: 44d8462e378bbabea4083bf35631de6985bb8715 + docs/models/judgeclassificationoutputoption.md: + id: 41dde6c5cf31 + last_write_checksum: sha1:25cc262d748a2c9285cccdc8ed6c3d1572016a2b + pristine_git_object: 67e08ed21124756e4fe471bba5deccfc9bc7ebd2 + docs/models/judgeconversationrequest.md: + id: d2a3c6b8ddd3 + last_write_checksum: sha1:b40e607d37edf7fca7f1fb19a05688da61bf6400 + pristine_git_object: 491c3b3459b508d7573daa77ac46a8aedfb78161 + docs/models/judgeconversationv1observabilityjudgesjudgeidlivejudgingpostrequest.md: + id: c5ca3ccf1640 + last_write_checksum: sha1:946d24c242aff90e205bae751cc62c42db1585f7 + pristine_git_object: 4d36242330ae3b9d49984151f0cef6793b2cb1e2 + docs/models/judgedatasetrecordrequest.md: + id: 8b53c13e8af5 + last_write_checksum: sha1:6f636ff57171c21f214b012dbde5400be91057c4 + pristine_git_object: d82aabd9ecf595703eb43679502733483cb1d536 + docs/models/judgedatasetrecordv1observabilitydatasetrecordsdatasetrecordidlivejudgingpostrequest.md: + id: 41e358ee6a41 + last_write_checksum: sha1:cc831164ee1feb176796ca2c8ac54356ec7ed646 + pristine_git_object: 9ce4f011d6ab9f26b7bf3c720fa48ab0ec65dcf7 + docs/models/judgeoutput.md: + id: 7a436a0118b9 + last_write_checksum: sha1:fff6b2d6ce5f958a68bcc75ae19718fef7d5a49e + pristine_git_object: 4abeffa50be5eb60802391062302e9106f1ccfd0 + docs/models/judgeoutputtype.md: + id: 49623b360404 + last_write_checksum: sha1:d47557ab8f7ae50d94c597ea2e827b1e5a603a90 + pristine_git_object: 35a1a8373a8c072d90d7e93264209bd894ed92b5 + docs/models/judgeoutputunion.md: + id: 636200cea9aa + last_write_checksum: sha1:382aa75d840423705f9477cb77ca2a5832a1ee69 + pristine_git_object: 618295642a13f3c153084efa1146ddaab9d17e2b + docs/models/judgeregressionoutput.md: + id: fb323d9098ab + last_write_checksum: sha1:e3dc55fef190040b70467ec96c724b9150b41461 + pristine_git_object: 8f020dfba2e068d3b0c3cb7e355f9705a00b0b76 + docs/models/legacyjobmetadata.md: + id: 50ac14d9b270 + last_write_checksum: sha1:ebe37a176ca318e797fee7ebf4eef73fb9938a12 + pristine_git_object: 4705ab4f67e10b8e2cbfc86b29c03a9945aeb8fb + docs/models/librariesdeletev1request.md: + id: c0c3b2e1aabc + last_write_checksum: sha1:bef84f8851b06d2d914b605f11109de1850d0294 + pristine_git_object: 68d7e54369ce75422bf8b0ff16cada1c0ae2b05c + docs/models/librariesdocumentsdeletev1request.md: + id: 9d557bd7d1cc + last_write_checksum: sha1:1b580b657559356886915ee5579b90a03db19337 + pristine_git_object: efccdb1bbc36cf644ed2d1716cbd202e6d6bf6c5 + docs/models/librariesdocumentsgetextractedtextsignedurlv1request.md: + id: 27ad38ce4cb1 + last_write_checksum: sha1:b35ad610330232b395b5f87cc15f6ae270de6816 + pristine_git_object: 14ca66f72693f1df05eb93e0cca45f440b62d282 + docs/models/librariesdocumentsgetsignedurlv1request.md: + id: 4498715b6cfb + last_write_checksum: sha1:31f78079e31e070d080c99555cd2d85318fc4610 + pristine_git_object: 7c08c180d59a8e8475fea89424b8b2021d51385f + docs/models/librariesdocumentsgetstatusv1request.md: + id: c2219d3a3738 + last_write_checksum: sha1:44e79df94cf2686e83d7a2e793140a6a7b3a1c05 + pristine_git_object: e6d41875966348fd9e770d06c8099e48f0e64b5d + docs/models/librariesdocumentsgettextcontentv1request.md: + id: 850dfa465952 + last_write_checksum: sha1:a87002fc46509fd10c5cf73cd4336298ca969011 + pristine_git_object: 6413e51c0d706dc11c4fe204d0f0e788927a8c9c + docs/models/librariesdocumentsgetv1request.md: + id: cdd0df2f7e9d + last_write_checksum: sha1:36e5ef39552159044ecd28d20ee0792ea5bcadef + pristine_git_object: 6febc058425bb38857c391ee4c40d600858e6058 + docs/models/librariesdocumentslistv1request.md: + id: 7b5756e50d64 + last_write_checksum: sha1:2605b7972a3d7b4f73ab8052be4bf740f44f6f6f + pristine_git_object: 44f6300115853053214639982516a60b3268e778 + docs/models/librariesdocumentsreprocessv1request.md: + id: 1b8bf57b3f0a + last_write_checksum: sha1:8528785c1b4ae18d6ec6f261d29d5daac0d420a3 + pristine_git_object: 196ba17b749ce9efc1c30189864e474896814f85 + docs/models/librariesdocumentsupdatev1request.md: + id: b9147b1c0e38 + last_write_checksum: sha1:ed3ae7761990bd26a4bf99cd4641822eb90d3d57 + pristine_git_object: d46308509330099e30a53dddad51da8a6186aa92 + docs/models/librariesdocumentsuploadv1request.md: + id: 89a89d889c72 + last_write_checksum: sha1:32294a87d8a0b173b4d6f12b607a1bb3da765776 + pristine_git_object: 172a6183f31eec3142a84637414484799c2a4677 + docs/models/librariesgetv1request.md: + id: f47ad71ec7ca + last_write_checksum: sha1:3b2bf1e4f6069d0c954e1ebf95b575a32c4adeac + pristine_git_object: 6e1e04c39c15a85d96710f8d3a8ed11a22412816 + docs/models/librarieslistv1request.md: + id: eb6047c126d3 + last_write_checksum: sha1:7bd4a00dfe54162bd3c315ca0ab2990133969390 + pristine_git_object: 37352ee1277aa9576da968ce44b0ffda772715f7 + docs/models/librariessharecreatev1request.md: + id: 99e7bb8f7fed + last_write_checksum: sha1:f37578c7882eab83cca3cb2aaf1ac17b9a21934c + pristine_git_object: 8af7cc9dcd387d209343cab071551542a9829ebe + docs/models/librariessharedeletev1request.md: + id: bc8adba83f39 + last_write_checksum: sha1:79fc5a9a3cee5b060f29edd95f00e0fea32579cf + pristine_git_object: 850e22ab79863ba544f453138322c0eb5bf544cd + docs/models/librariessharelistv1request.md: + id: 86e6f08565e2 + last_write_checksum: sha1:6f2ffff66fa5fb141d930bca7bb56e978d62b4a5 + pristine_git_object: 98bf6d17ab013c1dd3f0ab18c37bbfc1a63f1b76 + docs/models/librariesupdatev1request.md: + id: f7e51b528406 + last_write_checksum: sha1:6a33b0161702ecc335dd2859df1bbc05b73702a9 + pristine_git_object: c5c142db7aaa49990135c21eabde43b8c0fdf756 + docs/models/library.md: + id: e8ec114dd107 + last_write_checksum: sha1:5434149d101255cb5135f8726acdcfb29c4381bd + pristine_git_object: a07d3afac18faccb504c51f1a54cf5addc3faab3 + docs/models/listbatchjobsresponse.md: + id: e03025d58630 + last_write_checksum: sha1:de42c9396546fc8487d0bd6ed15b4076599fa83f + pristine_git_object: c23e32201d12a2594f97a493f63b2b7b42b9e337 + docs/models/listcampaignselectedeventsresponse.md: + id: e004d0b21d0d + last_write_checksum: sha1:3ff807be72c465b8de127a031e82c2a0ce03422d + pristine_git_object: eb6ea27f8e2966624da05ebcec56909fd0f0f4b7 + docs/models/listcampaignsresponse.md: + id: b81dfede5d8c + last_write_checksum: sha1:09b8a734298d398cba8be04a544e9f3d20841c40 + pristine_git_object: 2fcc7d194b4a94267dae86380769b76a11834e4d + docs/models/listchatcompletionfieldsresponse.md: + id: 379ca3b00d2d + last_write_checksum: sha1:82d8a580b417766ad34b31f19a47136b38fcb1d6 + pristine_git_object: c552805e2b9d96d202377244e0936e28bbc5ff75 + docs/models/listdatasetimporttasksresponse.md: + id: 8a4a3c88410e + last_write_checksum: sha1:87fba295324e978949ba8f9172662e3610367ec7 + pristine_git_object: ce2e9057176f3054466c9d4fdf2aa5ce0ae3f1a5 + docs/models/listdatasetrecordsresponse.md: + id: ce200ac11b8c + last_write_checksum: sha1:6b55916029922e18bdcc9abb5c1fec188bb8d66b + pristine_git_object: 25d2618ae300874654cb3209117cb1ffb737763d + docs/models/listdatasetsresponse.md: + id: a776dbfbc267 + last_write_checksum: sha1:abba75226b6bc439381777ea05d83bc8e910e53c + pristine_git_object: af046696ebac829f4d7f6333075a4e5b26dd855e + docs/models/listdeploymentsv1workflowsdeploymentsgetrequest.md: + id: 7c9f534b899b + last_write_checksum: sha1:5a57963e7633b8ae37c8967dd9613c25995e9136 + pristine_git_object: c93c0dbbd799f3817fc94c257720e231378d6c37 + docs/models/listdocumentsresponse.md: + id: f2091cee0405 + last_write_checksum: sha1:335d0ccd3a448e65739d5a0cfa2c67614daec031 + pristine_git_object: 47b9d3b73fdc85bf6e463c91790faf346df56664 + docs/models/listfilesresponse.md: + id: b15df90d2d59 + last_write_checksum: sha1:4840f26427acf8846a9f1e48136f0663c6e4cd87 + pristine_git_object: 802f685fb3a76afb86a69cf41e6de9339cd6fbc7 + docs/models/listfinetuningjobsresponse.md: + id: d04e4dfddf78 + last_write_checksum: sha1:cebaf361aa10f1f6c4299c3c8a34f32d301455ad + pristine_git_object: 00251242023e2161747ebf00b4c2959909e2b654 + docs/models/listfinetuningjobsresponsedata.md: + id: 59c80de4086d + last_write_checksum: sha1:5a0d91c251b4b9283895d9f19f7b9416f93d4468 + pristine_git_object: adb0644475841c6a4686e8c42790dd44eed43dc1 + docs/models/listjudgesresponse.md: + id: dd610841e2f0 + last_write_checksum: sha1:d90e6af66b36c914af2c478b5e3cf7d4fb79e096 + pristine_git_object: 66883d64d0e040f5eef0976a88c1a83b7a3137ed + docs/models/listlibrariesresponse.md: + id: 87e3bec10745 + last_write_checksum: sha1:7c0a155e2cd02e420745c3739df42b824305e363 + pristine_git_object: 18cb63c16ab28d9399b6035c36f24a761008f734 + docs/models/listmodelsv1modelsgetrequest.md: + id: ade37f6d014a + last_write_checksum: sha1:10d4e1242cdac6cdc7597881e0d25ce06760971f + pristine_git_object: 537269f7e774b31c45ac75c82c096530c0bd2b4e + docs/models/listrunsv1workflowsrunsgetrequest.md: + id: 132927390b33 + last_write_checksum: sha1:ac1d4705c77aaf9f96cb97305a3c45da43b7bbdc + pristine_git_object: 319d9ed5923c9e84221f31fb74d82f557b902c9c + docs/models/listrunsv1workflowsrunsgetresponse.md: + id: da55980ef20d + last_write_checksum: sha1:e176049e48a9f78b47be166b6dc8f47bca3e7da7 + pristine_git_object: 405119b0a2320a2fd6a6a8b43bede0b5e8435da8 + docs/models/listrunsv1workflowsrunsgetstatus.md: + id: 91fb9d0c3512 + last_write_checksum: sha1:5b6ee877902594eda2f001322c275100981d778d + pristine_git_object: e6f0d606f374000f752021bee5216f622e0df405 + docs/models/listsharingresponse.md: + id: 165871ba2e7d + last_write_checksum: sha1:2c6c18123e297829dde6e877f3df984ce20aeef3 + pristine_git_object: 4c29d4d4fc8087424104ff7d5312177ec4940094 + docs/models/listvoicesv1audiovoicesgetrequest.md: + id: 2728f62b4ff4 + last_write_checksum: sha1:ef9581d0fa6fbabde734174727c9600fd46c9938 + pristine_git_object: 67c04d7c738ff871aaaeb8252721265f1754b5d1 + docs/models/listvoicesv1audiovoicesgettype.md: + id: 953d5379682a + last_write_checksum: sha1:63cdc365642971afbc8e737cde026775860bc3d7 + pristine_git_object: a44f95b351b2da5ff6a2ab56a72b24478710771e + docs/models/listworkfloweventresponse.md: + id: 891251fced72 + last_write_checksum: sha1:a8eceef60570b6fe8d254ce05806a8966e7631af + pristine_git_object: 72c51a165a6d7430910db5dc115fad19518bd371 + docs/models/listworkfloweventresponseevent.md: + id: b7e837f50a09 + last_write_checksum: sha1:f7a335daf57910fbc5bf435d43023271772bfc8f + pristine_git_object: 2b8cb1e461c146faeb06a940781803a008ea2173 + docs/models/loc.md: + id: b071d5a509cc + last_write_checksum: sha1:09a04749333ab50ae806c3ac6adcaa90d54df0f1 + pristine_git_object: d6094ac2c6e0326c039dad2f6b89158694ef6aa7 + docs/models/locationtype.md: + id: e25e2392c4c9 + last_write_checksum: sha1:647413204680efd677ce7746101b74e2ad7d59d5 + pristine_git_object: 6daecdd1eb31ad2d80400b4eb9032f635f0bc889 + docs/models/mcpservericon.md: + id: 0b20f03adab8 + last_write_checksum: sha1:d66113a4b0486f144b1f73f423559360ec751631 + pristine_git_object: b0ae7da069119f7477ffa5ad756f353f56f213f1 + docs/models/mcptool.md: + id: f809e227a108 + last_write_checksum: sha1:90833e29c750ca8452cec010f91e451ead93049c + pristine_git_object: 006802b47caa662f9087357bf7fea45141b76788 + docs/models/mcptoolmeta.md: + id: 271159bcac6f + last_write_checksum: sha1:f88fc0a6c65c02b9fd6945a9db0b5704eed79c9e + pristine_git_object: 23e8b64c9584f1ef5f2ad56b70d5b57732159608 + docs/models/mcpuitoolmeta.md: + id: 95390caf0719 + last_write_checksum: sha1:e40fd3d493e32bb28fdb0ffc8fa7acb79acc1d30 + pristine_git_object: c09b29ad40fd96b944f7f9bf320b3a67bd587d5b + docs/models/messageentries.md: + id: 9af3a27b862b + last_write_checksum: sha1:a3eb6e37b780644313738f84e6c5ac653b4686bc + pristine_git_object: 76256fb913376a15d5bcd2531b18f1a78b980c9d + docs/models/messageinputcontentchunks.md: + id: 34aac9c271db + last_write_checksum: sha1:641cd1dba3721f85b049c5ee514879f067483949 + pristine_git_object: 4fd18a0dcb4f6af4a9c3956116f8958dc2fa78d1 + docs/models/messageinputentry.md: + id: eb74af2b9341 + last_write_checksum: sha1:c91bfdf9426c51236b6ff33d127dbe62b051a9da + pristine_git_object: f8514fb3305dbe1df91db8d622cc33a753b63623 + docs/models/messageinputentrycontent.md: + id: 7e12c6be6913 + last_write_checksum: sha1:6be8be0ebea2b93712ff6273c776ed3c6bc40f9a + pristine_git_object: 65e55d97606cf6f3119b7b297074587e88d3d01e + docs/models/messageoutputcontentchunks.md: + id: 802048198dc0 + last_write_checksum: sha1:d70a638af21ee46126aa0434bf2d66c8dd8e43ff + pristine_git_object: d9c3d50e295b50618f106ef5f6b40929a28164df + docs/models/messageoutputentry.md: + id: f969119c8134 + last_write_checksum: sha1:f50b955cd622a6160c0ada34b0e14bff612802b7 + pristine_git_object: 73a1c666acc913b96d65a124612c4a728882bbc9 + docs/models/messageoutputentrycontent.md: + id: 44019e6e5698 + last_write_checksum: sha1:d0cc7a8ebe649614c8763aaadbf03624bb9e47e3 + pristine_git_object: 5206e4eb0d95e10b46c91f9f26ae00407d2dd337 + docs/models/messageoutputevent.md: + id: b690693fa806 + last_write_checksum: sha1:a4157c087ff95fa9445757c9d363615718156164 + pristine_git_object: e09a965f7d4cc35d6b120ba5555d96ba7b3e8a27 + docs/models/messageoutputeventcontent.md: + id: cecea075d823 + last_write_checksum: sha1:16dac25382642cf2614e24cb8dcef6538be34914 + pristine_git_object: 16d8d52f6ff9f43798a94e96c5219314731ab5fb + docs/models/messageresponse.md: + id: 3dd409ff05ba + last_write_checksum: sha1:f7dd5b03360f01417c32a33fd8131e6899ec6430 + pristine_git_object: 504aa9de165ea21ffd7178dd092b7532fc3f9e6a + docs/models/messagetokens.md: + id: c348c2448aaa + last_write_checksum: sha1:5f99a25a3f689030756a63e925113030121c5d7e + pristine_git_object: 427e09b524964c521a6b63962e5f71ae0ca1b485 + docs/models/metric.md: + id: a812a3e37338 + last_write_checksum: sha1:14016848dcfaba90014b482634ed6d5715caa860 + pristine_git_object: 7f86303651650177ece51b82d867cab858e830ae + docs/models/mistralpromptmode.md: + id: d17d5db4d3b6 + last_write_checksum: sha1:d7804c45f10f2e929276d4a00bf6c2b966a78fb5 + pristine_git_object: 9b234e3ea8fc13261897acf18ce4da3b14485f72 + docs/models/modelcapabilities.md: + id: 283fbc5fa32f + last_write_checksum: sha1:804b67d580cbb8be444485712b85ade3c059fbe1 + pristine_git_object: 7c125e6490b40b53b090f55ff9b5634bc2c2572c + docs/models/modelconversation.md: + id: 497521ee9bd6 + last_write_checksum: sha1:aea6f51b6276c5e36447c828e78a30367f15a978 + pristine_git_object: 190a6f6eb48191b2507a4861525707f041961538 + docs/models/modelconversationtool.md: + id: 2dd28167bc36 + last_write_checksum: sha1:029cca1fe47df23ef858a01fd2627f0bc2ffdfd3 + pristine_git_object: 0b6a45f7ec2ca95191b228a6468c80ddbfd373ed + docs/models/modellist.md: + id: ce07fd9ce413 + last_write_checksum: sha1:b4c22b5eff4478ffa5717bd5af92ca79f4a90b01 + pristine_git_object: 85b20be7376f80cf169c25b3c7117079cd4c2828 + docs/models/modellistdata.md: + id: e2eb639c646f + last_write_checksum: sha1:7394ba5645f990163c4d777ebbfc71f24c5d3a74 + pristine_git_object: b44e84a00d0c54f8df78650d45de0a409c901048 + docs/models/moderationllmaction.md: + id: 26373b4ad9cd + last_write_checksum: sha1:d8398d9c6b0da5f6a9947342c2cfc2d04e599519 + pristine_git_object: e46a30b4c3737fa2098d2502b896edb2c950b2c8 + docs/models/moderationllmv1categorythresholds.md: + id: b474ca28a6e7 + last_write_checksum: sha1:9080b6f5a7a6a00ed04c1cb32a43cb997cbeb5d5 + pristine_git_object: 90ae213feda5e63ad71fbd7bb0bfb07ee7b1e2c1 + docs/models/moderationllmv1config.md: + id: e39a45c3e458 + last_write_checksum: sha1:63b7677d0b488d44312417d9335abd595f9b6fa9 + pristine_git_object: bdb5812b87a69af904eb9cdc0fffff6e73d96cd3 + docs/models/moderationllmv2categorythresholds.md: + id: 401d3285071c + last_write_checksum: sha1:6fbfadaba4db8bed9fc7d38ad77cd47a089dd5f0 + pristine_git_object: e95b81b0315cf77724d027dbf8ff0f524ad1d068 + docs/models/moderationllmv2config.md: + id: 64c1e213e7cc + last_write_checksum: sha1:851923395e5a4097b82d184e070a85bf648a9e8c + pristine_git_object: e928506c8d210b865e8aee9739a35433ca136872 + docs/models/moderationobject.md: + id: 4e84364835f5 + last_write_checksum: sha1:2831033dcc3d93d32b8813498f6eb3082e2d3c4e + pristine_git_object: 320b2ab4935f8751eb58794e8eb9e422de35ae7c + docs/models/moderationresponse.md: + id: e15cf12e553b + last_write_checksum: sha1:18e8f4b4b97cb444824fcdce8f518c4e5a27c372 + pristine_git_object: 75a5eec74071fdd0d330c9f3e10dac0873077f20 + docs/models/multipartbodyparams.md: + id: f5be2d861921 + last_write_checksum: sha1:624f30759b7b7de1913b1ef3b8bb2187a95b9570 + pristine_git_object: 9d7a00c44e1507edd12f16fbb6b3864f1c0bbd81 + docs/models/networkencodedinput.md: + id: 44842604e405 + last_write_checksum: sha1:50e09dfa5ed838df4a760358c6bf81c04da4910b + pristine_git_object: 71e38615fada1e4f3b10e669eb3d8a6b768aa268 + docs/models/oauth2token.md: + id: 409bc5ff306f + last_write_checksum: sha1:cfa4eca0c2a099adf3d365d2bda4fe026d6dc36d + pristine_git_object: 59716ed683a8749e86c05b9c6b161900dafefb63 + docs/models/oauth2tokenauth.md: + id: f23959dcc4b0 + last_write_checksum: sha1:ca434f8479c3f5e868db1269e86efa5e0d9070e2 + pristine_git_object: 89f80436474e3c2293bb4fcafce11e626e2cdf79 + docs/models/observabilityerrorcode.md: + id: 61d16ff95b87 + last_write_checksum: sha1:db506572c8c6e989127c270dd65d4ea98e281c58 + pristine_git_object: d8532e86b041e814f56b11ebae900dcdc88efc60 + docs/models/observabilityerrordetail.md: + id: 38061447dfbb + last_write_checksum: sha1:1da7bf6e72c2f972b0e22f0201a1cb9b76f53ccd + pristine_git_object: a95e25c91c54edc4948ef82c1626773975190110 + docs/models/ocrconfidencescore.md: + id: 44a3cb211acc + last_write_checksum: sha1:d88c21a3aa36f24e00c2b24c31bc54944d1fc73f + pristine_git_object: 73fdcb28b1044bb7122ba6609708979c17a46e5e + docs/models/ocrimageobject.md: + id: b72f3c5853b2 + last_write_checksum: sha1:90c5158dec6a7b31c858677b6a8efa1e3cabd504 + pristine_git_object: 3c0d5544a80499b011467f29ef83d49f53801af6 + docs/models/ocrpageconfidencescores.md: + id: 4bc78fe53e38 + last_write_checksum: sha1:26733f345c69b188d372290784688a972fe39dbf + pristine_git_object: bffb214868dd74e617c87ff19e3909419d9acc97 + docs/models/ocrpagedimensions.md: + id: b3429f9883f5 + last_write_checksum: sha1:6435aa56e6153b0c90a546818ed780105ae1042a + pristine_git_object: c93ca64d5e20319ec6ec1bcb82b28c6ce0940f29 + docs/models/ocrpageobject.md: + id: 88a9e101b11e + last_write_checksum: sha1:84b903d90dadcac943000b90e8a8e8a81c8b92fa + pristine_git_object: 0fc55052cdf2360131c0adcec93a732e2b0f78c5 + docs/models/ocrrequest.md: + id: 6862a3fc2d0f + last_write_checksum: sha1:2ea2303ff17a962fe38a64f20f43ea0986e29cc4 + pristine_git_object: 54cea7c1359b338c552fdfd321abd2fd137602df + docs/models/ocrresponse.md: + id: 30042328fb78 + last_write_checksum: sha1:8e4a4ae404ea752f3e9f1108c2a5f89ed6cfb143 + pristine_git_object: 0a309317644eedc643009b6cec3a7dbb142b1a15 + docs/models/ocrtableobject.md: + id: c967796380e6 + last_write_checksum: sha1:deb1715d618330b4f791b7237955e697d26c6bc2 + pristine_git_object: 2da8f6105dd83d7f4d067c74298316ab512c9c3f + docs/models/ocrusageinfo.md: + id: 419abbb8353a + last_write_checksum: sha1:6e717a3f3de3c464e8b3237f06867cdfecec339e + pristine_git_object: d9d79125cb02bc2b09d8dc543a5e2d4a6c55571c + docs/models/op.md: + id: 4f953e6b890f + last_write_checksum: sha1:24b06144f98d9843f99402c3dc890fa911646e52 + pristine_git_object: da9031db6360c37490c3b30f9608bfb9776c38ca + docs/models/operator.md: + id: 1b6d3fc58add + last_write_checksum: sha1:98ac05cdbd6839c9ff93c4d805eebd7ba9f26dcd + pristine_git_object: 2790c574454daba86720666a2877ffa4467a4134 + docs/models/option.md: + id: b70901c8beab + last_write_checksum: sha1:aeac15a068312b38625c3efcd08f5f179f607f92 + pristine_git_object: 0f600be4b142e088e916a243e196d57ffb3dd76e + docs/models/or_.md: + id: 4062b9894f72 + last_write_checksum: sha1:cbf92175e3a4f829d7ad84da51301a42bbfa80cd + pristine_git_object: 2a2172695146be50782a3ef32815950d4829cf64 + docs/models/orderby.md: + id: 9e749ed80f72 + last_write_checksum: sha1:4f6dd8e684dd11e4856d3d6cf2c0f2e2d1a01640 + pristine_git_object: d778621f6b1e6788aecbe25bd741d27a0d863990 + docs/models/outboundauthenticationtype.md: + id: a62ff6260857 + last_write_checksum: sha1:fa53bfaf3b76537c2e044863430db44c41e5f83d + pristine_git_object: a8ddd6241371f24309c4878b4522738fde01d3d5 + docs/models/outputcontentchunks.md: + id: f7e175c8e002 + last_write_checksum: sha1:5094466110028801726cc825e8809f524fe1ee24 + pristine_git_object: c76bc31d4d8791b7bef4dc6cbff6671b38a7927d + docs/models/ownertype.md: + id: 96bf508ddec4 + last_write_checksum: sha1:8021d596504b99d8ff2c3db36a494b192fe35e45 + pristine_git_object: 288d58339ece9c69572e86f17f364dfc4213be50 + docs/models/pages.md: + id: 9045c659bb29 + last_write_checksum: sha1:b4b9daaa3e2bd6efeb6f5efe07e8da58385b3ee3 + pristine_git_object: a3631692d4d8c230e71c7c9c6ccb12b96fd93279 + docs/models/paginatedconnectors.md: + id: 108e699a33a1 + last_write_checksum: sha1:bbec5d2256b55b26ea1429439ff5d7abe744ab04 + pristine_git_object: 3fff5b95a6ccbed2356e4fbfe907ed2fb8334ea2 + docs/models/paginatedresultcampaignpreview.md: + id: cbc69a4c26bd + last_write_checksum: sha1:032f0179ec659ed0f1401b8fd9bbef10637d8afc + pristine_git_object: 7e8e5715b373b00ac7ea06a568da27dc777173a9 + docs/models/paginatedresultchatcompletioneventpreview.md: + id: bc3919eaf32b + last_write_checksum: sha1:1a537bafaa390ee5e8dd7869c5b8905a35526f29 + pristine_git_object: 96b4b7ae6913846f39be80a3732b85eeddfeb93f + docs/models/paginatedresultdatasetimporttask.md: + id: 461b15377067 + last_write_checksum: sha1:6f916fe2ffc98bfabbc8905a470513016211ba4c + pristine_git_object: ce067d528e53e859577217e60e83b63eb8d5199c + docs/models/paginatedresultdatasetpreview.md: + id: 509ba8c49460 + last_write_checksum: sha1:b3f072c50ace6b4c52d0e8a43a39bc84767391dc + pristine_git_object: f6ca903772591eefbdd02d836fb2227635380858 + docs/models/paginatedresultdatasetrecord.md: + id: 79bed183ed1c + last_write_checksum: sha1:9f3d08b3f0b2618d66047f198121d762e8782a17 + pristine_git_object: 31b086eb6ce8db231af2ca60d07b10d20a99ce9a + docs/models/paginatedresultjudgepreview.md: + id: 90506e511844 + last_write_checksum: sha1:01368f99123b7db0e8dee1f03640f8258f89ea8b + pristine_git_object: 91bf0c35876a6dcc2bf5cd34c8cbf1ade82b4d0c + docs/models/paginationinfo.md: + id: 3d2b61cbbf88 + last_write_checksum: sha1:1da38e172024fe703f3180ea3c6ec91fe3c51ed0 + pristine_git_object: ad1fbb86c714c152a5e6e99d8a741e7346884e55 + docs/models/paginationresponse.md: + id: 592cf80526b8 + last_write_checksum: sha1:e72a2238fe984cc4fa0d2522b462aa9ad247af78 + pristine_git_object: 7ed17a697771f10febe2b893f092865b09dc04c7 + docs/models/pauseschedulev1workflowsschedulesscheduleidpausepostrequest.md: + id: 56f6ceab8262 + last_write_checksum: sha1:3b5c8e341c685a7f4b2789a9d051eef54ff8cfda + pristine_git_object: dc69416ce94c9709dda30becc7616016c397615f + docs/models/payload.md: + id: cd93a0338683 + last_write_checksum: sha1:58bb76cb62da4c0c3c0f41965854dac205dcae3c + pristine_git_object: 22b47fa5d1a09c31ceacca958e094b9f37ea994a + docs/models/postdatasetrecordsfromcampaignv1observabilitydatasetsdatasetidimportsfromcampaignpostrequest.md: + id: d5158d7e7b7f + last_write_checksum: sha1:7e425ce967a5d92b14b2efa1b98e9fcf578d9c92 + pristine_git_object: b3bf2a61d1e14f54b53e746326649a51beb3419b + docs/models/postdatasetrecordsfromdatasetv1observabilitydatasetsdatasetidimportsfromdatasetpostrequest.md: + id: 6a1b28e01fd6 + last_write_checksum: sha1:63acf2f14db16c43da0347c0b5547cf90bf91e55 + pristine_git_object: 33dafda2ecabe8d4d92b973ae78932c6037809f5 + docs/models/postdatasetrecordsfromexplorerv1observabilitydatasetsdatasetidimportsfromexplorerpostrequest.md: + id: 92f8f5c18f8e + last_write_checksum: sha1:0de74481df2b1114c0c6e5bae6c8b83e09e65c7d + pristine_git_object: ba25323e33b0ab40287aa944ae77fe79148a9459 + docs/models/postdatasetrecordsfromfilev1observabilitydatasetsdatasetidimportsfromfilepostrequest.md: + id: ffc31f79f514 + last_write_checksum: sha1:f07eefba3eff14afa69786c37beacaac8484a99a + pristine_git_object: 0bff196b59382962b6e49884c547354c2f71af03 + docs/models/postdatasetrecordsfromplaygroundv1observabilitydatasetsdatasetidimportsfromplaygroundpostrequest.md: + id: a3c711a50d05 + last_write_checksum: sha1:130c16a00743f65394279d00af233e6ee4337451 + pristine_git_object: 86ab87b8d016644f31b762a9010b368337c3b141 + docs/models/prediction.md: + id: 3c70b2262201 + last_write_checksum: sha1:ca8a77219e6113f2358a5363e935288d90df0725 + pristine_git_object: fae3c1ca4ba2c2ddb3b7de401ecdc8d56dcc7740 + docs/models/processingstatus.md: + id: 06047222d2ff + last_write_checksum: sha1:fd2f5d605c6e5f8aa86461e8442c50db3fbea07d + pristine_git_object: 514caa50e524ae5afab802b8394cb27189b2bfbe + docs/models/processstatus.md: + id: "336054835357" + last_write_checksum: sha1:43253d2ef4badf3a5e8e5981becfb558c934359a + pristine_git_object: 68313743c4d926b2cb29037d0e59a2f9d8d25f1c + docs/models/prompttokensdetails.md: + id: 1391892fce0a + last_write_checksum: sha1:4a82fc483f090e4fc09d19a3f2c0f2a2e022cf3f + pristine_git_object: 36b58e9aa80a53dad530cad93fb1d565fdd03b59 + docs/models/publicauthenticationmethod.md: + id: abfb51fdf794 + last_write_checksum: sha1:9be30607f8c895958f33b5be25fc1b8b4cb3d328 + pristine_git_object: 59de7076ce05ff71ba4bd5f22112459f4500bf4d + docs/models/querydefinition.md: + id: 4831b7e558f9 + last_write_checksum: sha1:f4983c0963906b3eda13c69e2852b08d662dd744 + pristine_git_object: 9d094fdad5d9b33792fc366fe156a91531d771fa + docs/models/queryinvocationbody.md: + id: b8ceb9c9a70c + last_write_checksum: sha1:01de5f28c0358b7051b80ca6467bb00a30bd8941 + pristine_git_object: 3d4e5441618a02a07ece83fe69e27d68c5cd8ce4 + docs/models/queryinvocationbodyinput.md: + id: e56d939bc2dd + last_write_checksum: sha1:e3b7f0a0865843b789f4ddbc849faa9851fbbb8c + pristine_git_object: deb0db275d3da722d0cf340f4ce5e3f914b590c4 + docs/models/queryworkflowexecutionv1workflowsexecutionsexecutionidqueriespostrequest.md: + id: 9ab2fbbf8cc3 + last_write_checksum: sha1:49e01dcdfec3ec5b60fd7c80f2eaa08ebbc482d1 + pristine_git_object: 0e0d378d22959d5d3ca1e65aae8d9c6c0a780b95 + docs/models/queryworkflowresponse.md: + id: 6f29ca165760 + last_write_checksum: sha1:1fb91b06fd875a868c0e8d3bb4b86ae31cc17fec + pristine_git_object: cc5b08669152c4f3581a6d80a856c0925c40768b + docs/models/realtimetranscriptionerror.md: + id: 4bc5e819565b + last_write_checksum: sha1:c93e4b19a0aa68723ea69973a9f22a581c7b2ff6 + pristine_git_object: e01f2126b3084eade47a26ea092556f7f61142c9 + docs/models/realtimetranscriptionerrordetail.md: + id: ea137b1051f1 + last_write_checksum: sha1:7e1d18760939d6087cda5fba54553141f8a78d1e + pristine_git_object: 5b34755dc67359bb884d5c2387608686ee527470 + docs/models/realtimetranscriptionerrordetailmessage.md: + id: d25137243bef + last_write_checksum: sha1:f8c3a4984d647d64e8ea4e1e42654265ffe46b0f + pristine_git_object: da3764ef56337bdc773eaf8e9aa747cbd1b407e2 + docs/models/realtimetranscriptioninputaudioappend.md: + id: fa2aa317d1ca + last_write_checksum: sha1:59cce0828505fdb55104cd3144b75334e0f31050 + pristine_git_object: 5ee365eb9a993933509ac4666bcec24bfcc6fccd + docs/models/realtimetranscriptioninputaudioend.md: + id: 11045f9cc039 + last_write_checksum: sha1:945ca0475826294e13aba409f3ae2c2fc49b1b67 + pristine_git_object: 393d208c6e242959161f4436d53cf4aa2df69a92 + docs/models/realtimetranscriptioninputaudioflush.md: + id: c2f2258e0746 + last_write_checksum: sha1:a4e6d160da44c6f57b01059f7198208702e9b06a + pristine_git_object: 367725baa278935a6a282338ca7f2a23895a86d8 + docs/models/realtimetranscriptionsession.md: + id: aeb0a0f87d6f + last_write_checksum: sha1:d72bf67442ac5e99f194c429e96a504685f02efb + pristine_git_object: 750bd7f79b65666812c6207d7085b9437c49517d + docs/models/realtimetranscriptionsessioncreated.md: + id: aa2ae26192d6 + last_write_checksum: sha1:d13fec916d05300c86b52e951e81b1ceee230634 + pristine_git_object: 34e603fd0a1cbc8007eef06decb158213faebeed + docs/models/realtimetranscriptionsessionupdated.md: + id: 56ce3ae7e208 + last_write_checksum: sha1:833db566b2c8a6839b43cb4e760f2af53a2d7f57 + pristine_git_object: 7e2719957aae390ee18b699e61fbc7581242942f + docs/models/realtimetranscriptionsessionupdatemessage.md: + id: 02a5eee40cdd + last_write_checksum: sha1:44f8e6bc8f8cd4087a7e86c85db5141fab90f78d + pristine_git_object: 2a50ca92720bad6605bdeafd83b43d0e8bf40615 + docs/models/realtimetranscriptionsessionupdatepayload.md: + id: 3ddd5a95510a + last_write_checksum: sha1:33bca4d547ca812d55ac49bf7b17851b2fecfc80 + pristine_git_object: d6c6547d7895e53be15a0cce46b6524178acc3bc + docs/models/reasoningeffort.md: + id: c8fd630d3f07 + last_write_checksum: sha1:0a4afcf2f35b5a53764b7daae3ea3c5834743312 + pristine_git_object: 9b418bc3b9819560a9b468571d619e5d2f65dea5 + docs/models/referencechunk.md: + id: 07895f9debfd + last_write_checksum: sha1:3d35227a4f7612301fd5f17a445c4c2b712f0bf1 + pristine_git_object: 0186d3c358e27d01617c982f61db0910039a049a + docs/models/referenceid.md: + id: 22fa492a467e + last_write_checksum: sha1:80161796acbc185876a3656ee8cbdde4df7e23d0 + pristine_git_object: 1d29397fd96b42b7dc33bd10184bef55de5ae066 + docs/models/requestsource.md: + id: 8857ab6025c4 + last_write_checksum: sha1:5634447d01c483713dad3d6d39df182007e6181b + pristine_git_object: b710cc1f394e04ecc93c9fc6daddddec366254ad + docs/models/resetinvocationbody.md: + id: 4063ca65ac51 + last_write_checksum: sha1:94c7cd498cba13d4da784c4be76ddbb5b1b64cd9 + pristine_git_object: 9f306e2d0ce2e3b9311ed55fdcd028a74319c79d + docs/models/resetworkflowv1workflowsexecutionsexecutionidresetpostrequest.md: + id: 834b0b115e63 + last_write_checksum: sha1:21bf448e143353577c2bb1cc9333dba89c033f4b + pristine_git_object: 418c6c5a041db5bc33b731b112346c671cd136bd + docs/models/resource.md: + id: 94a32a903140 + last_write_checksum: sha1:0c141e37497f5b07d2da77a41777617ed3653582 + pristine_git_object: 30d74c40f3add81023ad86271bb02dfe018c1013 + docs/models/resourcelink.md: + id: 1086204e8a19 + last_write_checksum: sha1:f1a1c228a16e8e99cd5ff04622455e080418dd6d + pristine_git_object: 074c573e64e98cbaf177fde279364f26df04a2bf + docs/models/resourcevisibility.md: + id: 891d464e9c47 + last_write_checksum: sha1:cb0eaebe4e984ab4d999745a142868d2359ab8e4 + pristine_git_object: 970211bb11b10aac688084845d1172e65d1ced1d + docs/models/response.md: + id: 583c991c7a30 + last_write_checksum: sha1:0791cb4aa4045708ab64d42bf67bd6ab74bc7752 + pristine_git_object: ff67925758959b87992b47a1a32c224eeeb599e3 + docs/models/responseconnectorlisttoolsv1.md: + id: 11f3f310ef36 + last_write_checksum: sha1:db8c315f851caf7f36b852bf7a34ab2a0daf63fe + pristine_git_object: 18a31c5628f714a7bf1757bc8f79cab9e689bc6a + docs/models/responsedoneevent.md: + id: 38c38c3c065b + last_write_checksum: sha1:4ac3a0fd91d5ebaccce7f4098ae416b56e08416f + pristine_git_object: 63d4cc06493e1ca12cf0e8ef800acfc0bdc9a02d + docs/models/responseerrorevent.md: + id: 3e868aa9958d + last_write_checksum: sha1:4711077bf182e4f3406dd12357da49d37d172b4c + pristine_git_object: 4309bdadc323918900cc4ca4fddb18788361d648 + docs/models/responseexecuteworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepost.md: + id: 7df3dce048fa + last_write_checksum: sha1:f98acd879d2690c2ce02646026242f21b19a0cb5 + pristine_git_object: 381987b63d5749243a1aad073f0c6fa03062e3b5 + docs/models/responseexecuteworkflowv1workflowsworkflowidentifierexecutepost.md: + id: 052963e8160c + last_write_checksum: sha1:bf0b0faed2f7d54fba78ecb89cef07c339b99233 + pristine_git_object: 368f23184def4b3d4fe1f7c8a06693afb3eac4dd + docs/models/responseformat.md: + id: 50a1e4140614 + last_write_checksum: sha1:e877b2e81470ef5eec5675dfb91a47e74d5d3add + pristine_git_object: 5cab22f2bf1c412699f6a7ed18ef801ecbc3ee4b + docs/models/responseformats.md: + id: cf1f250b82db + last_write_checksum: sha1:c7fedb61c8c40d4ff6bebefa37133668e5a8582d + pristine_git_object: 12e5edd7ffaa05000f26cab5e92a7ea1570a94f9 + docs/models/responseretrievemodelv1modelsmodelidget.md: + id: 6143ec73bdd6 + last_write_checksum: sha1:6bae62cbb18559065a53f0acdacb1f72f513467e + pristine_git_object: ffbc1473d39c8266bb6b05b37677c98ca1d10858 + docs/models/responsestartedevent.md: + id: 88e3b9f0aa8d + last_write_checksum: sha1:156f38bbe8278f9c03117135938e7cbdae3038b9 + pristine_git_object: e2f421af866690b34c2d9fa4595a63e9172a65f5 + docs/models/responsev1conversationsget.md: + id: 48d4a45780a9 + last_write_checksum: sha1:8e75db359f0d640a27498d20c2ea6d561c318d7e + pristine_git_object: 844c5d610a9a351532d12b1a73f6c660059da76b + docs/models/resumeschedulev1workflowsschedulesscheduleidresumepostrequest.md: + id: 70bace616181 + last_write_checksum: sha1:2c13407b2c3b01bc59f486e2848fac0c3d025dc1 + pristine_git_object: e50fe6cd7baa2a65e3b74bf213196fdcd42d5472 + docs/models/retrievemodelv1modelsmodelidgetrequest.md: + id: ac567924689c + last_write_checksum: sha1:7534c5ec5f1ae1e750c8f610f81f2106587e81a9 + pristine_git_object: f1280f8862e9d3212a5cfccd9453884b4055710a + docs/models/role.md: + id: b694540a5b1e + last_write_checksum: sha1:dd140bf891a9b08db014fde4a99af28839e10dfb + pristine_git_object: b16f5c3baef6a17d3900b3eddcc5034e37a12b01 + docs/models/roles.md: + id: 2af79e204ed6 + last_write_checksum: sha1:10354a9bcbe03a498848de9874b3163cde0fcc05 + pristine_git_object: d722e7654427a013da70deb45f1bdb65b55add30 + docs/models/sampletype.md: + id: 0e09775cd9d3 + last_write_checksum: sha1:b77964a7b39ec1b74f70925a39c30b23fad6ac43 + pristine_git_object: 31f26c3c2869a453306fff5b062b40e95aa5f19a + docs/models/scalarmetric.md: + id: e23b9b990914 + last_write_checksum: sha1:272bcac17d958e6d045be0e78ad80aa710d35bb7 + pristine_git_object: 96b932315f7844bc432ce6bacc48d0349203262b + docs/models/scalarmetricvalue.md: + id: b73292165d87 + last_write_checksum: sha1:6585beed45b4f6ce8188348145a148fb3380cf74 + pristine_git_object: 6723310e9e340eebf58f11dfdc2417d030a87a60 + docs/models/schedulecalendar.md: + id: 60c22b27e191 + last_write_checksum: sha1:6c5457c6c0f2393e41c297e42d25ca95a14f752a + pristine_git_object: 4166bef5ded04c323f5644b80305ed5bb4159fb4 + docs/models/scheduledefinition.md: + id: 5a795fa1c041 + last_write_checksum: sha1:cbe6e2f2ebaf6bb52be56ffbca6b9d966fdbc2e3 + pristine_git_object: 7d0509f6263ae04d3eb99b65cef0b85adf71aeae + docs/models/scheduledefinitionoutput.md: + id: e5f8d9d43716 + last_write_checksum: sha1:a41e2d99be8b57984e9db632fb17af0212b51e60 + pristine_git_object: 64b7b525f9f5187980711921055bff171cd218f6 + docs/models/schedulefutureexecution.md: + id: 9e732a58123f + last_write_checksum: sha1:2b88b19a82bb66a6910986e5608aef6bdb474aea + pristine_git_object: 7dfa16af938f21db25cb992477e76d276902f996 + docs/models/scheduleinterval.md: + id: 4792384fc173 + last_write_checksum: sha1:3c73f2b3bcf44494d0ecd943cf15a592fed95493 + pristine_git_object: e99d552f4d302f1385afbb76a77b7ac5897be62c + docs/models/scheduleoverlappolicy.md: + id: ced0baf85d76 + last_write_checksum: sha1:24c5a5f8bccc5204084bf9bd7f6d419c7fbea309 + pristine_git_object: 1df8c0ea277353267bdf3b024c7482e9ebc3a0ab + docs/models/schedulepolicy.md: + id: cd43e2c8ebd4 + last_write_checksum: sha1:148ef1b0166528b0ddc7c502495b9bac713e482b + pristine_git_object: 5f0790490888458b468c4dca9cdbfde2c860f405 + docs/models/schedulerange.md: + id: 70268cb45dae + last_write_checksum: sha1:cc9778a0389b2255c8ce8433802fa327a1716980 + pristine_git_object: d6cb09759e5a983434ffd094b77fd3d36ab450c3 + docs/models/schedulerecentexecution.md: + id: c093e67b0d4d + last_write_checksum: sha1:c8f57f472e2df609a23d94bf07684348bb007d04 + pristine_git_object: f849e1ae2896ee6db55c7af27f575f9f6c8c9132 + docs/models/scope.md: + id: c7d8338540ba + last_write_checksum: sha1:08e688325601e4c4614cc6b7264ea4d2f631da36 + pristine_git_object: 0dc29aa5d453a82d0366ea003ab6e5710e2b1e3a + docs/models/searchchatcompletioneventidsrequest.md: + id: ace22de1b563 + last_write_checksum: sha1:0368a82e5b6399806252670aec01714e5bb78331 + pristine_git_object: 7d0c4a509c8388cb9762724badd4c20a4494bf6c + docs/models/searchchatcompletioneventidsresponse.md: + id: d35dba44c6e3 + last_write_checksum: sha1:ecaf8fbe6e098c63df02d016fa391320e4bb2f92 + pristine_git_object: 6e429684ac0246438d1b1c5ae799ec499a5bbe64 + docs/models/searchchatcompletioneventsrequest.md: + id: 429f092e3dcb + last_write_checksum: sha1:caacd88fdf6e4c28c0c1a6a33357ab0f728996ef + pristine_git_object: 11bc3ab9d2c7096775e68fed59aecab0c3d25834 + docs/models/searchchatcompletioneventsresponse.md: + id: e7cb0de862bc + last_write_checksum: sha1:d8e860c666fe6b152d3944e9182e90be539c3ce2 + pristine_git_object: 9474c1109d62fc5f7ff0bae32d386d54951d7fa2 + docs/models/security.md: + id: 452e4d4eb67a + last_write_checksum: sha1:45b7b8881a6560a468153662d61b99605a492edf + pristine_git_object: 2e0839d06f821dd97780dc22f202dedf23e4efe1 + docs/models/shareenum.md: + id: 53a713500576 + last_write_checksum: sha1:de5c59ca89596a3b28134a9f7318fed3b3e6af02 + pristine_git_object: d471b7c3c6700146dc02e20d3aa6205a5025d134 + docs/models/sharing.md: + id: 9f1e88417a87 + last_write_checksum: sha1:876fd514d08a6987646bf0fec636bf3fef89155b + pristine_git_object: fc718632594e04c682c6d6a3931a94d8b1fd4059 + docs/models/sharingdelete.md: + id: 165cac179416 + last_write_checksum: sha1:1a0b3c95f4b56173510e234d7a76df85c593f360 + pristine_git_object: 1dcec0950c7fcd264ea9369c24244b54ba2bcfbf + docs/models/sharingrequest.md: + id: cd53ce3913a5 + last_write_checksum: sha1:380d0621a0a8ec9cd4be2b53a6e326b8c9c3d201 + pristine_git_object: 21b8ec1f74c1f903aa087cd3b4d13918c0ea9dad + docs/models/signaldefinition.md: + id: 4627d2840cb7 + last_write_checksum: sha1:3606a41b67a27350c22aa2bf234d8a8696b23404 + pristine_git_object: c1974f70ef9676beb9fefae2c124e231da5b1b6b + docs/models/signalinvocationbody.md: + id: 9723986308b4 + last_write_checksum: sha1:4c005bb178a814e1f23bcb5112a0ba61df96ad92 + pristine_git_object: 14dc23e0e9a8d74b7275daf8a492d6a0a83d5e8a + docs/models/signalinvocationbodyinput.md: + id: db0ac2b1de58 + last_write_checksum: sha1:edda01f077f43a2527900caab977d4d07f2e8eff + pristine_git_object: e9308bcb4b74122eca76aeca31883c160eb15ebd + docs/models/signalinvocationbodynetworkencodedinput.md: + id: 0a2d313daef1 + last_write_checksum: sha1:4a2e7fed866136d621b842d58d0cd6964a869bdb + pristine_git_object: 09368656b06d42477862d0f4f8dcf5909d52d1c3 + docs/models/signalworkflowexecutionv1workflowsexecutionsexecutionidsignalspostrequest.md: + id: f43e35cd41a6 + last_write_checksum: sha1:701f949b648221e98bb302c4afff668f4d86fc4d + pristine_git_object: 2ca356d85370faff6c573a678a4380c9caf56ad6 + docs/models/signalworkflowresponse.md: + id: 38c985ca6ede + last_write_checksum: sha1:f82ac07d517e89bfa8044eebff6f9f7aa56f6c77 + pristine_git_object: f65d7924388b842863deddb0e52d4376f2e28925 + docs/models/source.md: + id: 6541ef7b41e7 + last_write_checksum: sha1:00d43797d0155945ec39d4aff068a3ac7bad5ad5 + pristine_git_object: 37ca338b6f2ba9d10209cbcd3c680b7589589767 + docs/models/speechoutputformat.md: + id: cd623f390460 + last_write_checksum: sha1:1f237bad21e275b29ff8fa4c25397497adb5db92 + pristine_git_object: 9b06e46475dd6160588ce4fe9d275c2f2454a6c0 + docs/models/speechrequest.md: + id: 1403855cf560 + last_write_checksum: sha1:ae21118684de7d75eb6b176234a06d891baf562d + pristine_git_object: 3a22e80af5aba7084f98ef38805b6f941bda043e + docs/models/speechresponse.md: + id: be437798d476 + last_write_checksum: sha1:c1c23ed7f45484831d04ca5bc12a28b4e91cd0d0 + pristine_git_object: c44ecd830d84c74b2d7d15f1369f60ab81c6fa3a + docs/models/speechstreamaudiodelta.md: + id: 2fafdd59efa2 + last_write_checksum: sha1:1bfecfce38c78162ff0c324429e16da1d98651b4 + pristine_git_object: 3a1725529f737b69ecfe147f1619c05896d0c2a4 + docs/models/speechstreamdone.md: + id: 660654bb6961 + last_write_checksum: sha1:460b0891989440add3f7f0e802b5744e343249cb + pristine_git_object: d9b5e0c0c9deef93a2ff79d46a026766c4aef673 + docs/models/speechstreamevents.md: + id: d071f3e7ecda + last_write_checksum: sha1:48806c50f933cdf9331fafe5a622717147fe9427 + pristine_git_object: f624f85f3da3c45a1e50faa730d516d29e18edce + docs/models/speechstreameventtypes.md: + id: 6d82ea8e72db + last_write_checksum: sha1:8bc26e2195e060d96f906f69c9237c7f7f91eea9 + pristine_git_object: 8c688c27acfe398412316b6695b2524e7818bb66 + docs/models/speechv1audiospeechpostdata.md: + id: f79b3009aa04 + last_write_checksum: sha1:6f3b9fb81fc82b8b4f745df380ed786b02ccb157 + pristine_git_object: 52735e257a4238155537411a06b2ff03a1897454 + docs/models/speechv1audiospeechpostresponse.md: + id: "224767288403" + last_write_checksum: sha1:a05342901f170d8226a06cc4e2854dd36917756e + pristine_git_object: 040f3351c61c89abd53602eaaf767edd977af2b5 + docs/models/ssetypes.md: + id: 6a902241137c + last_write_checksum: sha1:6291d6bc7cbcd7640b83b03ac8ce353b95c1f913 + pristine_git_object: 372eafee6f22105d6f5fd31f2e04ea04f5abe641 + docs/models/streameventssepayload.md: + id: c3cdfddd480b + last_write_checksum: sha1:6251dc54c4becf826ac475ffd8cc48d18a509aad + pristine_git_object: 6ec6726a4464f4535a51398cd042f90e4390f789 + docs/models/streameventssepayloaddata.md: + id: 04bdf412c709 + last_write_checksum: sha1:6feb3abc7dcb4766216d12093d597c180ab396f1 + pristine_git_object: 61e6556277ba7ffe5e81b43fbc0c3eb0d21013df + docs/models/streameventworkflowcontext.md: + id: 32e6c8f9826e + last_write_checksum: sha1:d89a4e547d92889b3c88269d8f3c9a870a5058c3 + pristine_git_object: 098f48fd4cb8dad49298c723081528dcd715c26a + docs/models/streamv1workflowsexecutionsexecutionidstreamgetrequest.md: + id: 5ca96459c844 + last_write_checksum: sha1:200e5cf38c1c655c72d856591ebca1c3e85a9b7f + pristine_git_object: 19d02a40d06b7066d32f63e0daf6a40434d88754 + docs/models/streamv1workflowsexecutionsexecutionidstreamgetresponsebody.md: + id: 09d5a590ebf1 + last_write_checksum: sha1:1f22c1e502478d9532b6729bcde30aa8bb5528c4 + pristine_git_object: e12bb93835a164b665e4cdf4b9862f350d91c850 + docs/models/supportedoperator.md: + id: 000f0770e0f9 + last_write_checksum: sha1:ea71b0062712f8750234d8bd5313063589de1155 + pristine_git_object: 97dbd4b14b71389273583d142009548abca92e1f + docs/models/systemmessage.md: + id: fdb7963e1cdf + last_write_checksum: sha1:c7603c5ce77ba2bcbda9eff65eeafdb1e9ecbec7 + pristine_git_object: 10bda10f921fb5d66c1606ff18e654b4e78ab197 + docs/models/systemmessagecontent.md: + id: 94a56febaeda + last_write_checksum: sha1:6cb10b4b860b4204df57a29c650c85c826395aeb + pristine_git_object: 0c87baf3c2fade64a2738a9a4b3ce19647e5dc9a + docs/models/systemmessagecontentchunks.md: + id: cea1c19e9d7a + last_write_checksum: sha1:986aec0f8098158515bbccd0c22e0b3d4151bb32 + pristine_git_object: 40030c170746d9953d25b979ab7e6f522018e230 + docs/models/tableformat.md: + id: d8cd08c55c3c + last_write_checksum: sha1:3ef23d504527602f2d0789d2cfb1a6629115f41a + pristine_git_object: 8321a3090910115b586be900bcf23da5baf4c245 + docs/models/tasksupport.md: + id: 58be1f1aef25 + last_write_checksum: sha1:2005c0e15f36bd315c17688daa4dd9a8c260b009 + pristine_git_object: 2d16da9de0af99ca5cecd7aab3349e13d22c7013 + docs/models/tempogettraceresponse.md: + id: b5700fe45c4d + last_write_checksum: sha1:334312483f0365ed3ec20f6fc26b7fdf54fde811 + pristine_git_object: cc4a4e93da510f5852e5ce2c7254f6f18efe0ca7 + docs/models/tempotraceattribute.md: + id: 6ce2d6cbea6b + last_write_checksum: sha1:d296899e9a5fb160925a36382dee30dbe959a106 + pristine_git_object: 6061df8649c32a4c4daea648223525a9f870bb2a + docs/models/tempotraceattributearraycontainer.md: + id: d47f0c8b6956 + last_write_checksum: sha1:9e7bb43dbf6f4176284ef5985f8fbbea8efccd5f + pristine_git_object: 049dce7d7b8b7da965af6629e45be77e81aa4302 + docs/models/tempotraceattributearrayelement.md: + id: be9d9005df77 + last_write_checksum: sha1:e970ae3b60c1adaf0bb79e109ec675338f2095de + pristine_git_object: a4b8208099ff361160ad3c403f427eeb5fc143e5 + docs/models/tempotraceattributearrayvalue.md: + id: 619f60780ece + last_write_checksum: sha1:889052cfcc2f44c882bbfe32cfbaeb104b9927f4 + pristine_git_object: b763756f99de3f53af5916c92585ea3b8a09ddba + docs/models/tempotraceattributeboolvalue.md: + id: 0e2767bf14da + last_write_checksum: sha1:6e09bcab345a7cbe376c41fd20955017f54243bc + pristine_git_object: 07b77e43cd17be26c620a30a8ec627310d67886f + docs/models/tempotraceattributeintvalue.md: + id: 55a1d75f3e12 + last_write_checksum: sha1:2381b0f0f84aeb42d9a0a97fe3764ebaa9dee0d9 + pristine_git_object: 5c47f1eb1b12d0d1a29f676daf2b79225032c524 + docs/models/tempotraceattributestringvalue.md: + id: ccd801521b60 + last_write_checksum: sha1:3c0c1e94c6adb62043be5498dc6632079e3ec701 + pristine_git_object: 61e7eb8ac7f91e718e85fd46b7298095300821f5 + docs/models/tempotraceattributevalue.md: + id: b5a74866dcac + last_write_checksum: sha1:2acdf3c2c1c7e163ded5d12c51eb649f2a11b95d + pristine_git_object: 3b0a18692fce0a107217c3f274626ece86f22aa2 + docs/models/tempotracebatch.md: + id: 1a73bb7f3ee0 + last_write_checksum: sha1:778e8837929ee817567c02653ae9daca8d564ea7 + pristine_git_object: 1e7779a2d9c56a5e25d46e26031f69e5ab8410eb + docs/models/tempotraceevent.md: + id: 07cb7db3504c + last_write_checksum: sha1:04a17ed3d22f34bc1a10c135f10ae18785abe42d + pristine_git_object: e456fa7c93b66686c0d3ac802da83e2b0b8ffa69 + docs/models/tempotraceresource.md: + id: 9e75b787c050 + last_write_checksum: sha1:dc195ca7c4331183e5688fc53161208a54495ffe + pristine_git_object: 0d0e2ded0e99297f1982e70bc5bb9d14e957d25d + docs/models/tempotracescope.md: + id: 07e19420387a + last_write_checksum: sha1:14ccec8d631703fbee79ac1a1f5e1ac71b5a461f + pristine_git_object: f3678a9fb8867a9e42b4ad02ef98dcbb7622fe63 + docs/models/tempotracescopekind.md: + id: 04915d7e8cc2 + last_write_checksum: sha1:e5ab7e2396f71337a812c298097080a4e6b4b175 + pristine_git_object: e08cc9be04286dc81cd000422e0b914ad7acd8bb + docs/models/tempotracescopespan.md: + id: 3fa2689ebf7c + last_write_checksum: sha1:474874dac2f2513fb2c8c834aa21cb59db543bb1 + pristine_git_object: e3b6d58a39dde1cdcab1deb5f53bfad5d14bb64a + docs/models/tempotracespan.md: + id: b7d1c4f02519 + last_write_checksum: sha1:e7dc0b212731b706d7e3b475bcd0d41826ff8ae4 + pristine_git_object: f657acc6870a7a9f024c0763716e4ecea1111adf + docs/models/terminateworkflowexecutionv1workflowsexecutionsexecutionidterminatepostrequest.md: + id: 197e0d3cf762 + last_write_checksum: sha1:1ff1f9ac91867332457179b31786f013d6923b5c + pristine_git_object: 227066fb06da0b4cd22b923ca466e10087fa5467 + docs/models/textchunk.md: + id: 6cd12e0ef110 + last_write_checksum: sha1:d9fe94c670c5e0578212752c11a0c405a9da8518 + pristine_git_object: df0e61c32bc93ef17dbba50d026edace139fee6a + docs/models/textcontent.md: + id: 82aa22f226fc + last_write_checksum: sha1:b359ace0ab7d8960b9c0a205a788fb26189cc6ac + pristine_git_object: ddd2df027b7f0cca132c69fa47bb76e5e8afdc87 + docs/models/textresourcecontents.md: + id: aa82a3efa4ec + last_write_checksum: sha1:58468c602ae4e85c860b909f39384f49f7471a4b + pristine_git_object: daa531e1bf60f55962069ef586b4f1ae56c32662 + docs/models/thinkchunk.md: + id: bca24d7153f6 + last_write_checksum: sha1:baa8dd2840678133f585ba3d94cc279cb284be22 + pristine_git_object: b7494beed66469ecdb570b7e084b3824ab171052 + docs/models/thinking.md: + id: 07234f8dd364 + last_write_checksum: sha1:90c0b34284137712678b0671e9f4bfb319548cbf + pristine_git_object: d9e51d7dc93b24edd807b018393eab38143d46f4 + docs/models/timeseriesmetric.md: + id: 64217edf3511 + last_write_checksum: sha1:ca9fad09ddf36bb078950120f53d9011a98e0654 + pristine_git_object: 2b5fc61d3717b4383d4e7b4660ae6a7229774336 + docs/models/timeseriesmetricvalue1.md: + id: 6cb257de9197 + last_write_checksum: sha1:86c5cf46002459d8f86d1fd197f181bba7b12246 + pristine_git_object: f1783455276c32478d9c22523a3e2f1d1a58b948 + docs/models/timeseriesmetricvalue2.md: + id: 40045842e667 + last_write_checksum: sha1:0ca94992e7bbfee401a1bafd03b5fd09940f4633 + pristine_git_object: c6ba5ecaaf5a26b60415b4292757366e9fa95c20 + docs/models/timestampgranularity.md: + id: eb4d5a8e6f08 + last_write_checksum: sha1:b423f56d3a6004ed89c356806002b2af3e5c5a56 + pristine_git_object: 4c84779c4d2e8bf2a2fe258c2b350b05d047f2e3 + docs/models/tool.md: + id: 8966139dbeed + last_write_checksum: sha1:2ab2016846da06ab38751176ba80fb6527c2818b + pristine_git_object: 85888d01cf439be601c8d1df4048c90161cf47df + docs/models/toolannotations.md: + id: ac541d142ff4 + last_write_checksum: sha1:54d9bfd3cd764d11cd993f7ff87784bd6d11f14d + pristine_git_object: f3c8fc3cf7d9b4587b47afaf67eb14608eb58b48 + docs/models/toolcall.md: + id: 80892ea1a051 + last_write_checksum: sha1:621dc83981e13cbcbc21f2e16a34178c322c4566 + pristine_git_object: 9d236e8b289977d2aa7bded0d633b224c5ec9e57 + docs/models/toolcallconfirmation.md: + id: 944eebb142ff + last_write_checksum: sha1:864ccb39a00094d965b764235e74709945abca3d + pristine_git_object: 1812f7d687d83f5692d9e79709e56813ab2c79b1 + docs/models/toolchoice.md: + id: "097076343426" + last_write_checksum: sha1:65a2794a1102fdcba6fa5a3f497630fbaf98f94b + pristine_git_object: a457f96f6e295d590a5ef75f83a5a6c4fdd41c47 + docs/models/toolchoiceenum.md: + id: 15410de51ffc + last_write_checksum: sha1:cdff87c62661fcb902824fda8e305c5b1b98b3d8 + pristine_git_object: eb1f36298acfc2c3aa33224e95c87f17da9caf0d + docs/models/toolconfiguration.md: + id: 06bfa2c4e662 + last_write_checksum: sha1:9b619977375f228c76f09d48d6e2833add6c07e2 + pristine_git_object: 89286a172124ce3473bcb081de6e4db8c95afefa + docs/models/toolexecution.md: + id: 0c47c08eaa46 + last_write_checksum: sha1:1af09b39f042e21e47ac09f73301ca9bbb521029 + pristine_git_object: 8d385132baca782d1a7ec0d586136a29751f6ec8 + docs/models/toolexecutiondeltaevent.md: + id: f2fc876ef7c6 + last_write_checksum: sha1:ae1462a9b5cb56002b41f477ce262cb64ccf2f4e + pristine_git_object: 7066f3485407707500e5006335279bfa37db8705 + docs/models/toolexecutiondeltaeventname.md: + id: 93fd3a3b669d + last_write_checksum: sha1:d5dcdb165c220209ee76d81938f2d9808c77d4fc + pristine_git_object: 9c3edef8c0698d7293a71ee56410a0ed67fd1924 + docs/models/toolexecutiondoneevent.md: + id: b604a4ca5876 + last_write_checksum: sha1:6b6975ded0b0495b6c56250d153186c7818b5958 + pristine_git_object: b2d81be3cfa3e1dd0d1a58ef5ad16556c5e953c7 + docs/models/toolexecutiondoneeventname.md: + id: d19dc0060655 + last_write_checksum: sha1:aa5677087e6933699135a53f664f5b86bbae5ac6 + pristine_git_object: 6449079d7b467796355e3353f4245046cced17e8 + docs/models/toolexecutionentry.md: + id: 75a7560ab96e + last_write_checksum: sha1:668d8fbc59bc729bf4b1d95d2f2bfe4097701c0e + pristine_git_object: 03316381b130cf02751b10fef4129c8f23072b76 + docs/models/toolexecutionentryname.md: + id: 86d537762559 + last_write_checksum: sha1:6c528cdfbb3f2f7dc41d11f57c86676f689b8845 + pristine_git_object: fb762a5382d8b0e93dc2eb277f18adf810057c55 + docs/models/toolexecutionstartedevent.md: + id: 37657383654d + last_write_checksum: sha1:5a020d24bdeb4eb9976ce93a8daa91947026bde9 + pristine_git_object: 189b8a3d3b22d73000850a3f1a95b85e358c2090 + docs/models/toolexecutionstartedeventname.md: + id: be6b33417678 + last_write_checksum: sha1:f8857baa02607b0a0da8d96d130f1cb765e3d364 + pristine_git_object: 3308c483bab521f7fa987a62ebd0ad9cec562c3a + docs/models/toolfilechunk.md: + id: 67347e2bef90 + last_write_checksum: sha1:2e4c6ce703733c02e62467507c231033716fdb92 + pristine_git_object: d60021755729f1a2870e24a500b3220c8f1fc6e3 + docs/models/toolfilechunktool.md: + id: eafe1cfd7437 + last_write_checksum: sha1:73a31dbff0851612f1e03d8fac3dbbee77af2df0 + pristine_git_object: aa5ac8a99a33d8c511f3d08de93e693bf75fb2a1 + docs/models/toolmessage.md: + id: 0553747c37a1 + last_write_checksum: sha1:ac61e644ba7c6da607cb479eafd1db78d8e8012e + pristine_git_object: 7201481e61e269b238887deec30c03f7e16c53d7 + docs/models/toolmessagecontent.md: + id: f0522d2d3c93 + last_write_checksum: sha1:783769c0200baa1b6751327aa3e009fa83da72ee + pristine_git_object: 5c76091fbd2c8e0d768921fab19c7b761df73411 + docs/models/toolreferencechunk.md: + id: 10414b39b7b3 + last_write_checksum: sha1:ea3bdfc83177c6b7183ad51fddb2d15aee0f0729 + pristine_git_object: 49ea4ca7b05e5fcaaf914f781e3a28483199d82d + docs/models/toolreferencechunktool.md: + id: c2210d74792a + last_write_checksum: sha1:368add3ac6df876bc85bb4968de840ac578ae623 + pristine_git_object: 999f7c34885015a687c4213d067b144f1585c946 + docs/models/tooltype.md: + id: 5e2ddf7b3863 + last_write_checksum: sha1:3aa9c92e9872fe75032e53e311bf050dbab51e98 + pristine_git_object: 2a64e130e526f8d99e623e7cbc0c7add82d8fab0 + docs/models/trainingfile.md: + id: 4039958e8930 + last_write_checksum: sha1:d02543c2d1446e56501f2ac358a09669b0077648 + pristine_git_object: cde218bb2281a1274d013844ad76b4b2a34b986c + docs/models/transcriptionresponse.md: + id: 39e2354aca38 + last_write_checksum: sha1:7b32e2179c3efc675c05bba322cc33554a9ff9db + pristine_git_object: 1bc0189c5d1833c946a71c9773346e21b08d2404 + docs/models/transcriptionsegmentchunk.md: + id: f09db8b2273e + last_write_checksum: sha1:d4a7ebd6a8cc512a0bd00a49af4130c533254b44 + pristine_git_object: d7672c0eebb55243965306c94a771aa18ed641d6 + docs/models/transcriptionstreamdone.md: + id: 2253923d93cf + last_write_checksum: sha1:2a1910d59be258af8dd733b8911e5a0431fab5a4 + pristine_git_object: bca69a2b02e069ce240342d76ac408aec67993a9 + docs/models/transcriptionstreamevents.md: + id: d0f4eedfa2b6 + last_write_checksum: sha1:ec6b992049bd0337d57baab56603b1fa36a0a35b + pristine_git_object: f760385dfbd9779e63d61ec6357901bc9b4ca8e9 + docs/models/transcriptionstreameventsdata.md: + id: 506af75a0708 + last_write_checksum: sha1:99fcb3bf3aab0fb87dc02a4e6ccef9271ff0ae89 + pristine_git_object: eea8e9281634c56517e28f613afee38e0b0846ad + docs/models/transcriptionstreameventtypes.md: + id: 701782e8a63d + last_write_checksum: sha1:7a6fc032e6dd63912472b9158c07cf20ceefe7e3 + pristine_git_object: 9e49384e399f15e70382050ee414a7446d1e4b70 + docs/models/transcriptionstreamlanguage.md: + id: 5e9df200153c + last_write_checksum: sha1:d5626a53dde8d6736bab75f35cee4d6666a6b795 + pristine_git_object: 63fcfbc63a65cdff4228601e8a46f9d003ec9210 + docs/models/transcriptionstreamsegmentdelta.md: + id: f59c3fb696f2 + last_write_checksum: sha1:7d6999abf5a01fc01c0d5302acd3218e535adc9a + pristine_git_object: 1b652a3b6dc4406a3b7efa8a412b15ca0a5d765f + docs/models/transcriptionstreamtextdelta.md: + id: 69a13554b554 + last_write_checksum: sha1:d969f462034ed356f2c8713b601ee7d873d4ce07 + pristine_git_object: 77bd0ddcf8a1d95707fa9e041de3a47bb9e7f56d + docs/models/turbinetoollocale.md: + id: 57197dc9a955 + last_write_checksum: sha1:8ec2a585bfc0f5dca7bbad5fe143d21b9e5f6cb8 + pristine_git_object: 283dd339629448669557acf2d6eda10dea735421 + docs/models/turbinetoolmeta.md: + id: f99b41288e88 + last_write_checksum: sha1:092cd9ae293706419a86fd69c490cbc6587965d3 + pristine_git_object: 2f61a2c4d8be1634ccbb1ef0adacde0c6722a9bd + docs/models/unarchivemodelresponse.md: + id: a690f43df567 + last_write_checksum: sha1:5c9d4b78c92d30bb4835cb724d1ea22a19bf5327 + pristine_git_object: 375962a7110f814288ea9f72323383bd8194e843 + docs/models/unarchiveworkflowv1workflowsworkflowidentifierunarchiveputrequest.md: + id: 68ac0e7701d3 + last_write_checksum: sha1:3ff86e1e4647f0787841ba5f267a16b730c60351 + pristine_git_object: e25cd4bcc990fc9b6d583b8d771ce9b0c297d391 + docs/models/unscheduleworkflowv1workflowsschedulesscheduleiddeleterequest.md: + id: 40615902c1fe + last_write_checksum: sha1:d42a893a1c281ddfc8db957e168d832311917fe8 + pristine_git_object: c2bc33738e8e34d66da61ae08a496384b6c623f0 + docs/models/updateagentrequest.md: + id: 371bfedd9f89 + last_write_checksum: sha1:73936f78ae35e5f84ebe32aabb150d6792ce40d1 + pristine_git_object: b8aa01f66b13d050839bd0aacf1550f669bc8d13 + docs/models/updateagentrequesttool.md: + id: bdf961d2c886 + last_write_checksum: sha1:104218314ae55ccf111d90bdbad987a13988f7f5 + pristine_git_object: cf590a2fc7f58707855eb0bda2d4b8460bfea800 + docs/models/updateconnectorrequest.md: + id: 40e38d9c7c2a + last_write_checksum: sha1:03a8cd1c8d6415b26cdf592534ba09c022a5414e + pristine_git_object: 335588eac79ddbd851ead9950f3681f7dda90ee3 + docs/models/updatedatasetrecordpayloadrequest.md: + id: ada11a6c544f + last_write_checksum: sha1:220ce1184c9f6b6c6d1e5cdf2dc18197778f7af2 + pristine_git_object: f152d84329ffd358b56392025a69f13f6d2b7546 + docs/models/updatedatasetrecordpayloadv1observabilitydatasetrecordsdatasetrecordidpayloadputrequest.md: + id: abb1793448c5 + last_write_checksum: sha1:4bc30c277c9d2fa5f8fdf8938f65c61e1da8abf8 + pristine_git_object: fbb4b308362ac1f8157554ab6deeae1658231879 + docs/models/updatedatasetrecordpropertiesrequest.md: + id: 8e3f0136f445 + last_write_checksum: sha1:afa0832f5a234c6e7434a4414cb16f9b2c9ae45d + pristine_git_object: 6e98944d42f9adc02dd45c0e152dd28ba7ad6cdf + docs/models/updatedatasetrecordpropertiesv1observabilitydatasetrecordsdatasetrecordidpropertiesputrequest.md: + id: 2f433ceabf6d + last_write_checksum: sha1:18a646d17ae785ab5813eb36c43dfda857429558 + pristine_git_object: 6b09e479247a14a4c4e5d4786c2705a8c01ba5c8 + docs/models/updatedatasetrequest.md: + id: c8f941dea81b + last_write_checksum: sha1:3b4276274ab943411faf51b2a788226f0ac8343d + pristine_git_object: 2a5194e493808629a9031f518a36bbe68d2c04a6 + docs/models/updatedatasetv1observabilitydatasetsdatasetidpatchrequest.md: + id: 4be4c812536f + last_write_checksum: sha1:600212552869daf41c872ff6ec7a4cbff1e00b63 + pristine_git_object: 78eae8fb8193b201064416858d719fc28bb964b1 + docs/models/updatedefinition.md: + id: 66f521a5a9f5 + last_write_checksum: sha1:a5121824ba55698bcb31641641e73e2eeb19136c + pristine_git_object: 8cf62617303949d2633773af0268447befb04af2 + docs/models/updatedocumentrequest.md: + id: ee4e094a6aa7 + last_write_checksum: sha1:09171d42fdac0060276af58c5f036cb5714709d3 + pristine_git_object: dd06dd4b43b72ee73faf0bb2d39edf22889c0780 + docs/models/updateinvocationbody.md: + id: d8b3b9cca5ae + last_write_checksum: sha1:0fed6d77626ec76d3584e8d38b97ee228218a390 + pristine_git_object: e810a041e5db77f4d9396075b420600c1d86054d + docs/models/updateinvocationbodyinput.md: + id: 6c6c00bca06a + last_write_checksum: sha1:604242fdb6f47c049b1e5afbe4ddd374a516cb98 + pristine_git_object: 70665f9ea1871781bc6192b41b1e5b1bff91bf2c + docs/models/updatejudgerequest.md: + id: c220d8a2a289 + last_write_checksum: sha1:7c85b0f8b6ca133ca9e4b435322e50f97afd8fbd + pristine_git_object: bf28ae7acdb67cf7b2beb0bd34403ff33fc7e477 + docs/models/updatejudgerequestoutput.md: + id: 3d8371657f6e + last_write_checksum: sha1:ba478cb39ba8ebc739477e4ac763bbe87b0f0a8e + pristine_git_object: a8db68ab3266b42741f22348e54524a2134f081a + docs/models/updatejudgev1observabilityjudgesjudgeidputrequest.md: + id: e900c1258e5e + last_write_checksum: sha1:4125c640bf8271131c8e57c0c617aa9348f29e67 + pristine_git_object: bfe3648d706b6c1f95b8c5515d4ee999d556fa2d + docs/models/updatelibraryrequest.md: + id: 2eda82f12f31 + last_write_checksum: sha1:67b0996be205dc819aa1add249822f72a03b4c27 + pristine_git_object: 32d53eecafd52a692f5f34da54afd358b1ab55b2 + docs/models/updatemodelrequest.md: + id: 8eabdced3e0e + last_write_checksum: sha1:96879df11c005b591f2e59975897feff8fc8656e + pristine_git_object: 56b84c59c48ac135345394235c71ce77d384e33e + docs/models/updateruninfo.md: + id: 88a321690025 + last_write_checksum: sha1:29e161253e4cfe28981968a10c0a7ff153f35779 + pristine_git_object: 1f09fb3bdaf0d8f62e1cd93e437e1c314b1c0f81 + docs/models/updateruninfov1ragingestionpipelineconfigurationsidruninfoputrequest.md: + id: fef8641b24c8 + last_write_checksum: sha1:4c9532d96f40fc0b406e3c8e34b40d2b457963bf + pristine_git_object: c675adeffe4da132426b8002b45d4c290bdd97bc + docs/models/updatevoicev1audiovoicesvoiceidpatchrequest.md: + id: 0b7dfc68573f + last_write_checksum: sha1:53d5d07d53d184d68b57185d251c8d68ff3cf4d4 + pristine_git_object: a8ca8e298bab527fe82e3c0dbf076ace0c70da20 + docs/models/updateworkflowexecutionv1workflowsexecutionsexecutionidupdatespostrequest.md: + id: df780faca122 + last_write_checksum: sha1:d0ebf3489a9b91d85983af31625040583ab0fed4 + pristine_git_object: 5705af6b2d86aa378f3c54a10e863c731805fa4d + docs/models/updateworkflowresponse.md: + id: fcf739a23f8a + last_write_checksum: sha1:76e12ce365fad9b2d68abbd60b6c54bd30acd01e + pristine_git_object: a4e9494e8ec0d6b4cb187c7d1479b3407bd004ba + docs/models/updateworkflowv1workflowsworkflowidentifierputrequest.md: + id: fc6e47dd1496 + last_write_checksum: sha1:9184d5f03fa53c41eda416b24ab1e75eef94cc8f + pristine_git_object: 51877da9157009f81857f115a84101cc5142c2fa + docs/models/usageinfo.md: + id: ec6fe65028a9 + last_write_checksum: sha1:cf71fb9676d870eba7c4d10a69636e1db4054adc + pristine_git_object: f5204ac94a4d6191839031c66c5a9bc0124a1f35 + docs/models/usageinfodollardefs.md: + id: db2412f29163 + last_write_checksum: sha1:0f0dcb8301e46d644e458f3f0d1ae0349f22f589 + pristine_git_object: e5088d432997327c8b5f96e267e569cccfacc0a2 + docs/models/usermessage.md: + id: ed66d7a0f80b + last_write_checksum: sha1:f0ed7d9cb7264f1d9e4a9190772df3f15e25346c + pristine_git_object: e7a932ed71496fa7cc358388c650d25f166f27a4 + docs/models/usermessagecontent.md: + id: 52c072c851e8 + last_write_checksum: sha1:1de02bcf7082768ebe1bb912fdbebbec5a577b5a + pristine_git_object: 8350f9e8f8996c136093e38760990f62fd01f8cf + docs/models/utils/retryconfig.md: + id: 4343ac43161c + last_write_checksum: sha1:562c0f21e308ad10c27f85f75704c15592c6929d + pristine_git_object: 69dd549ec7f5f885101d08dd502e25748183aebf + docs/models/validationerror.md: + id: 304bdf06ef8b + last_write_checksum: sha1:1f297f34069668f6107f2c0389606efe413ff5a8 + pristine_git_object: 5bcea5b5d12e72222720af2c014d64ec4bdfee4a + docs/models/visibility.md: + id: 69ecc096de1e + last_write_checksum: sha1:30226db515dbfeef9316552cf871cf6882f597d2 + pristine_git_object: 924f2bdd9bcaa0bc59ba7a28733ce53fa968f822 + docs/models/voicecreaterequest.md: + id: 1014a6e8d549 + last_write_checksum: sha1:2eba4e618f2767df9ca52b8b352e3060e9d0f04e + pristine_git_object: e9a3b3a14963b63e3b5555912bfe2c2f5ad6c67b + docs/models/voicelistresponse.md: + id: 8226f91596b3 + last_write_checksum: sha1:5d4dc06036e1c8267fe736ae23c53104853850dd + pristine_git_object: d2d40dffd0bcda10a2266c95ac951e8242209f6e + docs/models/voiceresponse.md: + id: f6523df1521d + last_write_checksum: sha1:92c959e003170588fa6fa7d9d0bd33207fbaf49e + pristine_git_object: 3ec6d5407d0e7bde20488c2831dc3fe962696eee + docs/models/voiceupdaterequest.md: + id: 7fbbdd315066 + last_write_checksum: sha1:8a1883407eff51f9e81fa3024af0d9fab016b2ca + pristine_git_object: 924b5f477dd97f8fe417de63b5d7b744616b2fc4 + docs/models/wandbintegration.md: + id: ba1f7fe1b1a3 + last_write_checksum: sha1:ef35648cec304e58ccd804eafaebe9547d78ddcf + pristine_git_object: c73952d9e79ea8e08bc1c17817e74e3650def956 + docs/models/wandbintegrationresult.md: + id: 729c2601b338 + last_write_checksum: sha1:49f442907815de4661a85a3521803d80b953a17e + pristine_git_object: d12bc31191ba534a9744d78f657c19e7f93f777a + docs/models/websearchpremiumtool.md: + id: 267988aa8c3f + last_write_checksum: sha1:38f80a43f73a13ddedc7730f853c092a48b665f9 + pristine_git_object: 78b736cd314617caa0d77f3c42015212e37ab539 + docs/models/websearchtool.md: + id: fc4df52fb9b5 + last_write_checksum: sha1:72636dc7ae74264bb5158d284ef6f83da5290b27 + pristine_git_object: 4ca7333c412ad819e3e02c61debe402e3f9b0af9 + docs/models/workflow.md: + id: a782201b7327 + last_write_checksum: sha1:b633fce77c3d985b73268fadf161e6ab790e4970 + pristine_git_object: b1765cc45eb62883640c9e7d7e47345fcdeaf819 + docs/models/workflowarchiveresponse.md: + id: e952228d4f02 + last_write_checksum: sha1:49dbb8dd7c8b3a2442de072bd45244540c79954f + pristine_git_object: 6192c2b2c82b3a29e8cefab33067b6e7c23a5d55 + docs/models/workflowbasicdefinition.md: + id: a88b03086ce2 + last_write_checksum: sha1:7046dd6a11770b56c36e22af07552e28c6cf36f0 + pristine_git_object: a534ad34da32c4d8eb93f055e1bbf128c5df7e8a + docs/models/workflowcodedefinition.md: + id: 16ce7d540f36 + last_write_checksum: sha1:96703471ed4249c118cd0d2563182f9300e3bfc9 + pristine_git_object: f8cf3bbd5a9d0aad13daf38d140ffbe9c3df825f + docs/models/workfloweventtype.md: + id: 0ea616e53d9b + last_write_checksum: sha1:97e9654b44b627a610b3a30f14b3dc56dab1d725 + pristine_git_object: ebfe2d86bb5c460219eb9fe9902002817c0f914a + docs/models/workflowexecutioncanceledattributes.md: + id: 2eb975976d1a + last_write_checksum: sha1:63f7d6bbbbca074ebc2988988477d95d2f147c11 + pristine_git_object: 8c2929eb3de33ac39ebf3b243af978957c6a43f5 + docs/models/workflowexecutioncanceledresponse.md: + id: c56b39b95831 + last_write_checksum: sha1:3fc990c9fd4b7b3b0368b80840d737cf355a8759 + pristine_git_object: f9f4c01d263fb222de033128cd43f86c56f2b8cd + docs/models/workflowexecutioncompletedattributesresponse.md: + id: ee786dd87f88 + last_write_checksum: sha1:0d6121ea184c00cb362a345113fcb1f84cff3b13 + pristine_git_object: 53596a91525e00e58cdf548c2b17deeecba8b567 + docs/models/workflowexecutioncompletedresponse.md: + id: c1888ba90ec6 + last_write_checksum: sha1:491656749133e6b0d7714d2a9cbc8de8aa9c92d7 + pristine_git_object: a4d40dc52ead7c8a525cfd838fc0aa336570fb3b + docs/models/workflowexecutioncontinuedasnewattributesresponse.md: + id: 30eef6da0d67 + last_write_checksum: sha1:5419f5ccfb9b13fbef8aef96a97a34a32ea136c6 + pristine_git_object: 13e21499434f9bdef975a6d6902e2b85d8c7a04f + docs/models/workflowexecutioncontinuedasnewresponse.md: + id: 1ea81bc536b4 + last_write_checksum: sha1:e65c01b128029322249b28e4152cd60af2443b18 + pristine_git_object: e6a7212a856f0b89b18c16e7b9f6e93ddbb2e527 + docs/models/workflowexecutionfailedattributes.md: + id: b5ddf561c50e + last_write_checksum: sha1:097719213eeb253420f6bc7167f96c58d00bb5b4 + pristine_git_object: 9fa14fa42e0d11148df4ceb227e35d808b3b7909 + docs/models/workflowexecutionfailedresponse.md: + id: 1c88150815b1 + last_write_checksum: sha1:92a46ae195053013887496ae827cfd8853e864c5 + pristine_git_object: 222fbfd75c79bf9868b04affab9d2708f5942f64 + docs/models/workflowexecutionlistresponse.md: + id: a66878b279ba + last_write_checksum: sha1:9fafefc730d10ae17baf0c77462f658f9f15fdcb + pristine_git_object: 0434e94872c5989925f698380b725bfa1c48a00c + docs/models/workflowexecutionprogresstraceevent.md: + id: 143ceb0718a6 + last_write_checksum: sha1:9878b118897957dd4b92163966ea4199c29bc5ff + pristine_git_object: ac50a894e5290f07d8531e25663baae090cf533e + docs/models/workflowexecutionrequest.md: + id: 44a6d9ef046a + last_write_checksum: sha1:a7c35ec35e8ba3a3c48c2e27b334ae54abff2ff5 + pristine_git_object: 4b61c7b7fad5d597639122a8b32b7ac3c375d669 + docs/models/workflowexecutionresponse.md: + id: 73595cfc443f + last_write_checksum: sha1:b2aacb271ca655f622ba0c724971620814e0272b + pristine_git_object: 03f1010030defa48eb7d3f98189baab9ff7b1bfe + docs/models/workflowexecutionstartedattributesresponse.md: + id: 384d48b3e104 + last_write_checksum: sha1:54ce029d9db1b0f5dee6a42019995a58ef196268 + pristine_git_object: 63c20eb12a9d285cf448057f156820f98e282c43 + docs/models/workflowexecutionstartedresponse.md: + id: 64174669ff20 + last_write_checksum: sha1:8eee734d26442d9c6e6693386c78eb204a932847 + pristine_git_object: 7c370d468250ef29319f365957f8eca504f40d19 + docs/models/workflowexecutionstatus.md: + id: 1e988cdad165 + last_write_checksum: sha1:9478f494d16651522d373f36d0537c0fca703038 + pristine_git_object: 1be6d741ec3dbda33b167ee7e6fd6ae4295084d8 + docs/models/workflowexecutionsyncresponse.md: + id: de066d2e3d26 + last_write_checksum: sha1:f3bcd9c25419d4da5c307d2f201517c7b48b5126 + pristine_git_object: 88cbc21caa9762cfa485366f7e98681f8e482986 + docs/models/workflowexecutiontraceevent.md: + id: 0c99f0388dcf + last_write_checksum: sha1:387058f5e007dd8aef7bed906e394bb748149dbf + pristine_git_object: b6bb388ca18523ca9b682e5bc4d4cf1c95100fa5 + docs/models/workflowexecutiontraceeventsresponse.md: + id: 4242880e71fc + last_write_checksum: sha1:e240be5e6d57636189c0648f749ea7c2bb1b18bd + pristine_git_object: d24dfcaf0cb9f0c1519b5057263dcb839b61f275 + docs/models/workflowexecutiontraceeventsresponseevent.md: + id: 40012f3fc374 + last_write_checksum: sha1:b7b2a4544e04bda359d226efc6ae4247678bda9a + pristine_git_object: 81c4f573a5af75f2ea8356f8bf23da676700ab8d + docs/models/workflowexecutiontraceotelresponse.md: + id: 358cf8c2556f + last_write_checksum: sha1:8a518835d45e407d39893fe1493e24bb5931dd86 + pristine_git_object: cc4ff9cab9673bdce6ab31e930224490ad78f6c1 + docs/models/workflowexecutiontracesummaryattributesvalues.md: + id: 50e4fbfd4cf6 + last_write_checksum: sha1:ee33a4345041c2d8529049f0d04efb410ead4f64 + pristine_git_object: 04bd34abb60485a9fe252a3c3cb125570f6fcc27 + docs/models/workflowexecutiontracesummaryresponse.md: + id: 5ac68ea4a1a4 + last_write_checksum: sha1:57899967680f72b2093c5a1add7fd4e598bc38f5 + pristine_git_object: c0380e7893e43ce2f5e4bef048efb1061ad93fa5 + docs/models/workflowexecutiontracesummaryspan.md: + id: 3851de52d638 + last_write_checksum: sha1:528371799a9c90c9ddaf5315c2d33b89320688b8 + pristine_git_object: 8ee487a2091161e674db28a7919d0d3d4cb57e32 + docs/models/workflowexecutionwithoutresultresponse.md: + id: 612e2645e3a3 + last_write_checksum: sha1:a62d8b840c5c769f61ec6e6af3b06dec3aecb044 + pristine_git_object: 47d795898cda1c2ce875b5f46f740d2f6c708c59 + docs/models/workflowgetresponse.md: + id: aa8fca163259 + last_write_checksum: sha1:eba9585e94ebc141c43d39689c31997083dcb615 + pristine_git_object: ef9baa44ce44b31d7cba47e1d1ce88ffef29c539 + docs/models/workflowlistresponse.md: + id: 00dfc68e54c1 + last_write_checksum: sha1:ca7ce66386b7cf011d9a906ecd6b70626c5417e4 + pristine_git_object: d36e48c68f379ac55a9b8f91916e7f7fbd465c63 + docs/models/workflowmetadata.md: + id: 3ae926974727 + last_write_checksum: sha1:de9267bafa22597a6cbc7f52cf8b4c1744d4b141 + pristine_git_object: c69cb08b384e5659f6884fa5f1d364ea848be02d + docs/models/workflowmetrics.md: + id: a8fe312f060c + last_write_checksum: sha1:211ed95c429aa5db0b074caaec7b5e1962a03be6 + pristine_git_object: 4936382b48d568309c80ba1c4c25703ef3b69659 + docs/models/workflowregistration.md: + id: 1d0720b1355b + last_write_checksum: sha1:4704d8dc8f5b961ac128ccbc4ff0e95874b8a020 + pristine_git_object: 52658c64464a744ff8f64205036a7abb6e92586d + docs/models/workflowregistrationgetresponse.md: + id: f2658cb29bf4 + last_write_checksum: sha1:ef021920be1f1cf2016887fb1e3fb7f583c3596f + pristine_git_object: c524fc68d9034604c7ab756ee401223b93287f32 + docs/models/workflowregistrationlistresponse.md: + id: 343e0dd93827 + last_write_checksum: sha1:79c56fad05442fb760af09584fcf6e42b742c002 + pristine_git_object: e37b36713c38a44b35d0aea4fb96cc8a44658156 + docs/models/workflowregistrationwithworkerstatus.md: + id: a558e858a7a9 + last_write_checksum: sha1:26d77bcd8fcfb7f2940513cc0aa2af2ca1734aca + pristine_git_object: f85563cedae6cb209614fc97ecf6dd94ef810172 + docs/models/workflowschedulelistresponse.md: + id: 4c425808aa60 + last_write_checksum: sha1:d8e8aad7a91d7f8e398f7716109d436df6c4fc86 + pristine_git_object: 7142185b8081d076cb3b8fcd592234d49e3e0e5a + docs/models/workflowschedulepauserequest.md: + id: 3a6d7adc379a + last_write_checksum: sha1:97b3dc2321f62497cea5f13b54c5b1d049d855d1 + pristine_git_object: 3abd719fd5b320498860757bf86776e4859dde90 + docs/models/workflowschedulerequest.md: + id: 5a6b71dbc1a7 + last_write_checksum: sha1:d053fd9a98d217986d09f941bb3429a9b9123e39 + pristine_git_object: a6255c75646dc93a333c51ffdb92d80a4ad0ac8f + docs/models/workflowscheduleresponse.md: + id: ef0b813976ad + last_write_checksum: sha1:2da7d2a8519fe915554fdcebc25915ad11fbb203 + pristine_git_object: 96d7ced717099cc1bbff4ac38d60e7552e9c6204 + docs/models/workflowtaskfailedattributes.md: + id: 7f329c44d7fb + last_write_checksum: sha1:432c70ec990e81e2de79c14efbbb6161b60e1b3e + pristine_git_object: c6515f84fb66f59e6b35a4524dbd1f3edc73a7ad + docs/models/workflowtaskfailedresponse.md: + id: 9e6bdbc8ec6d + last_write_checksum: sha1:3c83e4760483063bed3f48ec1babddd0b53e9a22 + pristine_git_object: 731ed219c64f5024884887bbdbd67857b3658707 + docs/models/workflowtasktimedoutattributes.md: + id: e9ab5a25e976 + last_write_checksum: sha1:52fb7ed9cfce65338b381616afac1dfc1e676d16 + pristine_git_object: 7f298ea251febc1a35510655d14a84c37172c899 + docs/models/workflowtasktimedoutresponse.md: + id: f53d1e6e4141 + last_write_checksum: sha1:8c3355239dce116da33ebc288363b20ddbf3a335 + pristine_git_object: ea3edade3558a0d95faa58c6d7c592928aae0fd9 + docs/models/workflowtype.md: + id: fdb669e25dee + last_write_checksum: sha1:1cb6c274e8bd8942a7064a46a183f402935b0526 + pristine_git_object: 93aa31f16f086c84fe097f0d0f306f13d5803d06 + docs/models/workflowunarchiveresponse.md: + id: fd8377932c7c + last_write_checksum: sha1:50ffff371e778ae77c66128b1673f096157415e3 + pristine_git_object: 667c93871f80c652ab1f61ce4fbd62252efc19a7 + docs/models/workflowupdaterequest.md: + id: 4dfd044f6694 + last_write_checksum: sha1:138ba57f1972c97dc1ac9f99b43e0f5c5b09626c + pristine_git_object: f8ce41edac51832df67aa8e18c13b43e1694fbab + docs/models/workflowupdateresponse.md: + id: 61dc42aa3dcc + last_write_checksum: sha1:0e9fc12bd0148cc59fd6222e22c3f923f305089d + pristine_git_object: 68faf7c0932990ae52eb0ff627544bd76bcb1545 + docs/models/workflowwithworkerstatus.md: + id: 81265aadaf0d + last_write_checksum: sha1:907f0ec1a157e36e002ee5088a2ee1519688e230 + pristine_git_object: daa637fafd39b03b9d6c0b627047be1142f060cc + docs/sdks/accesses/README.md: + id: 2ea167c2eff2 + last_write_checksum: sha1:663516c8c94ca324b938a5d5bd1196663cb1de88 + pristine_git_object: 51051e2f8def9bfd6032617530ba9bead989404f + docs/sdks/agents/README.md: + id: 5965d8232fd8 + last_write_checksum: sha1:962df50ddc8aa1f501ad596313ee590ba704ff8a + pristine_git_object: f02ea6cd7f7405763edb09dcece22e65028e8fbb + docs/sdks/batchjobs/README.md: + id: a3b8043c6336 + last_write_checksum: sha1:ca7b55fb1705fa127f1750ec41bf31bc1f05c37d + pristine_git_object: b9655075680d5046d4b10d10de77d6b7b2ccea23 + docs/sdks/betaagents/README.md: + id: 5df79b1612d8 + last_write_checksum: sha1:6d14ffeace9a068f45ed9c62ee6663dc3768239f + pristine_git_object: b936538c54d38e52a67ffdb8c65ec35999197a3a + docs/sdks/campaigns/README.md: + id: 18dcc3c717ca + last_write_checksum: sha1:758413376668e53883ded94d41b1167cbc00fa04 + pristine_git_object: d5d7e4d4681811419874f58c294cb59688e595aa + docs/sdks/chat/README.md: + id: 393193527c2c + last_write_checksum: sha1:839bc022bed585cd691c403333f68ed8b68d1a8c + pristine_git_object: 54b9f02913409dd73b0a0f36f7eab4f7fbcf5791 + docs/sdks/chatcompletionevents/README.md: + id: 6965539e0525 + last_write_checksum: sha1:ae7c0a0e7576a1114a85b9e607cb91c2ac1181a2 + pristine_git_object: c3f19868c6707a94f0efaeeb456c09221105ff74 + docs/sdks/classifiers/README.md: + id: 74eb09b8d620 + last_write_checksum: sha1:9f11740f8cf1a3af44fff15b63916305f1882505 + pristine_git_object: dc0f4984380b5b137266421e87a1505af5260e89 + docs/sdks/connectors/README.md: + id: 7633a87d946d + last_write_checksum: sha1:f4c8a2ee577cae1b8b1e9551bb873bf34fe0f403 + pristine_git_object: 753c1cf3974ff3be77dc3b401d27ec5c0ef8bced + docs/sdks/conversations/README.md: + id: e22a9d2c5424 + last_write_checksum: sha1:d0a4e55b1f1c9acc6e9b7cf5925faf930a911d26 + pristine_git_object: 63cd80a4a655a5c139be79239b0787c3f90cdea9 + docs/sdks/datasets/README.md: + id: deb5d90f4faf + last_write_checksum: sha1:cf41aa56b5fe1296961ddb769b96cb0f451ed2f2 + pristine_git_object: c04ced0cf5e5f7774ba9b1d25722085b92b8f0c2 + docs/sdks/deployments/README.md: + id: e7c5559ab768 + last_write_checksum: sha1:b6f43ed5be5071a808499af105191d2d79e9f81d + pristine_git_object: 941b5538a57b3b693914d6b0d2acad2e8bb47611 + docs/sdks/documents/README.md: + id: 9758e88a0a9d + last_write_checksum: sha1:c3ee7c987ddaa856fa0a2f1040a2592edb0b82f1 + pristine_git_object: 2efbc3488ec4b4b6bc5d30d9ae1b5a344a0fe79b + docs/sdks/embeddings/README.md: + id: 15b5b04486c1 + last_write_checksum: sha1:4a279bf9bcd84a9878ef979c78b8b75af3d52f02 + pristine_git_object: cb207d8be2ca86b00dc797fc06eabd1498adb770 + docs/sdks/events/README.md: + id: cf45a4390b9b + last_write_checksum: sha1:cc73282a4eafa837ee37f9db1517853e5ada0562 + pristine_git_object: de6b43fcbbcbadef17a4e35978815289146925ec + docs/sdks/executions/README.md: + id: 401745b17323 + last_write_checksum: sha1:deb3ec67034ab14cf9b4dc56abe7cafadb84b6d1 + pristine_git_object: 1bf4ed25ebc0b9f0c93b50da16119f4371219346 + docs/sdks/fields/README.md: + id: fdb6c4f3bd69 + last_write_checksum: sha1:ea6dea75f85d25fd0ccdd2c659ecec43d0e5242d + pristine_git_object: 3c8424419bae5c7e6e47b4cb23e35064531a8345 + docs/sdks/files/README.md: + id: e576d7a117f0 + last_write_checksum: sha1:45265e774720742cde1c76c8be294983bf4fc77a + pristine_git_object: 246707073e9dee115d30b20a01bf728dcb43efd7 + docs/sdks/fim/README.md: + id: 499b227bf6ca + last_write_checksum: sha1:be2db0822c83cec2cfe2b5424d4b08db06d1c63c + pristine_git_object: 7bf8908378c764c58cca2eddc6a4a97574c3709f + docs/sdks/finetuningjobs/README.md: + id: 03d609f6ebdd + last_write_checksum: sha1:2d7ff255c1462d5f1dff617a1993e730ec3911ea + pristine_git_object: 4262b3a9833180ce86da43a26ee7ab27403f2cd0 + docs/sdks/ingestionpipelineconfigurations/README.md: + id: ead2af7afd1c + last_write_checksum: sha1:77adda7a00ccea31ceca1aadde96141a1462dc94 + pristine_git_object: 671a7182a9fb2622b68db2826640d6eeae93e6b0 + docs/sdks/judges/README.md: + id: 330e067ff8b7 + last_write_checksum: sha1:e21c7f2201ab3e2ed14c5be687e5291f7c6ee9cb + pristine_git_object: 34d167398ac81ce78d50c1498c01f4c74917ce7f + docs/sdks/libraries/README.md: + id: df9a982905a3 + last_write_checksum: sha1:3cd3aef0294fb5b421a2b64baa7a53cfc1ad4f31 + pristine_git_object: 08606189680228ca4f4d30b6fc626c2d0c4b9287 + docs/sdks/metrics/README.md: + id: a8545d964e21 + last_write_checksum: sha1:0c559bd570e162c994c6125058f3712e24bc576b + pristine_git_object: 08a5ccb9418788b3f333dcbeddd25e51f71ca104 + docs/sdks/models/README.md: + id: b35bdf4bc7ed + last_write_checksum: sha1:ca04fe883c5440abf402640cf26a1a0e9799a55f + pristine_git_object: f585dcbeadeb87d5634a505450f3599af21df155 + docs/sdks/ocr/README.md: + id: 545e35d2613e + last_write_checksum: sha1:be72cd3b23779c9538f01ed718be7c44ae43c775 + pristine_git_object: 533b1bb20d121df7feb586680f20a5349b46acfa + docs/sdks/records/README.md: + id: db86bab024d3 + last_write_checksum: sha1:2ef5b164016e9b40c27d8a4915aeb8d3d2ed42c7 + pristine_git_object: ce8f1f689512a9eac118c05ec1e9acf17e931556 + docs/sdks/runs/README.md: + id: 4598fd39b715 + last_write_checksum: sha1:20e849d15916f477bfc94f62d69c50385c0370b1 + pristine_git_object: 7ed914205115222f7ade5a656541af0dba64ff28 + docs/sdks/schedules/README.md: + id: 2f28c809a225 + last_write_checksum: sha1:cb4f7d988d25d87b8c18443c6cf64b5cb31146df + pristine_git_object: 7bf59931141869fc2797586fb6cdcb8adb9f0b7b + docs/sdks/speech/README.md: + id: d5924688d48c + last_write_checksum: sha1:7128863f5b445f343d4fde121c78de3a8ee4cc11 + pristine_git_object: 7cd76ff4dc2354a55ae8b7bf08fbe46cf20ab081 + docs/sdks/transcriptions/README.md: + id: 089cf94ecf47 + last_write_checksum: sha1:15d118796f147bc5b0bf4146ba39bfa9edfbc996 + pristine_git_object: 97703c9b4dc942385ee04ae96cbd100c3f632a17 + docs/sdks/voices/README.md: + id: 4f1a657c8f68 + last_write_checksum: sha1:88be1b4df915b0c4f50f2a54f2c7e93ffd5a5263 + pristine_git_object: 49b8533f85e2c6bf70ff1ea296136f4d18cb8348 + docs/sdks/workflows/README.md: + id: 80c76ce944c0 + last_write_checksum: sha1:807551c827dd5936819393e88ff2160839bd01fc + pristine_git_object: 4575977672501a047dcd701dc471e2694d13d294 + docs/sdks/workflowsevents/README.md: + id: 514b42269280 + last_write_checksum: sha1:34971ab6eef89b115d78375a85142f3d2612f431 + pristine_git_object: 3915eb2498986000282ace30f486dce558efb4e2 + py.typed: + id: 258c3ed47ae4 + last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 + pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 + scripts/publish.sh: + id: fe273b08f514 + last_write_checksum: sha1:b290b25b36dca3d5eb1a2e66a2e1bcf2e7326cf3 + pristine_git_object: c35748f360329c2bc370e9b189f49b1a360b2c48 + src/mistralai/client/__init__.py: + id: f1b791f9d2a5 + last_write_checksum: sha1:c05dc9845d3361c4aae7796b079ac0e7952e8606 + pristine_git_object: 4b79610a3fc8222fc8f9adeeaf798e894708fc06 + src/mistralai/client/_hooks/__init__.py: + id: cef9ff97efd7 + last_write_checksum: sha1:9a6f060871150610f890cc97676c3afe9050b523 + pristine_git_object: 66a04e3727ffcc2c427d854cdbb4f5f340af050f + src/mistralai/client/_hooks/sdkhooks.py: + id: ed1e485b2153 + last_write_checksum: sha1:e592d5ab277827b988257b4df3e746508ca91b23 + pristine_git_object: ecf94240a5689c8b248add46509bc7a7982d8437 + src/mistralai/client/_hooks/types.py: + id: 85cfedfb7582 + last_write_checksum: sha1:40294e852f818a974034c33e510e0f8723fcaf31 + pristine_git_object: 036d44b8cfc51599873bd5c401a6aed30450536c + src/mistralai/client/_version.py: + id: cc807b30de19 + last_write_checksum: sha1:6b2772cd63b60cddf4ea95d94cfc44f81a878a73 + pristine_git_object: 9f9ae8c6224af17b3e22410b33f5a5ad37389e33 + src/mistralai/client/accesses.py: + id: 76fc53bfcf59 + last_write_checksum: sha1:de197fbbfea8bc95f44b4e7ee1b39e68fdde8bc7 + pristine_git_object: 5d859a399cb62144f5e47ae879407907427d56fc + src/mistralai/client/agents.py: + id: e946546e3eaa + last_write_checksum: sha1:02f7e2c669dba9f1d29f41bc6427357e9d04be5c + pristine_git_object: 1bcd8c54f685630c8248243b7dbf0ad5a8aa6082 + src/mistralai/client/audio.py: + id: 7a8ed2e90d61 + last_write_checksum: sha1:b9dc19b4b6070baf7d8937907b8665e9f0e36afd + pristine_git_object: 597954e4facba105cee62d92ea6b8c68555f63dd + src/mistralai/client/basesdk.py: + id: 7518c67b81ea + last_write_checksum: sha1:321a95c38231ed5126753702e6368a85a1af1667 + pristine_git_object: 4a27eb2ff362dd6189abfde2c8f739b70deab192 + src/mistralai/client/batch.py: + id: cffe114c7ac7 + last_write_checksum: sha1:b452983f67b33f26e1faa60fdbbb171cb1877224 + pristine_git_object: 7e36fd0d73ebeb873f74f4109896a6cf3bb7d2ba + src/mistralai/client/batch_jobs.py: + id: 3423fec25840 + last_write_checksum: sha1:89deea7e036f775d7d0551ef7edd550a7903ccfb + pristine_git_object: 2bf50fd3dc54ca084c026c97cac055f75d4a885a + src/mistralai/client/beta.py: + id: 981417f45147 + last_write_checksum: sha1:1f6972862310651111b52027dd8b4c5519adadfd + pristine_git_object: f9bbb5aed59e7f9505e4bba2ee9c0190d51cf626 + src/mistralai/client/beta_agents.py: + id: b64ad29b7174 + last_write_checksum: sha1:307dd8e2fd0e8bda707894118ce9b89d329e7964 + pristine_git_object: 64baf53b7d7757a35324c0b3b86544167f331b16 + src/mistralai/client/campaigns.py: + id: 9e64fcf4e60e + last_write_checksum: sha1:8d4471059539934a69b9fa1f98b4cf35f1db61ab + pristine_git_object: c9f28794e32130e6ef92127316815772c6a04c71 + src/mistralai/client/chat.py: + id: 7eba0f088d47 + last_write_checksum: sha1:e8b8b2e745117b6d78402148121c9f5229694066 + pristine_git_object: 9deff9a0d2091c706146eb903834a354c5432ec8 + src/mistralai/client/chat_completion_events.py: + id: 1813f339625b + last_write_checksum: sha1:785474540b9ddc3d3e9c7ec5011e2f25519bc8c2 + pristine_git_object: af4124f0c3e71e3f335f4c0b54d36a0b2dddcbb6 + src/mistralai/client/classifiers.py: + id: 26e773725732 + last_write_checksum: sha1:d057b735d057147e1341953dd696fbc7110611ec + pristine_git_object: ddb2d0b1abaff5f267320779bf9ae64d5ae0adf3 + src/mistralai/client/connectors.py: + id: 39da03126050 + last_write_checksum: sha1:16a6fe8ffbf14828b1b930d7dda7a001d4780ea4 + pristine_git_object: 793c9f8ae726f86fc82de044e8a09b6931bb2592 + src/mistralai/client/conversations.py: + id: 40692a878064 + last_write_checksum: sha1:501da7474cc0bc6fd627150f15870dd3acf70235 + pristine_git_object: a30f8b05f9735464ac53b612cdfe139e5469b8b4 + src/mistralai/client/datasets.py: + id: e5a6ae2a2d85 + last_write_checksum: sha1:fdd59e77aa9d19e64ab31cb949ea3565392c3113 + pristine_git_object: 437b42fdc5354378e822b38172bb5ee769355425 + src/mistralai/client/deployments.py: + id: a874b267fcb9 + last_write_checksum: sha1:5b62dd6436ce4914de7fbf0abc0819734eb08136 + pristine_git_object: 26e9c5658068de85878942b444538e0e58f706f5 + src/mistralai/client/documents.py: + id: bcc17286c31c + last_write_checksum: sha1:27beb1104b009c5237d37f11e11b589fadf3838b + pristine_git_object: 2a555d3e3d34afe673de231bd1fcadb8fc36b59b + src/mistralai/client/embeddings.py: + id: f9c17258207e + last_write_checksum: sha1:737e09a794867ea7242fb7c9e09cdff5f837fbf4 + pristine_git_object: 64337b4f3f56f084ed47a3f1f17a999a868db2c3 + src/mistralai/client/errors/__init__.py: + id: 0b2db51246df + last_write_checksum: sha1:0032f4eb3501c71fafb8f68113a8c80e677311a4 + pristine_git_object: f6fd99a097e71ec901f14f3c726a50f6351939de + src/mistralai/client/errors/httpvalidationerror.py: + id: ac3de4a52bb6 + last_write_checksum: sha1:73251adb99a07d11b56d0bc0399a2362ff9ccdba + pristine_git_object: 97b165629c39ab6e24406eb3f13970414b73f8f7 + src/mistralai/client/errors/mistralerror.py: + id: d1f57f0ff1e9 + last_write_checksum: sha1:30065cdd7003ec02cb3463d7c63229c4ff97503c + pristine_git_object: eb73040c5b5251018695204fde80eac914b35dae + src/mistralai/client/errors/no_response_error.py: + id: 8b469ecb0906 + last_write_checksum: sha1:0b3fdb1136472c41a4a739a5cbf9e2a4ce0c63a4 + pristine_git_object: d71dfa7b24146f1390ac6830e61acf337b99ca83 + src/mistralai/client/errors/observabilityerror.py: + id: 4946ae06717e + last_write_checksum: sha1:dc65670ba779ef19f015f65d133ec595ba002878 + pristine_git_object: a360bac4c0c6620e19d3b27f4de6d722b2d420c2 + src/mistralai/client/errors/responsevalidationerror.py: + id: 6cfaa3147abe + last_write_checksum: sha1:6862d178d4d1964bc03db47b76709aa406546981 + pristine_git_object: a7b3b9f0207846b5f176076b9f400e95cb08ebb9 + src/mistralai/client/errors/sdkerror.py: + id: c489ffe1e9ca + last_write_checksum: sha1:f708168e46c2960dd51896083aee75ccdb36f9dd + pristine_git_object: 25b87255a51021079f8ba5cc60b43509e12f9a4d + src/mistralai/client/events.py: + id: ac9b961cc70d + last_write_checksum: sha1:b250b6454555bb436cbc194e732c72982af23d94 + pristine_git_object: 3a4c47224be925a5701c88f9cf363e61bc1afd7f + src/mistralai/client/executions.py: + id: 974004d347a2 + last_write_checksum: sha1:bc0b48a037c85cc0411dc16f59da9481510c0469 + pristine_git_object: e4b9f90b0d985710715421cf68320a8dd0585a19 + src/mistralai/client/fields.py: + id: 862335210b20 + last_write_checksum: sha1:c200568ed4ad334849643bd85f19edc258877ff2 + pristine_git_object: 17441ca699fd8fb22701a0e59411d3ebd292f049 + src/mistralai/client/files.py: + id: f12df4b2ce43 + last_write_checksum: sha1:076c1f6435398d29491e1dcdaecab760e9f4a0a1 + pristine_git_object: e4549c75f5b5c21e8025383cce66737e0b1a96f6 + src/mistralai/client/fim.py: + id: 217bea5d701d + last_write_checksum: sha1:4fdaa4ccd058e700e510c63a5397e5c28fa4e923 + pristine_git_object: d25f79b193237ef5d3b55921837882c8dd9dd30f + src/mistralai/client/fine_tuning.py: + id: 5d5079bbd54e + last_write_checksum: sha1:fe1f774df4436cc9c2e54ed01a48db573eb813cd + pristine_git_object: df6bc5643a13294ddfbeecc6ae84d00cd7199bed + src/mistralai/client/fine_tuning_jobs.py: + id: fa1ea246e0b2 + last_write_checksum: sha1:18c53b380f2524d2dcca63ad014b1adb2dd682a0 + pristine_git_object: a6bf93a320939857513d85a8f5ecb1b5a47d8533 + src/mistralai/client/httpclient.py: + id: 3e46bde74327 + last_write_checksum: sha1:0f4ecc805be1dc3d6e0ca090f0feb7d988f6eb9d + pristine_git_object: 544af7f87d6b7097935290bebd08e30e5f485672 + src/mistralai/client/ingestion_pipeline_configurations.py: + id: f5a994272058 + last_write_checksum: sha1:b34f23cf74285c410c1258be40b37c2c3b652a73 + pristine_git_object: adef39f9953d4c6e59c1288c7e6deb2cdd75ad60 + src/mistralai/client/judges.py: + id: b6024a41ecb4 + last_write_checksum: sha1:a5c33a8bc46f6f3d435827a2a701016a428cc83c + pristine_git_object: 52c8899eb8c8ec092be454aca929012a62fec337 + src/mistralai/client/libraries.py: + id: d43a5f78045f + last_write_checksum: sha1:db5cab2f824979cfe953e31f465c30fa322a4cff + pristine_git_object: 928c1ea8a79f1f838a6ea4c7a23826f5bdb82445 + src/mistralai/client/metrics.py: + id: 937cb03f8130 + last_write_checksum: sha1:491be33059fb0bbccff73b2a3bb0a66fb7a5ba9b + pristine_git_object: 60597c40f00705b4758827fb7d119f33ae2ad1b9 + src/mistralai/client/models/__init__.py: + id: e0e8dad92725 + last_write_checksum: sha1:c072eedd54264d94cc39317fd40433adf40f6fa9 + pristine_git_object: ab36240c66a1da2d58318b7155af6a803e2e1e13 + src/mistralai/client/models/activitytaskcompletedattributesresponse.py: + id: 8174941767cc + last_write_checksum: sha1:b5246e203765ba0532a6a65d391bdd237ab2c891 + pristine_git_object: 8e355d48421982b9480d0ea50ce07de0aaba6e3b + src/mistralai/client/models/activitytaskcompletedresponse.py: + id: 28373f0a2c9e + last_write_checksum: sha1:93e29f246bdade11ed0bcd55e5781fe86d352f89 + pristine_git_object: b324066b94687faa020c9019721eedb2a1aa6998 + src/mistralai/client/models/activitytaskfailedattributes.py: + id: 12635cd17417 + last_write_checksum: sha1:d9f8dbbc30720e66e0d3da8046dbdc3a6a350198 + pristine_git_object: 37749d4a7fe8f6c3dfa007a2a6db3cf480761663 + src/mistralai/client/models/activitytaskfailedresponse.py: + id: b739e8fc9b44 + last_write_checksum: sha1:a4624cf0d6177e940004e180e1ed372d43cb3534 + pristine_git_object: 3410ea840d9c740ef8dd74cdee6abd9f2d6c9a6f + src/mistralai/client/models/activitytaskretryingattributes.py: + id: 9aaa9eecac09 + last_write_checksum: sha1:811a7631992abea7dbcabc4a33d43b135ca1c4ce + pristine_git_object: b0ee11d8ae7005e3c1fb7cb403602841632ad1c6 + src/mistralai/client/models/activitytaskretryingresponse.py: + id: 3a4ff1e01fa1 + last_write_checksum: sha1:770c9b60721c8ba1f60f193ec1c4f8ac10a4e075 + pristine_git_object: cf054a27d05dc1683275094a40336cc6f4164eb5 + src/mistralai/client/models/activitytaskstartedattributesresponse.py: + id: 3a365e2c2942 + last_write_checksum: sha1:e932c7960e78f8b31008efef29df7cc8ce3c4ce4 + pristine_git_object: 9a049150e26cf8fd89f5f85195cab961629c5402 + src/mistralai/client/models/activitytaskstartedresponse.py: + id: d01ef9cb3955 + last_write_checksum: sha1:1f1dda76127bdb08549b0dd94f68dafd1d6a71fc + pristine_git_object: 75186e027475280fefb1750beb1933bdac4d76cb + src/mistralai/client/models/agent.py: + id: 1336849c84fb + last_write_checksum: sha1:c650f57616b5455de2a6ff33c51f91b174586aee + pristine_git_object: 36cb26bfc19f17866330d709f82e15555b1a99e5 + src/mistralai/client/models/agentaliasresponse.py: + id: 3899a98a55dd + last_write_checksum: sha1:d7e12ea05431361ad0219f5c8dee11273cd60397 + pristine_git_object: 6972af2a4ae846e63d2c70b733ecd6c8370ee0cd + src/mistralai/client/models/agentconversation.py: + id: 1b7d73eddf51 + last_write_checksum: sha1:2619ac07a5b0642d5ea02b843bf38a7e32ec8cb1 + pristine_git_object: b52f5e5a96c497c731c19f32c6142ee50ed29367 + src/mistralai/client/models/agenthandoffdoneevent.py: + id: 82628bb5fcea + last_write_checksum: sha1:2c8fbb608143ee836e675a0d9610a64b7b8ac99a + pristine_git_object: ea9cd6b2a64e6add14bcf1f87dc5a15f800dde61 + src/mistralai/client/models/agenthandoffentry.py: + id: 5030bcaa3a07 + last_write_checksum: sha1:dbbadef3757f8949c63cc0bf91ac8e72a2e42abb + pristine_git_object: 8d1c143eac305c79da8ce4566b51b399da91585c + src/mistralai/client/models/agenthandoffstartedevent.py: + id: 2f6093d9b222 + last_write_checksum: sha1:b354f10f57b51aa515932ec403eba7034eaf9e9b + pristine_git_object: 9525bcf65ed318872e038078ec379f87794d6f84 + src/mistralai/client/models/agents_api_v1_agents_create_or_update_aliasop.py: + id: 23a832f8f175 + last_write_checksum: sha1:237d6b4419615c9c26f96d49760732bd7b4617e7 + pristine_git_object: 04761ae786c35e6fa6cd5a896a5e52458cb3a5d5 + src/mistralai/client/models/agents_api_v1_agents_delete_aliasop.py: + id: 9c9947e768d3 + last_write_checksum: sha1:385faebecef8479d1a72a7ab6f15ddcc611dad87 + pristine_git_object: 291a9802a7d49108fc0d428610cb4c37b42f0796 + src/mistralai/client/models/agents_api_v1_agents_deleteop.py: + id: 95adb6768908 + last_write_checksum: sha1:f222a61a73ba2f37051fffbf2d19b3b81197d998 + pristine_git_object: 5e41fdcdbf182e993acd71603ecb8c9a14e48043 + src/mistralai/client/models/agents_api_v1_agents_get_versionop.py: + id: ef9914284afb + last_write_checksum: sha1:c99ee098f659a56cb365c280cc29de441916b48a + pristine_git_object: 941863d0f8143020200bb5566ce66d527c4369c8 + src/mistralai/client/models/agents_api_v1_agents_getop.py: + id: f5918c34f1c7 + last_write_checksum: sha1:6a420e218b378015507acda1e8eb4de9fc865c06 + pristine_git_object: dee6a3475ff81f773f92f4473410639dacafd517 + src/mistralai/client/models/agents_api_v1_agents_list_version_aliasesop.py: + id: a04815e6c798 + last_write_checksum: sha1:b4b5c4e8566f1d0c68a14aba94b7ffea257fd7ce + pristine_git_object: bb1da6020386fabfbd606db9a098a0e9323ce3b0 + src/mistralai/client/models/agents_api_v1_agents_list_versionsop.py: + id: 19e3310c3907 + last_write_checksum: sha1:14f86d6a09a6c3ee8579ef5b3f7ecbf0aa467c40 + pristine_git_object: 25ea29e31693b6352f0ab395b4f21352e46ab037 + src/mistralai/client/models/agents_api_v1_agents_listop.py: + id: 25a6460a6e19 + last_write_checksum: sha1:ff64974c26700e1b32ad90f7b7b8917aef73d985 + pristine_git_object: 100e0da71927900c796e294c5e7438138faaf647 + src/mistralai/client/models/agents_api_v1_agents_update_versionop.py: + id: 63f61b8891bf + last_write_checksum: sha1:e9046cf75e008e856f00dda8725cbb16d83cd394 + pristine_git_object: 5ab821ea413d656dc7194f3588c8987c3e720831 + src/mistralai/client/models/agents_api_v1_agents_updateop.py: + id: bb55993c932d + last_write_checksum: sha1:bc922e15651d7bb33b841d9b3ae247843b6a5426 + pristine_git_object: 69da5001007916e458cab6caf8c10073c8fbc7d6 + src/mistralai/client/models/agents_api_v1_conversations_append_streamop.py: + id: ec00e0905f15 + last_write_checksum: sha1:d0a253c2f383241378e6fab35a38427d0a1dd827 + pristine_git_object: d257dc789cdc4f57bb91d1788335d2d49442d02f + src/mistralai/client/models/agents_api_v1_conversations_appendop.py: + id: 39c6125e850c + last_write_checksum: sha1:864ece4ddcd65075547daa1ab996ba7cfe9939fc + pristine_git_object: 61fec0834e6e05a56a7ee5c984fb0401f9c72f5c + src/mistralai/client/models/agents_api_v1_conversations_deleteop.py: + id: 0792e6abbdcb + last_write_checksum: sha1:9725fce86a52b4995a51e1995ca114c0c4b414df + pristine_git_object: 499645a77782e29db61e439060340fee787799c1 + src/mistralai/client/models/agents_api_v1_conversations_getop.py: + id: c530f2fc64d0 + last_write_checksum: sha1:241e5a07f37fa88f1e5011615b3e2b47a1aaf6a7 + pristine_git_object: 504616abbf0c9d0595f2aae81c59e52352cee323 + src/mistralai/client/models/agents_api_v1_conversations_historyop.py: + id: 2f5ca33768aa + last_write_checksum: sha1:fccc3e1a3f48eff31463829037a440be667a7da1 + pristine_git_object: ef0a4eb084de52d4bde435ee9751aaa12e61dcc3 + src/mistralai/client/models/agents_api_v1_conversations_listop.py: + id: 936e36181d36 + last_write_checksum: sha1:dc0da883d6e6d045dc85f74032c50d7ae0c19669 + pristine_git_object: dd6276d9ececa4fd28f179c58adfc5b71043db86 + src/mistralai/client/models/agents_api_v1_conversations_messagesop.py: + id: b5141764a708 + last_write_checksum: sha1:17fd503da7fb20198792c6e25f94dcc0a1e5db05 + pristine_git_object: 19978a194e2dd633fe89bcee7ceac177fcdd6629 + src/mistralai/client/models/agents_api_v1_conversations_restart_streamop.py: + id: c284a1711148 + last_write_checksum: sha1:2e462249c8ab71376c5f6179a2c033e254165f3e + pristine_git_object: 63c744498dfbdd254f2e780d90a680b10100ee63 + src/mistralai/client/models/agents_api_v1_conversations_restartop.py: + id: 3ba234e5a8fc + last_write_checksum: sha1:5dd06d300dbe8832b72d868657dc4c58f0ebaad5 + pristine_git_object: 3186d5df9000d4a62c0fbc64a601e6b709803deb + src/mistralai/client/models/agentscompletionrequest.py: + id: 3960bc4c545f + last_write_checksum: sha1:2f05e7029b2a283e82dd5744f333ced15b7519b9 + pristine_git_object: 55794ea2f7f27c8b2c1946fcee3fbc8887ce5f26 + src/mistralai/client/models/agentscompletionstreamrequest.py: + id: 1b73f90befc2 + last_write_checksum: sha1:0d00a288f9ca11bcbe75e8f826fb73d8a13d75a2 + pristine_git_object: 5d3bdecd4ff8c2330de59873edfc9a69973a1d58 + src/mistralai/client/models/annotations.py: + id: 3ae9e07de11d + last_write_checksum: sha1:c015e86fa53f60f6fccce2be63b2faf8a6d81f38 + pristine_git_object: f3f5c21c66dd570be71d8d87350ec7683478b545 + src/mistralai/client/models/apiendpoint.py: + id: 00b34ce0a24d + last_write_checksum: sha1:733e852bf75956acd2c72a23443627abfa090b7b + pristine_git_object: a6665c1076f05c28936510c24ee7d3498d7e7a24 + src/mistralai/client/models/apikeyauth.py: + id: f55510f5ff82 + last_write_checksum: sha1:995d3fcf007b0f10eea18bb6745478e7eeb6bce2 + pristine_git_object: 10cbaf589e2a4bc1e63b3a02689e76f4d7f1e88a + src/mistralai/client/models/archive_workflow_v1_workflows_workflow_identifier_archive_putop.py: + id: 0be575ead94b + last_write_checksum: sha1:1a28b0b1fc741af5fc2830363f6acbd713a9c0f0 + pristine_git_object: 8582aaf5a704186cd72f67487db55b90ffd081fd + src/mistralai/client/models/archivemodelresponse.py: + id: 2d22c644df64 + last_write_checksum: sha1:e55af09d03586d14e2a52292be9a0d6729f9e1e7 + pristine_git_object: c5ca8ff5d3a571bd8bc936eca1d361d09358b2f5 + src/mistralai/client/models/assistantmessage.py: + id: 2b49546e0742 + last_write_checksum: sha1:0610c5a58e3aa264ba77f603e75adce29ecbe3c7 + pristine_git_object: f333a44422c7f6114797b63f1faf94e2bc9ef90e + src/mistralai/client/models/audiochunk.py: + id: ce5dce4dced2 + last_write_checksum: sha1:d3c2e28583d661a9583c40c237430a1f63ea7631 + pristine_git_object: 68866cd2c3c640cf56258f2f98b8a2385ea6fcdb + src/mistralai/client/models/audiocontent.py: + id: 8e39736e73f0 + last_write_checksum: sha1:8ae8d3af5ba655b4766f8710c34c31d8401cc18a + pristine_git_object: 2d38d2a1479327156434a5338229f48d7fae7df6 + src/mistralai/client/models/audioencoding.py: + id: b14e6a50f730 + last_write_checksum: sha1:92ca06dce513cd39b2c7d9e5848cf426b40598ce + pristine_git_object: 67fec75d72845b8dda774c96767a0b233f269fe5 + src/mistralai/client/models/audioformat.py: + id: c8655712c218 + last_write_checksum: sha1:8ee7b564d106b601b6ad8a9321c27dfff421ce5e + pristine_git_object: fef87ae76b31128ebd5ced4278e274c249181c23 + src/mistralai/client/models/audiotranscriptionrequest.py: + id: e4148b4d23e7 + last_write_checksum: sha1:ab55d16773cdd9d536999537908d5bb70c642cd1 + pristine_git_object: 734860d52b12c11e007faf8ef5d1c233d2a183c6 + src/mistralai/client/models/audiotranscriptionrequeststream.py: + id: 33a07317a3b3 + last_write_checksum: sha1:c7e404caadd964924bb59372827f702acc7dd3f2 + pristine_git_object: 84c4dbcdf555b057190d53ac5a952b9b566ca3fc + src/mistralai/client/models/authdata.py: + id: b4d3fb07196e + last_write_checksum: sha1:70f8bbaa8d72e5684eb5cda5d95c0f17ed61a8f7 + pristine_git_object: fb8b79723f3f0f4485c0c6bb1c52b0a5db2fa1fe + src/mistralai/client/models/authenticationconfiguration.py: + id: 97b5056c29fb + last_write_checksum: sha1:95b12ce07e5656f40d1fcf4566af5336f5279cf3 + pristine_git_object: 84f665915ad716ce97cd9219f59ffa9cefc68bbd + src/mistralai/client/models/authurlresponse.py: + id: a2b468c87a8a + last_write_checksum: sha1:8ffc0c770c51d7b0cb49770e6829486d0cb82741 + pristine_git_object: 1f5a6639b3fae3a5c96cf35bc4417d5d5151a37f + src/mistralai/client/models/basefielddefinition.py: + id: ffa42818fea3 + last_write_checksum: sha1:daf1a595cf333e7ee53378849430e79aba1d253a + pristine_git_object: 2b45183d4d4727551377e12615d216dc8a64f62d + src/mistralai/client/models/basemodelcard.py: + id: 556ebdc33276 + last_write_checksum: sha1:1a1d261bad5394f01bbad562e8eee941014b7d9e + pristine_git_object: bb3c99ddb4495488b4e058cd32332808d6de08b9 + src/mistralai/client/models/basetaskstatus.py: + id: 7b381554d5c7 + last_write_checksum: sha1:8124cb3871ff7565865cd8b06181b5b0a8eb3428 + pristine_git_object: ff2f1c63a6dceceeabe6b8c6bc8bf1a7c64c70a0 + src/mistralai/client/models/batcherror.py: + id: 1563e2a576ec + last_write_checksum: sha1:3bb5b8a9f479b888efc37cf1ba9731e5efc3d8d0 + pristine_git_object: a0add5ad71b1732849fe89de72227e846b3e3b1b + src/mistralai/client/models/batchexecutionbody.py: + id: 6cfbee9c4ec7 + last_write_checksum: sha1:b59b61a0a9b3f678918d939448b9a95d07abde7b + pristine_git_object: 7d9895e5a7e8bfebc77c2a36cbe190dbbc7eb164 + src/mistralai/client/models/batchexecutionresponse.py: + id: 37e6d5d616fe + last_write_checksum: sha1:3118fd4f7196e446101b017ec77667a439da09f6 + pristine_git_object: a0c1f06e72e744cb74ad495d8a906c4723fcee0a + src/mistralai/client/models/batchexecutionresult.py: + id: ca6840204f22 + last_write_checksum: sha1:d8628b48ae4198b487312b70cc425dc810b0ea8c + pristine_git_object: ebe41e0110c69a856461fa033ce698cd324e2db0 + src/mistralai/client/models/batchjob.py: + id: 85cd28932cc7 + last_write_checksum: sha1:d9aab4f4058332de7f8e05ddc0719dbc9b054993 + pristine_git_object: 9cef43800cf382fe27d84fa958df493fe9624ea1 + src/mistralai/client/models/batchjobstatus.py: + id: 61e08cf5eea9 + last_write_checksum: sha1:78934183519948464385245cbc89efb68ac00bfb + pristine_git_object: bd77faa2fbed74b19a8d3884af6d43bc1b4806e0 + src/mistralai/client/models/batchrequest.py: + id: 6f36819eeb46 + last_write_checksum: sha1:f4ed16f0d2fef446bf1b4eb3023d4f38824ffe6d + pristine_git_object: dcc47bd25fd0b790677b3e175b3e62058c970327 + src/mistralai/client/models/blobresourcecontents.py: + id: fa924bc295ad + last_write_checksum: sha1:e624129b00144d82726a5a2ac5d3a809061b76ae + pristine_git_object: bfae16fb641bbe2c6dfa8c3aab1a042182d9137e + src/mistralai/client/models/builtinconnectors.py: + id: 2d276ce938dc + last_write_checksum: sha1:4ceb3182009b6535c07d652ccf46661b553b6272 + pristine_git_object: ecf60d3c1a83028d9cf755d4c9d5459f6b56e72a + src/mistralai/client/models/campaign.py: + id: c91d862fb405 + last_write_checksum: sha1:770d93cc4d9b8e23ea781592888be5b811533f21 + pristine_git_object: 62427fa0336eab3448064fc1a7a02427d44e309b + src/mistralai/client/models/cancel_workflow_execution_v1_workflows_executions_execution_id_cancel_postop.py: + id: e26fc5a228af + last_write_checksum: sha1:cc7b1b2bb13a1ee8f88f5a485c3f4c7ef7e32875 + pristine_git_object: 8ba7176cb0213275c463d39fe8fc3ad9b9e5a0ad + src/mistralai/client/models/chatclassificationrequest.py: + id: afd9cdc71834 + last_write_checksum: sha1:a29088359142ebd6409f45569168b2096014119e + pristine_git_object: cf2aa78af3ffc747d557422b83551075b83e601d + src/mistralai/client/models/chatcompletionchoice.py: + id: 7e6a512f6a04 + last_write_checksum: sha1:1ca89c543a5a01368910a35bb2381c4340fdd2e7 + pristine_git_object: ab8f331f35e80425590a13948bdab8cadcb4d394 + src/mistralai/client/models/chatcompletionevent.py: + id: d85484d0205e + last_write_checksum: sha1:065c475704210d080294d1e8585f423127f18b38 + pristine_git_object: bcd6757fde74639463848d39102dfbdb76d09dbb + src/mistralai/client/models/chatcompletioneventpreview.py: + id: 1cd843828e99 + last_write_checksum: sha1:25eeed82742f43de7e13337c4d9313e9710fde58 + pristine_git_object: 40985f844c72814bc23d3ed1f6869fcf33fb19c2 + src/mistralai/client/models/chatcompletionrequest.py: + id: 9979805d8c38 + last_write_checksum: sha1:3211124d52b666c680a614d9c99bf8f4a80af273 + pristine_git_object: ee168c18d6427a745fce5a639c60ce2ae82024b9 + src/mistralai/client/models/chatcompletionresponse.py: + id: 669d996b8e82 + last_write_checksum: sha1:97f164fea881127ac82303e637b6a270e200ac5b + pristine_git_object: 7092bbc18425091d111ec998b33edc009ff0931b + src/mistralai/client/models/chatcompletionstreamrequest.py: + id: 18cb2b2415d4 + last_write_checksum: sha1:59663f3b3bd4a17253208e73025a3857e7c9de32 + pristine_git_object: f6ad6a3610ddd57857b3f1019dfde13d8e8e42bc + src/mistralai/client/models/chatmoderationrequest.py: + id: 057aecb07275 + last_write_checksum: sha1:7677494c0e36ccbc201384cb587abeb852a1a924 + pristine_git_object: 228e7d26b8b172c3e11f01d4f260bf6e5195b318 + src/mistralai/client/models/chattranscriptionevent.py: + id: 8ca679b2c39a + last_write_checksum: sha1:b49bd47918ea1f954f3c789c8ea0579ec893c49f + pristine_git_object: b23adf744944631e00f376c3dadf6f17a24a7df0 + src/mistralai/client/models/checkpoint.py: + id: 1a530d3674d8 + last_write_checksum: sha1:418f08c61b64fa7ffb053c6f5912e211acab1330 + pristine_git_object: c24e433eb4787146620fb48b6d301f51a4db5067 + src/mistralai/client/models/classificationrequest.py: + id: 6942fe3de24a + last_write_checksum: sha1:8b6f78592b6fe5c5a0e686f54ad1f99d3fdb78c5 + pristine_git_object: 4300f9ad559f6a2d87c726fd5f0b82d83e643481 + src/mistralai/client/models/classificationresponse.py: + id: eaf279db1109 + last_write_checksum: sha1:64522aa2b0970e86a0133348411592f95163f374 + pristine_git_object: d2f09f430c4bca39ea9e5423b7d604ea4016fc70 + src/mistralai/client/models/classificationtargetresult.py: + id: 2445f12b2a57 + last_write_checksum: sha1:2b8b9aeadee3b8ffe21efd1e0c842f9094c4ecc7 + pristine_git_object: 6c7d6231d211977332100112900ea0f8cdf5d84c + src/mistralai/client/models/classifierfinetunedmodel.py: + id: 5a9a7a0153c8 + last_write_checksum: sha1:bfd6ffd8323a7b62199c84e64077b26b4c9c72d5 + pristine_git_object: 35d557aa6c122efe7fd300233f5837e69302fc33 + src/mistralai/client/models/classifierfinetuningjob.py: + id: a244d5f2afc5 + last_write_checksum: sha1:70194835716d3499c0ba695e978f095eaeba9556 + pristine_git_object: 05de88c794b3ada262a9de2386d3107fd6f86ee6 + src/mistralai/client/models/classifierfinetuningjobdetails.py: + id: 75c5dee8df2e + last_write_checksum: sha1:d48adf952a85493d565a039bd0e67e34b479df24 + pristine_git_object: 98cdc81022ed2250535f59abbb348cf1237564f8 + src/mistralai/client/models/classifiertarget.py: + id: 2177d51d9dcf + last_write_checksum: sha1:ea159e369ba3dcaada53eec102ec37234fa14670 + pristine_git_object: bfd5646e92aa5ed41f5ac13787a6200896b3d37e + src/mistralai/client/models/classifiertargetresult.py: + id: 19c343844888 + last_write_checksum: sha1:3f5b37de3585cb38a3e41f0ee49dc4b5a33bf925 + pristine_git_object: 8ce7c0ca167b38ebaf1e5fc6393ab56d9f142cfa + src/mistralai/client/models/classifiertrainingparameters.py: + id: 4000b05e3b8d + last_write_checksum: sha1:1d639da446bf3e2df7576f4320b0d0e2dbdfff8d + pristine_git_object: 5d1d1f8f3adad438f83619f61e3e396aa3b65d15 + src/mistralai/client/models/codeinterpretertool.py: + id: 950cd8f4ad49 + last_write_checksum: sha1:248d6e6c1906303f03eb4f29429227a7d39679a2 + pristine_git_object: 4cf9d055c3aaee426d99071180ae6de21eb648cf + src/mistralai/client/models/completionargs.py: + id: 3db008bcddca + last_write_checksum: sha1:1c9918b8b9631471dcee25f6608c026770810a2f + pristine_git_object: 57e4840a14602ab11b4018810aae5bc5772a1e5c + src/mistralai/client/models/completionargsstop.py: + id: 5f339214501d + last_write_checksum: sha1:744878976d33423327ea257defeff62073dad920 + pristine_git_object: 39c858e66380044e11d3c7fd705334d130f39dea + src/mistralai/client/models/completionchunk.py: + id: d786b44926f4 + last_write_checksum: sha1:df78fa0e2374a4f39d8cc0489109a0b7eaf85ce5 + pristine_git_object: 27029b6f08ab42842022f04ddeebbf90154751da + src/mistralai/client/models/completionevent.py: + id: c68817e7e190 + last_write_checksum: sha1:dc43ac751e4e9d9006b548e4374a5ec44729eea4 + pristine_git_object: 3b90ab0c1ecac12f90e0ae3946a6b61410247e4f + src/mistralai/client/models/completionfinetunedmodel.py: + id: f08c10d149f5 + last_write_checksum: sha1:da9ba4911148929c202368ec95f5a5bd55f6da21 + pristine_git_object: 9b420ed73a496a0bfd0309422992178332ec6b48 + src/mistralai/client/models/completionfinetuningjob.py: + id: c242237efe9b + last_write_checksum: sha1:36f1d95e323f90b723ab0d96854d526cdf972e73 + pristine_git_object: ff94ed5fdb46a1d6b33d68412601eb09b0771400 + src/mistralai/client/models/completionfinetuningjobdetails.py: + id: e8379265af48 + last_write_checksum: sha1:2179c2fd436674da7dd6968630b1f833e71fdb82 + pristine_git_object: 490982cd8aa74f2379c48a27c0dc4605d19cf823 + src/mistralai/client/models/completionresponsestreamchoice.py: + id: 5969a6bc07f3 + last_write_checksum: sha1:4a1cd9adf6558faf84f873313210e9ae448c287b + pristine_git_object: ef1a106bdbde4eba5de9342a9418413daa08c0da + src/mistralai/client/models/completiontrainingparameters.py: + id: be202ea0d5a6 + last_write_checksum: sha1:fe9420a42d598d1a6ae15ff0d35bbfad4f56e7b8 + pristine_git_object: 3b99a69322ac18cfda3df0d4726d218063092ae0 + src/mistralai/client/models/connectioncredentials.py: + id: 2f4a79b452fb + last_write_checksum: sha1:2183abeb08ce54a985d531baac5f67b84f42417d + pristine_git_object: de461057f967b4dbd746cc82321fbed4afbdf145 + src/mistralai/client/models/connector.py: + id: 1a4facac922d + last_write_checksum: sha1:dc5989fda6b4a5f49e2e5febae8ebf8ddfc5b33a + pristine_git_object: 9d8b600032db4f260a96140433bce3f7e4c21f3a + src/mistralai/client/models/connector_call_tool_v1op.py: + id: 7948899b3068 + last_write_checksum: sha1:c4388ac1594641c36f97daaedcf42b0e94753be7 + pristine_git_object: 9c77123e18a86efaa7c0055e0c2a1a7226e7ffd9 + src/mistralai/client/models/connector_create_or_update_organization_credentials_v1op.py: + id: 57c711e81d89 + last_write_checksum: sha1:19d272c21834d9273aae754bd821fa5f252c24e5 + pristine_git_object: f66d73d3822fee42507625e5ba1b1ba75c4fda4e + src/mistralai/client/models/connector_create_or_update_user_credentials_v1op.py: + id: 6ededc839b03 + last_write_checksum: sha1:26b00ed504ad3dea28e1ef521bc6ca3d23763211 + pristine_git_object: 338d4f3923cb85adccf725f24235bd6b94d26075 + src/mistralai/client/models/connector_create_or_update_workspace_credentials_v1op.py: + id: 7795b085704b + last_write_checksum: sha1:70bffd65c359d4c295b0f4a419d5a783d50e03ea + pristine_git_object: 43b3c1dc6576d9d9260a220097f52b51029e205a + src/mistralai/client/models/connector_delete_organization_credentials_v1op.py: + id: aab3a70dbbc5 + last_write_checksum: sha1:a53123b18f8dd5a33e777741ab44aac0d5ed64ee + pristine_git_object: 6cdb0c31f9a3d13ee87336fafe85865da6cfcf7e + src/mistralai/client/models/connector_delete_user_credentials_v1op.py: + id: 8bf2075ebdbf + last_write_checksum: sha1:9fbbc77385a362f9a03f9fdd6110d7e77854d16f + pristine_git_object: 40d25aabfd4c0e2c980782afa6cc5c059441045e + src/mistralai/client/models/connector_delete_v1op.py: + id: a377930b1435 + last_write_checksum: sha1:2c9a501ab2e2b05829f2e3fd838f88a610d56781 + pristine_git_object: 74134361aeeaf83af57d7edc7d9ae26ab09d96fb + src/mistralai/client/models/connector_delete_workspace_credentials_v1op.py: + id: 4f0993c25ece + last_write_checksum: sha1:d928043c07daf8e170649473bd6cb36b1c928805 + pristine_git_object: a746ff5e09af76bf2aa4135b5fc675c816a8941f + src/mistralai/client/models/connector_get_auth_url_v1op.py: + id: 2e6b9ab43d1d + last_write_checksum: sha1:ad08ab3776eb111a5feac74d06a98c6b7bd9d9d5 + pristine_git_object: 10f42827ca82eb227fc760e1edb806438b745a15 + src/mistralai/client/models/connector_get_authentication_methods_v1op.py: + id: 6861e4d57959 + last_write_checksum: sha1:8114ef46326cfcdadbbcc73fdcdc9ab52f3d8e0d + pristine_git_object: e0c4146d4621eec51f6961f85de95088e7480c08 + src/mistralai/client/models/connector_get_v1op.py: + id: 73ca3a446dcc + last_write_checksum: sha1:74ce85c377be5d7f86506d8a8d97249708c246b8 + pristine_git_object: 780afac9281bf78c4263c7bd32faa04a718695d2 + src/mistralai/client/models/connector_list_organization_credentials_v1op.py: + id: a52ee058feab + last_write_checksum: sha1:2abf099d7a6ea68134d38c3a95dfec08d37e9ed9 + pristine_git_object: 6b37773fb3e7b1b0e999a342709599797d64c558 + src/mistralai/client/models/connector_list_tools_v1op.py: + id: 4c6ad704479b + last_write_checksum: sha1:8af274c0304af97a649137075b4fea4acadeb434 + pristine_git_object: 3e9905c30d02fef3e73689b2e8968462dc4b36fa + src/mistralai/client/models/connector_list_user_credentials_v1op.py: + id: 106e8fba762d + last_write_checksum: sha1:35c2b9e14c552a6525c7d1baf1bdea509284e939 + pristine_git_object: 5434a2833038b37e0c944330569a3fa0eb295160 + src/mistralai/client/models/connector_list_v1op.py: + id: 5ec0889995f5 + last_write_checksum: sha1:17c0a5965d058a4aacb891d37db3481a907ff091 + pristine_git_object: 3cb31bf7fe0b814606b4bbdfbf7e5cbf733984bf + src/mistralai/client/models/connector_list_workspace_credentials_v1op.py: + id: de7c431e8a54 + last_write_checksum: sha1:01b9e654b460634000b4975323311dae56c983d4 + pristine_git_object: c610c4c8b4f8c3561c389eb5092023d86ee4767d + src/mistralai/client/models/connector_update_v1op.py: + id: 6f884d18ac56 + last_write_checksum: sha1:be8044958ac76ecfc486dc5cb5f0876e595dcc38 + pristine_git_object: 6b00d0b0ca6d83b4ac1fce1ab204ac09ca5ceeb5 + src/mistralai/client/models/connectorauthenticationheader.py: + id: 7271f22f39b0 + last_write_checksum: sha1:0811c183ba11289f038860270ccf622ca51b0a6a + pristine_git_object: 5fc073f040c9fae143383077747e5fad8799a2e7 + src/mistralai/client/models/connectorcalltoolrequest.py: + id: 7dc7ec295301 + last_write_checksum: sha1:8af4bd44caa8ad09180139e7e8a68052c16dce11 + pristine_git_object: 85366bb6acaa0724a907803c689a2caeb431bf7b + src/mistralai/client/models/connectorsqueryfilters.py: + id: 3b9fc81aa726 + last_write_checksum: sha1:399567eb362a40f1225f7d8adb820aabc6b9df99 + pristine_git_object: f10d689771d50077bc35193a39a94672a9f09ac2 + src/mistralai/client/models/connectortool.py: + id: 41ca596b44f8 + last_write_checksum: sha1:0306b9a607d59afe042aac018df6e2bc0cff0d8a + pristine_git_object: e8a036c7800ad7db3cdad18f4a61c9c3b8d050b8 + src/mistralai/client/models/connectortoolcallmetadata.py: + id: 2d27189e58e6 + last_write_checksum: sha1:da057b97e36ab7b49f863ab92e1c20ccbf81fb45 + pristine_git_object: 0280eae009cd4fa8b91923f31bd607d74ce7f753 + src/mistralai/client/models/connectortoolcallresponse.py: + id: c4f7a932bd2e + last_write_checksum: sha1:453f0382ecf925c483a6071130c61eb7b7326ee4 + pristine_git_object: 76abe558e5c558db157d743a6e90ef7c26038680 + src/mistralai/client/models/connectortoollocale.py: + id: 247ebe411537 + last_write_checksum: sha1:e68370e4bcf2a1f5f2f9036416fc889821668244 + pristine_git_object: ec1359c8ccf883bff066fd1500503f5e28913e05 + src/mistralai/client/models/connectortoolresultmetadata.py: + id: 86730e16aa67 + last_write_checksum: sha1:fae6e84b040a1c8bcb25b94041f990525529472a + pristine_git_object: 8c92f2f8d4c25eac7f3c95e0ae425942829390d0 + src/mistralai/client/models/contentchunk.py: + id: c007f5ee0325 + last_write_checksum: sha1:b921b03b4c1e300b0e3f51ea9eadd4d7c4b7a0ea + pristine_git_object: e3de7591a089a3739af17108cecdc2d4240f10bf + src/mistralai/client/models/conversationappendrequest.py: + id: 81ce529e0865 + last_write_checksum: sha1:1180d6092dc70b5c919529694623e7c5c2f8f470 + pristine_git_object: 6d310816dfe569850207a701a5ce84853702f8d1 + src/mistralai/client/models/conversationappendstreamrequest.py: + id: 27ada745e6ad + last_write_checksum: sha1:7a5ac0f3f0e255d2ebf2005a9dc931b0fc8d4320 + pristine_git_object: b65f1e82f38099aad5f2a113a784ac706adbd8be + src/mistralai/client/models/conversationevents.py: + id: 8c8b08d853f6 + last_write_checksum: sha1:2eedde1ecf31061fb13de0b1bdc9ea311897b570 + pristine_git_object: 17812983f3aee3e675d44f46ca1b741315c2139a + src/mistralai/client/models/conversationhistory.py: + id: 60a51ff1682b + last_write_checksum: sha1:661d135eb6614a54ffbeb7d63320311821f9f23b + pristine_git_object: 2e812bb8b2945db91e534d74265482ce914a8975 + src/mistralai/client/models/conversationinputs.py: + id: 711b769f2c40 + last_write_checksum: sha1:5fc688af61d6a49ede9c9709069f3db79f4dc615 + pristine_git_object: 7ce3ffc3772926a259d714b13bfc4ee4e518f8f7 + src/mistralai/client/models/conversationmessages.py: + id: 011c39501c26 + last_write_checksum: sha1:83adcc316ff46085a7b02a4ce54b3cee7a848937 + pristine_git_object: a7e13c712fa0ac250929efdc10303ea7fd26c37d + src/mistralai/client/models/conversationpayload.py: + id: 4581218c84c1 + last_write_checksum: sha1:51c3787091d7d2a09a0625d854a74db3c46d6a1a + pristine_git_object: 6bfc5894b329531c7845d0457209a0d5c35c0145 + src/mistralai/client/models/conversationrequest.py: + id: 58e3ae67f149 + last_write_checksum: sha1:5d64abb831437c60c7e88a7dce2e08d03174ee1e + pristine_git_object: 94fcb03bb392ff4a369e0dfaa524644d611d2c49 + src/mistralai/client/models/conversationresponse.py: + id: ad7a8472c7bf + last_write_checksum: sha1:cd45eec534ccd27052d9809f8aafedeee243d9f9 + pristine_git_object: 64437b23c7ff4cd50010e970832bed3567ae4bf0 + src/mistralai/client/models/conversationrestartrequest.py: + id: 681d90d50514 + last_write_checksum: sha1:edc3713fa0be297da7c622f60775db3c617ab221 + pristine_git_object: b6b03f1faa89d72e4a4b3682f47692f301cfed9c + src/mistralai/client/models/conversationrestartstreamrequest.py: + id: 521c2b5bfb2b + last_write_checksum: sha1:6fd47c92114693010c6014af6e2a347091985a87 + pristine_git_object: 41b7098f7086b41089432b183df664fb7539bfc1 + src/mistralai/client/models/conversationsource.py: + id: 24d6a0861d4b + last_write_checksum: sha1:e28921788ab1b6d2b6daf08b714bf34b2047eb6c + pristine_git_object: a3b93b61b842002fc9fbb05815b800fb1294cb52 + src/mistralai/client/models/conversationstreamrequest.py: + id: 58d633507527 + last_write_checksum: sha1:17f643578f395a5b4605710402f115eb25cae8b3 + pristine_git_object: a1afb2679b5c1e97995b78bbf2572cec489d28c5 + src/mistralai/client/models/conversationusageinfo.py: + id: 6685e3b50b50 + last_write_checksum: sha1:ee993afc39cece27caf99ee60258f45980d86cbc + pristine_git_object: e717284f15a4f3c88768f96d98007b95aa2b7922 + src/mistralai/client/models/create_dataset_record_v1_observability_datasets_dataset_id_records_postop.py: + id: 1ddc53a46c74 + last_write_checksum: sha1:5df5b6676f6c115da0b1c242a6f3cc7f8c077927 + pristine_git_object: 03156fa31f51655dfd9bda21082710b1d1f42907 + src/mistralai/client/models/createagentrequest.py: + id: 442629bd914b + last_write_checksum: sha1:da0d93f32efd9db292a83ccb8c0d18c02dbbb7ee + pristine_git_object: b434619d8c161f74453e2546986e24ea802269e8 + src/mistralai/client/models/createbatchjobrequest.py: + id: 56e24cd24e98 + last_write_checksum: sha1:8f3af5306ce986bde39b315e19947d1f21cfe0e1 + pristine_git_object: c74c13815aae904b0b8da9c864edbf41d891cc6a + src/mistralai/client/models/createcampaignrequest.py: + id: 60012b559aee + last_write_checksum: sha1:b45a2ee90bf901bec844aa20e9184ca1afba4172 + pristine_git_object: b3957df9ef369ecc1746ee3efd1b463bc10b4be7 + src/mistralai/client/models/createconnectorrequest.py: + id: 3da192d6491a + last_write_checksum: sha1:21ab6824e52ffb3bd2f97a97b4521188d6725f02 + pristine_git_object: 18060ca33206509d6443e306b8e505c9698ea9c6 + src/mistralai/client/models/createdatasetrecordrequest.py: + id: 9455e38a8c31 + last_write_checksum: sha1:df3e8d7425500f23101c25267738e617eeb2d467 + pristine_git_object: 6fd2bf96a28dceb4096d4e9bebe51495ef7a2103 + src/mistralai/client/models/createdatasetrequest.py: + id: 046a094d3ef9 + last_write_checksum: sha1:5c38317b544af6ca66fb895c627634d160bc3975 + pristine_git_object: ecffc52a82e3e0baca00cf94de047ff5124e3a04 + src/mistralai/client/models/createfileresponse.py: + id: fea5e4832dcc + last_write_checksum: sha1:e0a0abb33411e145285db9d36c207812bf8f0587 + pristine_git_object: bafefc372e35f21c38e45b0055610f19e7efad44 + src/mistralai/client/models/createfinetuningjobrequest.py: + id: c60d2a45d66b + last_write_checksum: sha1:b89555bb4f30da8a31708140731c2d97964ec784 + pristine_git_object: 1f9c1e153eb75c4484021099f27a5364568e6250 + src/mistralai/client/models/creategithubrepositoryrequest.py: + id: 0814afcf63bb + last_write_checksum: sha1:a69ba08cf88aedc6c478cc8083cdd33d4f0ca815 + pristine_git_object: a3f6cd61bec7eab9f734906b6ef1758525fd2d06 + src/mistralai/client/models/createingestionpipelineconfigurationrequest.py: + id: 480f219c27e5 + last_write_checksum: sha1:1cb2730b7d0c680c180eff4b285242bb198d29bc + pristine_git_object: 068c8db95da3561ae993c5d780c54bdbbdba29c7 + src/mistralai/client/models/createjudgerequest.py: + id: e606837a626e + last_write_checksum: sha1:d5c16104089075af1b8b2fe922006aea9d74b0e3 + pristine_git_object: 7c30aa5ffde4e23ce9ebcb0d67a0e1a3c875c698 + src/mistralai/client/models/createlibraryrequest.py: + id: 1c489bec2f53 + last_write_checksum: sha1:0d98f058dc61560790d2bde49026dd631845218b + pristine_git_object: e0357e9252a4911292e5dce370c808350b6da0ec + src/mistralai/client/models/credentialscreateorupdate.py: + id: 9927546f2487 + last_write_checksum: sha1:e31d3c7fc19e2a7fb49d07cb6f85c5ea73aabb98 + pristine_git_object: 0766a4d3226231936feb478187cf0de3a7af7d47 + src/mistralai/client/models/credentialsresponse.py: + id: 80cc6fb316f9 + last_write_checksum: sha1:f5dc920dbfba507188ddfa8a1ba964ab8b5ba755 + pristine_git_object: 5cf9a198ece228642c0147d218ddd6be39825fd4 + src/mistralai/client/models/customconnector.py: + id: 14f3643f7703 + last_write_checksum: sha1:2162c7e4b3a9c747c5da88e72315d138f28dea5d + pristine_git_object: f3a1e2ffb1a29e8798a2ac8c9c636ac3bada7413 + src/mistralai/client/models/customtaskcanceledattributes.py: + id: c20b8be67b8c + last_write_checksum: sha1:94e8aa92de645553991a5a0940aee90c19a6adc1 + pristine_git_object: cea2137e5356e636b44a3b1107aa9e29a69fd504 + src/mistralai/client/models/customtaskcanceledresponse.py: + id: 0eeb9d6cf409 + last_write_checksum: sha1:99a1b1ce86f1636abd7f00e746d183cbe8e5c665 + pristine_git_object: 7873b3ca5fdb61c6c4d1205894727cd09e8d939d + src/mistralai/client/models/customtaskcompletedattributesresponse.py: + id: 0b9fb891f354 + last_write_checksum: sha1:f5053cec4e78eaa7b83df2c7e6d7f9f66cd35933 + pristine_git_object: afd48d7660446f5daa52b7358934227bb3761e87 + src/mistralai/client/models/customtaskcompletedresponse.py: + id: 719b68571f4c + last_write_checksum: sha1:4d8b84868e4d94be8ca9190e29dc8dbf37c442fe + pristine_git_object: 5d2a8686342100c46426bc1212868129e54835bd + src/mistralai/client/models/customtaskfailedattributes.py: + id: ff33698df363 + last_write_checksum: sha1:dbbd423357a0d653ba20e94737126e9919bf2ff9 + pristine_git_object: b66d7d3c973307e23a73f45a1e654e375f55140c + src/mistralai/client/models/customtaskfailedresponse.py: + id: 1cde7920833f + last_write_checksum: sha1:faa16c185064c28a2c58a4ac9ece342fdf4e1d52 + pristine_git_object: 1f9835ec2cd05a55d2f545b23a223b0039609805 + src/mistralai/client/models/customtaskinprogressattributesresponse.py: + id: 895147a1a6a8 + last_write_checksum: sha1:67a5a511f40f83c678f591a2f6e9be632e5c622b + pristine_git_object: 45ee5e4244bd011c0a271f4429abb72f41fe92b3 + src/mistralai/client/models/customtaskinprogressresponse.py: + id: 9d012ecb7626 + last_write_checksum: sha1:ed0824ea2641df6e5284030f0906ee4d14ce7bde + pristine_git_object: 33c126f716d9b63fef593498a2442bfa1637d5dc + src/mistralai/client/models/customtaskstartedattributesresponse.py: + id: 6b8946c77018 + last_write_checksum: sha1:5902afbf5696150caae710ef55a4c5b5f8b2ed1a + pristine_git_object: 4f53ae8a35f590ab4bd2fd5e5ab63e44ea449cc1 + src/mistralai/client/models/customtaskstartedresponse.py: + id: 02b330a5292e + last_write_checksum: sha1:676b985755499c4691c1ac615d04fb35481d9a0f + pristine_git_object: 59d11fa8319c601ad80482944e6e3aef55257a66 + src/mistralai/client/models/customtasktimedoutattributes.py: + id: 9cc865098add + last_write_checksum: sha1:229037a374553cf8523d2c0e0f0aa017adb8790b + pristine_git_object: 47517ab1924cfce787805e9a528b04b1d4766a19 + src/mistralai/client/models/customtasktimedoutresponse.py: + id: 2dbbc78b85d1 + last_write_checksum: sha1:da1f0487cccc52c38a8132124efe085d3eeb334f + pristine_git_object: 7f274a535271c9e62974eedde427e3df577d6e2e + src/mistralai/client/models/dataset.py: + id: cbf14670ee00 + last_write_checksum: sha1:012f85ebfbdb286436621efc3b5b1adb150871f3 + pristine_git_object: 08ce979e19eb6b852a0a565b38c5b8d4f25ba35c + src/mistralai/client/models/datasetimporttask.py: + id: c20f7db9633c + last_write_checksum: sha1:0a1c92ca0b498fa04d5fac1d3857937d616a8b38 + pristine_git_object: e8d90f126fdeb041bb2cbce9709481c6174c6662 + src/mistralai/client/models/datasetpreview.py: + id: 128c29db3f37 + last_write_checksum: sha1:5bd20ac7c1b179bd30489cf869ce9e71fd48c135 + pristine_git_object: 90676245b258a6c4217a730fb8b59a336e830afb + src/mistralai/client/models/datasetrecord.py: + id: 87ddebf2a0ce + last_write_checksum: sha1:399243f84e7f6488b7994cedc2db565d21c087d8 + pristine_git_object: 39c92cce7ee7f42878703c7983ebfe1c964e1d4e + src/mistralai/client/models/delete_campaign_v1_observability_campaigns_campaign_id_deleteop.py: + id: 3d1cd35fecc6 + last_write_checksum: sha1:276676f082fa84f14ab74502302d32361277d4c8 + pristine_git_object: f33a3747bcc06b8131e178ea86fa5256e2f156a5 + src/mistralai/client/models/delete_dataset_record_v1_observability_dataset_records_dataset_record_id_deleteop.py: + id: 66b2054bda8c + last_write_checksum: sha1:06f6736ce3d02ea899edc1e90b2f1e6af053a9bf + pristine_git_object: ffeefca659a79f77480655bc960cb8c74dc4899d + src/mistralai/client/models/delete_dataset_v1_observability_datasets_dataset_id_deleteop.py: + id: 446419cd07d2 + last_write_checksum: sha1:fc4e716afa0920b4c07fb9bf90c69c3e50a3f958 + pristine_git_object: af8697706726676862d2b27317b64ebd52510282 + src/mistralai/client/models/delete_judge_v1_observability_judges_judge_id_deleteop.py: + id: 415724e139bd + last_write_checksum: sha1:0fc88a1a4edefd593e8b2d6f18bdd77383142209 + pristine_git_object: c2f7b79701af71ecf95839c1037e50776469ea41 + src/mistralai/client/models/delete_model_v1_models_model_id_deleteop.py: + id: 767aba526e43 + last_write_checksum: sha1:73568f2f450bf9c23aca3649372a92e1b9a2fc54 + pristine_git_object: 199614f53501f34088cb112d6fe1114e1e588d8a + src/mistralai/client/models/delete_voice_v1_audio_voices_voice_id_deleteop.py: + id: a84ce12a8251 + last_write_checksum: sha1:4c0a37f3516ff7198dfe13c0ed04fa4cf48b35fb + pristine_git_object: 3ce383648b1de95099b59b1f4c015a595f24060b + src/mistralai/client/models/deletebatchjobresponse.py: + id: 79a43aab6cf9 + last_write_checksum: sha1:9d4916ba4733e777f745c54dd20e71a6a8f4fdd7 + pristine_git_object: 958f0c4f4dbd989b9a95f0c8d52a279c1d448f0e + src/mistralai/client/models/deletedatasetrecordsrequest.py: + id: e7ef16596e54 + last_write_checksum: sha1:971e81be9064277df5dd656e912b9f319474e742 + pristine_git_object: 8c33a9634f99fcf30475545c9af175434b5f41cf + src/mistralai/client/models/deletefileresponse.py: + id: 3ee464763a32 + last_write_checksum: sha1:2c0df66fc8c4384d50e54ac03577da3da2997cf5 + pristine_git_object: ffd0e0d015e38e5f6113da036ebeba98441444f4 + src/mistralai/client/models/deletemodelresponse.py: + id: 8957175b7482 + last_write_checksum: sha1:f5cef2da79834be2cbd72c4bd37c94aa4ef5abb2 + pristine_git_object: 1e65e08f881d1c57b8ea61c7db5551be964b47f6 + src/mistralai/client/models/deltamessage.py: + id: 68f53d67a140 + last_write_checksum: sha1:5653c52c448643feab36e03ba2c73b602438149f + pristine_git_object: f0ca3282d3d26bbdcf9382063b14c185c3758faa + src/mistralai/client/models/deploymentdetailresponse.py: + id: 7f4a17a1c7ca + last_write_checksum: sha1:bd85744b2412a60be5a1411f28c633e05d5fb2b1 + pristine_git_object: 6bf228123c95132e64239ea6a3aaecf8bdde4b68 + src/mistralai/client/models/deploymentlistresponse.py: + id: 1f0b404ba621 + last_write_checksum: sha1:abf42a7e10930c6fa908aece4903f5464f88aef2 + pristine_git_object: 7926cde725d80b9055401de46ab947c98e8c5a3e + src/mistralai/client/models/deploymentlocation.py: + id: c62839f1466c + last_write_checksum: sha1:a67cf8983cf1bf9c5790a22a5b9b8ed6d5c51fab + pristine_git_object: 52ce79939cd52cb071d7f532b2b4ea8ab4f4976f + src/mistralai/client/models/deploymentresponse.py: + id: ea15ddd64402 + last_write_checksum: sha1:fe377892fc9125736a2e35ea402654b9c0100e3b + pristine_git_object: 0e31684900b6e1cad1a7399cefc0d0a83eaae0f9 + src/mistralai/client/models/deploymentworkerresponse.py: + id: b11a9947bd19 + last_write_checksum: sha1:cf27528873306d9137f08c82c87fa99b44ed5fc5 + pristine_git_object: 2955dc485bbf1017a728cb0562baf948083e1b13 + src/mistralai/client/models/document.py: + id: fbbf7428328c + last_write_checksum: sha1:bc290f10562aaf9c24bd14ab3d2a31e62f535042 + pristine_git_object: 8d1aea883e579ff1677949573f43dddc362bd35d + src/mistralai/client/models/documentlibrarytool.py: + id: 3eb3c218f457 + last_write_checksum: sha1:a84295aba7b9e7f70b68f279934d1a5ca0817f77 + pristine_git_object: 29f8d64a695342489d81bfe20ec2f8de60546ddd + src/mistralai/client/models/documenttextcontent.py: + id: e730005e44cb + last_write_checksum: sha1:c86f4b15e8fda1cd5c173da01462342cd22b7286 + pristine_git_object: b6904cb4267347b62a457a01b91a391500326da9 + src/mistralai/client/models/documenturlchunk.py: + id: 4309807f6048 + last_write_checksum: sha1:f45ecef78fb4412dc76ce54478fe536df0259048 + pristine_git_object: f7a99ff81ee01d256052920405ca4788d3a47f75 + src/mistralai/client/models/embeddedresource.py: + id: 94a23f656f72 + last_write_checksum: sha1:50375363269d68edd3ea1c0a31ba08c8bf9bd160 + pristine_git_object: e16fedf8362a19e55e7bfc6c273000f3446fe3ac + src/mistralai/client/models/embeddingdtype.py: + id: 77f9526a78df + last_write_checksum: sha1:a4e2ce6d00e6d1db287a5d9f4254b0947227f337 + pristine_git_object: 732c4ebe3678563ebcdbafd519f93317261586fb + src/mistralai/client/models/embeddingrequest.py: + id: eadbe3f9040c + last_write_checksum: sha1:00e4499575e7a8a4a5e879174b7f25a0f522fd8c + pristine_git_object: 2ef747d8ba91f824f0ad117d21c5a8487cc7ea80 + src/mistralai/client/models/embeddingresponse.py: + id: f7d790e84b65 + last_write_checksum: sha1:9bb53a5a860c8e10d4d504648d84da73068c0a83 + pristine_git_object: 6ffd68941f32f396998df9dded14ff8365926608 + src/mistralai/client/models/embeddingresponsedata.py: + id: 6d6ead6f3803 + last_write_checksum: sha1:b0daee4bd21a441a2e8e47cf8ca8be32d2179869 + pristine_git_object: 03b23a7cba53c27ef02f3bc025f38f10d7b98e2d + src/mistralai/client/models/encodedpayloadoptions.py: + id: 97955ebc2eb9 + last_write_checksum: sha1:d6acbb9cd0a962a9ae91da84cf10c7f066ede245 + pristine_git_object: cc19b54359640f2af7a058f179a459cc2d70c539 + src/mistralai/client/models/encodingformat.py: + id: b51ec296cc92 + last_write_checksum: sha1:ea907f86b00323d99df37f7ff45d582aace798e7 + pristine_git_object: 4a39d0295f9069ae9f749cf21dab450eaf145d19 + src/mistralai/client/models/entitytype.py: + id: 62d6a6a13288 + last_write_checksum: sha1:015e2db9e8e5a3e4ce58442ccedaf86c66239dde + pristine_git_object: 56d82cbed237f32a8b00cfee4042dfe3e7053bcb + src/mistralai/client/models/event.py: + id: e5a68ac2dd57 + last_write_checksum: sha1:0711bc7d48998b1c01e7708e29ae5889f9bea7bc + pristine_git_object: 01157dfab89756ecfb587722270ef3cef8722807 + src/mistralai/client/models/eventprogressstatus.py: + id: 48623263df72 + last_write_checksum: sha1:e2fd3c6e145e07d247c1ec41adf67996c86696ba + pristine_git_object: 6fde1c3913c670a60d3eead5ba0d27f77a281799 + src/mistralai/client/models/eventsource.py: + id: 8b926028b7b2 + last_write_checksum: sha1:435ed061780a6e971cd120b2dc40467c0ecc90b3 + pristine_git_object: 1959cdec5d3970a27f7ad2d0d5844ebdd02fefd6 + src/mistralai/client/models/eventtype.py: + id: f70686df1fa5 + last_write_checksum: sha1:a9f66d0772a83a6f83968d7a6a4877ddcf5e4728 + pristine_git_object: a85321b2603057de07d343b380e86476f1b70adb + src/mistralai/client/models/execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop.py: + id: 3e2249825144 + last_write_checksum: sha1:d177be670203df65ed11fb73210d4a5afed1a566 + pristine_git_object: 2e79ef25f7117584df49c6f1f925a3386360d49b + src/mistralai/client/models/execute_workflow_v1_workflows_workflow_identifier_execute_postop.py: + id: 5da876c66fc5 + last_write_checksum: sha1:2a474dbbbd10132f2530e3f09d6a5a87ec9e4aa1 + pristine_git_object: bd9496a2d969927634c9cea1c294c9d26fc3a87b + src/mistralai/client/models/executionconfig.py: + id: 14518c40a13b + last_write_checksum: sha1:351fb4a74622cb70969b728ac65b62ca670fc7e5 + pristine_git_object: 56b58ae369ffb75c9556ef20af79b985fe3db710 + src/mistralai/client/models/export_dataset_to_jsonl_v1_observability_datasets_dataset_id_exports_to_jsonl_getop.py: + id: 74f5f3183b64 + last_write_checksum: sha1:8d7dde90d9c55b520aa9300a25c843a0b866638b + pristine_git_object: 07b4e58fe2a7065e1f61e571355a7e6997abcb56 + src/mistralai/client/models/exportdatasetresponse.py: + id: 22cc29d258db + last_write_checksum: sha1:83a787b852101f1862f0aabc1638f68753b5d607 + pristine_git_object: f1600cac74e1d50979277d3eb6830ea5e84b69ec + src/mistralai/client/models/failure.py: + id: 596e38493eaa + last_write_checksum: sha1:5077e5660c7192e2123fc26059f1786f9d75e273 + pristine_git_object: 85ca77a5713f0fc3d51c5c7fdaa3f06066ac4dbc + src/mistralai/client/models/feedresultchatcompletioneventpreview.py: + id: 19109368b436 + last_write_checksum: sha1:2dfbc8aa7110a57f892ad80002cc01bc4c94589d + pristine_git_object: bf248758026549d8e2395895dfb18eccf96cc31c + src/mistralai/client/models/fetchcampaignstatusresponse.py: + id: b74b57603a4c + last_write_checksum: sha1:62b1fd7d42f79518e15abdb07b11cac817837e1e + pristine_git_object: 6004892e377a9852e406bf911bd91afe891ea7b3 + src/mistralai/client/models/fetchchatcompletionfieldoptionsresponse.py: + id: 2191cab4638b + last_write_checksum: sha1:32526d8625f46e27b57f28483652f7d1a38f26f6 + pristine_git_object: 92c29e22eb942fc756d1926e7ed1b01582903f5c + src/mistralai/client/models/fetchfieldoptioncountsrequest.py: + id: 2fd8caa0697d + last_write_checksum: sha1:e9b547f04bf87e5d6863bec706b96ff2d732512c + pristine_git_object: e310f6603d1a602c56da30a1e3a9971586a078c9 + src/mistralai/client/models/fetchfieldoptioncountsresponse.py: + id: 16ce9431fc7b + last_write_checksum: sha1:a633398597cb0ccf0c3e36aca8566f679b527850 + pristine_git_object: 4c9f9d0f4027655c4a9e496321314241b6949296 + src/mistralai/client/models/fieldgroup.py: + id: 201353e45f89 + last_write_checksum: sha1:58c9c30558556e8b5f24f8b342d55e998d6154d9 + pristine_git_object: 07f9e7c7bb798338a593e59c737398b3595574e1 + src/mistralai/client/models/fieldoptioncountitem.py: + id: 5b707a343930 + last_write_checksum: sha1:20f2d847c42591c222d06ac5fce04d75ad9d90d8 + pristine_git_object: 0b50c148c524f59fbc02d2b22ee961dc4f7a2d6f + src/mistralai/client/models/file.py: + id: f972c39edfcf + last_write_checksum: sha1:bfcb027361112e24202716f02804699bc1dc5de0 + pristine_git_object: 528bc13a60e1ca006a54e1a9b20087651d10d470 + src/mistralai/client/models/filechunk.py: + id: ff3c2d33ab1e + last_write_checksum: sha1:dc247ef441b0436a1444322bca312be8bfc8ded2 + pristine_git_object: 6c9c8b0e5772d51465f69950b55dd0ecc22be3b2 + src/mistralai/client/models/filepurpose.py: + id: a11e7f9f2d45 + last_write_checksum: sha1:8b167c02f9f33e32d5fd1c6de894693924f4d940 + pristine_git_object: 49a5568ff82ad4a85e15c8de911e8d6c98dcd396 + src/mistralai/client/models/files_api_routes_delete_fileop.py: + id: 2f385cc6138f + last_write_checksum: sha1:ccfd3ff64635cfd511f49c5e02a6f1860c479966 + pristine_git_object: eaba274b9dd94d6cf729325316b3e3e9b3834566 + src/mistralai/client/models/files_api_routes_download_fileop.py: + id: 8184ee3577c3 + last_write_checksum: sha1:81058ede2a5eb333b54561f99ed7878082c0f411 + pristine_git_object: 83de8e73a3d50917e4a41bb92a828a10e646a632 + src/mistralai/client/models/files_api_routes_get_signed_urlop.py: + id: 0a1a18c6431e + last_write_checksum: sha1:46c5a0babdc6df693c03355f22131ff8d847389c + pristine_git_object: c381244b5d819e48ca7d1ad5064726fd6627cfd1 + src/mistralai/client/models/files_api_routes_list_filesop.py: + id: b2e92f2a29b4 + last_write_checksum: sha1:18f318488f01a9a919c8650ee1f5eb825c39c91d + pristine_git_object: e18eaa6a509344303c81599ac19ce2aa8e741060 + src/mistralai/client/models/files_api_routes_retrieve_fileop.py: + id: 5d5dbb8d5f7a + last_write_checksum: sha1:d451d8d2b32f412158a074919cca1a72f79940cb + pristine_git_object: 5f8de05f1bba07517dc2ee33a4f05122503b54b5 + src/mistralai/client/models/files_api_routes_upload_fileop.py: + id: f13b84de6fa7 + last_write_checksum: sha1:9f48f3a8ca29457de8d1109bca2e98985963f286 + pristine_git_object: 25efcff2ade46c116ddc622a3c5796c2b95e039f + src/mistralai/client/models/fileschema.py: + id: 19cde41ca32a + last_write_checksum: sha1:c559713ad8602bc8f4a73268758f9a010a7fe8f1 + pristine_git_object: ce64a16bb54c33024580619fb15443f25473df8c + src/mistralai/client/models/filevisibility.py: + id: 11a670fa3b71 + last_write_checksum: sha1:8d44761845eea1d9bb239864863fc058e7c09bf2 + pristine_git_object: 56cfe8810059e7fcb0eae8f50dcdc1f91e2db157 + src/mistralai/client/models/filtercondition.py: + id: ba62f90873c5 + last_write_checksum: sha1:f8a602ea82374e57ba80e3e1ad1eff572dcf2936 + pristine_git_object: fe62d6ddc1187e1177ac834a85bd4e1b6a86ee52 + src/mistralai/client/models/filtergroup.py: + id: dbc0c34fbc2f + last_write_checksum: sha1:f900312cfcea2b2a341d83e95ca2fce3e467fa03 + pristine_git_object: 4e9815b7387904b071645a9a4682a4ffbf23d488 + src/mistralai/client/models/filterpayload.py: + id: 56757b849f7a + last_write_checksum: sha1:1d9a513f9c5a33c5ae249fb4926dd70eeb5e02e5 + pristine_git_object: ced355f16abe74ce87d1770cebe761d0b26c35bc + src/mistralai/client/models/fimcompletionrequest.py: + id: cf3558adc3ab + last_write_checksum: sha1:ce9f8fa0775c9208ce5a393fdfc9439aabc2bdab + pristine_git_object: 65d132eac878cdb5e025ab34a149f832a6dc5ffe + src/mistralai/client/models/fimcompletionresponse.py: + id: b860d2ba771e + last_write_checksum: sha1:dffd5a7005999340f57eaa94e17b2c82ddc7fd90 + pristine_git_object: 1345a116b7855ab4b824cf0369c0a5281e44ea97 + src/mistralai/client/models/fimcompletionstreamrequest.py: + id: 1d1ee09f1913 + last_write_checksum: sha1:68ca7eac3aeb3c8b35d9769201111aa078f32bc9 + pristine_git_object: dc7ede38dc81ac74d2e21a7e1de2fffe11295836 + src/mistralai/client/models/finetuneablemodeltype.py: + id: 05e097395df3 + last_write_checksum: sha1:daf4cd1869da582981023dea1074268da071e16a + pristine_git_object: 7b924bd7abc596f0607a513eee30e98cbf7ab57a + src/mistralai/client/models/finetunedmodelcapabilities.py: + id: 475c805eab95 + last_write_checksum: sha1:91f720f910b01109b6216aa7de1b3f76d04108c9 + pristine_git_object: b9ad2f9e62486e5f54bc801ab547377114ca3f5c + src/mistralai/client/models/ftclassifierlossfunction.py: + id: d21e2a36ab1f + last_write_checksum: sha1:ca90e2f1cd0b9054293bea304be0867c93f7fac2 + pristine_git_object: ccb0f21b5a69f91119bec9db6e9f3d876e4c35af + src/mistralai/client/models/ftmodelcard.py: + id: c4f15eed2ca2 + last_write_checksum: sha1:1c3ab1bda3fa9e2df33b47a49d5e9b9e2d82a701 + pristine_git_object: bb7c52c881ceadccdeb3590104e774f3d2ad94d7 + src/mistralai/client/models/function.py: + id: 32275a9d8fee + last_write_checksum: sha1:c01c1ed54b3086859cde0dd3c3c466c78d8323ae + pristine_git_object: 8a3267e8b4b3fc78e64c46a0c05f7f9822bd3e3f + src/mistralai/client/models/functioncall.py: + id: 393fca552632 + last_write_checksum: sha1:6e96e9abaa9b7625a9a30e376c31b596ee9defcb + pristine_git_object: 527c3ad408e1e1ccfe6301a8860e7f751e1d312d + src/mistralai/client/models/functioncallentry.py: + id: cd058446c0aa + last_write_checksum: sha1:209dc38d13e7cab489dc99ecd2f400b259847ad2 + pristine_git_object: a88d87ab553d42a244cda26946dc10c44da3031a + src/mistralai/client/models/functioncallentryarguments.py: + id: 3df3767a7b93 + last_write_checksum: sha1:9858feba8f7f01017f10477a77dec851a1d06e55 + pristine_git_object: afe81b24e131a8ef879ee7f140271aa762b8ed2f + src/mistralai/client/models/functioncallevent.py: + id: 23b120b8f122 + last_write_checksum: sha1:57469e759f6d9100ca09e607a9687a4f59043bb0 + pristine_git_object: 6e3c0715818bf78d7cd90ab3cf1106aa5d31640f + src/mistralai/client/models/functionname.py: + id: 000acafdb0c0 + last_write_checksum: sha1:4145b7b817b712b85dcbedb309416c7ba72d827e + pristine_git_object: 07d98a0e65ccbcba330fb39c7f23e26d3ffc833c + src/mistralai/client/models/functionresultentry.py: + id: 213df39bd5e6 + last_write_checksum: sha1:ec72ed10d5170484643db846ac32df5e3263ca4e + pristine_git_object: 115765225e6b0f1c166b7b9c89a41fade1ba90e6 + src/mistralai/client/models/functiontool.py: + id: 2e9ef5800117 + last_write_checksum: sha1:bce744d77a3dac92d4776a37be497311674bdc7d + pristine_git_object: eae872643c85115a825c2feda11d9a6c12a06b99 + src/mistralai/client/models/get_campaign_by_id_v1_observability_campaigns_campaign_id_getop.py: + id: "288520184035" + last_write_checksum: sha1:ba2f5a6ef8e1f7a2e859f014510ea4fffe4fd7ea + pristine_git_object: a8446737ead106f400900bc6b73d57db306bb47f + src/mistralai/client/models/get_campaign_selected_events_v1_observability_campaigns_campaign_id_selected_events_getop.py: + id: 270800e2c264 + last_write_checksum: sha1:080172a6bc5bdadf2a6cbdb2ad91f8fe49b4a6f2 + pristine_git_object: 9db415bff26597d2ebd8544f39b86e15ac244cff + src/mistralai/client/models/get_campaign_status_by_id_v1_observability_campaigns_campaign_id_status_getop.py: + id: 853a43ee6b98 + last_write_checksum: sha1:9e3fd0b27e1ff30e596fb2a81b0770cb6afbcf39 + pristine_git_object: 57ac44905fd7db69e96533092c6d6e8bbe0eb083 + src/mistralai/client/models/get_campaigns_v1_observability_campaigns_getop.py: + id: 598a7340fc98 + last_write_checksum: sha1:e439c5269ea0a59311a3e8ddc514836364744a35 + pristine_git_object: 4ff0c3075443875ffe8c0e13aa3f7bb6fb45d4c6 + src/mistralai/client/models/get_chat_completion_event_v1_observability_chat_completion_events_event_id_getop.py: + id: 98aff68bc7c7 + last_write_checksum: sha1:dcdfebf2d374e5bbaa61e34c985d100b4a736581 + pristine_git_object: f39b0f562ee8a75e611f6ad2929c43c83c230e99 + src/mistralai/client/models/get_chat_completion_events_v1_observability_chat_completion_events_search_postop.py: + id: 36957d0f73aa + last_write_checksum: sha1:9761398171c914a2b602c65e5e9a0beb69156aef + pristine_git_object: b4af68e0e0fee80dc3cde41e8e8324d6807e1b39 + ? src/mistralai/client/models/get_chat_completion_field_options_counts_v1_observability_chat_completion_fields_field_name_options_counts_postop.py + : id: 0b1bd06b24af + last_write_checksum: sha1:e3489181ee8230c478e5785e93c4f5270950fd33 + pristine_git_object: f579260de403280d3768115d185d60090203a721 + ? src/mistralai/client/models/get_chat_completion_field_options_v1_observability_chat_completion_fields_field_name_options_getop.py + : id: 4fb7f3c0e51b + last_write_checksum: sha1:534ea0a18c71be6c04c64817c4e2029e6a8b83a8 + pristine_git_object: c044bb92fbc871852bb358ade46f1157d01b7e65 + src/mistralai/client/models/get_dataset_by_id_v1_observability_datasets_dataset_id_getop.py: + id: cfd3282e7f33 + last_write_checksum: sha1:5f3de85d18b2cbd085a01946ac1c193d41e1ab71 + pristine_git_object: 0259485d3d2d36f1042d3807abf38f4b122b9b5e + src/mistralai/client/models/get_dataset_import_task_v1_observability_datasets_dataset_id_tasks_task_id_getop.py: + id: b45f77cb328c + last_write_checksum: sha1:70df627813ed0c25aa8d4d2d51a3861b942a014c + pristine_git_object: cf900d0e4ef6eff4114c5e7737d03d0ab0e07d6f + src/mistralai/client/models/get_dataset_import_tasks_v1_observability_datasets_dataset_id_tasks_getop.py: + id: 07ece48f664d + last_write_checksum: sha1:9156ce8891f5b9c0775f633316644afcf8984e6a + pristine_git_object: 8213c023c3d47e38d6f3cf14cf985e267529c600 + src/mistralai/client/models/get_dataset_record_v1_observability_dataset_records_dataset_record_id_getop.py: + id: 6ea6a0dab32f + last_write_checksum: sha1:8a8027a201a49fa1fe6717a1dbae4a6c242b8dbe + pristine_git_object: 0cb239dfd04d98488b8ce7ee143bb3cc589326e8 + src/mistralai/client/models/get_dataset_records_v1_observability_datasets_dataset_id_records_getop.py: + id: 77967c965aea + last_write_checksum: sha1:831414ebd99ed826562864b2819fbe35180b6e50 + pristine_git_object: ed1778235ce208110598a165c5afc9fbfc1a20aa + src/mistralai/client/models/get_datasets_v1_observability_datasets_getop.py: + id: 3e4f4e2447ac + last_write_checksum: sha1:c58e1c3e04892b5bfcadeec7c640c37c8d3da017 + pristine_git_object: 1d79f2d59fc1d0f38c66d85cf266bc9700087c37 + src/mistralai/client/models/get_deployment_v1_workflows_deployments_name_getop.py: + id: 3fae92e2573a + last_write_checksum: sha1:2257627743f50ff58107762a69aae40ef5528214 + pristine_git_object: 1f699bed56b6a40166274492d7b2ca4ff84a8f61 + src/mistralai/client/models/get_judge_by_id_v1_observability_judges_judge_id_getop.py: + id: 4201c3c5a891 + last_write_checksum: sha1:44c9a7d21ea727e0f849cfc5dc4a02220bcf6e74 + pristine_git_object: 375db2e9b8ff839f6ec3bdfdf06de9b7a24fbe7c + src/mistralai/client/models/get_judges_v1_observability_judges_getop.py: + id: fa04e3db7781 + last_write_checksum: sha1:d59740c9021cd891db4b81a7f4c6aeeecb9d6958 + pristine_git_object: b5d0980e197c19eaa70ac26f3b118a8e60364e3e + src/mistralai/client/models/get_run_history_v1_workflows_runs_run_id_history_getop.py: + id: 9d566ab77998 + last_write_checksum: sha1:d75b0ea41941a0d1a0b748cf5181a976ecba068f + pristine_git_object: e297367919706bb21f8950aa38f21be4fd67eb2c + src/mistralai/client/models/get_run_v1_workflows_runs_run_id_getop.py: + id: 60463c59ff01 + last_write_checksum: sha1:a851312a3e0c91273ad444c6e2cc81c8c541c9cd + pristine_git_object: d9b6758f1622c76ad41092f4dbb9c6cf392b299c + ? src/mistralai/client/models/get_similar_chat_completion_events_v1_observability_chat_completion_events_event_id_similar_events_getop.py + : id: d651bdc06c1b + last_write_checksum: sha1:25331ac322d230cb7d9fc2a6aff2d7db561fdf2f + pristine_git_object: 7689415dd70da6eec8d0b416cbf020c4b9adeecf + src/mistralai/client/models/get_stream_events_v1_workflows_events_stream_getop.py: + id: 8dd6ce0e8d66 + last_write_checksum: sha1:021765a807c5b127c3bfabbf227e952e10f5be88 + pristine_git_object: 442a7a940b03c27b173281626d612b650a1ade2d + src/mistralai/client/models/get_voice_sample_audio_v1_audio_voices_voice_id_sample_getop.py: + id: a5838063aee4 + last_write_checksum: sha1:457e62a76bd229aecf1725c5f813de63e35d8b7e + pristine_git_object: 5d4cbbfd8e3e30fe2e24d1a9f6f624a7480487f1 + src/mistralai/client/models/get_voice_v1_audio_voices_voice_id_getop.py: + id: b6ca849d5005 + last_write_checksum: sha1:ef189175dacf5a9be4295782eebfead3f40ce137 + pristine_git_object: bd81442ec3758ba0833ce8d3ad54fbc803748bc5 + src/mistralai/client/models/get_workflow_events_v1_workflows_events_list_getop.py: + id: 9d6d093835d6 + last_write_checksum: sha1:143b69eded03282526de2164ca95f51915be6a10 + pristine_git_object: 186c55486ef2f9ba01b4c5ace5b91a416b0a6bcb + src/mistralai/client/models/get_workflow_execution_history_v1_workflows_executions_execution_id_history_getop.py: + id: 8d636c8cad1e + last_write_checksum: sha1:783549db97e2001b739d807715242c8428c4d922 + pristine_git_object: c71a23052cd42092941951cf0157734253535e0a + src/mistralai/client/models/get_workflow_execution_trace_eventsop.py: + id: 75438195bf19 + last_write_checksum: sha1:3fc47c8b7c301c1029f6a10e30298d8bc776d140 + pristine_git_object: a60fb536b9e4dd1ab8a2256d1cc28235752c34f2 + src/mistralai/client/models/get_workflow_execution_trace_otelop.py: + id: f24457d6ea21 + last_write_checksum: sha1:33ddf619eb30b950d5e2120b432a8dc1b3acb10a + pristine_git_object: 0abdd75fc1650a95aee925ec26bfd1af8a6e2632 + src/mistralai/client/models/get_workflow_execution_trace_summaryop.py: + id: e44e62e3c444 + last_write_checksum: sha1:818f5bd1151bd77c9c200f2799e352ae5eab73ab + pristine_git_object: 54b080e0b03bd406c805874666e81ee32967bc76 + src/mistralai/client/models/get_workflow_execution_v1_workflows_executions_execution_id_getop.py: + id: 25bc5d3fec8d + last_write_checksum: sha1:e7145925a38e3e33c9615e61a880e222eac8a20b + pristine_git_object: c99260545f162e2a93c50d26b9a6a07c102e80c8 + src/mistralai/client/models/get_workflow_metrics_v1_workflows_workflow_name_metrics_getop.py: + id: 449550c7f76a + last_write_checksum: sha1:93b1174df5a303444fe0d99c881ddec4cac6c788 + pristine_git_object: 1d9c8989416bf2090476f3ad839c1ad011e522b7 + src/mistralai/client/models/get_workflow_registration_v1_workflows_registrations_workflow_registration_id_getop.py: + id: a6b7d0f559ef + last_write_checksum: sha1:881422f47653ae2962f935b039a9c77d347c7b7f + pristine_git_object: fe7d639da434356114d8cd5829c0d3fffa776515 + src/mistralai/client/models/get_workflow_registrations_v1_workflows_registrations_getop.py: + id: 822f256b2372 + last_write_checksum: sha1:7d816703621bc0539d3e167b3e811175edf82bec + pristine_git_object: d8cc7f6e1ff24c85ad6a86bd87c6071d1741d461 + src/mistralai/client/models/get_workflow_v1_workflows_workflow_identifier_getop.py: + id: 097af37374fd + last_write_checksum: sha1:962b823e10fb6cc838ecf2b02b0cc284252ee908 + pristine_git_object: 20d0b6dd4e74c9c39a8b95cb9f9ec590d146574f + src/mistralai/client/models/get_workflows_v1_workflows_getop.py: + id: a128585aee76 + last_write_checksum: sha1:bd3043f5808b7713f36ed1866a992c9a7ad567aa + pristine_git_object: 38ca4d72f95339ca39224c2b3d5e8a2e43dbc420 + src/mistralai/client/models/getfileresponse.py: + id: 81919086e371 + last_write_checksum: sha1:a116c2fdef65748b5015804fc0eb9860fd2bc3b2 + pristine_git_object: 37c29bbb41ab44aa6d42ea7e7f094d52a210a5a8 + src/mistralai/client/models/getsignedurlresponse.py: + id: cee4e4197372 + last_write_checksum: sha1:ab9adbc06e7f02e791dc549ad1850ce1b1a250a7 + pristine_git_object: 4ba95894f2b89719fa58e7e397c28014dbd00316 + src/mistralai/client/models/githubrepository.py: + id: 4bc83ce18378 + last_write_checksum: sha1:4c1358be59e667394757b01a5eeebb4b5ce134f4 + pristine_git_object: 4ec88aa827f1d813e4a01ed2f382b2d02a19dc3e + src/mistralai/client/models/guardrailconfig.py: + id: c72b74412547 + last_write_checksum: sha1:1688b51dafa47d23ff048e88975b21f24932f6c0 + pristine_git_object: d152ec36741bb8302b0d4f72563e534ed7768cb6 + src/mistralai/client/models/imagecontent.py: + id: 3abe7faee278 + last_write_checksum: sha1:c0057cab50e78c45069bab3cbec065ab3dbbb50c + pristine_git_object: e6363daa7442b2f0b48bb99ceab76bff08680550 + src/mistralai/client/models/imagedetail.py: + id: c1084b549abb + last_write_checksum: sha1:375db5c8fa87712dc37e46d0bf72283ae6cd6400 + pristine_git_object: 1982d357277a92fc7ebea3b99146116596d99c78 + src/mistralai/client/models/imagegenerationtool.py: + id: e1532275faa0 + last_write_checksum: sha1:0fcb9fdeffe252c88497f02164f7e753bea40ff1 + pristine_git_object: 0dd4a4d2a4671bb310410eb17bb85032638d817c + src/mistralai/client/models/imageurl.py: + id: e4bbf5881fbf + last_write_checksum: sha1:a3e5c91291a5fcc24bda8fc1c96a2608965edae5 + pristine_git_object: 32efa67ba4a33ac90c1a16c153ef480e35d1bb67 + src/mistralai/client/models/imageurlchunk.py: + id: 746fde62f637 + last_write_checksum: sha1:84122edbb655e6fb252dc37abbb14cdd59d8a488 + pristine_git_object: 55a2023ef775f06d586a50ac98e129950ef55d5d + src/mistralai/client/models/importdatasetfromcampaignrequest.py: + id: ee475b85bfc7 + last_write_checksum: sha1:34367bb23d1528b87e67f36d06cc362a05a02c6b + pristine_git_object: 5db45e8ea9a0e431eb1cb28638e2f4c2342a37f6 + src/mistralai/client/models/importdatasetfromdatasetrequest.py: + id: 77aea4882ccb + last_write_checksum: sha1:89fe7ea38a0b073ec539c88dc6b0865f28caeb15 + pristine_git_object: ebf2a649f3b00f4472bd9db0c65cc1a53140cf49 + src/mistralai/client/models/importdatasetfromexplorerrequest.py: + id: 852a3cbc1631 + last_write_checksum: sha1:ee8f1a1d6ebb5b450a00e37724a9d497da22fe10 + pristine_git_object: 85df7af6a855581a03bd745105e8f8134e66aee4 + src/mistralai/client/models/importdatasetfromfilerequest.py: + id: b2882fa57029 + last_write_checksum: sha1:fb867b50ff6d9a8ab14ec32592c951f834854d32 + pristine_git_object: 9a4867765aab522a33f3846a9e2bf0162270c916 + src/mistralai/client/models/importdatasetfromplaygroundrequest.py: + id: 8d809b14b144 + last_write_checksum: sha1:3c858d0475e826d072c96a84d868e97593a399a3 + pristine_git_object: f5bd720db16c37504e1993cc6e651712551d2612 + src/mistralai/client/models/ingestionpipelineconfiguration.py: + id: b4746c0f2c1c + last_write_checksum: sha1:f256b78196bde2b5bf39f15ed65b1daba784680a + pristine_git_object: 5289c66d7097548dc5d434f639eaefe2ceb7e504 + src/mistralai/client/models/inputentries.py: + id: 44727997dacb + last_write_checksum: sha1:9e2a776be59c5043ea4179a60ac082faf064cc3d + pristine_git_object: e2da5a80aea121d18e2232f302ad73f63b4fc050 + src/mistralai/client/models/inputs.py: + id: 84a8007518c7 + last_write_checksum: sha1:d067587b5395529fbd638741f20b80edb2848e39 + pristine_git_object: 9ecd7f484ea306b91a9ebf038a0addd80ccd57c4 + src/mistralai/client/models/instructrequest.py: + id: 6d3ad9f896c7 + last_write_checksum: sha1:b56a77442b50b50151adedaa5ec356dc96c56428 + pristine_git_object: e5f9cccf174d8e73c42e8ee4aa294b43e1ad6cf5 + src/mistralai/client/models/jobmetadata.py: + id: cfbdde7fc0a2 + last_write_checksum: sha1:7048bbb5be8434a39170b428f9211a0455d32dd5 + pristine_git_object: deddb4e1f8e0bd85b5a122e2dbd523c6a458b9b4 + src/mistralai/client/models/jobs_api_routes_batch_cancel_batch_jobop.py: + id: b56cb6c17c95 + last_write_checksum: sha1:21b5794f110c53691654d7195201f9a4b7793f21 + pristine_git_object: de2e63472ac53809cfeae200bd7d2f3dcbb70034 + src/mistralai/client/models/jobs_api_routes_batch_delete_batch_jobop.py: + id: 8c43af108342 + last_write_checksum: sha1:06244690f3de161dc1ba5648070b0212cb2c38d7 + pristine_git_object: 9fc4a7e77cd756b47cdd1a0c4817cd458fd6a68a + src/mistralai/client/models/jobs_api_routes_batch_get_batch_jobop.py: + id: 36b5a6b3ceee + last_write_checksum: sha1:449dc131e1514edb32107ae1c699544732b313fb + pristine_git_object: 683da4af5412e7da90a4af83864c40dc53a9ed77 + src/mistralai/client/models/jobs_api_routes_batch_get_batch_jobsop.py: + id: d8f0af99c94d + last_write_checksum: sha1:04082f4aa3dcf94708c1fab8c3114e690959d6d1 + pristine_git_object: e5869656d9666768dcbfd53883ed6706304fd565 + src/mistralai/client/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py: + id: 34f89d2af0ec + last_write_checksum: sha1:3d5242f757ee9be10963af9cd5d47824fc83c71a + pristine_git_object: 9fa99837dda7e9413d3a05822cd17107c5fae51d + src/mistralai/client/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py: + id: d175c6e32ecb + last_write_checksum: sha1:515b7737cf8262243ee6175e297714125f3962bc + pristine_git_object: 56fa534044522f27fb26ef4820d10f22752134ea + src/mistralai/client/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py: + id: 81651291187a + last_write_checksum: sha1:19a0707e2f73b0184959d7c710a170650fa1767a + pristine_git_object: db857f7d6cc77057491e4b968798f730228b09bc + src/mistralai/client/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py: + id: d910fd8fe2d6 + last_write_checksum: sha1:52704f01d7388a8b62d59b6f7cd94fcb7d067ebf + pristine_git_object: ddd9c1891356a7c272e0244a9aea3d3d6b2d00d6 + src/mistralai/client/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py: + id: cf43028824bf + last_write_checksum: sha1:80c2601bdbab567e7bdf72f1814c3ae58d477a22 + pristine_git_object: 9b9aeb51176498eeaa29bed80346f150d6b94573 + src/mistralai/client/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py: + id: e7ff4a4a4edb + last_write_checksum: sha1:8cbfc309c09df806ad7d130004b4e1c2b89ede0a + pristine_git_object: cd25fa04f29dd544f01f3620b31d1c54c86addbb + src/mistralai/client/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py: + id: 7cc1c80335a9 + last_write_checksum: sha1:f66c16423155066b844f8e89446d2acbb6e68157 + pristine_git_object: fd01fe6948613b0fffef9ac76cf1a0f9011ec5af + src/mistralai/client/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py: + id: 6d9dc624aafd + last_write_checksum: sha1:fbacb171b9c75f1fe45406f542a958d10c15fae2 + pristine_git_object: 296070b426900305fe4596f03a3c9f081cdb2dcf + src/mistralai/client/models/jsonpatch.py: + id: b7521bc9a558 + last_write_checksum: sha1:0f81a4adaa3fb28ba2620c9a89459b70f0ec3d86 + pristine_git_object: d67657f54dd315a9df71f1bf8a87c96dc3a25749 + src/mistralai/client/models/jsonpatchadd.py: + id: fb2a1e58a6a5 + last_write_checksum: sha1:a323e406accd1b25f4e094a54647dd140aab43d5 + pristine_git_object: d4242f11b063f795b8d677abdd8c19ab0419a0b7 + src/mistralai/client/models/jsonpatchappend.py: + id: 61801f21f4b0 + last_write_checksum: sha1:f0400cf42fa6c776042487285cf18c1970e17ad6 + pristine_git_object: 7181ddac1956f1c29b815231f30c3405d4f50754 + src/mistralai/client/models/jsonpatchpayloadresponse.py: + id: 1b39f46f529f + last_write_checksum: sha1:1d2a8b1039cef824f0e030804a72a0325c413a10 + pristine_git_object: a0301f9a7045f6b64a7d22b60be6e8ce5a2cbff3 + src/mistralai/client/models/jsonpatchpayloadvalueresponse.py: + id: 6cf0e3599e2c + last_write_checksum: sha1:46b19e3813ed9f20969ae14fbab56ea559507fc5 + pristine_git_object: d6ac1b6b02b55ebefe7f3298975679e7962473f1 + src/mistralai/client/models/jsonpatchremove.py: + id: e472e5b752ec + last_write_checksum: sha1:2dec39f883b362968f8d55b9b7daef6fb40094e4 + pristine_git_object: 5bcedf879eae1921fd55bc76ba5b5532a2e9641f + src/mistralai/client/models/jsonpatchreplace.py: + id: 816f9df2f3c9 + last_write_checksum: sha1:9448e1181ad7913305712966d0984ebad3a9dc4b + pristine_git_object: 3dd7aee65f0c4f0a2218762a9b9ea8cd571c406d + src/mistralai/client/models/jsonpayloadresponse.py: + id: ba3265f85453 + last_write_checksum: sha1:0c659a3bab8faea27b23bf827167601a968ce796 + pristine_git_object: 9de73d2c5162a15ab1dbd394a46d9e9fdaf8365c + src/mistralai/client/models/jsonschema.py: + id: e1fc1d8a434a + last_write_checksum: sha1:f6e3ddb37e55ff27b795389fce6d4f433e7d5639 + pristine_git_object: bc0bd6c41111937654fba20a16420b6867f7c92a + src/mistralai/client/models/judge.py: + id: d6adc687c2d9 + last_write_checksum: sha1:fec0539aab8eb11de3815317c1a54d3e86957ba0 + pristine_git_object: 036aabb710e1d96af1bf69d563032ab05567b909 + src/mistralai/client/models/judge_chat_completion_event_v1_observability_chat_completion_events_event_id_live_judging_postop.py: + id: 98c823e7cc1b + last_write_checksum: sha1:74dd8fba663c0338a24c497949572b5e5df7e494 + pristine_git_object: a6b9c969d506481b3c3bf5c86611905f30f6ec88 + src/mistralai/client/models/judge_conversation_v1_observability_judges_judge_id_live_judging_postop.py: + id: a958f3e6b122 + last_write_checksum: sha1:21834ba5dc03705ebd02e5d449549cf1dcd2fd32 + pristine_git_object: 4f211dd3463eb2cbeffc67c22d17e43a083f9501 + src/mistralai/client/models/judge_dataset_record_v1_observability_dataset_records_dataset_record_id_live_judging_postop.py: + id: 4749566fd16d + last_write_checksum: sha1:cc2201d706b884e41bd83333d4db37970cf7bcd5 + pristine_git_object: 4d54fa42aaad05d1deb44b16bd93a0eaa1948a1d + src/mistralai/client/models/judgechatcompletioneventrequest.py: + id: 4fad8a510f7d + last_write_checksum: sha1:eb193a8ee840c016a383eb0c33b569396222e763 + pristine_git_object: 59c68801ce1270a8058a4d775a4aa8f7b8c96e2b + src/mistralai/client/models/judgeclassificationoutput.py: + id: 683ae72d0efa + last_write_checksum: sha1:36cae71fa78777aad28bba3dacbfe931169fc5cc + pristine_git_object: aa799682d6a6cd360856525d174621a88e73f8bd + src/mistralai/client/models/judgeclassificationoutputoption.py: + id: c238f17d786b + last_write_checksum: sha1:1adbac09caf15374b52b61f257d838db2e486690 + pristine_git_object: 64fad49fa2336b0cbaa69dac7493a18593021275 + src/mistralai/client/models/judgeconversationrequest.py: + id: b8bfdade89a2 + last_write_checksum: sha1:42873ec62a6e8f78beeeddc7c87b82b23fcb5532 + pristine_git_object: 2c93f7b7c2cb00f19eb3a7ce2cf3f5da76ba50af + src/mistralai/client/models/judgedatasetrecordrequest.py: + id: 9ad8915328dd + last_write_checksum: sha1:c37f9c158061e4d3c6c6eda2d7ee8a5d5e7f5afa + pristine_git_object: 11499067e594adae0510334e455b38b23b58ca20 + src/mistralai/client/models/judgeoutput.py: + id: 8c8099403e62 + last_write_checksum: sha1:7eee16a1cbff3978eca638e6d74ada983244d8ec + pristine_git_object: 2224a797049eb11cd05dde1376cab7fbdb779168 + src/mistralai/client/models/judgeoutputtype.py: + id: 3f07e1eb25f9 + last_write_checksum: sha1:35de2d9f5d03caa87d4a19cccf325a9fb67f543c + pristine_git_object: 4fa99498fb6a60e9d4d8358660eb0ecd57d34178 + src/mistralai/client/models/judgeregressionoutput.py: + id: c61d451066dc + last_write_checksum: sha1:2dd3b0dc5c82a977bac095aa6c45c7067bcc187c + pristine_git_object: 9bb8f9c1283b3de89bbf8b859a79d27054ee6074 + src/mistralai/client/models/legacyjobmetadata.py: + id: 0330b8930f65 + last_write_checksum: sha1:32265ed638a7675fb46c7de747bdb2a775a94505 + pristine_git_object: 143f0e7cb42b050da2ba7ef5ad1afd28397f7f00 + src/mistralai/client/models/libraries_delete_v1op.py: + id: b2e8bbd19baa + last_write_checksum: sha1:ba41496bc99040f7598659c5b037b955b7f6d385 + pristine_git_object: 893ab53b11672edd9cde175e68a80d89ff949cb6 + src/mistralai/client/models/libraries_documents_delete_v1op.py: + id: 81eb34382a3d + last_write_checksum: sha1:66d1c6ec5e2535b0db72a3beac65b25a1f2336d7 + pristine_git_object: 0495832efba33314f3cd28fe62759c6dac5ca706 + src/mistralai/client/models/libraries_documents_get_extracted_text_signed_url_v1op.py: + id: a7417ebd6040 + last_write_checksum: sha1:030ca9fb7e10396e6b743ee644fe1a734e1df1f0 + pristine_git_object: 186baaed8346d106272fea2e4826587634b061bc + src/mistralai/client/models/libraries_documents_get_signed_url_v1op.py: + id: d4b7b47913ba + last_write_checksum: sha1:fdad7a6d3ae9a9c69009caf8207b284835675a9a + pristine_git_object: ebcf85d77ed6982d510ae95a6971e1d4b3ad56ca + src/mistralai/client/models/libraries_documents_get_status_v1op.py: + id: f314f73e909c + last_write_checksum: sha1:11d463eb328a1133658e8ff92340edc7f75923e4 + pristine_git_object: 1f4847874cdeff26caaf5fd16e0f8382834ecb2b + src/mistralai/client/models/libraries_documents_get_text_content_v1op.py: + id: 1ca4e0c41321 + last_write_checksum: sha1:b2fee3d9658ab1614f88ffcaf8bb19e6a7548ba6 + pristine_git_object: 3d2ad43d8cdc6336bb73c7911c7058115524fda4 + src/mistralai/client/models/libraries_documents_get_v1op.py: + id: 26ff35f0c69d + last_write_checksum: sha1:e87e56e8fb9f7c11d61c805362db4755a81186b9 + pristine_git_object: 857dfbe60c57af8b0fa6655a049ed336d70fb941 + src/mistralai/client/models/libraries_documents_list_v1op.py: + id: 756f26de3cbe + last_write_checksum: sha1:565872ef17a53cc9751fa2c8fc1267dac2d01e76 + pristine_git_object: afc474cbe6c571ac36fe0800d4c1e5ffd07eb207 + src/mistralai/client/models/libraries_documents_reprocess_v1op.py: + id: dbbeb02fc336 + last_write_checksum: sha1:bd5013cb1581dd13642ce7edf1e701f5b0c967c4 + pristine_git_object: a2f9ba2a0465fb3a8eb3b9afbb41d813de348656 + src/mistralai/client/models/libraries_documents_update_v1op.py: + id: 734ba6c19f5f + last_write_checksum: sha1:e12ca003680ff17523fe09438cd8f71d00ea081e + pristine_git_object: 7ad4231f72901b675d9af67c33364592c86be5ab + src/mistralai/client/models/libraries_documents_upload_v1op.py: + id: "744466971862" + last_write_checksum: sha1:9691ac41ecf986c9ccfad81423d367f96b10f4b7 + pristine_git_object: 388633d1c7e906803b711ef2bbf37656624515a9 + src/mistralai/client/models/libraries_get_v1op.py: + id: d493f39e7ebb + last_write_checksum: sha1:25b3c2c1040cd73ebd6b988b8b27708831affefd + pristine_git_object: 7a51d6053aa2cf2e6524a80487fe9549eec3dfa1 + src/mistralai/client/models/libraries_list_v1op.py: + id: 2d9b1b4deeb0 + last_write_checksum: sha1:1c99dd9165c57ca19d94daf81f31c378125d280b + pristine_git_object: cac06dadbb33c7bf28b276b4c51f569a885ac44e + src/mistralai/client/models/libraries_share_create_v1op.py: + id: feaacfd46dd3 + last_write_checksum: sha1:cdb7e60f1aceb2c7aa54fe2b9ba5dafc2bb70995 + pristine_git_object: 9751045c01e389ad5b77891b8a311dc0a9e04e09 + src/mistralai/client/models/libraries_share_delete_v1op.py: + id: 7f3a679ca384 + last_write_checksum: sha1:897857c11cf0c14a0a81ef122dec4395dc16c0ce + pristine_git_object: eca3f86a6135e702f8cb6412a5f215dac2335a8f + src/mistralai/client/models/libraries_share_list_v1op.py: + id: 8f0af379bf1c + last_write_checksum: sha1:d27e0360c504576c315350fc226d371da455a598 + pristine_git_object: 895a259059283a17cc7558e3cc03022e2d4dd259 + src/mistralai/client/models/libraries_update_v1op.py: + id: 92c8d4132252 + last_write_checksum: sha1:a252f68e65cdb47e27d7059f256381daf2847344 + pristine_git_object: 54b0ab708c665ccb841b1c8d0f2748c390850506 + src/mistralai/client/models/library.py: + id: 028a34b08f9c + last_write_checksum: sha1:82eb895302f95f3f1a1adf85070027e22ab22350 + pristine_git_object: 0e09cfaa14040397a37ac72810521fb14fe6562f + src/mistralai/client/models/list_deployments_v1_workflows_deployments_getop.py: + id: 0c6586ffcab0 + last_write_checksum: sha1:c7d7be66560be5bb813316f958a3fecdf7813156 + pristine_git_object: 066b8db154651681af532e557c60587eddf15536 + src/mistralai/client/models/list_models_v1_models_getop.py: + id: 1843a7aa68e5 + last_write_checksum: sha1:018c32019aab6c4995285ace8abba54d88f41c0b + pristine_git_object: 1a42d9b0828a2e826948641a7b8be3e5d80e94db + src/mistralai/client/models/list_runs_v1_workflows_runs_getop.py: + id: 2f1b225158c3 + last_write_checksum: sha1:2c2e900a0aa6336031ac08a73ae2dc6fa335e644 + pristine_git_object: 3237a29abcce0972fdc4613ffcfa38eea5e2a0e9 + src/mistralai/client/models/list_voices_v1_audio_voices_getop.py: + id: 6b3ce5be1294 + last_write_checksum: sha1:f11a5135ce79d1913db87f9db7d05b4266630b20 + pristine_git_object: 30161b334339ffb310506b8ab87c40990478b483 + src/mistralai/client/models/listbatchjobsresponse.py: + id: 99d94c86a871 + last_write_checksum: sha1:01e5fd232c654b3c4a9d86c09f89cfef6f51805f + pristine_git_object: 77265322df4e5b13c7e2efaa9f7e3e2554387893 + src/mistralai/client/models/listcampaignselectedeventsresponse.py: + id: 8e28cb9aff1a + last_write_checksum: sha1:7ada7958f9c87fa6ae7a329fd03cd626a279ca93 + pristine_git_object: a6133eccdfd4de563b829e0e3ce99fee7f38c2c3 + src/mistralai/client/models/listcampaignsresponse.py: + id: 307695cde5c2 + last_write_checksum: sha1:bb03fc71d3c940945c928a9dd150b06edbdd34f6 + pristine_git_object: 741b1b21ee3f6c5a50e7553329d3be021f916c41 + src/mistralai/client/models/listchatcompletionfieldsresponse.py: + id: 2f8837a6a5c3 + last_write_checksum: sha1:49aca9a0bc6779464db07a229253dd505483b639 + pristine_git_object: d260463aad003c4755c3ee9125d05ef3ae5bbd4c + src/mistralai/client/models/listdatasetimporttasksresponse.py: + id: f635c1a3d02b + last_write_checksum: sha1:5df6977a3511d0f03c2a550d266a3ed6115d5a0e + pristine_git_object: 15bea396f3dfea85101efb4b8ef7fa19efbf8770 + src/mistralai/client/models/listdatasetrecordsresponse.py: + id: 13b97e8095c4 + last_write_checksum: sha1:02ed64f409f2d266685baaee0d81fc921a522303 + pristine_git_object: 2341577a0847bd02d2f458db3c47d9502dfbfd0d + src/mistralai/client/models/listdatasetsresponse.py: + id: e18de4849423 + last_write_checksum: sha1:746cbde66531f4ec9f526d28a3e4206016dc795b + pristine_git_object: a35e9a73e4e7c63fd5cbd85cb1c51c4804249254 + src/mistralai/client/models/listdocumentsresponse.py: + id: f593d8e66833 + last_write_checksum: sha1:0d842168856056ff681b2a1c36b87df8e0d96570 + pristine_git_object: c48b8c051ad0d1fb4aed8396697e57e782be5a40 + src/mistralai/client/models/listfilesresponse.py: + id: 85d6d24c1a19 + last_write_checksum: sha1:c47c2d220c41e4b467c25dfe2e94546a5b452138 + pristine_git_object: 37787dae3bc4016988b1f1edfdfeac4b2d4b0000 + src/mistralai/client/models/listfinetuningjobsresponse.py: + id: 118e05dbfbbd + last_write_checksum: sha1:7943e1bfc9a400ef330284b8241c28f2e64259f5 + pristine_git_object: 39547d571d2e8ce8485f6cf41aa8ad4bfbc7398e + src/mistralai/client/models/listjudgesresponse.py: + id: db389a8abc34 + last_write_checksum: sha1:4ba57c7b7966b7eb81472d8ecc0b5ce726458360 + pristine_git_object: 0284cb99375d1205339a5de99a527c212ac2dfbd + src/mistralai/client/models/listlibrariesresponse.py: + id: df556a618365 + last_write_checksum: sha1:f90b903fb4a1ca5504e63350c5353c6eab505761 + pristine_git_object: be4125f2125eab43cf2682c852f48400a56051d5 + src/mistralai/client/models/listsharingresponse.py: + id: 487c6addf089 + last_write_checksum: sha1:cebb9e6ab7db8c067a3403211765ebfffec0190a + pristine_git_object: f3e6dc8714311989d1e6c7275c8944e228f3f0c5 + src/mistralai/client/models/listworkfloweventresponse.py: + id: 20a423148117 + last_write_checksum: sha1:bdf75230150022794f0268453c9f59952580c524 + pristine_git_object: be99ccea41922c73c7209fbc78393c7ae47e1a3e + src/mistralai/client/models/locationtype.py: + id: 72a73946b20e + last_write_checksum: sha1:18a2d1aeb07ed9d84a1854bb7186e5d32783cb58 + pristine_git_object: 4e2ff2f6869517202f4f0c435ce4a6435c5cc571 + src/mistralai/client/models/mcpservericon.py: + id: a5b508a322d7 + last_write_checksum: sha1:0dd9bac0684864bf6264ddded7f27c8c88b804f5 + pristine_git_object: 293ab37505a1098241631dd83435a0e91d073551 + src/mistralai/client/models/mcptool.py: + id: 5a696c8478cb + last_write_checksum: sha1:c4b180a023664313dea583377b79bf53f0f93262 + pristine_git_object: 908ff8ce20773a4ca1fd80e47a588acc9ba401af + src/mistralai/client/models/mcptoolmeta.py: + id: 07cf1c0762c9 + last_write_checksum: sha1:01af35e36f16d4ab4318633b6d773550c8403108 + pristine_git_object: edbf39a9b4c066ea495471cf6ff21b08d8a390a6 + src/mistralai/client/models/mcpuitoolmeta.py: + id: 7c54fb6157a9 + last_write_checksum: sha1:a115ada5e6c22925919160a88a8358c16129bce2 + pristine_git_object: 287192a67a4fe1c22a209996db9b9e8df1a93359 + src/mistralai/client/models/messageentries.py: + id: e13f9009902b + last_write_checksum: sha1:43aebdc9eaecc8341298dc6b281d0d57edf4e9e6 + pristine_git_object: a95098e01843fe3b4087319881967dc42c6e4fef + src/mistralai/client/models/messageinputcontentchunks.py: + id: 01025c12866a + last_write_checksum: sha1:9eab6d7734dcd4bf9da5222c1927f5f40ef45db0 + pristine_git_object: 63cf14e7fcbc7c3969220b4f07109473b246bf49 + src/mistralai/client/models/messageinputentry.py: + id: c0a4b5179095 + last_write_checksum: sha1:715be926eadfd33538ac4241becd803411126479 + pristine_git_object: be271e317c5de4c52c83fc1c1091eef696e48458 + src/mistralai/client/models/messageoutputcontentchunks.py: + id: 2ed248515035 + last_write_checksum: sha1:df4ef4d17ce48df271ff2b8cab297ae305aa08ec + pristine_git_object: def7a4d27cd3d1479864a1d6af19e89bd57bff70 + src/mistralai/client/models/messageoutputentry.py: + id: a07577d2268d + last_write_checksum: sha1:ceee2327568213ee455a42c07a5be6b64469b384 + pristine_git_object: fd683ad31afb5765535d87affc9ef2011c16d574 + src/mistralai/client/models/messageoutputevent.py: + id: a2bbf63615c6 + last_write_checksum: sha1:7081a6aa27f0893b5628f16871bb1ae5dc23f2be + pristine_git_object: 8f5ecd4363fe23e96127bc5ffdd534f7c500496b + src/mistralai/client/models/messageresponse.py: + id: 6b388bc155dd + last_write_checksum: sha1:14ce5842084a2086505dd80eaa6200638a278000 + pristine_git_object: c8fbdff77b3464b630b0cd18f25d9179c5ff9eca + src/mistralai/client/models/messagetokens.py: + id: e2a5171d27c5 + last_write_checksum: sha1:361fdea88fe10abec7f0e49ad918e8a02354a801 + pristine_git_object: f3e292bd722e7a0a0b50a7c66a61b0f9808e7b4d + src/mistralai/client/models/metric.py: + id: c6a65acdd1a2 + last_write_checksum: sha1:0d7e4ebbf55f8dcc52facb894589ce44abb0c2fa + pristine_git_object: 8d05989420e1b8b68c90fef193bcaff4452c97fc + src/mistralai/client/models/mistralpromptmode.py: + id: 95abc4ec799a + last_write_checksum: sha1:a1417b987bb34daeb73ca4e015c085814e6c8ad2 + pristine_git_object: 9b91323e7545d636308064085ca16fc554eac904 + src/mistralai/client/models/modelcapabilities.py: + id: 64d8a422ea29 + last_write_checksum: sha1:fcc03fee877a5a9a11bbcfdfe84cc4c3ee76dfd9 + pristine_git_object: 2206f9a7e5a42e66bf00e550591c9b09eba56620 + src/mistralai/client/models/modelconversation.py: + id: fea0a651f888 + last_write_checksum: sha1:46ed83726fd34517bf05bf6fc1204a0134c38a06 + pristine_git_object: 72ca957f0eb33dfdfad8fb8074f93b066868f074 + src/mistralai/client/models/modellist.py: + id: 00693c7eec60 + last_write_checksum: sha1:fedfe929f37d6d81248f8f2d6004454aaa35145f + pristine_git_object: a6020100124b5c6493cd1014bf576c439537502e + src/mistralai/client/models/moderationllmaction.py: + id: 7b18ccbd8ca9 + last_write_checksum: sha1:0067c773f68e8c9a6fa9e802b1d5a5b97efa7d5b + pristine_git_object: a2553f3041e129df165d49072a60fe31cd8b387b + src/mistralai/client/models/moderationllmv1categorythresholds.py: + id: 0c51d6766440 + last_write_checksum: sha1:3eca62d031d924bc504a3963911d8f0894c1b4c0 + pristine_git_object: 9a947d111113c748df99d7a01a4c899962425dc7 + src/mistralai/client/models/moderationllmv1config.py: + id: 483378b56394 + last_write_checksum: sha1:bb2f92e87172e9ada69b1746f2b64ab41b550397 + pristine_git_object: fe597a9b9654ccdb37b35b673698ac8015796e6f + src/mistralai/client/models/moderationllmv2categorythresholds.py: + id: 4c2a8ff4d52b + last_write_checksum: sha1:1b3e0e76b7f1b70a77cb7b24965d83f88188f306 + pristine_git_object: 2ca952c5264bd1e19c149802b380c3d82ec09ed6 + src/mistralai/client/models/moderationllmv2config.py: + id: bb511e7c628b + last_write_checksum: sha1:e77793718de35e58f2e6280126fc320b233cc365 + pristine_git_object: 5cd8b7ca1bd68540274db7a11286c200f4d57add + src/mistralai/client/models/moderationobject.py: + id: 132faad0549a + last_write_checksum: sha1:5c551cc8657d3d9c3394638e6d336162563fc6ee + pristine_git_object: 66f6a84bf55703c7e4b46e4381e2b39a0b0eaaeb + src/mistralai/client/models/moderationresponse.py: + id: 06bab279cb31 + last_write_checksum: sha1:b9158e575276c1e0a510c129347b9a98c5a70567 + pristine_git_object: a8a8ec3d8d8a58deb3c1f8358c6dce5a9734f89c + src/mistralai/client/models/networkencodedinput.py: + id: 6dc5321dbe77 + last_write_checksum: sha1:5a99ca47003b7bcfee48753dd4683a94eeee1fe1 + pristine_git_object: 70d9241431ae75d58435965be03089ab8419d32f + src/mistralai/client/models/oauth2token.py: + id: 6153dd0f41bc + last_write_checksum: sha1:01476e43abf5a755d7d8a3f42a7b662cbb37a949 + pristine_git_object: 0887216bdc99f6cddecfcb48881440b35a48fca6 + src/mistralai/client/models/oauth2tokenauth.py: + id: 167c3b8a104e + last_write_checksum: sha1:146c4ce3a29c0bedcb575cf7fa32cb97aa375c5b + pristine_git_object: 76ebfd0de6c7457bcecb1aee026ea16ffa8a7cbd + src/mistralai/client/models/observabilityerrorcode.py: + id: ae572b470a30 + last_write_checksum: sha1:48e211ca35c9df84914a119d118e2645862dc557 + pristine_git_object: 6c1826ed797ecb1a4b1e1e8abd2477bae3cdce60 + src/mistralai/client/models/observabilityerrordetail.py: + id: cb6e8a484a38 + last_write_checksum: sha1:3a7991f57573edee24780bc4b3907c8426aa3fa6 + pristine_git_object: f1535352af02c0d32c573f431b0440da4dab2fd6 + src/mistralai/client/models/ocrconfidencescore.py: + id: 15b75862a7bd + last_write_checksum: sha1:daafce451f4ee4a0440db6f6444f10187a64fe67 + pristine_git_object: 7fab8c9b542b1419bc4844d9d91d62c4f76f19ad + src/mistralai/client/models/ocrimageobject.py: + id: 685faeb41a80 + last_write_checksum: sha1:a848d782d09e7b899e4a801d8ea43505783c853f + pristine_git_object: 583cc38bf6046ff783ac2b5b2306fa42fa3c6fb5 + src/mistralai/client/models/ocrpageconfidencescores.py: + id: 7e4a07e4bdfd + last_write_checksum: sha1:5b1a3f6f27f8c45141bc9c445bbbd17636aae7f7 + pristine_git_object: 622171d06eca8212d9ec9435e777903c0b9fd8da + src/mistralai/client/models/ocrpagedimensions.py: + id: 02f763afbc9f + last_write_checksum: sha1:f572ed8992ba1ba4d53b705c4e8c94c85ae1290e + pristine_git_object: 847205c6c74a621dd2ee6d9eb18d1acba8395c50 + src/mistralai/client/models/ocrpageobject.py: + id: 07a099f89487 + last_write_checksum: sha1:d97dc5b6ff4f91302cfcf1ea120c8e99545716c5 + pristine_git_object: d77661aad5832248ab66bfb3c7bf48bfd2910303 + src/mistralai/client/models/ocrrequest.py: + id: 36f204c64074 + last_write_checksum: sha1:032a1fcd9eb0a6c0a4249772c2e5790705ee2b28 + pristine_git_object: 2a16e7128eeb7f262bb1f80633a9a50d02a093b5 + src/mistralai/client/models/ocrresponse.py: + id: 2fdfc881ca56 + last_write_checksum: sha1:8e496f6122ea0798df0d23f50ea3046a29f0f8db + pristine_git_object: ff4b96c30573a18c2e5665a6f3f10724f7a23f9a + src/mistralai/client/models/ocrtableobject.py: + id: d74dd0d2ddac + last_write_checksum: sha1:fd0c1d3034011209de01a573952d1fd7f663504d + pristine_git_object: 1cb59527b9c1892c789b099f04b99cb1e7169c6c + src/mistralai/client/models/ocrusageinfo.py: + id: 272b7e1785d5 + last_write_checksum: sha1:eb223a88b7e5175056197f64bb4bce2c88ccea19 + pristine_git_object: bfd748e0010e6acc404fdadfff40ee54ac52b9be + src/mistralai/client/models/outboundauthenticationtype.py: + id: 705e7172ba40 + last_write_checksum: sha1:ccefdb6371573bd67aa1b567869f4f3dce884714 + pristine_git_object: 39da354ae26d5effad55be0d6541804b5bc2aa40 + src/mistralai/client/models/outputcontentchunks.py: + id: 9ad9741f4975 + last_write_checksum: sha1:afb76f3af2952c2afab5397e348ddfd6dbb56c4f + pristine_git_object: 1a115fe8b4874a6bd86719d91332cd3db6d95b46 + src/mistralai/client/models/paginatedconnectors.py: + id: 17e125b1022c + last_write_checksum: sha1:b9daf0fd7f3241b03f91e9f7edcb792b91962592 + pristine_git_object: 291da1115294da17b7ca7babc8dc2d7ef672d709 + src/mistralai/client/models/paginatedresultcampaignpreview.py: + id: 6653cba0f982 + last_write_checksum: sha1:0f8d85739c71ececa1df8228ae827e1ebb9cfdcc + pristine_git_object: f6cfce379837e38cf5e42927ceb2d57c58325c67 + src/mistralai/client/models/paginatedresultchatcompletioneventpreview.py: + id: 8c640682ccf9 + last_write_checksum: sha1:43b669ef54761d35893eb433c7089d1c350848cf + pristine_git_object: e08443c16e0d23cde396bd6465d92f1ae9a93777 + src/mistralai/client/models/paginatedresultdatasetimporttask.py: + id: 8fd0a8bad4e7 + last_write_checksum: sha1:27afb85f9e813c8d9674bdac0892bda94d66659f + pristine_git_object: 4b9f48817baacc32672225b1c08642b4988f17f6 + src/mistralai/client/models/paginatedresultdatasetpreview.py: + id: bf20489474ce + last_write_checksum: sha1:57f86606669135792e8ed1bd7065028380e689ed + pristine_git_object: 81746f355996c52df14778f2d402932a59c983a3 + src/mistralai/client/models/paginatedresultdatasetrecord.py: + id: 2556a91b48c4 + last_write_checksum: sha1:bd99e30e61b7487ef86acae66cdd44669b811355 + pristine_git_object: d9aa8c8e810767d749c8588fe801beba7cf77e65 + src/mistralai/client/models/paginatedresultjudgepreview.py: + id: 4d5aab2705a0 + last_write_checksum: sha1:16667401828bb23b61f284c0ed934eeb78e1eaec + pristine_git_object: c61382f99c27190203d05aa304f8a9eecaebbdb6 + src/mistralai/client/models/paginationinfo.py: + id: 48851e82d67e + last_write_checksum: sha1:166961e2c0f573ba0677ee803820bb944a8a5efb + pristine_git_object: 2b9dab6258249f7be87e1d4a73a2502e21fe1f0d + src/mistralai/client/models/paginationresponse.py: + id: d64678967bf0 + last_write_checksum: sha1:693e9b575e0da721b15363db1e381d19f8766efb + pristine_git_object: a60640aae96b54f7f8e7561029fda45a165007c4 + src/mistralai/client/models/pause_schedule_v1_workflows_schedules_schedule_id_pause_postop.py: + id: "53799174e259" + last_write_checksum: sha1:0d12062b4884937e8100490414a29842da524c5f + pristine_git_object: 2a53eaecc95afba612552debcadb0d0dad63afb8 + ? src/mistralai/client/models/post_dataset_records_from_campaign_v1_observability_datasets_dataset_id_imports_from_campaign_postop.py + : id: 3e8e390b7fa1 + last_write_checksum: sha1:7785e0e41ffed189357a2f5682a0158fbcfe80ca + pristine_git_object: 3d57251729621b291e32ae4055a756583905de38 + ? src/mistralai/client/models/post_dataset_records_from_dataset_v1_observability_datasets_dataset_id_imports_from_dataset_postop.py + : id: d396e018c804 + last_write_checksum: sha1:6b4a9b21f1443c40be7298058117d589a0ffd8b2 + pristine_git_object: aac48bd62ab8cd7d32caf4ae5fd190159e1c7580 + ? src/mistralai/client/models/post_dataset_records_from_explorer_v1_observability_datasets_dataset_id_imports_from_explorer_postop.py + : id: 046c79ed47c7 + last_write_checksum: sha1:630755741aac13b4d8fca9028e9e4bb82bfe56da + pristine_git_object: 6524c4d9c34e763fe9c3a186c352a64c51f24dc2 + src/mistralai/client/models/post_dataset_records_from_file_v1_observability_datasets_dataset_id_imports_from_file_postop.py: + id: 6e93e5363630 + last_write_checksum: sha1:e7c66567203632bddbd6d50b8f0bbd730180d4e7 + pristine_git_object: 17f90d48656e697e74195236c3a7b295d63c1a81 + ? src/mistralai/client/models/post_dataset_records_from_playground_v1_observability_datasets_dataset_id_imports_from_playground_postop.py + : id: 09334d96c26d + last_write_checksum: sha1:db69f60fa1e25cd24b958e997c8b4c635b2202ea + pristine_git_object: 7423375af779911d2842ff9736452fc19a385daf + src/mistralai/client/models/prediction.py: + id: 1cc842a069a5 + last_write_checksum: sha1:3ccc14b40fd70f3b4a5cdae3eebcc557b96aea8e + pristine_git_object: 614f481174e58eb7ba28cae5238b532d1d66ef9c + src/mistralai/client/models/processingstatus.py: + id: 28146eaecfcf + last_write_checksum: sha1:a3e3ebeae169441cf430c302c9fe278de79ce215 + pristine_git_object: 7e93308f4cf6af8f968e93f20765c41694b8fad9 + src/mistralai/client/models/processstatus.py: + id: "0205512146e6" + last_write_checksum: sha1:22ad3d5fc80fbf3f83db61512e7bc79295c5fc91 + pristine_git_object: 15bdce2056f2f642096fbbdb2ac32ce1e5b8c9cf + src/mistralai/client/models/prompttokensdetails.py: + id: e6be33f2cd2d + last_write_checksum: sha1:aa71bf6de6316b8754fb18f897b30051a2d4c70e + pristine_git_object: 2c5186c02f6b463c12fd7819637b52c8c7ee4cd7 + src/mistralai/client/models/publicauthenticationmethod.py: + id: 545ab7f24523 + last_write_checksum: sha1:5256ee8833f1e44717f19b6d2ee3aeff6dbe2dc4 + pristine_git_object: 42e943a6f63dcfcfcfc3e994080e318c21a5e619 + src/mistralai/client/models/query_workflow_execution_v1_workflows_executions_execution_id_queries_postop.py: + id: 73826dbd3f5b + last_write_checksum: sha1:5105618697e031bae45cf9f6d7c5227d9c08f155 + pristine_git_object: 5598c4b6f24b0c1a7cc24c6a71b7732aa18e89b2 + src/mistralai/client/models/querydefinition.py: + id: 9648273c8b7d + last_write_checksum: sha1:f76a8ac3af27ab1a8ceab6b6befb3af4b4ec919d + pristine_git_object: bc9b4f20c754f5e29b2193682376a044186a5a10 + src/mistralai/client/models/queryinvocationbody.py: + id: d78662a1a9bf + last_write_checksum: sha1:002769d41d021a34f2adfe0bc7383f02142aaf24 + pristine_git_object: 550e1d7b584213d84fa9fc367711f3af1f8f0d62 + src/mistralai/client/models/queryworkflowresponse.py: + id: 30281fcedce6 + last_write_checksum: sha1:fbcc1e870c0a81ff165311519981bd179b4bffec + pristine_git_object: aed982d5bb0939985e3966bf54a5a1a43e9b634d + src/mistralai/client/models/realtimetranscriptionerror.py: + id: 8c2267378f48 + last_write_checksum: sha1:8bfdc2564fc416b0e1a4cc2e2a3a5437b26cea85 + pristine_git_object: 8ea1d4259df73f29096dd469dc24f668a4af0066 + src/mistralai/client/models/realtimetranscriptionerrordetail.py: + id: 5bd25cdf9c7a + last_write_checksum: sha1:a226b10718b1fe4a661311cbd98ea3b1d1ac4163 + pristine_git_object: cec1f6eabd44ceab4e58694a0862c9c90ea2f264 + src/mistralai/client/models/realtimetranscriptioninputaudioappend.py: + id: 8b03cde6e115 + last_write_checksum: sha1:292ec325423d102ac2ff89071dd814625359ee09 + pristine_git_object: 82ce59fccfe6347876f83a7bcfb78858915eca8c + src/mistralai/client/models/realtimetranscriptioninputaudioend.py: + id: c187ba1b551d + last_write_checksum: sha1:7edc5617574a354fd3eb67a16086b5cd0d52cfbb + pristine_git_object: 9b0a87099103480379794727fa12bf1face16c6b + src/mistralai/client/models/realtimetranscriptioninputaudioflush.py: + id: b27b600c310e + last_write_checksum: sha1:a7ad72a1bbae2f4f8c79aa277fd8beca6db2e1d2 + pristine_git_object: fe7286330722a27859c647d1c4f66f501e5fdd03 + src/mistralai/client/models/realtimetranscriptionsession.py: + id: 02517fa5411a + last_write_checksum: sha1:3932d73a512a963ba7b8ed77ebaeb614785d7d1a + pristine_git_object: e23c07ec9df36495b4482a4fd9592867db2d0b3b + src/mistralai/client/models/realtimetranscriptionsessioncreated.py: + id: 4e3731f63a3c + last_write_checksum: sha1:daf7843f9d775a7c915e55f34213f3db2620044c + pristine_git_object: 88da8764f123cb42d6476c8f0cd60c9e7d2b07ae + src/mistralai/client/models/realtimetranscriptionsessionupdated.py: + id: 686dc4f2450f + last_write_checksum: sha1:ec6e2ddb086b80138cbb1492b013ae0a6dd11b9e + pristine_git_object: 474b2fa70798bd0fea65232fa5f32eb33dce4c69 + src/mistralai/client/models/realtimetranscriptionsessionupdatemessage.py: + id: 4e1b3fd7c5a3 + last_write_checksum: sha1:2edad8c5170e38fc0968569bcd0cf1c51321f80b + pristine_git_object: 4013d63818394f0f2eff84b72bba5234fb139378 + src/mistralai/client/models/realtimetranscriptionsessionupdatepayload.py: + id: 7033fdb33ad4 + last_write_checksum: sha1:0221d1f4df2e6f7c8e42c366d439ec54023e0b1d + pristine_git_object: d4ce43f77c6dd2e6691b04402523bee6b9d21ba6 + src/mistralai/client/models/reasoningeffort.py: + id: b930a0a20654 + last_write_checksum: sha1:2dcf48ea45f83012695492d9d97ba1e74674fc8d + pristine_git_object: e4dd2a33247f23ad98f3e39802d98df028d65fab + src/mistralai/client/models/referencechunk.py: + id: 921acd3a224a + last_write_checksum: sha1:4547701c01752a19e509f3edabfe6a5de0281454 + pristine_git_object: 0ed4a73708e2c63435c0733c06bb0653b96559f2 + src/mistralai/client/models/requestsource.py: + id: 3f2774d9e609 + last_write_checksum: sha1:1ce68530a46793968f1122d29df722f0a5c9d267 + pristine_git_object: fc4433cb4e657b06aa6a4c078094c2df342810e2 + src/mistralai/client/models/reset_workflow_v1_workflows_executions_execution_id_reset_postop.py: + id: 3e9d229cd8ba + last_write_checksum: sha1:ef6d5e37d26d9488c657f0fc27e3e3fd4ec34e02 + pristine_git_object: eda20e536e92f38bf5ffc115da6d7c748c70a4fd + src/mistralai/client/models/resetinvocationbody.py: + id: 3c0a985a5a77 + last_write_checksum: sha1:bef8afbe543404fdd79d1b40ea7611f4ac7de3e0 + pristine_git_object: 26c3389f988818090bc60e17ffb9a65ce992d33c + src/mistralai/client/models/resourcelink.py: + id: 4251cc3c7797 + last_write_checksum: sha1:fad9dd6a100450397ee358842a31804c3552ca06 + pristine_git_object: 890c5be1de611379c12d1525d596bc284e0e197d + src/mistralai/client/models/resourcevisibility.py: + id: b5819dd5f981 + last_write_checksum: sha1:3c7e91baa8c8a0bb2ba55a6b7c14db04350278d7 + pristine_git_object: 56f91f154594a121c988497332e5b978cee4264c + src/mistralai/client/models/responsedoneevent.py: + id: cf8a686bf82c + last_write_checksum: sha1:598757cc2549972367c626143eb14864f40b4868 + pristine_git_object: 89a58bf77313bbddb0fe8d460374cdbe5d02cea6 + src/mistralai/client/models/responseerrorevent.py: + id: b286d74e8724 + last_write_checksum: sha1:443a69babe18e95bcc4219423449e57b73bc6015 + pristine_git_object: 5326c4e8293d5bc7cd6572e4cf5511ae2bec97d7 + src/mistralai/client/models/responseformat.py: + id: 6ab8bc8d22c0 + last_write_checksum: sha1:8f0993a7f7eb6ef5264706320242ab0f0d939227 + pristine_git_object: 95141394226e21ab908efd7e3795c8132fc8fa38 + src/mistralai/client/models/responseformats.py: + id: c4462a05fb08 + last_write_checksum: sha1:3cb82d44a4f9df5e9a3f51867be6eab1d439d87a + pristine_git_object: 21345778ad2d41a3746292e67fec628f9ec2a84d + src/mistralai/client/models/responsestartedevent.py: + id: 24f54ee8b0f2 + last_write_checksum: sha1:bbe13695d5cde5f98635c01453057061d0167f99 + pristine_git_object: ca3750421f3dda97cd85a6783084a934ed4f0fd4 + src/mistralai/client/models/resume_schedule_v1_workflows_schedules_schedule_id_resume_postop.py: + id: 2daf20be73bb + last_write_checksum: sha1:4775b3a31c7dcdd5be1db4117044bfacb4698d51 + pristine_git_object: 101bef6a08df0fc4fb4c4db2f5675b58908863e0 + src/mistralai/client/models/retrieve_model_v1_models_model_id_getop.py: + id: 6fefa90ca351 + last_write_checksum: sha1:52775e73fb5c51d245362ce63672cec776e5b6bd + pristine_git_object: cd5955c1eadb8cd9d1f9ecc388c2cc17df11c885 + src/mistralai/client/models/roles.py: + id: e41c04cf7422 + last_write_checksum: sha1:e953cc08f43a7a4b8f143830e5308eb26d44f8ac + pristine_git_object: ff36ebd72389228752297c1c9ec80deb7557430d + src/mistralai/client/models/sampletype.py: + id: a9309422fed7 + last_write_checksum: sha1:86a61340a647696f6c35a82d945509b1c85aa6f7 + pristine_git_object: dfec7cce1e22ab607b6a9e947fa940284426086d + src/mistralai/client/models/scalarmetric.py: + id: ae8eb1017da6 + last_write_checksum: sha1:c85c3825e8f60eac8776e912425ed4f43b387ad6 + pristine_git_object: b9c70a7712022ef4f2f0b9d2e2cdeb3399f79621 + src/mistralai/client/models/schedulecalendar.py: + id: 76d72d187023 + last_write_checksum: sha1:8f732c72e3b29748d8d913990fe95dadf6a14cc6 + pristine_git_object: 2cb179eb22e9ac10e820ed276187cd863fc7a440 + src/mistralai/client/models/scheduledefinition.py: + id: 6ea58a356f77 + last_write_checksum: sha1:a394dee8c49c4a6c6ede7e27ca256a3c376e137b + pristine_git_object: 5810229349e4b84c88458fa729b4b1bce4d761cc + src/mistralai/client/models/scheduledefinitionoutput.py: + id: 69dc15b9a0d6 + last_write_checksum: sha1:4dd8612486768de992731c044cb13b4c52f4622a + pristine_git_object: 8a9f205886f5fb2051c3c4591cf140ab65f6e2d3 + src/mistralai/client/models/schedulefutureexecution.py: + id: 44bb85af3d44 + last_write_checksum: sha1:11be9c9a4c488c42aabaa8090b8032b2e699ac4b + pristine_git_object: 50f0491e7acfe4dc7c2a65e5c7f3eb2259f01076 + src/mistralai/client/models/scheduleinterval.py: + id: 1d89c2043566 + last_write_checksum: sha1:8119be5607d6ccad371b83f93b22da6e08c21504 + pristine_git_object: c01cf8522f743b4b744f02603da7df15311de406 + src/mistralai/client/models/scheduleoverlappolicy.py: + id: a729c26f9c43 + last_write_checksum: sha1:f39e47b552d05c3bd9534d1c061f811d47d71191 + pristine_git_object: 13db394715c184da98432af6a971393424bc5197 + src/mistralai/client/models/schedulepolicy.py: + id: f326afe63958 + last_write_checksum: sha1:47f6665bb77b023658794ef1eac2013d92f3d349 + pristine_git_object: 9a507656a4da020ea5c7a2d22b81d912ead32022 + src/mistralai/client/models/schedulerange.py: + id: f9d442a062b5 + last_write_checksum: sha1:763d3229958d166028203998b964abaf73d42a2c + pristine_git_object: e30eed16bde2b71981b7b15e9d88a044910c6c3b + src/mistralai/client/models/schedulerecentexecution.py: + id: 745d146d9413 + last_write_checksum: sha1:ffa517cc252189aab02c3dd0b342475e2aa2e5a5 + pristine_git_object: ad46a70d3b507aac0811d7250e5a11fb26d5b32b + src/mistralai/client/models/searchchatcompletioneventidsrequest.py: + id: cabc8ef82d67 + last_write_checksum: sha1:3290793dcf229bffc16b16d32d2c599c9a54bf4a + pristine_git_object: 64bb8f9f9e55f9caac2621120465edad169629f7 + src/mistralai/client/models/searchchatcompletioneventidsresponse.py: + id: a5f0bad3ba10 + last_write_checksum: sha1:a521e3466db8258702fe5c286698d9404cc22b8c + pristine_git_object: f4751159faff30b92a979d6f03ecbfc0f780261e + src/mistralai/client/models/searchchatcompletioneventsrequest.py: + id: a437333780bc + last_write_checksum: sha1:aa956fbf5e01e20644b0de20047539209ed4210f + pristine_git_object: bca27f166a5b9e55bec2811110b94570fd604588 + src/mistralai/client/models/searchchatcompletioneventsresponse.py: + id: f96acbcd45f7 + last_write_checksum: sha1:539caf622ef9e7579fdc82e7986dcc3a2aedae53 + pristine_git_object: 8b9b10b51fe76de43895168df11e5bbcdfc29a62 + src/mistralai/client/models/security.py: + id: c2ca0e2a36b7 + last_write_checksum: sha1:28496d4ff921e8c2186072aad170c65836a4b8f8 + pristine_git_object: 36b129533187283e4fdf53a67019b379b1e251fa + src/mistralai/client/models/shareenum.py: + id: a0e2a7a16bf8 + last_write_checksum: sha1:15a84d57ceeb74cfb37275f714954e42d8e9b3ba + pristine_git_object: 08ffeb7e46fbbc28b7c93ef2aa4a49aff7c0d35e + src/mistralai/client/models/sharing.py: + id: 324f5ac27249 + last_write_checksum: sha1:b67aa68e320269e0f6da9da23ed35cd1c41f2879 + pristine_git_object: efa16203021055e1f704b2fd3683eeee0a49ba07 + src/mistralai/client/models/sharingdelete.py: + id: f5ecce372e06 + last_write_checksum: sha1:f993f4cc819a14985a70a31af7896115ee80af8a + pristine_git_object: 3472a50637d4582fa8945ec70b57ed12de88b99d + src/mistralai/client/models/sharingrequest.py: + id: 2439b732dfae + last_write_checksum: sha1:05e36cba36203bcc579a3b02538aed570cf22352 + pristine_git_object: 7c2d435c363bcd98aba97e120954ec1357524e34 + src/mistralai/client/models/signal_workflow_execution_v1_workflows_executions_execution_id_signals_postop.py: + id: 16c54f54e60f + last_write_checksum: sha1:57437b8a9d284f7e77459c319908ad0b8db33720 + pristine_git_object: c61ed019456f82a15c53944dcf0cf122edbdbc0e + src/mistralai/client/models/signaldefinition.py: + id: f1c1ac98a427 + last_write_checksum: sha1:d60f213a8d1783df73214a3117761ffdab92d564 + pristine_git_object: 434e12309e5e3232bc7ece9ec2351e75cf105d6e + src/mistralai/client/models/signalinvocationbody.py: + id: 0fd96a7c058b + last_write_checksum: sha1:13c77816c7846edfe1fbf013c2864c20e9775c1b + pristine_git_object: 3b7a1ff1d590cf2a6b4df68016c56a01677808ba + src/mistralai/client/models/signalworkflowresponse.py: + id: e1844a7da20b + last_write_checksum: sha1:c891e5a904c040bcf2a5d46fe9851575890ae8d3 + pristine_git_object: 2d9ea356fb09d47e53274453476bd04eb6403e54 + src/mistralai/client/models/source.py: + id: fcee60a4ea0d + last_write_checksum: sha1:4d4277d75f7ce001780a069898b38afa7c8addc0 + pristine_git_object: fcea403cdbad44299fb2178f07a63bb7e83dc033 + src/mistralai/client/models/speech_v1_audio_speech_postop.py: + id: 7ab5c1250642 + last_write_checksum: sha1:df0d69df993dc2615822996db86ab643d5d745d4 + pristine_git_object: 3dbd044cd61251b99e0f08515b85b80dc2914c3b + src/mistralai/client/models/speechoutputformat.py: + id: e6be9ec9e74c + last_write_checksum: sha1:5b31afa5927cbf56ee5b93fc7c32110c574c1701 + pristine_git_object: f564d2affd4a0b031cf44caf5242c8bbec9235e9 + src/mistralai/client/models/speechrequest.py: + id: cf3bc148e629 + last_write_checksum: sha1:9a1a2a4c87877a40591b013b50bdd80230278b70 + pristine_git_object: c57df7a8f7ade2da3c4132de4a186dbc082f52f2 + src/mistralai/client/models/speechstreamaudiodelta.py: + id: ac66815396b1 + last_write_checksum: sha1:eb3e66fbf2164686d20900761be40c7b90bfb82b + pristine_git_object: e3cc7053cb803b75019ac36a26efb953360af941 + src/mistralai/client/models/speechstreamdone.py: + id: 2164b6526a81 + last_write_checksum: sha1:0ba5e06311e0256617a25384a2899c3f22463f54 + pristine_git_object: 2febda7b6f06d0ceed3db9d7bf81aaa29dc8afd5 + src/mistralai/client/models/speechstreameventtypes.py: + id: b76eee4fdf6a + last_write_checksum: sha1:f1a2a3dd855c77b91a126d8919ffc6942906b4f5 + pristine_git_object: 723a571b58629aeeb3e1e0b7b5a65c378180c403 + src/mistralai/client/models/ssetypes.py: + id: 1733e4765106 + last_write_checksum: sha1:3c79fc7c43cd018fba4950ba013ed15899b82ebf + pristine_git_object: 0add960bc93f53df5ddda94892543a0857f32dd6 + src/mistralai/client/models/stream_v1_workflows_executions_execution_id_stream_getop.py: + id: 793a9301522f + last_write_checksum: sha1:c05e4bedbc131352b0b275e2bef7eb2f541433b0 + pristine_git_object: 5282e52aeb9c3dc5729b5cd54502802bc9c514e1 + src/mistralai/client/models/streameventssepayload.py: + id: c6becbbd80bc + last_write_checksum: sha1:c54a8dc9c54e62937b61b52e2b5ce3ff3c422ce7 + pristine_git_object: 2c662a65bc6e419c3402e42755c0365cc30d9541 + src/mistralai/client/models/streameventworkflowcontext.py: + id: 14c00c79de78 + last_write_checksum: sha1:ea0a2d8e68a44783e47dc532307c7a2b1f717805 + pristine_git_object: f24de860f5ad2ca115bac68b494caba4cd6ee800 + src/mistralai/client/models/systemmessage.py: + id: 500ef6e85ba1 + last_write_checksum: sha1:a88de3fc70adab47943f867336659b3a1a6cdae0 + pristine_git_object: 2602cd2db03cd129b42b343f2dc79ce68106ac35 + src/mistralai/client/models/systemmessagecontentchunks.py: + id: 297e8905d5af + last_write_checksum: sha1:e5695ca0ebdb0f02f3a0c527015df154a0c52b7f + pristine_git_object: d480a219e935aaea91adc320de0003b562c0bbb5 + src/mistralai/client/models/tempogettraceresponse.py: + id: 8bb3c013aa76 + last_write_checksum: sha1:ff35ba718f008554d79defc41dc02af5115c7ab0 + pristine_git_object: 8575b95430e10a9b8d7e1df0f0e131cda68bb685 + src/mistralai/client/models/tempotraceattribute.py: + id: 7d0ec3402dc0 + last_write_checksum: sha1:663896264ac81d443679ca397fdad95a96683455 + pristine_git_object: dea530ea8fc2ee80d5218b3e1437b23fa94daf4b + src/mistralai/client/models/tempotraceattributearraycontainer.py: + id: afca3b2e0b21 + last_write_checksum: sha1:b4f8414e509c84ca90f2d859f222a313b9948b39 + pristine_git_object: 082060373b99b74bfe6c29a30048758f3023bdcb + src/mistralai/client/models/tempotraceattributearrayelement.py: + id: 4f3b1d9264a3 + last_write_checksum: sha1:d1922dd0b17d26b2aa0e4858a35a90662ebba626 + pristine_git_object: 6fa0ec60f028712573e8947ef2d34e526c64ef81 + src/mistralai/client/models/tempotraceattributearrayvalue.py: + id: d75dd416f9e3 + last_write_checksum: sha1:47995b569301c6d8b7a6ca1ad8c04717f16d0868 + pristine_git_object: 95fe337ec35bc6fe4161837b7efe5ff3a59e7cf3 + src/mistralai/client/models/tempotraceattributeboolvalue.py: + id: c7c383a6c05f + last_write_checksum: sha1:a40945504a6845a3e43a80d5f901af9f5c5ee96b + pristine_git_object: 72fb79d022533d8a7af27c5d7e91258e7cf3a3b5 + src/mistralai/client/models/tempotraceattributeintvalue.py: + id: c4659ad7a2a5 + last_write_checksum: sha1:471273678346f841dd718fce1899a6ae8ad7cd1d + pristine_git_object: 6ffe7efe56d3b050b0ecd3db8f6d24d2d37b4854 + src/mistralai/client/models/tempotraceattributestringvalue.py: + id: 2dcdd05a5115 + last_write_checksum: sha1:67aea0de94db0eb1127f22f0eeafe28bb8a125be + pristine_git_object: f4dea6395300960e835d56aa47d4ead96536c9af + src/mistralai/client/models/tempotracebatch.py: + id: 969acd9d6220 + last_write_checksum: sha1:8e865d710af9d3a7627423163857a7bf19e7f60e + pristine_git_object: 7f50804747fd972ba45bf70bf621d92031e2ef0b + src/mistralai/client/models/tempotraceevent.py: + id: 98dd1b838524 + last_write_checksum: sha1:c0153772618cf57c4c3f7830519ca7e7310fc5af + pristine_git_object: bda2115aac42c4b0b195143abe2ed9d610053db4 + src/mistralai/client/models/tempotraceresource.py: + id: cc8a7ff3feea + last_write_checksum: sha1:3fb070d82116606740a3b6433b97b65ac80ffd79 + pristine_git_object: 42c4d56ade5183234c30a88ba3cac010bdd6ee50 + src/mistralai/client/models/tempotracescope.py: + id: a2da1a3b8198 + last_write_checksum: sha1:ea6ee30b2e080440e72fa9a4eb3c592d2bf52fe9 + pristine_git_object: 3e302f81252b0628eb0046777825e8bde71ea98d + src/mistralai/client/models/tempotracescopekind.py: + id: 40c697c1e617 + last_write_checksum: sha1:b0298aaf269df98bba2bae72e8d47ada6aaa2433 + pristine_git_object: a26d5c38c5dbf1605baaa96bb29ec3d1c3ca6c29 + src/mistralai/client/models/tempotracescopespan.py: + id: cb248e9c0a00 + last_write_checksum: sha1:7f3742ddf7d4baf8e91182d920206ae3e505c4ee + pristine_git_object: 362f3c9974a8183cbe5f59a42f164f6f2d1d5542 + src/mistralai/client/models/tempotracespan.py: + id: f36568c83a96 + last_write_checksum: sha1:a533d06b305ca4076ff40faaa9ce5546cec50537 + pristine_git_object: 51b181ba48d4040e0c48c41960b9076b57f95e4b + src/mistralai/client/models/terminate_workflow_execution_v1_workflows_executions_execution_id_terminate_postop.py: + id: 458eee7d2603 + last_write_checksum: sha1:51c88c99243e964d8b044a1e25a78dff85145e7c + pristine_git_object: 771c165035c62d9963b6b9c71a00e8e948ac6661 + src/mistralai/client/models/textchunk.py: + id: 9c96fb86a9ab + last_write_checksum: sha1:40fa1ea5dcbca9f4c534b58f7cb65bbaa5084521 + pristine_git_object: bae970f3cb1f7cfec74cd38b3f1f1b5171943e99 + src/mistralai/client/models/textcontent.py: + id: 60805b9f7050 + last_write_checksum: sha1:072d40013e047296f98a8be455b30546c8ce0874 + pristine_git_object: 03de48d36befc3f89fb55a9d12c0a78e1ef8d8bd + src/mistralai/client/models/textresourcecontents.py: + id: 58fe427f427f + last_write_checksum: sha1:7d9dd5965f048f07338c19d79147b09f41e1f96f + pristine_git_object: c3f26a65734775d166a1f5d27cab50933e1a4597 + src/mistralai/client/models/thinkchunk.py: + id: 294bfce193a4 + last_write_checksum: sha1:d4cb78e98c29689beb2634a8c9d23fd360849ca5 + pristine_git_object: d2af3da69462a2ad410bf9108861e1122ecdb7a9 + src/mistralai/client/models/timeseriesmetric.py: + id: 7f91751795ac + last_write_checksum: sha1:e7871d8fa64b59e8448f0ae3be46f02c4d02eac8 + pristine_git_object: a0eb0c9ca86791401aeb1df0d851b3a42be1bef7 + src/mistralai/client/models/timestampgranularity.py: + id: 68ddf8d702ea + last_write_checksum: sha1:64e7b198a75f026590e26758112651d31984076f + pristine_git_object: 8d3773752444db865c0e2629ad9eed66eb7f2bc6 + src/mistralai/client/models/tool.py: + id: 48b4f6f50fe9 + last_write_checksum: sha1:507bcbe7af5e919614c27c0704f1c26def7da2bd + pristine_git_object: a83a6d1c4f66ae2876179e4cf3967f84b013f020 + src/mistralai/client/models/toolannotations.py: + id: 2ae257a35b01 + last_write_checksum: sha1:6f7c174966fc9a9fee5de7c8dfa4dbf2064c10e4 + pristine_git_object: b2e9b94808b96b859d29c42aa0d5ca994761a395 + src/mistralai/client/models/toolcall.py: + id: fb34a1a3f3c2 + last_write_checksum: sha1:f07d54b25fddde055361c448764a428238c57a4a + pristine_git_object: 1424d87929b8c7f19205eb1a348c8278b436e817 + src/mistralai/client/models/toolcallconfirmation.py: + id: f2e953cfb4fe + last_write_checksum: sha1:554a2e073917ffb479efe5887c0b59a2f4967c6e + pristine_git_object: fd6eca50a7ec2f4cca2ae20958717881660e0ac5 + src/mistralai/client/models/toolchoice.py: + id: 14f7e4cc35b6 + last_write_checksum: sha1:bf3eaf4ce3feeff3dd44e6ac69783f2833333c3e + pristine_git_object: e7a17d5cdebe8206f6df70e3be29afff68fbfe79 + src/mistralai/client/models/toolchoiceenum.py: + id: c7798801f860 + last_write_checksum: sha1:5388b2a6fad842f8e4ae79e6257b4d14c122a6ff + pristine_git_object: d66c3d07058eb87bcc3eec10de99a616b5f6638a + src/mistralai/client/models/toolconfiguration.py: + id: faec24b75066 + last_write_checksum: sha1:caa6c41ccb0825034bb9cab4e3fcd1a2547b66a9 + pristine_git_object: eb3d14e5517a60c1fbac1b1feb7d5daadd877a90 + src/mistralai/client/models/toolexecution.py: + id: 69fcb691327a + last_write_checksum: sha1:85bcd4a5d30aab54425bccec9c2374137fad6736 + pristine_git_object: 9c55e7bb9db0be106d30b9bf37153aaf8d7b61ff + src/mistralai/client/models/toolexecutiondeltaevent.py: + id: df8f17cf3e07 + last_write_checksum: sha1:77da4c0bca920d4ea77a64faa039fb3c07df46ed + pristine_git_object: c2e4095072f7efc6854f0f666fc5d7d0efcfc30c + src/mistralai/client/models/toolexecutiondoneevent.py: + id: 514fdee7d99f + last_write_checksum: sha1:b58fd690c6f3a0e2eeca2433f454f4b21a77c3e3 + pristine_git_object: ec3b691835bb0c76e0c5b7d825ca7a4867831302 + src/mistralai/client/models/toolexecutionentry.py: + id: 76db69eebe41 + last_write_checksum: sha1:d8167692473b2d2b01eb59a9bf83dcbb5ee3d93e + pristine_git_object: 226adce185a755d18a046803884b9194d3c42188 + src/mistralai/client/models/toolexecutionstartedevent.py: + id: 40fadb8e49a1 + last_write_checksum: sha1:e419d7f40dcb9450710952a0be173830d09cabf4 + pristine_git_object: a4af27b854e7a0d2ce0a04f2e986c865bfaaf179 + src/mistralai/client/models/toolfilechunk.py: + id: 26c8aadf416a + last_write_checksum: sha1:a79863e37d5cf2d6b52fabea259ce401ed0c4697 + pristine_git_object: 1d9e6118a393cbdf9b4c0d2b47b367b9381beee9 + src/mistralai/client/models/toolmessage.py: + id: 15f1af161031 + last_write_checksum: sha1:9557c9f6b7be4b6ac94d3316eb605e42aa8dc03c + pristine_git_object: 0dc9e92f5dd27ff93d6de62a6879699ace4300a8 + src/mistralai/client/models/toolreferencechunk.py: + id: 822e9f3e70de + last_write_checksum: sha1:2e489c4b2360741a3e4a20710361511a0d9158ea + pristine_git_object: 391724edbb7eea3d3acd1a4b3302045970cb5e31 + src/mistralai/client/models/tooltype.py: + id: cbe8c44aee50 + last_write_checksum: sha1:53949106f192944a13a8fcbeb37b3d08478b7bbc + pristine_git_object: 1a7781fc2c1001002785d512ed7909ce91a9129f + src/mistralai/client/models/trainingfile.py: + id: 2edf9bce227d + last_write_checksum: sha1:f72468d666e903a966c12273be5a64048dcd59a0 + pristine_git_object: bdaba37a65b2641c83bb8f2dee7c0680aabd0f2d + src/mistralai/client/models/transcriptionresponse.py: + id: 60896dbc6345 + last_write_checksum: sha1:c858aa031b871a7d0890b96c98aae07ce9d1d9d3 + pristine_git_object: c512a3453c16c329307e094a5758c223db1d7be9 + src/mistralai/client/models/transcriptionsegmentchunk.py: + id: d1e6f3bdc74b + last_write_checksum: sha1:c7e8305a3a49490c748f8c5ea16e7397be285be3 + pristine_git_object: 8a5a7162fbc5a70098f9b1eed79baf6d77968194 + src/mistralai/client/models/transcriptionstreamdone.py: + id: 066a9158ed09 + last_write_checksum: sha1:6c3db3298e520c56131f2f42841530013fa2aed1 + pristine_git_object: 89357277ef90b00e5b8e86d924dc35d288f07948 + src/mistralai/client/models/transcriptionstreamevents.py: + id: b50b3d74f16f + last_write_checksum: sha1:68f82eea8a0bcf1b8b65cedf9e276f34121d398b + pristine_git_object: 073fd99aebf6f90027a45c8ee4daa7ffeb8ee34e + src/mistralai/client/models/transcriptionstreameventtypes.py: + id: 6f71f6fbf4c5 + last_write_checksum: sha1:1d568460b1521f17dd5e551632ae4d7883a98dd3 + pristine_git_object: c74bbb7483cc3981ee3638c80c15924f3e1c20c4 + src/mistralai/client/models/transcriptionstreamlanguage.py: + id: e94333e4bc27 + last_write_checksum: sha1:d1ee93b09ca377bc29845924d53db3ccf250269d + pristine_git_object: b6c6190684eccdc3fe6ce4bc7b86f5ee6490a197 + src/mistralai/client/models/transcriptionstreamsegmentdelta.py: + id: c0a882ce57e5 + last_write_checksum: sha1:f849d8d9ddd3344a91ba23bdc40f55ed9388420d + pristine_git_object: 38e7b0a3142f4f1b4a4cc2c63729b3f51030300f + src/mistralai/client/models/transcriptionstreamtextdelta.py: + id: 6086dc081147 + last_write_checksum: sha1:968b4bc32731be6c63be3fd90eb26f4357f891a3 + pristine_git_object: 42f0ffb7f16bee4f68f9db9807aa4ec3d9ae5176 + src/mistralai/client/models/turbinetoollocale.py: + id: 2699936a7546 + last_write_checksum: sha1:9fa6910a64b464068a660b3d5bf5e09109da283b + pristine_git_object: 42682ee15e542672c190e1b82e713539a6c9b22e + src/mistralai/client/models/turbinetoolmeta.py: + id: cdb07c3837f7 + last_write_checksum: sha1:c2339efbf6dac10bf5e3f42491fa971982d4a998 + pristine_git_object: bcd4d5f2da000bcc4af9c41bf7e92efdaf99b039 + src/mistralai/client/models/unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop.py: + id: 9df426343c2c + last_write_checksum: sha1:12d529f6703695653004ac5692f13daab13bf060 + pristine_git_object: 3dc55512ab45c4b7617dd0cf2e464a3f53921c8b + src/mistralai/client/models/unarchivemodelresponse.py: + id: 22e2ccbb0c80 + last_write_checksum: sha1:8ebdd49f2bef3c5934395808bf71701b46e512be + pristine_git_object: 5cab4c2ef093236cacdc2a9e24b27c1a6c643ee9 + src/mistralai/client/models/unschedule_workflow_v1_workflows_schedules_schedule_id_deleteop.py: + id: 114f67717003 + last_write_checksum: sha1:f80651b63d89ef19a070c1ae7901b021914a0ddd + pristine_git_object: eac992d5936dd5dc935623babfa22177f0e0adb7 + src/mistralai/client/models/update_dataset_record_payload_v1_observability_dataset_records_dataset_record_id_payload_putop.py: + id: fa5d55a9d6cf + last_write_checksum: sha1:5cf094a6617b1900745deece2e34edfb1b040905 + pristine_git_object: d5a2bd9dabc6b10c0cfd5ac1aa6ff56b3abf803c + ? src/mistralai/client/models/update_dataset_record_properties_v1_observability_dataset_records_dataset_record_id_properties_putop.py + : id: b0af26e00bfa + last_write_checksum: sha1:5cd8dc574dd7e063fc725ab97185ffce58345087 + pristine_git_object: b828aa80dd6c0293ac783802470fbec1a01560ce + src/mistralai/client/models/update_dataset_v1_observability_datasets_dataset_id_patchop.py: + id: 7bb459765cba + last_write_checksum: sha1:56ae41144cef62f4c6384994f30dbaede3d30925 + pristine_git_object: 5a44056454e368ae54485532875e72750fe82e27 + src/mistralai/client/models/update_judge_v1_observability_judges_judge_id_putop.py: + id: a1bace5342e6 + last_write_checksum: sha1:2fd7c698f8fe16e5df54e49c7aba85e247d3f19b + pristine_git_object: 41c3a36574b60207207535a6930ae094c23a8fff + src/mistralai/client/models/update_run_info_v1_rag_ingestion_pipeline_configurations_id_run_info_putop.py: + id: 2a14ebf4ef57 + last_write_checksum: sha1:dc63747af5ef650f6d5f5a99e447bebc41450e46 + pristine_git_object: 6b7d24d465d34289f97aeb83dc036501883c9c7e + src/mistralai/client/models/update_voice_v1_audio_voices_voice_id_patchop.py: + id: 399da05bd75e + last_write_checksum: sha1:aca7b6539571a8111e8f1abb7f90dde1e461d4bc + pristine_git_object: a11b626a9b4ec3b1761bb383dda2cead843ee634 + src/mistralai/client/models/update_workflow_execution_v1_workflows_executions_execution_id_updates_postop.py: + id: 5799cc4ab66e + last_write_checksum: sha1:ce9516f04804a7aa692ce5525e0c094bfc8167c9 + pristine_git_object: 30ff2baef59c3acdcd3b9e3dda3fd15d01490338 + src/mistralai/client/models/update_workflow_v1_workflows_workflow_identifier_putop.py: + id: c537bd5a9dd1 + last_write_checksum: sha1:2475d631b74ec49cf8420227151e13083a6ffdb0 + pristine_git_object: 9ee9b6d2db84a56c401c91e9484cea378ecc38dd + src/mistralai/client/models/updateagentrequest.py: + id: 914b4b2be67a + last_write_checksum: sha1:db80a8f0b630acf98be5c27caa7bb448a4e58237 + pristine_git_object: 7bb9686b9b542c47ac25fb6780017b5739829b1e + src/mistralai/client/models/updateconnectorrequest.py: + id: a761cd154109 + last_write_checksum: sha1:1a943da5e32a0eec70de5a15b56de278082bbc25 + pristine_git_object: 145091d4ce119383e611d845f52dbb4489b78ddf + src/mistralai/client/models/updatedatasetrecordpayloadrequest.py: + id: bd45f357a538 + last_write_checksum: sha1:774ba70d9f417e84b546b9f4c5c85eb2876dd56d + pristine_git_object: 155ea78df17aeda6f1e7f70e4ae6d18dfdae1499 + src/mistralai/client/models/updatedatasetrecordpropertiesrequest.py: + id: c457ead40a69 + last_write_checksum: sha1:ef265db7817eb0f59ee182e327482918aefbf36c + pristine_git_object: ccba4a5c71aa8717c4fcb1af61f4f10c17b84ebd + src/mistralai/client/models/updatedatasetrequest.py: + id: bbb067caa23f + last_write_checksum: sha1:4ae8e1ea4a6a9ec5ed559bef8fe21d11af2b0ed3 + pristine_git_object: ddbaad1237d2056476c4fe7f8a6caba06a65f744 + src/mistralai/client/models/updatedefinition.py: + id: 143f97683a02 + last_write_checksum: sha1:932dbdf03be9a321795c14142ddf3729c1e0f111 + pristine_git_object: e878c8764774e4420a85145196cfb93c32d108fa + src/mistralai/client/models/updatedocumentrequest.py: + id: a8cfda07d337 + last_write_checksum: sha1:612b16cee373b0e395f51eb03b3dff70d7988148 + pristine_git_object: 5f67ea697ac8d4449c76863a8e4f42e0bd197908 + src/mistralai/client/models/updateinvocationbody.py: + id: b8558eff0be0 + last_write_checksum: sha1:ea486ca10c1165b9f3dd40c005cc98bc6b0e937f + pristine_git_object: a300bd20073a2ddfc9b3bd4844aae9f3915e2f9c + src/mistralai/client/models/updatejudgerequest.py: + id: f6ad6fb901a0 + last_write_checksum: sha1:0cc5d951aa36d1ba6cf82020d9ade4ac85bc3a94 + pristine_git_object: 04c86ab65599b96478f9b6a0cfa6ce3af1a489bb + src/mistralai/client/models/updatelibraryrequest.py: + id: 51bc63885337 + last_write_checksum: sha1:aebbb99655ad350295e5eea6943947eb8960e742 + pristine_git_object: 64af28c596d42f349ccd94daa7aae422a77e031e + src/mistralai/client/models/updatemodelrequest.py: + id: fe649967751e + last_write_checksum: sha1:b5ce56ef430768ee806b45d9c2e4c405764a1ef5 + pristine_git_object: 0179ba140d7d598a4a363ddfab67197e56857964 + src/mistralai/client/models/updateruninfo.py: + id: 4330bdaa00b9 + last_write_checksum: sha1:57f94ec7b05a21ab4849deffaf32078b01161567 + pristine_git_object: 91038d1d8f39b650ebd347afca60dc21c144856d + src/mistralai/client/models/updateworkflowresponse.py: + id: f5dcf717a0a1 + last_write_checksum: sha1:f0da842336a6aef26bab3fab2f0c742deda2653e + pristine_git_object: 699bef98d0eddd6d7b4e776c3aaa2896174bc223 + src/mistralai/client/models/usageinfo.py: + id: 54adb9a3af16 + last_write_checksum: sha1:108b7cd220312ff96d298981e7ada5bc05921cc9 + pristine_git_object: f23699d0223579e3477a1a010063f3a7a985b07c + src/mistralai/client/models/usageinfo_dollar_defs.py: + id: d543506af998 + last_write_checksum: sha1:193c4f38793c1ee11d95e785cad8f55e50db35de + pristine_git_object: 83bb2fe8ee725e295b32bc3b0b3eb4ee19e835e2 + src/mistralai/client/models/usermessage.py: + id: cb583483acf4 + last_write_checksum: sha1:b97161e1abd159d5a0c5757cac2a97bd6a5f1ef0 + pristine_git_object: 7b4b55630022708db7a53476dc7111416594df46 + src/mistralai/client/models/validationerror.py: + id: 15df3c7368ab + last_write_checksum: sha1:4acbbd9e47cf9b351336d552488d617270d37758 + pristine_git_object: 5fe796db923badd9fb85dc4080a30496ed2b419b + src/mistralai/client/models/voicecreaterequest.py: + id: 9a1752117dec + last_write_checksum: sha1:6ddd5af32737a8b0597f3fff476f151dbd039e50 + pristine_git_object: 99df178d594f4c5b029dd9dc027e5e1afc3f8dec + src/mistralai/client/models/voicelistresponse.py: + id: df4b1182d193 + last_write_checksum: sha1:c451d4d0534f4d857f16efde78a7027ae6ca84eb + pristine_git_object: eda768f53f2b6273ccae254ba25adf1c157d068a + src/mistralai/client/models/voiceresponse.py: + id: 24138e419fae + last_write_checksum: sha1:b3f4ef73cc34c3dafa3fa5bf6b4fb02774be04da + pristine_git_object: 6fa3987b8f3361baee9ca3605af0d187ddcb4858 + src/mistralai/client/models/voiceupdaterequest.py: + id: 798f8ff225de + last_write_checksum: sha1:1e4345add08618310635c7b79a8bf3991df98d99 + pristine_git_object: 717316b0033706f1f5fc8fccf3f0159bbc82e8a0 + src/mistralai/client/models/wandbintegration.py: + id: 4823c1e80942 + last_write_checksum: sha1:b836b2c829f16a00221354c44f55b672eefc3aa0 + pristine_git_object: 0e444becfc1e90daa3b5f2393975a530c95a7a36 + src/mistralai/client/models/wandbintegrationresult.py: + id: 8787b4ad5458 + last_write_checksum: sha1:80cb8d2eb89889ff54ab967b449c580e28c3f627 + pristine_git_object: e64bb27c9142d3fe312e8d7476893382dab20722 + src/mistralai/client/models/websearchpremiumtool.py: + id: bfe88af887e3 + last_write_checksum: sha1:bdb724b386fe512c2b6db6bd2931ea71c796dbc9 + pristine_git_object: 5c929e94c20159cf394a9f95ef990a926643f0ea + src/mistralai/client/models/websearchtool.py: + id: 26b0903423e5 + last_write_checksum: sha1:e486f50095cc7540ce828fff7571c6aa6748bf2f + pristine_git_object: f82b6ec1c89cae83ea21d9bae12a1984679262ae + src/mistralai/client/models/workflow.py: + id: 1548cd73984e + last_write_checksum: sha1:fa55b0742593b2b6a4c1bbd688f39b50449746df + pristine_git_object: 2eeac0dcb9d482774b6323b8c0750327b668bf89 + src/mistralai/client/models/workflowarchiveresponse.py: + id: 64c479b7f9da + last_write_checksum: sha1:7e14d02314fcc8dab22a6a908f89122491449151 + pristine_git_object: 18eeccf267343acdff7cb10db729d38e167ab5a5 + src/mistralai/client/models/workflowbasicdefinition.py: + id: 34623036478d + last_write_checksum: sha1:0516152c52c443b8b94c830f81f591798f08ac92 + pristine_git_object: d2f3db1fb851353d21ce5bbec5e8d2d4b9afabfa + src/mistralai/client/models/workflowcodedefinition.py: + id: 36fd5b898ddd + last_write_checksum: sha1:bd77f4a5e5b32892f806278bcd6dc2d951f10629 + pristine_git_object: 84444ce61006301fb145cc2fefcc577d7a2dc1fe + src/mistralai/client/models/workfloweventtype.py: + id: b4aeeb03b57a + last_write_checksum: sha1:451a78dadc17941f397d73ff83c14d552f7150d7 + pristine_git_object: 8c386b01b02e61266dd43f53c003571d5f3adcc8 + src/mistralai/client/models/workflowexecutioncanceledattributes.py: + id: c0802a5de5e5 + last_write_checksum: sha1:954a39fa24c0f24e603d66532fb18f31f9b06eec + pristine_git_object: 6c06bfa93bd601b4c2b6f5358d24045dc6fc3d5b + src/mistralai/client/models/workflowexecutioncanceledresponse.py: + id: bcc392d67222 + last_write_checksum: sha1:6fcd8350bcc05ff4eb87a3587bb8d2eefa11d227 + pristine_git_object: ee1c4e71acecff7f4a94078aae1560ca43c36e31 + src/mistralai/client/models/workflowexecutioncompletedattributesresponse.py: + id: f831331b0eb1 + last_write_checksum: sha1:dbb84007cd94e2d0ed45aec7da846e1375588396 + pristine_git_object: 1fe0c24872cdeac5a53ad8469d01deb6d2053183 + src/mistralai/client/models/workflowexecutioncompletedresponse.py: + id: a1bec20dfb0e + last_write_checksum: sha1:c6c891ed6fdae6204c47d425e0391e2163f20a2e + pristine_git_object: 17716668a30d68aad23a98d312e965171ca71306 + src/mistralai/client/models/workflowexecutioncontinuedasnewattributesresponse.py: + id: 2dd61dcd7b48 + last_write_checksum: sha1:05d7ec612f2674ee265f54c5233e1b79de8ebdae + pristine_git_object: 2ddbf0af4a9b8584f7c1efb6c883a1f9b524295e + src/mistralai/client/models/workflowexecutioncontinuedasnewresponse.py: + id: be26cd87dcb3 + last_write_checksum: sha1:4947f8cbfa73eae9607e252e85236894a34123d5 + pristine_git_object: 0f60a5be6324f370319e05b4a573e5cd157c0450 + src/mistralai/client/models/workflowexecutionfailedattributes.py: + id: dbb7fb36a4fd + last_write_checksum: sha1:d2922a566ccc93b7979cb9411ef46882606b76c7 + pristine_git_object: 1e61f3444594307656141cc999cf19f4d66763fa + src/mistralai/client/models/workflowexecutionfailedresponse.py: + id: a0836009f9de + last_write_checksum: sha1:07ea35829fb0411f39c019b42d17807d0aec02c2 + pristine_git_object: 687d33a9199612bbb8b5db5f6d2be2421469aeb5 + src/mistralai/client/models/workflowexecutionlistresponse.py: + id: c2b2e1ab4821 + last_write_checksum: sha1:0993e22cc42af96754b46ce7e880b4beb28988dc + pristine_git_object: b992bc8e6656b14122bad4996fa2137363a3afca + src/mistralai/client/models/workflowexecutionprogresstraceevent.py: + id: 6ea7078aaca3 + last_write_checksum: sha1:5af64f5a2d76bde2a1a51e3b543db894c2045a44 + pristine_git_object: ffebdb82a1a80d1d086b919da9b33e2f090388c4 + src/mistralai/client/models/workflowexecutionrequest.py: + id: 806340497ed4 + last_write_checksum: sha1:624af9c880e6fff244752469c3681e2913ce3bb7 + pristine_git_object: ea5e752df355fd5a771813a7e5c569539e66c90a + src/mistralai/client/models/workflowexecutionresponse.py: + id: 758786637be5 + last_write_checksum: sha1:1a06785d691c7bdc9e5d1fe4e2a4e3d5e2d3b96b + pristine_git_object: 83179054bf4ca0e3da6be1644fcb32680a4c43c7 + src/mistralai/client/models/workflowexecutionstartedattributesresponse.py: + id: d2276919a895 + last_write_checksum: sha1:53312110c8c2902f32c72a88ee68cea048833fca + pristine_git_object: 59746a615c07e0aeb10d315240b600145d7b45d2 + src/mistralai/client/models/workflowexecutionstartedresponse.py: + id: e1a597c911ea + last_write_checksum: sha1:9c761698883844061bf5cae76e3bc6444941124e + pristine_git_object: fa1e46a07b931f35b46324d9b2e5c111b359889d + src/mistralai/client/models/workflowexecutionstatus.py: + id: 56a16810d5de + last_write_checksum: sha1:71560f9e7a0222734e176a362d3188e703dfbbe2 + pristine_git_object: 611f3aa1ad149e30b577e5949be1e948c979d833 + src/mistralai/client/models/workflowexecutionsyncresponse.py: + id: ef77c54a11b5 + last_write_checksum: sha1:e89046ec323523aae1ef4fb9be7e19328ff84f01 + pristine_git_object: 6ed0f038c27085bbb8896b570dcc3302db137b90 + src/mistralai/client/models/workflowexecutiontraceevent.py: + id: 584e0a98082a + last_write_checksum: sha1:5de35701fd0bd92ec997603d1a6cb30c7597dd17 + pristine_git_object: f74cd5ab6aeadf662e90a46b394621a631602372 + src/mistralai/client/models/workflowexecutiontraceeventsresponse.py: + id: 94d92762ccb7 + last_write_checksum: sha1:2d46b00c374d7590802c60abee6ea69d1d999ed1 + pristine_git_object: 22853e9b01dea9917dfb6291feb36b32f1e65850 + src/mistralai/client/models/workflowexecutiontraceotelresponse.py: + id: 7531bf461dc2 + last_write_checksum: sha1:284b6d7b90576638656b3493e5ba7429a56fe9c5 + pristine_git_object: 46f5404e4da7d0e40199054cfb5b0dfc15ab1eed + src/mistralai/client/models/workflowexecutiontracesummaryattributesvalues.py: + id: 5e3448a39a40 + last_write_checksum: sha1:a59ae1b987558f478518c86f93713e174e5e8d19 + pristine_git_object: 1957662cace4c7ca9b7b892b749922a436ca92f0 + src/mistralai/client/models/workflowexecutiontracesummaryresponse.py: + id: 2ea199810f5f + last_write_checksum: sha1:8642e0396abaedb1f758df0bc06d8386c024c8c5 + pristine_git_object: 92e9a2a7b0df8a7a6ff1fff5f1aee4cdc04c51c5 + src/mistralai/client/models/workflowexecutiontracesummaryspan.py: + id: 750353cbd052 + last_write_checksum: sha1:ba4f7ecc22fdd36aa3c11af5c1e434bb974d5786 + pristine_git_object: e80db90fe890726c75f711ea2b52b3008ef949ca + src/mistralai/client/models/workflowexecutionwithoutresultresponse.py: + id: dd70ba8def79 + last_write_checksum: sha1:c6952b7163b972a0beb868b4407b3780f7ecbbd8 + pristine_git_object: 5e7fe8528de081b2366584af49ab954b93aeea0c + src/mistralai/client/models/workflowgetresponse.py: + id: 230f55a36ebf + last_write_checksum: sha1:935cfce50db82d85ac0e246736c8939bfb015da0 + pristine_git_object: ef1391c9367ed9adf371131c86045246fcee676d + src/mistralai/client/models/workflowlistresponse.py: + id: b255b05e7395 + last_write_checksum: sha1:194172c7c5140f090aa259608cd2d9ab8fd9cdf9 + pristine_git_object: a6497e825ed2dbdffde6072dc8e708e327c77129 + src/mistralai/client/models/workflowmetadata.py: + id: 0435707d6944 + last_write_checksum: sha1:141a99ae47e987fdfd9bc01c72170c9ad22fb412 + pristine_git_object: 597525395aac5d0704b45e09d8552366773a0b92 + src/mistralai/client/models/workflowmetrics.py: + id: 471fb1e10716 + last_write_checksum: sha1:0835e03836dc9f9bc0eeb953eb0fc42e25445183 + pristine_git_object: d80bb3db6cbc69404e22007a78bbef209c03c658 + src/mistralai/client/models/workflowregistration.py: + id: 2b937728c88b + last_write_checksum: sha1:aa049285311701b56fa1b3f331b395174cc9ece3 + pristine_git_object: 7c65801d28753f738dc9f0b8f06aabd4b8a50ffc + src/mistralai/client/models/workflowregistrationgetresponse.py: + id: f063656f22ae + last_write_checksum: sha1:cc7b4d3b71ea8bb8ae452c6fd3e4acc710a18321 + pristine_git_object: 3105856d933d7fad615fa786f2c29a0d5705ac1a + src/mistralai/client/models/workflowregistrationlistresponse.py: + id: 3752e5b776db + last_write_checksum: sha1:ae185c4823954b7a7c8a43fbf4fd441ed02b3bd9 + pristine_git_object: e66f219b28849d7a49af7c764389e0d1d1ee7f37 + src/mistralai/client/models/workflowregistrationwithworkerstatus.py: + id: 23b661b9496f + last_write_checksum: sha1:b09da5640b53502f1d2935729b17655c176de27e + pristine_git_object: 62c379d91f6f8e0b2842b11208513635160a0c02 + src/mistralai/client/models/workflowschedulelistresponse.py: + id: e5247c5183bb + last_write_checksum: sha1:37cea2f0f3220331105f9454169f1ea49ed1b51a + pristine_git_object: 3c9eb3d7f445a0ec010340aeae788cf47e034628 + src/mistralai/client/models/workflowschedulepauserequest.py: + id: da7b9a522bcb + last_write_checksum: sha1:079663a44a62694c48dd839ef1d3b4cd6fb7429b + pristine_git_object: a27f2e90c23222d27566a5ca49575b195f41aa41 + src/mistralai/client/models/workflowschedulerequest.py: + id: 2d8256704c6b + last_write_checksum: sha1:bac5dd140544747ebcd15a21da1df52303adaa17 + pristine_git_object: 2ded66b981775a0d60d04ca568bdc497373d2c04 + src/mistralai/client/models/workflowscheduleresponse.py: + id: c77172c4a9f6 + last_write_checksum: sha1:dd347319557279367f8ccde9158dec6c4586f528 + pristine_git_object: d74ba1dae81bccffa812df2a64babad0a61af787 + src/mistralai/client/models/workflowtaskfailedattributes.py: + id: c4c09c4d5ea7 + last_write_checksum: sha1:b1faee3ed43b88829ca68f5cd642f24d8f1fe9f5 + pristine_git_object: 49444347a46acf8f24c17a0f2b87c961c79efaca + src/mistralai/client/models/workflowtaskfailedresponse.py: + id: a02b01867b7f + last_write_checksum: sha1:47813f0c9b611079c346d5d11a80fbf4a51a3164 + pristine_git_object: 154145e3604b09a202f51b60101ef166ed69a3ce + src/mistralai/client/models/workflowtasktimedoutattributes.py: + id: 43369570cb96 + last_write_checksum: sha1:dd30ece2ca4bd84318494f4f49ca63446677f6d4 + pristine_git_object: 1824990e1e9bf911e0dc422743268a97091576a7 + src/mistralai/client/models/workflowtasktimedoutresponse.py: + id: 8b7540c47083 + last_write_checksum: sha1:6ecfe5907b5cdb05054b8e107977527a584e1b08 + pristine_git_object: 2c3350e09b75f1ebb212909f252cc48124a9997f + src/mistralai/client/models/workflowtype.py: + id: 01f37d193b17 + last_write_checksum: sha1:ec2cf5f7adb51eca3b7bbfc7cef89d4da473b11f + pristine_git_object: 67858c88fc20add975c7b7d6ae46a5f19a220ad8 + src/mistralai/client/models/workflowunarchiveresponse.py: + id: 30bdd050feac + last_write_checksum: sha1:b2cdd8c427160afb82a0137b3da1e8d6da0b6d0e + pristine_git_object: 16717856cc8c70d912af14920b4264b89f0ffc5c + src/mistralai/client/models/workflowupdaterequest.py: + id: 8f3878d3c7c7 + last_write_checksum: sha1:d2aaea5e39fbdb61036b65f2c8a303786f62cf83 + pristine_git_object: 480fa47dee918e3fc7b49246322aa258b791ca05 + src/mistralai/client/models/workflowupdateresponse.py: + id: 0ae165cc7a82 + last_write_checksum: sha1:21b4509ca190bc1abf18b318ae502faf24408184 + pristine_git_object: 3336e448baf9f21cf5bfd1369e6268ea3a7d5e24 + src/mistralai/client/models/workflowwithworkerstatus.py: + id: e1055203af7d + last_write_checksum: sha1:26d8e9f584293e324a10953cd9aff57644277fb7 + pristine_git_object: 81030e21fe08c8ac1401ac6fb0a105f985985cf0 + src/mistralai/client/models_.py: + id: 1d277958a843 + last_write_checksum: sha1:a5e45504b21a4126a41b59c52be2050cd8215cff + pristine_git_object: 2a00325f9205bec7b5ca6ff8df2915593d12bd0e + src/mistralai/client/observability.py: + id: 453a1d06d130 + last_write_checksum: sha1:62d4d03a08807271b404a8684b1153a739d70b05 + pristine_git_object: 4057909ebc43fc419396582fd69e62ca5135ecb3 + src/mistralai/client/ocr.py: + id: 2f804a12fc62 + last_write_checksum: sha1:f9fe8ca3be4450aff01d1a159d905b66054cf665 + pristine_git_object: c290b1bb53f62a966f724216b29f9dc3a949197d + src/mistralai/client/py.typed: + id: d95cd1565e33 + last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 + pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 + src/mistralai/client/rag.py: + id: 2c2b641de1b6 + last_write_checksum: sha1:d27e705578c277540b90b6a84a4669580170c64e + pristine_git_object: 091b02705ce1bd11ea3dc3602a1ebf8e29815495 + src/mistralai/client/records.py: + id: 10f90c990bd8 + last_write_checksum: sha1:3b54fb25751ef4d12a8263bc6f29999a42ac4f61 + pristine_git_object: 2ac04c2fcc4277af7abd42a2a0cacdbba741dd4d + src/mistralai/client/runs.py: + id: 4297d58aeb21 + last_write_checksum: sha1:65b82f507ef945cd17f5f4fc2767d6dab3e6909b + pristine_git_object: d1a242fb2bd517b27656e2f60eef07421418cb6e + src/mistralai/client/schedules.py: + id: d3b4fe452390 + last_write_checksum: sha1:946fac6872a9994efbea349a91c0fd14485859b0 + pristine_git_object: 9b013acdc092797cd78e9be3f50666f4a8203fd9 + src/mistralai/client/sdk.py: + id: 48edbcb38d7e + last_write_checksum: sha1:a606046063cd946633918efa1662846c987c9b7e + pristine_git_object: 03338f46bd3d32f1770ed9b6e4d30f9d707867df + src/mistralai/client/sdkconfiguration.py: + id: b7dd68a0235e + last_write_checksum: sha1:c6944f12c6fdc992d43db943b24c8c90854cde5e + pristine_git_object: 712e92e05c7fd3016431ec62ecb7b7789c8b7071 + src/mistralai/client/speech.py: + id: 5c1f1109aa5e + last_write_checksum: sha1:3cbd55d0df062a0de6e93c32816dd6e805018150 + pristine_git_object: 4893684b70781a097845f48c4b0a09b4fcb38dd5 + src/mistralai/client/transcriptions.py: + id: 75b45780c978 + last_write_checksum: sha1:c72a2c07abd80bc78554669e549ded4ec2b027e7 + pristine_git_object: d84b59f8efbe0adaff62dd4a95a9c7d9bb117d10 + src/mistralai/client/types/__init__.py: + id: 000b943f821c + last_write_checksum: sha1:12a4ace69cbc63f1125eeddf901afed7cdf378b0 + pristine_git_object: cf83864312d8fed0bb9dd3ce39d373b040c36b2e + src/mistralai/client/types/basemodel.py: + id: 7ec465a1d3ff + last_write_checksum: sha1:b62a9d42d79a238399e04efbf5c02215c707efde + pristine_git_object: 4e889aa0ffbb4402e416a40fa6259334cb0a3c5c + src/mistralai/client/utils/__init__.py: + id: b69505f4b269 + last_write_checksum: sha1:98698da73839db7c258fd1afd45ccacff86c64be + pristine_git_object: 4bde281a1fd8c616d4b3529af0fcb79f57374310 + src/mistralai/client/utils/annotations.py: + id: 1ffdedfc66a2 + last_write_checksum: sha1:f86ba37de752e63076f25d53f9c54fce98d2a0bd + pristine_git_object: 4b60ab8e730e7093a064b6869c4a712b96e4aad8 + src/mistralai/client/utils/datetimes.py: + id: c40066d868c9 + last_write_checksum: sha1:412ca432d6f5a75b692a967bc6fc52e4f4eff7d5 + pristine_git_object: a2c94fac73ecbfb8acd8ed4f75692318e4f863ec + src/mistralai/client/utils/dynamic_imports.py: + id: ac9918d925c0 + last_write_checksum: sha1:93d3eac90a47a039e7a652ae120bec66be6c681a + pristine_git_object: 969f2fc71178ed2114640c8f0831f4f3acb25af8 + src/mistralai/client/utils/enums.py: + id: a0735873b5ac + last_write_checksum: sha1:fe05b6a21360b0eff1fc246e9a3ee01758521262 + pristine_git_object: d897495f053459106144501c67f2215251d52a27 + src/mistralai/client/utils/eventstreaming.py: + id: 3263d7502030 + last_write_checksum: sha1:10fa278190f52e6acacabf3b1bab6a82d3459a96 + pristine_git_object: 93287ab457d4944394425eb197caec54280dfbd3 + src/mistralai/client/utils/forms.py: + id: 58842e905fce + last_write_checksum: sha1:d68ca0257e0e8bdc5cdc450f3e70a7ba789859f5 + pristine_git_object: 6facec5386675ccd5a26ff6093f98436a62fdf6b + src/mistralai/client/utils/headers.py: + id: 9066de2ead8b + last_write_checksum: sha1:bcd2f47b96bfaa54b3590c557a9267142d446be6 + pristine_git_object: 6491187230b5f11c7ff13396891ac69099a73a79 + src/mistralai/client/utils/logger.py: + id: 745023607a1f + last_write_checksum: sha1:2582e0cb889b6293c12ce9671aba6281d46bad44 + pristine_git_object: 3edad8307ea0ef38e857596a3ec11023a4af287f + src/mistralai/client/utils/metadata.py: + id: d49d535ae52c + last_write_checksum: sha1:aa5a42fb2fc9dd6469532a633648e8f1a8dad9bf + pristine_git_object: 3850a6ffb6c990a784b1692cefc81de3d67f611a + src/mistralai/client/utils/queryparams.py: + id: bb77d4664844 + last_write_checksum: sha1:d02ce5b2dcc26edb7c937d75b98b70c22a5af189 + pristine_git_object: 0b78c548233f32afa2aafe0040ebb120b51532e8 + src/mistralai/client/utils/requestbodies.py: + id: 946cfcd26ee4 + last_write_checksum: sha1:8cac30839193ee0bb02975b0e225eab97adf4fd1 + pristine_git_object: 3aae69c7cf618776daec8bd46f9116b06c25e837 + src/mistralai/client/utils/retries.py: + id: 5f1a5b90423c + last_write_checksum: sha1:bbf8e376c1c801911e65e33566d3a142f46133f9 + pristine_git_object: bea1304150e77ca06185efb7db7798aaacd5e623 + src/mistralai/client/utils/security.py: + id: 1acb7c006265 + last_write_checksum: sha1:9f176b3d22a80f5be7f22e1879ec33a3773cf765 + pristine_git_object: 77a4449d0b54ac5c43fa150ef38ed0406c5dff66 + src/mistralai/client/utils/serializers.py: + id: 53c57c7f29a8 + last_write_checksum: sha1:cd2d92c815492970aa7bba28346ea0e434a4169b + pristine_git_object: 691957f486c9adf667b8fbedcf04abc043f7a724 + src/mistralai/client/utils/unions.py: + id: d23713342634 + last_write_checksum: sha1:f814d757474f039199f501aa53cdfba97a8c6645 + pristine_git_object: 14ef1bd5c5abef9bd5f2a3a4ee2f79e954c67e7e + src/mistralai/client/utils/unmarshal_json_response.py: + id: b13585fc5626 + last_write_checksum: sha1:372a01f5abf034ddbe5d4a3fc68e9e397f86085a + pristine_git_object: 624433c4dd42c9fb1bfae363becc76c62e390e14 + src/mistralai/client/utils/url.py: + id: 3c6496c17510 + last_write_checksum: sha1:c64be472d29cf229f2b91102808dcb741371c227 + pristine_git_object: 27a6a3a05287ff8a4e24e379ae5d20280c2caf30 + src/mistralai/client/utils/values.py: + id: bb6ade7a7f82 + last_write_checksum: sha1:da9ce43ad241db386efd9b2f53d81eb051dd7544 + pristine_git_object: 2469a9f310a37a7170b54853715274f13d38901c + src/mistralai/client/voices.py: + id: ab76b1377d79 + last_write_checksum: sha1:a8009497c11da1e145fcc462ca5d6e7dcfd6e0f1 + pristine_git_object: e19d5d5a184d08110592147ba04c570cbb2b291a + src/mistralai/client/workflows.py: + id: e2a0381191f6 + last_write_checksum: sha1:b0644f87b63f179114350f2d90a2ec646cd72931 + pristine_git_object: 2693b05b7716298daafffbc76c7358feb49923c6 + src/mistralai/client/workflows_events.py: + id: 6d4f674ce8ef + last_write_checksum: sha1:a6362c45808a5fac5bc0a8f58c29b4d9291b9a7d + pristine_git_object: 71e44ac74c571debabf7a8b811f8c244f2b7c30a examples: list_models_v1_models_get: speakeasy-default-list-models-v1-models-get: responses: "200": - application/json: {"object": "list"} - "422": - application/json: {} - retrieve_model_v1_models__model_id__get: - speakeasy-default-retrieve-model-v1-models-model-id-get: + application/json: {"object": "list"} + "422": + application/json: {} + userExample: + responses: + "200": + application/json: {"object": "list"} + retrieve_model_v1_models__model_id__get: + speakeasy-default-retrieve-model-v1-models-model-id-get: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "", "object": "model", "owned_by": "mistralai", "capabilities": {"completion_chat": true, "function_calling": true, "reasoning": false, "completion_fim": false, "fine_tuning": false, "vision": false, "ocr": false, "classification": false, "moderation": false, "audio": false, "audio_transcription": false, "audio_transcription_realtime": false, "audio_speech": false}, "max_context_length": 32768, "type": "fine-tuned", "job": "Product Markets Facilitator", "root": "", "archived": false} + "422": + application/json: {} + userExample: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "", "object": "model", "owned_by": "mistralai", "capabilities": {"completion_chat": false, "function_calling": false, "reasoning": false, "completion_fim": false, "fine_tuning": false, "vision": false, "ocr": false, "classification": false, "moderation": false, "audio": false, "audio_transcription": false, "audio_transcription_realtime": false, "audio_speech": false}, "max_context_length": 32768, "type": "fine-tuned", "job": "Product Markets Facilitator", "root": "", "archived": false} + delete_model_v1_models__model_id__delete: + speakeasy-default-delete-model-v1-models-model-id-delete: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "ft:open-mistral-7b:587a6b29:20240514:7e773925", "object": "model", "deleted": true} + "422": + application/json: {} + userExample: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "ft:open-mistral-7b:587a6b29:20240514:7e773925", "object": "model", "deleted": true} + jobs_api_routes_fine_tuning_update_fine_tuned_model: + speakeasy-default-jobs-api-routes-fine-tuning-update-fine-tuned-model: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "object": "model", "created": 124166, "owned_by": "", "workspace_id": "", "root": "", "root_version": "", "archived": true, "capabilities": {"completion_chat": true, "completion_fim": false, "function_calling": false, "fine_tuning": false, "classification": false}, "max_context_length": 32768, "job": "c4f8ef9a-6612-4f49-88fa-a80eb8116e46", "model_type": "completion"} + jobs_api_routes_fine_tuning_archive_fine_tuned_model: + speakeasy-default-jobs-api-routes-fine-tuning-archive-fine-tuned-model: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "", "object": "model", "archived": true} + jobs_api_routes_fine_tuning_unarchive_fine_tuned_model: + speakeasy-default-jobs-api-routes-fine-tuning-unarchive-fine-tuned-model: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "", "object": "model", "archived": false} + agents_api_v1_conversations_start: + speakeasy-default-agents-api-v1-conversations-start: + requestBody: + application/json: {"inputs": "", "stream": false, "completion_args": {"response_format": {"type": "text"}}} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "agent.handoff", "previous_agent_id": "", "previous_agent_name": "", "next_agent_id": "", "next_agent_name": ""}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + agents_api_v1_conversations_list: + speakeasy-default-agents-api-v1-conversations-list: + parameters: + query: + page: 0 + page_size: 100 + responses: + "200": + application/json: [{"object": "conversation", "id": "", "created_at": "2025-11-20T22:30:47.754Z", "updated_at": "2025-08-05T08:36:20.296Z", "agent_id": ""}] + "422": + application/json: {} + agents_api_v1_conversations_get: + speakeasy-default-agents-api-v1-conversations-get: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation", "id": "", "created_at": "2023-06-02T14:00:42.201Z", "updated_at": "2024-10-06T17:16:50.325Z", "agent_id": ""} + "422": + application/json: {} + agents_api_v1_conversations_append: + speakeasy-default-agents-api-v1-conversations-append: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"stream": false, "store": true, "handoff_execution": "server", "completion_args": {"response_format": {"type": "text"}}} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + agents_api_v1_conversations_history: + speakeasy-default-agents-api-v1-conversations-history: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation.history", "conversation_id": "", "entries": [{"object": "entry", "type": "tool.execution", "name": "image_generation", "arguments": ""}]} + "422": + application/json: {} + agents_api_v1_conversations_messages: + speakeasy-default-agents-api-v1-conversations-messages: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation.messages", "conversation_id": "", "messages": []} + "422": + application/json: {} + agents_api_v1_conversations_restart: + speakeasy-default-agents-api-v1-conversations-restart: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"stream": false, "store": true, "handoff_execution": "server", "completion_args": {"response_format": {"type": "text"}}, "from_entry_id": ""} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + agents_api_v1_conversations_start_stream: + speakeasy-default-agents-api-v1-conversations-start-stream: + requestBody: + application/json: {"inputs": [{"object": "entry", "type": "function.result", "tool_call_id": "", "result": ""}], "stream": true, "completion_args": {"response_format": {"type": "text"}}} + responses: + "422": + application/json: {} + agents_api_v1_conversations_append_stream: + speakeasy-default-agents-api-v1-conversations-append-stream: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"stream": true, "store": true, "handoff_execution": "server", "completion_args": {"response_format": {"type": "text"}}} + responses: + "422": + application/json: {} + agents_api_v1_conversations_restart_stream: + speakeasy-default-agents-api-v1-conversations-restart-stream: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"stream": true, "store": true, "handoff_execution": "server", "completion_args": {"response_format": {"type": "text"}}, "from_entry_id": ""} + responses: + "422": + application/json: {} + agents_api_v1_agents_create: + speakeasy-default-agents-api-v1-agents-create: + requestBody: + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "LeBaron", "name": ""} + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "Ranchero", "name": "", "object": "agent", "id": "", "version": 316961, "versions": [818563, 316961], "created_at": "2025-03-26T19:00:51.430Z", "updated_at": "2023-04-28T15:08:02.110Z", "deployment_chat": false, "source": ""} + "422": + application/json: {} + agents_api_v1_agents_list: + speakeasy-default-agents-api-v1-agents-list: + parameters: + query: + page: 0 + page_size: 20 + responses: + "200": + application/json: [{"model": "Impala", "name": "", "object": "agent", "id": "", "version": 43153, "versions": [43153, 439473], "created_at": "2024-04-26T15:54:09.954Z", "updated_at": "2024-02-11T18:27:55.607Z", "deployment_chat": true, "source": ""}] + "422": + application/json: {} + agents_api_v1_agents_get: + speakeasy-default-agents-api-v1-agents-get: + parameters: + path: + agent_id: "" + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "Silverado", "name": "", "object": "agent", "id": "", "version": 845972, "versions": [845972, 878771, 621094], "created_at": "2025-08-21T03:10:48.135Z", "updated_at": "2024-11-11T17:15:57.309Z", "deployment_chat": false, "source": ""} + "422": + application/json: {} + agents_api_v1_agents_update: + speakeasy-default-agents-api-v1-agents-update: + parameters: + path: + agent_id: "" + requestBody: + application/json: {"completion_args": {"response_format": {"type": "text"}}} + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "Model X", "name": "", "object": "agent", "id": "", "version": 799821, "versions": [799821, 934063], "created_at": "2025-10-20T17:35:08.067Z", "updated_at": "2023-11-16T08:47:13.265Z", "deployment_chat": true, "source": ""} + "422": + application/json: {} + agents_api_v1_agents_update_version: + speakeasy-default-agents-api-v1-agents-update-version: + parameters: + path: + agent_id: "" + query: + version: 157995 + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "XTS", "name": "", "object": "agent", "id": "", "version": 310764, "versions": [], "created_at": "2023-05-08T23:29:06.216Z", "updated_at": "2023-05-16T19:20:05.735Z", "deployment_chat": false, "source": ""} + "422": + application/json: {} + files_api_routes_upload_file: + speakeasy-default-files-api-routes-upload-file: + requestBody: + multipart/form-data: {"file": "x-file: example.file"} + responses: + "200": + application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "batch", "sample_type": "batch_result", "source": "upload"} + userExample: + requestBody: + multipart/form-data: {"visibility": "workspace", "file": "x-file: example.file"} + responses: + "200": + application/json: {"id": "e85980c9-409e-4a46-9304-36588f6292b0", "object": "file", "bytes": 13000, "created_at": 1759500189, "filename": "example.file.jsonl", "purpose": "fine-tune", "sample_type": "instruct", "num_lines": 2, "mimetype": "application/jsonl", "source": "upload", "signature": "d4821d2de1917341"} + files_api_routes_list_files: + speakeasy-default-files-api-routes-list-files: + parameters: + query: + page: 0 + page_size: 100 + responses: + "200": + application/json: {"data": [{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "fine-tune", "sample_type": "batch_error", "source": "upload"}], "object": "", "total": 999335} + userExample: + parameters: + query: + page: 0 + page_size: 100 + include_total: true + responses: + "200": + application/json: {"data": [{"id": "", "object": "file", "bytes": 13000, "created_at": 1759491994, "filename": "", "purpose": "batch", "sample_type": "batch_result", "num_lines": 2, "mimetype": "application/jsonl", "source": "mistral", "signature": null}, {"id": "", "object": "file", "bytes": 13000, "created_at": 1759491994, "filename": "", "purpose": "batch", "sample_type": "batch_result", "num_lines": 2, "mimetype": "application/jsonl", "source": "mistral", "signature": null}], "object": "list", "total": 2} + files_api_routes_retrieve_file: + speakeasy-default-files-api-routes-retrieve-file: + parameters: + path: + file_id: "f2a27685-ca4e-4dc2-9f2b-88c422c3e0f6" + responses: + "200": + application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "batch", "sample_type": "instruct", "source": "repository", "deleted": false} + userExample: + parameters: + path: + file_id: "f2a27685-ca4e-4dc2-9f2b-88c422c3e0f6" + responses: + "200": + application/json: {"id": "e85980c9-409e-4a46-9304-36588f6292b0", "object": "file", "bytes": 13000, "created_at": 1759500189, "filename": "example.file.jsonl", "purpose": "fine-tune", "sample_type": "instruct", "num_lines": 2, "mimetype": "application/jsonl", "source": "upload", "signature": "d4821d2de1917341", "deleted": false} + files_api_routes_delete_file: + speakeasy-default-files-api-routes-delete-file: + parameters: + path: + file_id: "3b6d45eb-e30b-416f-8019-f47e2e93d930" + responses: + "200": + application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "deleted": false} + userExample: + parameters: + path: + file_id: "3b6d45eb-e30b-416f-8019-f47e2e93d930" + responses: + "200": + application/json: {"id": "e85980c9-409e-4a46-9304-36588f6292b0", "object": "file", "deleted": true} + files_api_routes_download_file: + speakeasy-default-files-api-routes-download-file: + parameters: + path: + file_id: "f8919994-a4a1-46b2-8b5b-06335a4300ce" + responses: + "200": + application/octet-stream: "x-file: example.file" + files_api_routes_get_signed_url: + speakeasy-default-files-api-routes-get-signed-url: + parameters: + path: + file_id: "06a020ab-355c-49a6-b19d-304b7c01699f" + query: + expiry: 24 + responses: + "200": + application/json: {"url": "https://knotty-birdcage.net/"} + userExample: + parameters: + path: + file_id: "06a020ab-355c-49a6-b19d-304b7c01699f" + query: + expiry: 24 + responses: + "200": + application/json: {"url": "https://mistralaifilesapiprodswe.blob.core.windows.net/fine-tune/.../.../e85980c9409e4a46930436588f6292b0.jsonl?se=2025-10-04T14%3A16%3A17Z&sp=r&sv=2025-01-05&sr=b&sig=..."} + jobs_api_routes_fine_tuning_get_fine_tuning_jobs: + speakeasy-default-jobs-api-routes-fine-tuning-get-fine-tuning-jobs: + parameters: + query: + page: 0 + page_size: 100 + created_by_me: false + responses: + "200": + application/json: {"data": [{"id": "26eef0fc-3789-443c-b2ac-b2993519b4b7", "auto_start": true, "model": "Fortwo", "status": "FAILED_VALIDATION", "created_at": 267488, "modified_at": 203336, "training_files": ["3ea0059a-6d48-49ed-b22d-3cb0ef3f47fa"], "object": "job", "job_type": "completion", "hyperparameters": {"learning_rate": 0.0001}}], "object": "list", "total": 843585} + jobs_api_routes_fine_tuning_create_fine_tuning_job: + speakeasy-default-jobs-api-routes-fine-tuning-create-fine-tuning-job: + requestBody: + application/json: {"model": "Camaro", "invalid_sample_skip_percentage": 0, "hyperparameters": {"learning_rate": 0.0001}} + responses: + "200": + application/json: {"expected_duration_seconds": 220, "cost": 10, "cost_currency": "EUR", "train_tokens_per_step": 131072, "train_tokens": 1310720, "data_tokens": 305375, "deprecated": true, "details": "", "epochs": 4.2922, "training_steps": 10, "object": "job.metadata"} + jobs_api_routes_fine_tuning_get_fine_tuning_job: + speakeasy-default-jobs-api-routes-fine-tuning-get-fine-tuning-job: + parameters: + path: + job_id: "c167a961-ffca-4bcf-93ac-6169468dd389" + responses: + "200": + application/json: {"id": "babac92a-96fa-48c4-931c-f6f97e1bf24c", "auto_start": false, "model": "Spyder", "status": "FAILED", "created_at": 232438, "modified_at": 32259, "training_files": ["7a95c5a0-399d-4665-84c8-deab766d22dc"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "classifier_targets": [{"name": "", "labels": [], "weight": 5651, "loss_function": "single_class"}]} + jobs_api_routes_fine_tuning_cancel_fine_tuning_job: + speakeasy-default-jobs-api-routes-fine-tuning-cancel-fine-tuning-job: + parameters: + path: + job_id: "6188a2f6-7513-4e0f-89cc-3f8088523a49" + responses: + "200": + application/json: {"id": "770b9cc0-1ab6-44de-a816-67010644e9fb", "auto_start": false, "model": "Volt", "status": "CANCELLATION_REQUESTED", "created_at": 546404, "modified_at": 180081, "training_files": ["45e621c6-ac30-4133-b6d1-fc0d1fe24c9f"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "classifier_targets": [{"name": "", "labels": [""], "weight": 1298.58, "loss_function": "multi_class"}]} + jobs_api_routes_fine_tuning_start_fine_tuning_job: + speakeasy-default-jobs-api-routes-fine-tuning-start-fine-tuning-job: + parameters: + path: + job_id: "56553e4d-0679-471e-b9ac-59a77d671103" + responses: + "200": + application/json: {"id": "68ad461a-676e-47fe-a07e-15e38f5082b5", "auto_start": false, "model": "Grand Cherokee", "status": "STARTED", "created_at": 134515, "modified_at": 192651, "training_files": ["39dabc3d-15eb-49ac-a549-69973f33acee"], "object": "job", "job_type": "completion", "hyperparameters": {"learning_rate": 0.0001}} + jobs_api_routes_batch_get_batch_jobs: + speakeasy-default-jobs-api-routes-batch-get-batch-jobs: + parameters: + query: + page: 0 + page_size: 100 + created_by_me: false + order_by: "-created" + responses: + "200": + application/json: {"object": "list", "total": 186589} + jobs_api_routes_batch_create_batch_job: + speakeasy-default-jobs-api-routes-batch-create-batch-job: + requestBody: + application/json: {"endpoint": "/v1/moderations", "model": "mistral-small-latest", "timeout_hours": 24} + responses: + "200": + application/json: {"id": "", "object": "batch", "input_files": ["7b2553d8-e17f-4df5-a862-a1678f6b5271", "8c618d9f-7d82-42ba-a284-d57d84f50a58", "c042f996-e842-441d-ae47-4e0850334e41"], "endpoint": "", "errors": [{"message": "", "count": 1}], "status": "SUCCESS", "created_at": 395527, "total_requests": 166919, "completed_requests": 258552, "succeeded_requests": 480980, "failed_requests": 684176} + jobs_api_routes_batch_get_batch_job: + speakeasy-default-jobs-api-routes-batch-get-batch-job: + parameters: + path: + job_id: "4017dc9f-b629-42f4-9700-8c681b9e7f0f" + responses: + "200": + application/json: {"id": "", "object": "batch", "input_files": ["11b83f16-f2f9-4de4-a81f-203fff419c99"], "endpoint": "", "errors": [], "status": "TIMEOUT_EXCEEDED", "created_at": 900958, "total_requests": 458292, "completed_requests": 184893, "succeeded_requests": 104800, "failed_requests": 836210} + jobs_api_routes_batch_cancel_batch_job: + speakeasy-default-jobs-api-routes-batch-cancel-batch-job: + parameters: + path: + job_id: "4fb29d1c-535b-4f0a-a1cb-2167f86da569" + responses: + "200": + application/json: {"id": "", "object": "batch", "input_files": ["8fd9d88a-66be-43fd-a816-ba509ca3ca85"], "endpoint": "", "errors": [], "status": "TIMEOUT_EXCEEDED", "created_at": 608251, "total_requests": 12693, "completed_requests": 203340, "succeeded_requests": 189291, "failed_requests": 969057} + chat_completion_v1_chat_completions_post: + speakeasy-default-chat-completion-v1-chat-completions-post: + requestBody: + application/json: {"model": "mistral-large-latest", "stream": false, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} + responses: + "200": + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} + "422": + application/json: {} + stream_chat: + speakeasy-default-stream-chat: + requestBody: + application/json: {"model": "mistral-large-latest", "stream": true, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} + responses: + "422": + application/json: {} + fim_completion_v1_fim_completions_post: + speakeasy-default-fim-completion-v1-fim-completions-post: + requestBody: + application/json: {"model": "codestral-2405", "top_p": 1, "stream": false, "prompt": "def", "suffix": "return a+b"} + responses: + "200": + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "codestral-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} + "422": + application/json: {} + userExample: + requestBody: + application/json: {"model": "codestral-latest", "stream": false, "prompt": "def", "suffix": "return a+b"} + responses: + "200": + application/json: {"id": "447e3e0d457e42e98248b5d2ef52a2a3", "object": "chat.completion", "model": "codestral-2508", "usage": {"prompt_tokens": 8, "completion_tokens": 91, "total_tokens": 99}, "created": 1759496862, "choices": [{"index": 0, "message": {"role": "assistant", "content": "add_numbers(a: int, b: int) -> int:\n \"\"\"\n You are given two integers `a` and `b`. Your task is to write a function that\n returns the sum of these two integers. The function should be implemented in a\n way that it can handle very large integers (up to 10^18). As a reminder, your\n code has to be in python\n \"\"\"\n", "tool_calls": null, "prefix": false}, "finish_reason": "stop"}]} + stream_fim: + speakeasy-default-stream-fim: + requestBody: + application/json: {"model": "codestral-latest", "stream": true, "prompt": "def", "suffix": "return a+b"} + responses: + "422": + application/json: {} + agents_completion_v1_agents_completions_post: + speakeasy-default-agents-completion-v1-agents-completions-post: + requestBody: + application/json: {"stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}], "agent_id": ""} + responses: + "200": + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} + "422": + application/json: {} + userExample: + requestBody: + application/json: {"stream": false, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}, "agent_id": ""} + responses: + "200": + application/json: {"id": "cf79f7daaee244b1a0ae5c7b1444424a", "object": "chat.completion", "model": "mistral-medium-latest", "usage": {"prompt_tokens": 24, "completion_tokens": 27, "total_tokens": 51, "prompt_audio_seconds": {}}, "created": 1759500534, "choices": [{"index": 0, "message": {"role": "assistant", "content": "Arrr, the scallywag Claude Monet be the finest French painter to ever splash colors on a canvas, savvy?", "tool_calls": null, "prefix": false}, "finish_reason": "stop"}]} + stream_agents: + speakeasy-default-stream-agents: + requestBody: + application/json: {"stream": true, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}, "agent_id": ""} + responses: + "422": + application/json: {} + embeddings_v1_embeddings_post: + speakeasy-default-embeddings-v1-embeddings-post: + requestBody: + application/json: {"model": "mistral-embed", "input": ["Embed this sentence.", "As well as this one."]} + responses: + "200": + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "data": [{"object": "embedding", "embedding": [0.1, 0.2, 0.3], "index": 0}, {"object": "embedding", "embedding": [0.4, 0.5, 0.6], "index": 1}]} + "422": + application/json: {} + userExample: + requestBody: + application/json: {"model": "mistral-embed", "input": ["Embed this sentence.", "As well as this one."]} + responses: + "200": + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "list", "model": "mistral-embed", "usage": {"prompt_tokens": 15, "completion_tokens": 0, "total_tokens": 15, "prompt_audio_seconds": null}, "data": [{"object": "embedding", "embedding": [-0.016632080078125, 0.0701904296875, 0.03143310546875, 0.01309967041015625, 0.0202789306640625], "index": 0}, {"object": "embedding", "embedding": [-0.0230560302734375, 0.039337158203125, 0.0521240234375, -0.0184783935546875, 0.034271240234375], "index": 1}]} + moderations_v1_moderations_post: + speakeasy-default-moderations-v1-moderations-post: + requestBody: + application/json: {"model": "Durango", "input": ["", ""]} + responses: + "200": + application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Corvette", "results": [{}]} + "422": + application/json: {} + userExample: + requestBody: + application/json: {"model": "mistral-moderation-latest", "input": ""} + responses: + "200": + application/json: {"id": "4d71ae510af942108ef7344f903e2b88", "model": "mistral-moderation-latest", "results": [{"categories": {"sexual": false, "hate_and_discrimination": false, "violence_and_threats": false, "dangerous_and_criminal_content": false, "selfharm": false, "health": false, "financial": false, "law": false, "pii": false}, "category_scores": {"sexual": 0.0011335690505802631, "hate_and_discrimination": 0.0030753696337342262, "violence_and_threats": 0.0003569706459529698, "dangerous_and_criminal_content": 0.002251847181469202, "selfharm": 0.00017952796770259738, "health": 0.0002780309587251395, "financial": 0.00008481103577651083, "law": 0.00004539786823443137, "pii": 0.0023967307060956955}}, {"categories": {"sexual": false, "hate_and_discrimination": false, "violence_and_threats": false, "dangerous_and_criminal_content": false, "selfharm": false, "health": false, "financial": false, "law": false, "pii": false}, "category_scores": {"sexual": 0.000626334105618298, "hate_and_discrimination": 0.0013670255430042744, "violence_and_threats": 0.0002611903182696551, "dangerous_and_criminal_content": 0.0030753696337342262, "selfharm": 0.00010889690747717395, "health": 0.00015843621804378927, "financial": 0.000191104321856983, "law": 0.00004006369272246957, "pii": 0.0035936026833951473}}]} + chat_moderations_v1_chat_moderations_post: + speakeasy-default-chat-moderations-v1-chat-moderations-post: + requestBody: + application/json: {"input": [{"content": "", "role": "tool"}], "model": "LeBaron"} + responses: + "200": + application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Explorer", "results": [{}]} + "422": + application/json: {} + userExample: + requestBody: + application/json: {"input": [{"role": "tool", "content": ""}], "model": "LeBaron"} + responses: + "200": + application/json: {"id": "352bce1a55814127a3b0bc4fb8f02a35", "model": "mistral-moderation-latest", "results": [{"categories": {"sexual": false, "hate_and_discrimination": false, "violence_and_threats": false, "dangerous_and_criminal_content": false, "selfharm": false, "health": false, "financial": false, "law": false, "pii": false}, "category_scores": {"sexual": 0.0010322310263291001, "hate_and_discrimination": 0.001597845577634871, "violence_and_threats": 0.00020342698553577065, "dangerous_and_criminal_content": 0.0029810327105224133, "selfharm": 0.00017952796770259738, "health": 0.0002959570847451687, "financial": 0.000079673009167891, "law": 0.00004539786823443137, "pii": 0.004198795650154352}}]} + classifications_v1_classifications_post: + speakeasy-default-classifications-v1-classifications-post: + requestBody: + application/json: {"model": "mistral-moderation-latest", "input": [""]} + responses: + "200": + application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "ATS", "results": [{}, {"key": {"scores": {"key": 2080.19}}}]} + "422": + application/json: {} + chat_classifications_v1_chat_classifications_post: + speakeasy-default-chat-classifications-v1-chat-classifications-post: + requestBody: + application/json: {"model": "Camry", "input": [{"messages": [{"role": "system", "content": ""}]}]} + responses: + "200": + application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Altima", "results": [{}, {"key": {"scores": {"key": 1360.53, "key1": 5946.42}}}, {"key": {"scores": {"key": 1360.53, "key1": 5946.42}}}]} + "422": + application/json: {} + ocr_v1_ocr_post: + speakeasy-default-ocr-v1-ocr-post: + requestBody: + application/json: {"model": "CX-9", "document": {"image_url": {"url": "https://measly-scrap.com"}, "type": "image_url"}} + responses: + "200": + application/json: {"pages": [{"index": 944919, "markdown": "", "images": [], "dimensions": {"dpi": 984283, "height": 453411, "width": 398292}}], "model": "Wrangler", "usage_info": {"pages_processed": 47064}} + "422": + application/json: {} + userExample: + requestBody: + application/json: {"model": "CX-9", "document": {"type": "document_url", "document_url": "https://upset-labourer.net/"}, "bbox_annotation_format": {"type": "text"}, "document_annotation_format": {"type": "text"}} + responses: + "200": + application/json: {"pages": [{"index": 1, "markdown": "# LEVERAGING UNLABELED DATA TO PREDICT OUT-OF-DISTRIBUTION PERFORMANCE\nSaurabh Garg*
Carnegie Mellon University
sgarg2@andrew.cmu.edu
Sivaraman Balakrishnan
Carnegie Mellon University
sbalakri@andrew.cmu.edu
Zachary C. Lipton
Carnegie Mellon University
zlipton@andrew.cmu.edu\n## Behnam Neyshabur\nGoogle Research, Blueshift team
neyshabur@google.com\nHanie Sedghi
Google Research, Brain team
hsedghi@google.com\n#### Abstract\nReal-world machine learning deployments are characterized by mismatches between the source (training) and target (test) distributions that may cause performance drops. In this work, we investigate methods for predicting the target domain accuracy using only labeled source data and unlabeled target data. We propose Average Thresholded Confidence (ATC), a practical method that learns a threshold on the model's confidence, predicting accuracy as the fraction of unlabeled examples for which model confidence exceeds that threshold. ATC outperforms previous methods across several model architectures, types of distribution shifts (e.g., due to synthetic corruptions, dataset reproduction, or novel subpopulations), and datasets (WILDS, ImageNet, BREEDS, CIFAR, and MNIST). In our experiments, ATC estimates target performance $2-4 \\times$ more accurately than prior methods. We also explore the theoretical foundations of the problem, proving that, in general, identifying the accuracy is just as hard as identifying the optimal predictor and thus, the efficacy of any method rests upon (perhaps unstated) assumptions on the nature of the shift. Finally, analyzing our method on some toy distributions, we provide insights concerning when it works ${ }^{1}$.\n## 1 INTRODUCTION\nMachine learning models deployed in the real world typically encounter examples from previously unseen distributions. While the IID assumption enables us to evaluate models using held-out data from the source distribution (from which training data is sampled), this estimate is no longer valid in presence of a distribution shift. Moreover, under such shifts, model accuracy tends to degrade (Szegedy et al., 2014; Recht et al., 2019; Koh et al., 2021). Commonly, the only data available to the practitioner are a labeled training set (source) and unlabeled deployment-time data which makes the problem more difficult. In this setting, detecting shifts in the distribution of covariates is known to be possible (but difficult) in theory (Ramdas et al., 2015), and in practice (Rabanser et al., 2018). However, producing an optimal predictor using only labeled source and unlabeled target data is well-known to be impossible absent further assumptions (Ben-David et al., 2010; Lipton et al., 2018).\nTwo vital questions that remain are: (i) the precise conditions under which we can estimate a classifier's target-domain accuracy; and (ii) which methods are most practically useful. To begin, the straightforward way to assess the performance of a model under distribution shift would be to collect labeled (target domain) examples and then to evaluate the model on that data. However, collecting fresh labeled data from the target distribution is prohibitively expensive and time-consuming, especially if the target distribution is non-stationary. Hence, instead of using labeled data, we aim to use unlabeled data from the target distribution, that is comparatively abundant, to predict model performance. Note that in this work, our focus is not to improve performance on the target but, rather, to estimate the accuracy on the target for a given classifier.\n[^0]: Work done in part while Saurabh Garg was interning at Google ${ }^{1}$ Code is available at [https://github.com/saurabhgarg1996/ATC_code](https://github.com/saurabhgarg1996/ATC_code).\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 2, "markdown": "![img-0.jpeg](img-0.jpeg)\nFigure 1: Illustration of our proposed method ATC. Left: using source domain validation data, we identify a threshold on a score (e.g. negative entropy) computed on model confidence such that fraction of examples above the threshold matches the validation set accuracy. ATC estimates accuracy on unlabeled target data as the fraction of examples with the score above the threshold. Interestingly, this threshold yields accurate estimates on a wide set of target distributions resulting from natural and synthetic shifts. Right: Efficacy of ATC over previously proposed approaches on our testbed with a post-hoc calibrated model. To obtain errors on the same scale, we rescale all errors with Average Confidence (AC) error. Lower estimation error is better. See Table 1 for exact numbers and comparison on various types of distribution shift. See Sec. 5 for details on our testbed.\nRecently, numerous methods have been proposed for this purpose (Deng & Zheng, 2021; Chen et al., 2021b; Jiang et al., 2021; Deng et al., 2021; Guillory et al., 2021). These methods either require calibration on the target domain to yield consistent estimates (Jiang et al., 2021; Guillory et al., 2021) or additional labeled data from several target domains to learn a linear regression function on a distributional distance that then predicts model performance (Deng et al., 2021; Deng & Zheng, 2021; Guillory et al., 2021). However, methods that require calibration on the target domain typically yield poor estimates since deep models trained and calibrated on source data are not, in general, calibrated on a (previously unseen) target domain (Ovadia et al., 2019). Besides, methods that leverage labeled data from target domains rely on the fact that unseen target domains exhibit strong linear correlation with seen target domains on the underlying distance measure and, hence, can be rendered ineffective when such target domains with labeled data are unavailable (in Sec. 5.1 we demonstrate such a failure on a real-world distribution shift problem). Therefore, throughout the paper, we assume access to labeled source data and only unlabeled data from target domain(s).\nIn this work, we first show that absent assumptions on the source classifier or the nature of the shift, no method of estimating accuracy will work generally (even in non-contrived settings). To estimate accuracy on target domain perfectly, we highlight that even given perfect knowledge of the labeled source distribution (i.e., $p_{s}(x, y)$ ) and unlabeled target distribution (i.e., $p_{t}(x)$ ), we need restrictions on the nature of the shift such that we can uniquely identify the target conditional $p_{t}(y \\mid x)$. Thus, in general, identifying the accuracy of the classifier is as hard as identifying the optimal predictor.\nSecond, motivated by the superiority of methods that use maximum softmax probability (or logit) of a model for Out-Of-Distribution (OOD) detection (Hendrycks & Gimpel, 2016; Hendrycks et al., 2019), we propose a simple method that leverages softmax probability to predict model performance. Our method, Average Thresholded Confidence (ATC), learns a threshold on a score (e.g., maximum confidence or negative entropy) of model confidence on validation source data and predicts target domain accuracy as the fraction of unlabeled target points that receive a score above that threshold. ATC selects a threshold on validation source data such that the fraction of source examples that receive the score above the threshold match the accuracy of those examples. Our primary contribution in ATC is the proposal of obtaining the threshold and observing its efficacy on (practical) accuracy estimation. Importantly, our work takes a step forward in positively answering the question raised in Deng & Zheng (2021); Deng et al. (2021) about a practical strategy to select a threshold that enables accuracy prediction with thresholded model confidence.\n", "images": [{"id": "img-0.jpeg", "top_left_x": 292, "top_left_y": 217, "bottom_right_x": 1405, "bottom_right_y": 649, "image_base64": ""}], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 3, "markdown": "", "images": [], "dimensions": {"dpi": 539192, "height": 944919, "width": 247256}}, {"index": 27, "markdown": "![img-8.jpeg](img-8.jpeg)\nFigure 9: Scatter plot of predicted accuracy versus (true) OOD accuracy for vision datasets except MNIST with a ResNet50 model. Results reported by aggregating MAE numbers over 4 different seeds.\n", "images": [{"id": "img-8.jpeg", "top_left_x": 290, "top_left_y": 226, "bottom_right_x": 1405, "bottom_right_y": 1834, "image_base64": ""}], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 28, "markdown": "| Dataset | Shift | IM | | AC | | DOC | | GDE | ATC-MC (Ours) | | ATC-NE (Ours) | | | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | | | | Pre T | Post T | Pre T | Post T | Pre T | Post T | Post T | Pre T | Post T | Pre T | Post T | | CIFAR10 | Natural | 6.60 | 5.74 | 9.88 | 6.89 | 7.25 | 6.07 | 4.77 | 3.21 | 3.02 | 2.99 | 2.85 | | | | (0.35) | (0.30) | (0.16) | (0.13) | (0.15) | (0.16) | (0.13) | (0.49) | (0.40) | (0.37) | (0.29) | | | Synthetic | 12.33 | 10.20 | 16.50 | 11.91 | 13.87 | 11.08 | 6.55 | 4.65 | 4.25 | 4.21 | 3.87 | | | | (0.51) | (0.48) | (0.26) | (0.17) | (0.18) | (0.17) | (0.35) | (0.55) | (0.55) | (0.55) | (0.75) | | CIFAR100 | Synthetic | 13.69 | 11.51 | 23.61 | 13.10 | 14.60 | 10.14 | 9.85 | 5.50 | 4.75 | 4.72 | 4.94 | | | | (0.55) | (0.41) | (1.16) | (0.80) | (0.77) | (0.64) | (0.57) | (0.70) | (0.73) | (0.74) | (0.74) | | ImageNet200 | Natural | 12.37 | 8.19 | 22.07 | 8.61 | 15.17 | 7.81 | 5.13 | 4.37 | 2.04 | 3.79 | 1.45 | | | | (0.25) | (0.33) | (0.08) | (0.25) | (0.11) | (0.29) | (0.08) | (0.39) | (0.24) | (0.30) | (0.27) | | | Synthetic | 19.86 | 12.94 | 32.44 | 13.35 | 25.02 | 12.38 | 5.41 | 5.93 | 3.09 | 5.00 | 2.68 | | | | (1.38) | (1.81) | (1.00) | (1.30) | (1.10) | (1.38) | (0.89) | (1.38) | (0.87) | (1.28) | (0.45) | | ImageNet | Natural | 7.77 | 6.50 | 18.13 | 6.02 | 8.13 | 5.76 | 6.23 | 3.88 | 2.17 | 2.06 | 0.80 | | | | (0.27) | (0.33) | (0.23) | (0.34) | (0.27) | (0.37) | (0.41) | (0.53) | (0.62) | (0.54) | (0.44) | | | Synthetic | 13.39 | 10.12 | 24.62 | 8.51 | 13.55 | 7.90 | 6.32 | 3.34 | 2.53 | 2.61 | 4.89 | | | | (0.53) | (0.63) | (0.64) | (0.71) | (0.61) | (0.72) | (0.33) | (0.53) | (0.36) | (0.33) | (0.83) | | FMoW-WILDS | Natural | 5.53 | 4.31 | 33.53 | 12.84 | 5.94 | 4.45 | 5.74 | 3.06 | 2.70 | 3.02 | 2.72 | | | | (0.33) | (0.63) | (0.13) | (12.06) | (0.36) | (0.77) | (0.55) | (0.36) | (0.54) | (0.35) | (0.44) | | RxRx1-WILDS | Natural | 5.80 | 5.72 | 7.90 | 4.84 | 5.98 | 5.98 | 6.03 | 4.66 | 4.56 | 4.41 | 4.47 | | | | (0.17) | (0.15) | (0.24) | (0.09) | (0.15) | (0.13) | (0.08) | (0.38) | (0.38) | (0.31) | (0.26) | | Amazon-WILDS | Natural | 2.40 | 2.29 | 8.01 | 2.38 | 2.40 | 2.28 | 17.87 | 1.65 | 1.62 | 1.60 | 1.59 | | | | (0.08) | (0.09) | (0.53) | (0.17) | (0.09) | (0.09) | (0.18) | (0.06) | (0.05) | (0.14) | (0.15) | | CivilCom.-WILDS | Natural | 12.64 | 10.80 | 16.76 | 11.03 | 13.31 | 10.99 | 16.65 | | 7.14 | | | | | | (0.52) | (0.48) | (0.53) | (0.49) | (0.52) | (0.49) | (0.25) | | (0.41) | | | | MNIST | Natural | 18.48 | 15.99 | 21.17 | 14.81 | 20.19 | 14.56 | 24.42 | 5.02 | 2.40 | 3.14 | 3.50 | | | | (0.45) | (1.53) | (0.24) | (3.89) | (0.23) | (3.47) | (0.41) | (0.44) | (1.83) | (0.49) | (0.17) | | ENTITY-13 | Same | 16.23 | 11.14 | 24.97 | 10.88 | 19.08 | 10.47 | 10.71 | 5.39 | 3.88 | 4.58 | 4.19 | | | | (0.77) | (0.65) | (0.70) | (0.77) | (0.65) | (0.72) | (0.74) | (0.92) | (0.61) | (0.85) | (0.16) | | | Novel | 28.53 | 22.02 | 38.33 | 21.64 | 32.43 | 21.22 | 20.61 | 13.58 | 10.28 | 12.25 | 6.63 | | | | (0.82) | (0.68) | (0.75) | (0.86) | (0.69) | (0.80) | (0.60) | (1.15) | (1.34) | (1.21) | (0.93) | | ENTITY-30 | Same | 18.59 | 14.46 | 28.82 | 14.30 | 21.63 | 13.46 | 12.92 | 9.12 | 7.75 | 8.15 | 7.64 | | | | (0.51) | (0.52) | (0.43) | (0.71) | (0.37) | (0.59) | (0.14) | (0.62) | (0.72) | (0.68) | (0.88) | | | Novel | 32.34 | 26.85 | 44.02 | 26.27 | 36.82 | 25.42 | 23.16 | 17.75 | 14.30 | 15.60 | 10.57 | | | | (0.60) | (0.58) | (0.56) | (0.79) | (0.47) | (0.68) | (0.12) | (0.76) | (0.85) | (0.86) | (0.86) | | NONLIVING-26 | Same | 18.66 | 17.17 | 26.39 | 16.14 | 19.86 | 15.58 | 16.63 | 10.87 | 10.24 | 10.07 | 10.26 | | | | (0.76) | (0.74) | (0.82) | (0.81) | (0.67) | (0.76) | (0.45) | (0.98) | (0.83) | (0.92) | (1.18) | | | Novel | 33.43 | 31.53 | 41.66 | 29.87 | 35.13 | 29.31 | 29.56 | 21.70 | 20.12 | 19.08 | 18.26 | | | | (0.67) | (0.65) | (0.67) | (0.71) | (0.54) | (0.64) | (0.21) | (0.86) | (0.75) | (0.82) | (1.12) | | LIVING-17 | Same | 12.63 | 11.05 | 18.32 | 10.46 | 14.43 | 10.14 | 9.87 | 4.57 | 3.95 | 3.81 | 4.21 | | | | (1.25) | (1.20) | (1.01) | (1.12) | (1.11) | (1.16) | (0.61) | (0.71) | (0.48) | (0.22) | (0.53) | | | Novel | 29.03 | 26.96 | 35.67 | 26.11 | 31.73 | 25.73 | 23.53 | 16.15 | 14.49 | 12.97 | 11.39 | | | | (1.44) | (1.38) | (1.09) | (1.27) | (1.19) | (1.35) | (0.52) | (1.36) | (1.46) | (1.52) | (1.72) |\nTable 3: Mean Absolute estimation Error (MAE) results for different datasets in our setup grouped by the nature of shift. 'Same' refers to same subpopulation shifts and 'Novel' refers novel subpopulation shifts. We include details about the target sets considered in each shift in Table 2. Post T denotes use of TS calibration on source. For language datasets, we use DistilBERT-base-uncased, for vision dataset we report results with DenseNet model with the exception of MNIST where we use FCN. Across all datasets, we observe that ATC achieves superior performance (lower MAE is better). For GDE post T and pre T estimates match since TS doesn't alter the argmax prediction. Results reported by aggregating MAE numbers over 4 different seeds. Values in parenthesis (i.e., $(\\cdot)$ ) denote standard deviation values.\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 29, "markdown": "| Dataset | Shift | IM | | AC | | DOC | | GDE | ATC-MC (Ours) | | ATC-NE (Ours) | | | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | | | | Pre T | Post T | Pre T | Post T | Pre T | Post T | Post T | Pre T | Post T | Pre T | Post T | | CIFAR10 | Natural | 7.14 | 6.20 | 10.25 | 7.06 | 7.68 | 6.35 | 5.74 | 4.02 | 3.85 | 3.76 | 3.38 | | | | (0.14) | (0.11) | (0.31) | (0.33) | (0.28) | (0.27) | (0.25) | (0.38) | (0.30) | (0.33) | (0.32) | | | Synthetic | 12.62 | 10.75 | 16.50 | 11.91 | 13.93 | 11.20 | 7.97 | 5.66 | 5.03 | 4.87 | 3.63 | | | | (0.76) | (0.71) | (0.28) | (0.24) | (0.29) | (0.28) | (0.13) | (0.64) | (0.71) | (0.71) | (0.62) | | CIFAR100 | Synthetic | 12.77 | 12.34 | 16.89 | 12.73 | 11.18 | 9.63 | 12.00 | 5.61 | 5.55 | 5.65 | 5.76 | | | | (0.43) | (0.68) | (0.20) | (2.59) | (0.35) | (1.25) | (0.48) | (0.51) | (0.55) | (0.35) | (0.27) | | ImageNet200 | Natural | 12.63 | 7.99 | 23.08 | 7.22 | 15.40 | 6.33 | 5.00 | 4.60 | 1.80 | 4.06 | 1.38 | | | | (0.59) | (0.47) | (0.31) | (0.22) | (0.42) | (0.24) | (0.36) | (0.63) | (0.17) | (0.69) | (0.29) | | | Synthetic | 20.17 | 11.74 | 33.69 | 9.51 | 25.49 | 8.61 | 4.19 | 5.37 | 2.78 | 4.53 | 3.58 | | | | (0.74) | (0.80) | (0.73) | (0.51) | (0.66) | (0.50) | (0.14) | (0.88) | (0.23) | (0.79) | (0.33) | | ImageNet | Natural | 8.09 | 6.42 | 21.66 | 5.91 | 8.53 | 5.21 | 5.90 | 3.93 | 1.89 | 2.45 | 0.73 | | | | (0.25) | (0.28) | (0.38) | (0.22) | (0.26) | (0.25) | (0.44) | (0.26) | (0.21) | (0.16) | (0.10) | | | Synthetic | 13.93 | 9.90 | 28.05 | 7.56 | 13.82 | 6.19 | 6.70 | 3.33 | 2.55 | 2.12 | 5.06 | | | | (0.14) | (0.23) | (0.39) | (0.13) | (0.31) | (0.07) | (0.52) | (0.25) | (0.25) | (0.31) | (0.27) | | FMoW-WILDS | Natural | 5.15 | 3.55 | 34.64 | 5.03 | 5.58 | 3.46 | 5.08 | 2.59 | 2.33 | 2.52 | 2.22 | | | | (0.19) | (0.41) | (0.22) | (0.29) | (0.17) | (0.37) | (0.46) | (0.32) | (0.28) | (0.25) | (0.30) | | RxRx1-WILDS | Natural | 6.17 | 6.11 | 21.05 | 5.21 | 6.54 | 6.27 | 6.82 | 5.30 | 5.20 | 5.19 | 5.63 | | | | (0.20) | (0.24) | (0.31) | (0.18) | (0.21) | (0.20) | (0.31) | (0.30) | (0.44) | (0.43) | (0.55) | | Entity-13 | Same | 18.32 | 14.38 | 27.79 | 13.56 | 20.50 | 13.22 | 16.09 | 9.35 | 7.50 | 7.80 | 6.94 | | | | (0.29) | (0.53) | (1.18) | (0.58) | (0.47) | (0.58) | (0.84) | (0.79) | (0.65) | (0.62) | (0.71) | | | Novel | 28.82 | 24.03 | 38.97 | 22.96 | 31.66 | 22.61 | 25.26 | 17.11 | 13.96 | 14.75 | 9.94 | | | | (0.30) | (0.55) | (1.32) | (0.59) | (0.54) | (0.58) | (1.08) | (0.93) | (0.64) | (0.78) | | | Entity-30 | Same | 16.91 | 14.61 | 26.84 | 14.37 | 18.60 | 13.11 | 13.74 | 8.54 | 7.94 | 7.77 | 8.04 | | | | (1.33) | (1.11) | (2.15) | (1.34) | (1.69) | (1.30) | (1.07) | (1.47) | (1.38) | (1.44) | (1.51) | | | Novel | 28.66 | 25.83 | 39.21 | 25.03 | 30.95 | 23.73 | 23.15 | 15.57 | 13.24 | 12.44 | 11.05 | | | | (1.16) | (0.88) | (2.03) | (1.11) | (1.64) | (1.11) | (0.51) | (1.44) | (1.15) | (1.26) | (1.13) | | NonLIVING-26 | Same | 17.43 | 15.95 | 27.70 | 15.40 | 18.06 | 14.58 | 16.99 | 10.79 | 10.13 | 10.05 | 10.29 | | | | (0.90) | (0.86) | (0.90) | (0.69) | (1.00) | (0.78) | (1.25) | (0.62) | (0.32) | (0.46) | (0.79) | | | Novel | 29.51 | 27.75 | 40.02 | 26.77 | 30.36 | 25.93 | 27.70 | 19.64 | 17.75 | 16.90 | 15.69 | | | | (0.86) | (0.82) | (0.76) | (0.82) | (0.95) | (0.80) | (1.42) | (0.68) | (0.53) | (0.60) | (0.83) | | LIVING-17 | Same | 14.28 | 12.21 | 23.46 | 11.16 | 15.22 | 10.78 | 10.49 | 4.92 | 4.23 | 4.19 | 4.73 | | | | (0.96) | (0.93) | (1.16) | (0.90) | (0.96) | (0.99) | (0.97) | (0.57) | (0.42) | (0.35) | (0.24) | | | Novel | 28.91 | 26.35 | 38.62 | 24.91 | 30.32 | 24.52 | 22.49 | 15.42 | 13.02 | 12.29 | 10.34 | | | | (0.66) | (0.73) | (1.01) | (0.61) | (0.59) | (0.74) | (0.85) | (0.59) | (0.53) | (0.73) | (0.62) |\nTable 4: Mean Absolute estimation Error (MAE) results for different datasets in our setup grouped by the nature of shift for ResNet model. 'Same' refers to same subpopulation shifts and 'Novel' refers novel subpopulation shifts. We include details about the target sets considered in each shift in Table 2. Post T denotes use of TS calibration on source. Across all datasets, we observe that ATC achieves superior performance (lower MAE is better). For GDE post T and pre T estimates match since TS doesn't alter the argmax prediction. Results reported by aggregating MAE numbers over 4 different seeds. Values in parenthesis (i.e., $(\\cdot)$ ) denote standard deviation values.\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}], "model": "mistral-ocr-2503-completion", "usage_info": {"pages_processed": 29, "doc_size_bytes": null}} + libraries_list_v1: + speakeasy-default-libraries-list-v1: + parameters: + query: + page_size: 100 + page: 0 + responses: + "200": + application/json: {"pagination": {"total_items": 935461, "total_pages": 720493, "current_page": 981761, "page_size": 755545, "has_more": true}, "data": [{"id": "bfc452fd-4bcb-46ec-9f68-ceea101e924d", "name": "", "created_at": "2024-01-31T13:50:47.409Z", "updated_at": "2023-04-09T15:28:24.261Z", "owner_id": "3fb92cf9-0fea-44d0-958f-16963601a1f0", "owner_type": "", "total_size": 811051, "nb_documents": 634577, "chunk_size": 502060}]} + "422": + application/json: {} + libraries_create_v1: + speakeasy-default-libraries-create-v1: + requestBody: + application/json: {"name": ""} + responses: + "201": + application/json: {"id": "7285d921-bbab-471e-a2df-600e096d8aca", "name": "", "created_at": "2025-12-10T18:12:15.618Z", "updated_at": "2023-12-29T15:14:03.343Z", "owner_id": "d5e2af8f-c98a-479e-aece-62d79ea6bab3", "owner_type": "", "total_size": 866940, "nb_documents": 123652, "chunk_size": 274694} + "422": + application/json: {} + libraries_get_v1: + speakeasy-default-libraries-get-v1: + parameters: + path: + library_id: "d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f" + responses: + "200": + application/json: {"id": "24e6ac5e-61cb-4f2c-b0c0-806dfd5d8dbf", "name": "", "created_at": "2023-01-19T09:20:07.756Z", "updated_at": "2023-05-28T00:39:57.656Z", "owner_id": "546a730e-7d06-4324-a4fd-2b7ff127978c", "owner_type": "", "total_size": 191122, "nb_documents": 932135, "chunk_size": null} + "422": + application/json: {} + libraries_delete_v1: + speakeasy-default-libraries-delete-v1: + parameters: + path: + library_id: "6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a" + responses: + "200": + application/json: {"id": "04e83772-3f8e-41d3-a053-763ed9937e07", "name": "", "created_at": "2025-03-15T23:45:26.060Z", "updated_at": "2024-08-03T06:23:12.129Z", "owner_id": "f636aa46-e1d5-4df4-966b-de4af27da6db", "owner_type": "", "total_size": 268102, "nb_documents": 821714, "chunk_size": null} + "422": + application/json: {} + libraries_update_v1: + speakeasy-default-libraries-update-v1: + parameters: + path: + library_id: "e01880c3-d0b5-4a29-8b1b-abdb8ce917e4" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "c3bb20a7-df8c-4461-8cfb-9e2a978c00da", "name": "", "created_at": "2025-03-12T04:49:28.349Z", "updated_at": "2025-12-18T03:09:25.092Z", "owner_id": "734e66b8-ae70-4069-9ebb-7eb7ee3967d5", "owner_type": "", "total_size": 762363, "nb_documents": 896591, "chunk_size": 507889} + "422": + application/json: {} + libraries_documents_list_v1: + speakeasy-default-libraries-documents-list-v1: + parameters: + path: + library_id: "5c3ca4cd-62bc-4c71-ad8a-1531ae80d078" + query: + page_size: 100 + page: 0 + sort_by: "created_at" + sort_order: "desc" + responses: + "200": + application/json: {"pagination": {"total_items": 23246, "total_pages": 881485, "current_page": 173326, "page_size": 318395, "has_more": false}, "data": [{"id": "5106c0c7-30fb-4fd3-9083-129b77f9f509", "library_id": "71eb68a2-756e-48b0-9d2b-a04d7bf95ff5", "hash": "", "mime_type": "", "extension": "pdf", "size": 367159, "name": "", "created_at": "2024-09-24T04:50:43.988Z", "process_status": "noop", "uploaded_by_id": "7d65f4d8-1997-479f-bfb4-535c0144b48c", "uploaded_by_type": "", "processing_status": "", "tokens_processing_total": 957230}]} + "422": + application/json: {} + libraries_documents_upload_v1: + speakeasy-default-libraries-documents-upload-v1: + parameters: + path: + library_id: "a02150d9-5ee0-4877-b62c-28b1fcdf3b76" + requestBody: + multipart/form-data: {"file": "x-file: example.file"} + responses: + "200": + application/json: {"id": "d40f9b56-c832-405d-aa99-b3e442254dd8", "library_id": "868d7955-009a-4433-bfc6-ad7b4be4e7e4", "hash": "", "mime_type": "", "extension": "m2v", "size": 418415, "name": "", "created_at": "2025-04-30T20:11:27.130Z", "process_status": "in_progress", "uploaded_by_id": "7db8d896-09c9-438c-b6dc-aa5c70102b3f", "uploaded_by_type": "", "processing_status": "", "tokens_processing_total": 61161} + "422": + application/json: {} + libraries_documents_get_v1: + speakeasy-default-libraries-documents-get-v1: + parameters: + path: + library_id: "03d908c8-90a1-44fd-bf3a-8490fb7c9a03" + document_id: "90973aec-0508-4375-8b00-91d732414745" + responses: + "200": + application/json: {"id": "0de60230-717d-459a-8c0f-fbb9360c01be", "library_id": "e0bf3cf9-cd3b-405b-b842-ac7fcb9c373e", "hash": "", "mime_type": "", "extension": "jpe", "size": 402478, "name": "", "created_at": "2023-07-29T21:43:20.750Z", "process_status": "self_managed", "uploaded_by_id": "d5eadabe-d7f2-4f87-a337-f80c192f886d", "uploaded_by_type": "", "processing_status": "", "tokens_processing_total": 793889} + "422": + application/json: {} + libraries_documents_update_v1: + speakeasy-default-libraries-documents-update-v1: + parameters: + path: + library_id: "3ddd8d93-dca5-4a6d-980d-173226c35742" + document_id: "2a25e44c-b160-40ca-b5c2-b65fb2fcae34" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "1111e519-9ba5-42de-9301-938fbfee59fc", "library_id": "70aac5e3-23f7-439b-bbef-090e4c1dbd6d", "hash": "", "mime_type": "", "extension": "m1v", "size": 802305, "name": "", "created_at": "2024-07-02T20:02:03.680Z", "process_status": "missing_content", "uploaded_by_id": "08471957-b27d-4437-8242-57256727dc49", "uploaded_by_type": "", "processing_status": "", "tokens_processing_total": 806683} + "422": + application/json: {} + libraries_documents_delete_v1: + speakeasy-default-libraries-documents-delete-v1: + parameters: + path: + library_id: "005daae9-d42e-407d-82d7-2261c6a1496c" + document_id: "edc236b0-baff-49a9-884b-4ca36a258da4" + responses: + "422": + application/json: {} + libraries_documents_get_text_content_v1: + speakeasy-default-libraries-documents-get-text-content-v1: + parameters: + path: + library_id: "1d177215-3b6b-45ba-9fa9-baf773223bec" + document_id: "60214c91-2aba-4692-a4e6-a53365de8caf" + responses: + "200": + application/json: {"text": ""} + "422": + application/json: {} + libraries_documents_get_status_v1: + speakeasy-default-libraries-documents-get-status-v1: + parameters: + path: + library_id: "e6906f70-368f-4155-80da-c1718f01bc43" + document_id: "2c904915-d831-4e9d-a345-8ce405bcef66" + responses: + "200": + application/json: {"document_id": "90473b79-1fd5-437f-bee0-6638bdf69c90", "process_status": "waiting_for_capacity", "processing_status": ""} + "422": + application/json: {} + libraries_documents_get_signed_url_v1: + speakeasy-default-libraries-documents-get-signed-url-v1: + parameters: + path: + library_id: "23cf6904-a602-4ee8-9f5b-8efc557c336d" + document_id: "48598486-df71-4994-acbb-1133c72efa8c" + responses: + "200": + application/json: "https://burdensome-jellyfish.name" + "422": + application/json: {} + libraries_documents_get_extracted_text_signed_url_v1: + speakeasy-default-libraries-documents-get-extracted-text-signed-url-v1: + parameters: + path: + library_id: "a6f15de3-1e82-4f95-af82-851499042ef8" + document_id: "9749d4f9-24e5-4ca2-99a3-a406863f805d" + responses: + "200": + application/json: "https://athletic-disadvantage.info" + "422": + application/json: {} + libraries_documents_reprocess_v1: + speakeasy-default-libraries-documents-reprocess-v1: + parameters: + path: + library_id: "51b29371-de8f-4ba4-932b-a0bafb3a7f64" + document_id: "3052422c-49ca-45ac-a918-cadb35d61fd8" + responses: + "422": + application/json: {} + libraries_share_list_v1: + speakeasy-default-libraries-share-list-v1: + parameters: + path: + library_id: "d2169833-d8e2-416e-a372-76518d3d99c2" + responses: + "200": + application/json: {"data": [{"library_id": "26c08a7a-d226-4d29-b4d8-c08f0ad41dd1", "org_id": "254e3633-51b9-47a9-bc14-466ecf29d167", "role": "", "share_with_type": "", "share_with_uuid": "815eb88e-1f97-4782-863f-5fd00d37268b"}]} + "422": + application/json: {} + libraries_share_create_v1: + speakeasy-default-libraries-share-create-v1: + parameters: + path: + library_id: "36de3a24-5b1c-4c8f-9d84-d5642205a976" + requestBody: + application/json: {"level": "Viewer", "share_with_uuid": "0ae92ecb-21ed-47c5-9f7e-0b2cbe325a20", "share_with_type": "User"} + responses: + "200": + application/json: {"library_id": "45b3a5b2-8b81-4453-9130-ded7f1e5a366", "org_id": "0fa6e542-f04b-431e-a1be-76a9a92b0e68", "role": "", "share_with_type": "", "share_with_uuid": "cdbcc0c5-e577-4880-8ed3-f919421d4fc5"} + "422": + application/json: {} + libraries_share_delete_v1: + speakeasy-default-libraries-share-delete-v1: + parameters: + path: + library_id: "709e3cad-9fb2-4f4e-bf88-143cf1808107" + requestBody: + application/json: {"share_with_uuid": "b843cc47-ce8f-4354-8cfc-5fcd7fb2865b", "share_with_type": "User"} + responses: + "200": + application/json: {"library_id": "7f9c6af4-e362-4cf1-9363-0409d51c2dfa", "org_id": "6b2cac3a-b29c-4d8f-bebb-0db06ec1bf97", "role": "", "share_with_type": "", "share_with_uuid": "618c78f1-41ca-45c3-8ef2-7d78898c7061"} + "422": + application/json: {} + audio_api_v1_transcriptions_post: + speakeasy-default-audio-api-v1-transcriptions-post: + requestBody: + multipart/form-data: {"model": "Model X", "stream": false} + responses: + "200": + application/json: {"model": "Beetle", "text": "", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "language": ""} + userExample: + requestBody: + multipart/form-data: {"model": "voxtral-mini-latest", "stream": false, "diarize": false} + responses: + "200": + application/json: {"model": "voxtral-mini-2507", "text": "This week, I traveled to Chicago to deliver my final farewell address to the nation, following in the tradition of presidents before me. It was an opportunity to say thank you. Whether we've seen eye to eye or rarely agreed at all, my conversations with you, the American people, in living rooms, in schools, at farms and on factory floors, at diners and on distant military outposts, All these conversations are what have kept me honest, kept me inspired, and kept me going. Every day, I learned from you. You made me a better President, and you made me a better man.\nOver the course of these eight years, I've seen the goodness, the resilience, and the hope of the American people. I've seen neighbors looking out for each other as we rescued our economy from the worst crisis of our lifetimes. I've hugged cancer survivors who finally know the security of affordable health care. I've seen communities like Joplin rebuild from disaster, and cities like Boston show the world that no terrorist will ever break the American spirit. I've seen the hopeful faces of young graduates and our newest military officers. I've mourned with grieving families searching for answers. And I found grace in a Charleston church. I've seen our scientists help a paralyzed man regain his sense of touch, and our wounded warriors walk again. I've seen our doctors and volunteers rebuild after earthquakes and stop pandemics in their tracks. I've learned from students who are building robots and curing diseases, and who will change the world in ways we can't even imagine. I've seen the youngest of children remind us of our obligations to care for our refugees, to work in peace, and above all, to look out for each other.\nThat's what's possible when we come together in the slow, hard, sometimes frustrating, but always vital work of self-government. But we can't take our democracy for granted. All of us, regardless of party, should throw ourselves into the work of citizenship. Not just when there is an election. Not just when our own narrow interest is at stake. But over the full span of a lifetime. If you're tired of arguing with strangers on the Internet, try to talk with one in real life. If something needs fixing, lace up your shoes and do some organizing. If you're disappointed by your elected officials, then grab a clipboard, get some signatures, and run for office yourself.\nOur success depends on our participation, regardless of which way the pendulum of power swings. It falls on each of us to be guardians of our democracy, to embrace the joyous task we've been given to continually try to improve this great nation of ours. Because for all our outward differences, we all share the same proud title – citizen.\nIt has been the honor of my life to serve you as President. Eight years later, I am even more optimistic about our country's promise. And I look forward to working along your side as a citizen for all my days that remain.\nThanks, everybody. God bless you. And God bless the United States of America.\n", "segments": [], "usage": {"prompt_tokens": 4, "completion_tokens": 635, "total_tokens": 3264, "prompt_audio_seconds": 203}, "language": "en"} + audio_api_v1_transcriptions_post_stream: + speakeasy-default-audio-api-v1-transcriptions-post-stream: + requestBody: + multipart/form-data: {"model": "Camry", "stream": true, "diarize": false} + agents_api_v1_conversations_delete: + speakeasy-default-agents-api-v1-conversations-delete: + parameters: + path: + conversation_id: "" + responses: + "422": + application/json: {} + agents_api_v1_agents_delete: + speakeasy-default-agents-api-v1-agents-delete: + parameters: + path: + agent_id: "" + responses: + "422": + application/json: {} + agents_api_v1_agents_list_versions: + speakeasy-default-agents-api-v1-agents-list-versions: + parameters: + path: + agent_id: "" + query: + page: 0 + page_size: 20 + responses: + "200": + application/json: [{"completion_args": {"response_format": {"type": "text"}}, "model": "Prius", "name": "", "object": "agent", "id": "", "version": 866135, "versions": [849276], "created_at": "2024-07-03T17:01:49.200Z", "updated_at": "2026-06-15T18:44:26.883Z", "deployment_chat": true, "source": ""}] + "422": + application/json: {} + agents_api_v1_agents_get_version: + speakeasy-default-agents-api-v1-agents-get-version: + parameters: + path: + agent_id: "" + version: "788393" + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "Model 3", "name": "", "object": "agent", "id": "", "version": 377706, "versions": [658369, 642981], "created_at": "2024-10-02T23:01:15.980Z", "updated_at": "2026-12-22T00:55:26.568Z", "deployment_chat": false, "source": ""} + "422": + application/json: {} + agents_api_v1_agents_create_or_update_alias: + speakeasy-default-agents-api-v1-agents-create-or-update-alias: + parameters: + path: + agent_id: "" + query: + alias: "" + version: 595141 + responses: + "200": + application/json: {"alias": "", "version": 768764, "created_at": "2026-12-28T00:40:21.715Z", "updated_at": "2025-09-01T12:54:58.254Z"} + "422": + application/json: {} + agents_api_v1_agents_list_version_aliases: + speakeasy-default-agents-api-v1-agents-list-version-aliases: + parameters: + path: + agent_id: "" + responses: + "200": + application/json: [{"alias": "", "version": 318290, "created_at": "2025-10-02T20:25:32.322Z", "updated_at": "2026-11-19T02:58:37.894Z"}] + "422": + application/json: {} + ListModels: + userExample: + responses: + "200": + application/json: {"object": "list"} + RetrieveModel: + speakeasy-default-retrieve-model: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "", "object": "model", "owned_by": "mistralai", "capabilities": {"completion_chat": false, "function_calling": false, "completion_fim": false, "fine_tuning": false, "vision": false, "ocr": false, "classification": false, "moderation": false, "audio": false, "audio_transcription": false}, "max_context_length": 32768, "type": "base"} + "422": + application/json: {} + userExample: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "", "object": "model", "owned_by": "mistralai", "capabilities": {"completion_chat": false, "function_calling": false, "completion_fim": false, "fine_tuning": false, "vision": false, "ocr": false, "classification": false, "moderation": false, "audio": false, "audio_transcription": false}, "max_context_length": 32768, "type": "fine-tuned", "job": "Principal Implementation Assistant", "root": "", "archived": false} + DeleteModel: + speakeasy-default-delete-model: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "ft:open-mistral-7b:587a6b29:20240514:7e773925", "object": "model", "deleted": true} + "422": + application/json: {} + userExample: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "ft:open-mistral-7b:587a6b29:20240514:7e773925", "object": "model", "deleted": true} + UpdateModel: + speakeasy-default-update-model: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "object": "model", "created": 76471, "owned_by": "", "workspace_id": "", "root": "", "root_version": "", "archived": true, "capabilities": {"completion_chat": true, "completion_fim": false, "function_calling": false, "fine_tuning": false, "classification": false}, "max_context_length": 32768, "job": "9765ed11-3bc9-49ff-a19d-06665406d404", "model_type": "completion"} + ArchiveModel: + speakeasy-default-archive-model: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "", "object": "model", "archived": true} + UnarchiveModel: + speakeasy-default-unarchive-model: + parameters: + path: + model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + responses: + "200": + application/json: {"id": "", "object": "model", "archived": false} + StartConversation: + speakeasy-default-start-conversation: + requestBody: + application/json: {"inputs": "", "stream": false, "completion_args": {"response_format": {"type": "text"}}} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "function.call", "tool_call_id": "", "name": "", "arguments": ""}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + ListConversations: + speakeasy-default-list-conversations: + parameters: + query: + page: 0 + page_size: 100 + responses: + "200": + application/json: [{"completion_args": {"response_format": {"type": "text"}}, "object": "conversation", "id": "", "created_at": "2026-05-02T18:35:22.595Z", "updated_at": "2024-04-15T10:58:56.705Z", "model": "Silverado"}] + "422": + application/json: {} + GetConversation: + speakeasy-default-get-conversation: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation", "id": "", "created_at": "2026-10-30T16:36:24.274Z", "updated_at": "2026-03-08T22:30:16.213Z", "agent_id": ""} + "422": + application/json: {} + DeleteConversation: + speakeasy-default-delete-conversation: + parameters: + path: + conversation_id: "" + responses: + "422": + application/json: {} + AppendConversation: + speakeasy-default-append-conversation: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"inputs": [], "stream": false, "store": true, "handoff_execution": "server", "completion_args": {"response_format": {"type": "text"}}} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "function.call", "tool_call_id": "", "name": "", "arguments": {"key": "", "key1": ""}}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + GetConversationHistory: + speakeasy-default-get-conversation-history: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation.history", "conversation_id": "", "entries": []} + "422": + application/json: {} + GetConversationMessages: + speakeasy-default-get-conversation-messages: + parameters: + path: + conversation_id: "" + responses: + "200": + application/json: {"object": "conversation.messages", "conversation_id": "", "messages": []} + "422": + application/json: {} + RestartConversation: + speakeasy-default-restart-conversation: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"inputs": "", "stream": false, "store": true, "handoff_execution": "server", "completion_args": {"response_format": {"type": "text"}}, "from_entry_id": ""} + responses: + "200": + application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "function.call", "tool_call_id": "", "name": "", "arguments": ""}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + "422": + application/json: {} + StartConversationStream: + speakeasy-default-start-conversation-stream: + requestBody: + application/json: {"inputs": "", "stream": true, "completion_args": {"response_format": {"type": "text"}}} + responses: + "422": + application/json: {} + AppendConversationStream: + speakeasy-default-append-conversation-stream: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"inputs": "", "stream": true, "store": true, "handoff_execution": "server", "completion_args": {"response_format": {"type": "text"}}} + responses: + "422": + application/json: {} + RestartConversationStream: + speakeasy-default-restart-conversation-stream: + parameters: + path: + conversation_id: "" + requestBody: + application/json: {"inputs": "", "stream": true, "store": true, "handoff_execution": "server", "completion_args": {"response_format": {"type": "text"}}, "from_entry_id": ""} + responses: + "422": + application/json: {} + CreateAgent: + speakeasy-default-create-agent: + requestBody: + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "Mustang", "name": ""} + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "Taurus", "name": "", "object": "agent", "id": "", "version": 388058, "versions": [980917, 959600], "created_at": "2024-07-23T17:25:11.997Z", "updated_at": "2025-07-14T09:13:03.268Z", "deployment_chat": false, "source": ""} + "422": + application/json: {} + ListAgents: + speakeasy-default-list-agents: + parameters: + query: + page: 0 + page_size: 20 + responses: + "200": + application/json: [{"completion_args": {"response_format": {"type": "text"}}, "model": "Challenger", "name": "", "object": "agent", "id": "", "version": 679172, "versions": [491437], "created_at": "2026-05-11T12:36:32.958Z", "updated_at": "2026-08-23T04:04:31.448Z", "deployment_chat": false, "source": ""}] + "422": + application/json: {} + GetAgent: + speakeasy-default-get-agent: + parameters: + path: + agent_id: "" + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "F-150", "name": "", "object": "agent", "id": "", "version": 928666, "versions": [246402], "created_at": "2024-02-28T12:05:26.160Z", "updated_at": "2024-05-16T04:31:56.940Z", "deployment_chat": false, "source": ""} + "422": + application/json: {} + UpdateAgent: + speakeasy-default-update-agent: + parameters: + path: + agent_id: "" + requestBody: + application/json: {"completion_args": {"response_format": {"type": "text"}}} + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "1", "name": "", "object": "agent", "id": "", "version": 388537, "versions": [955918, 365950, 823288], "created_at": "2026-11-04T08:06:14.896Z", "updated_at": "2025-05-23T04:44:27.181Z", "deployment_chat": true, "source": ""} + "422": + application/json: {} + DeleteAgent: + speakeasy-default-delete-agent: + parameters: + path: + agent_id: "" + responses: + "422": + application/json: {} + UpdateAgentVersion: + speakeasy-default-update-agent-version: + parameters: + path: + agent_id: "" + query: + version: 958693 + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "XTS", "name": "", "object": "agent", "id": "", "version": 203502, "versions": [449666], "created_at": "2024-09-21T15:29:30.503Z", "updated_at": "2026-10-29T17:49:52.509Z", "deployment_chat": true, "source": ""} + "422": + application/json: {} + ListAgentVersions: + speakeasy-default-list-agent-versions: + parameters: + path: + agent_id: "" + query: + page: 0 + page_size: 20 + responses: + "200": + application/json: [{"completion_args": {"response_format": {"type": "text"}}, "model": "Volt", "name": "", "object": "agent", "id": "", "version": 45747, "versions": [584697, 811109], "created_at": "2024-12-19T10:33:53.873Z", "updated_at": "2025-10-05T12:31:56.977Z", "deployment_chat": false, "source": ""}] + "422": + application/json: {} + GetAgentVersion: + speakeasy-default-get-agent-version: + parameters: + path: + agent_id: "" + version: "" + responses: + "200": + application/json: {"completion_args": {"response_format": {"type": "text"}}, "model": "Camaro", "name": "", "object": "agent", "id": "", "version": 663020, "versions": [210212], "created_at": "2026-11-16T03:32:55.781Z", "updated_at": "2026-09-28T23:51:49.611Z", "deployment_chat": true, "source": ""} + "422": + application/json: {} + CreateOrUpdateAgentAlias: + speakeasy-default-create-or-update-agent-alias: + parameters: + path: + agent_id: "" + query: + alias: "" + version: 154719 + responses: + "200": + application/json: {"alias": "", "version": 991981, "created_at": "2025-09-02T11:06:53.872Z", "updated_at": "2024-12-17T11:05:04.936Z"} + "422": + application/json: {} + ListAgentAliases: + speakeasy-default-list-agent-aliases: + parameters: + path: + agent_id: "" + responses: + "200": + application/json: [{"alias": "", "version": 345116, "created_at": "2025-03-19T21:46:52.564Z", "updated_at": "2026-07-18T22:23:53.218Z"}] + "422": + application/json: {} + DeleteAgentAlias: + speakeasy-default-delete-agent-alias: + parameters: + path: + agent_id: "" + query: + alias: "" + responses: + "422": + application/json: {} + ListLibraries: + speakeasy-default-list-libraries: + responses: + "200": + application/json: {"data": []} + CreateLibrary: + speakeasy-default-create-library: + requestBody: + application/json: {"name": ""} + responses: + "201": + application/json: {"id": "7a160c5d-b74e-44df-8beb-aca6894fa845", "name": "", "created_at": "2026-05-19T08:13:56.459Z", "updated_at": "2026-06-02T23:02:36.047Z", "owner_id": null, "owner_type": "", "total_size": 236146, "nb_documents": 584286, "chunk_size": 369781} + "422": + application/json: {} + GetLibrary: + speakeasy-default-get-library: + parameters: + path: + library_id: "44e385d6-783e-4b21-8fae-5181e6817bc4" + responses: + "200": + application/json: {"id": "785b8f2b-04c4-4e51-aeee-10ba7210996d", "name": "", "created_at": "2026-06-02T21:55:32.209Z", "updated_at": "2026-06-28T12:11:02.341Z", "owner_id": "489e38bd-4195-4ab1-a06d-f1253bcc0e7a", "owner_type": "", "total_size": 733226, "nb_documents": 896348, "chunk_size": 594373} + "422": + application/json: {} + DeleteLibrary: + speakeasy-default-delete-library: + parameters: + path: + library_id: "441ba08a-3d1f-4700-8d6f-f32eeed49dff" + responses: + "200": + application/json: {"id": "a03c22a9-d4f2-4735-806c-b8497fe2a882", "name": "", "created_at": "2024-03-20T22:16:14.073Z", "updated_at": "2025-08-10T22:18:39.851Z", "owner_id": null, "owner_type": "", "total_size": 735078, "nb_documents": 443485, "chunk_size": 738927} + "422": + application/json: {} + UpdateLibrary: + speakeasy-default-update-library: + parameters: + path: + library_id: "27049553-3425-49ce-b965-fcb3a7ab03a3" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "0c44cb97-9c48-4e8b-9837-239b80130faf", "name": "", "created_at": "2025-02-22T01:07:38.404Z", "updated_at": "2024-01-02T09:35:39.994Z", "owner_id": "9ea3bb36-40f8-41f9-ba61-d6f71a725ff2", "owner_type": "", "total_size": 234996, "nb_documents": 664396, "chunk_size": 337104} + "422": + application/json: {} + ListDocuments: + speakeasy-default-list-documents: + parameters: + path: + library_id: "05e1bda5-99b1-4baf-bb03-905d8e094f74" + query: + page_size: 100 + page: 0 + sort_by: "created_at" + sort_order: "desc" + responses: + "200": + application/json: {"pagination": {"total_items": 985775, "total_pages": 196446, "current_page": 86746, "page_size": 671573, "has_more": false}, "data": [{"id": "9b168ce6-0e63-4d0a-b784-71cab0b43775", "library_id": "01d6c3ae-df9c-448d-8e84-873b6588d655", "hash": "", "mime_type": "", "extension": "shtml", "size": null, "name": "", "created_at": "2024-06-29T16:51:59.433Z", "processing_status": "", "uploaded_by_id": "ce40c587-9bb9-48d4-8bd3-5ce14f8f07c8", "uploaded_by_type": "", "tokens_processing_total": 288046}]} + "422": + application/json: {} + UploadDocument: + speakeasy-default-upload-document: + parameters: + path: + library_id: "f973c54e-979a-4464-9d36-8cc31beb21fe" + requestBody: + multipart/form-data: {"file": "x-file: example.file"} + responses: + "200": + application/json: {"id": "a13f4191-9721-413d-ac5c-b8edadbfb34e", "library_id": "a6ea3cdd-242f-4132-baf8-9a2589d78cb2", "hash": "", "mime_type": "", "extension": "mp4v", "size": 731796, "name": "", "created_at": "2024-04-30T08:38:55.667Z", "processing_status": "", "uploaded_by_id": "fd1426b3-90f8-4b54-97de-c4f108cb2a63", "uploaded_by_type": "", "tokens_processing_total": 603440} + "422": + application/json: {} + GetDocument: + speakeasy-default-get-document: + parameters: + path: + library_id: "f9902d0a-1ea4-4953-be48-52df6edd302a" + document_id: "c3e12fd9-e840-46f2-8d4a-79985ed36d24" + responses: + "200": + application/json: {"id": "52c93ba5-b31c-4717-a099-f3415e6d4eea", "library_id": "912f1e36-456c-4551-bd6d-535931a66817", "hash": "", "mime_type": "", "extension": "wav", "size": null, "name": "", "created_at": "2026-09-30T22:43:59.455Z", "processing_status": "", "uploaded_by_id": "8578215b-d0b4-4ee2-857d-dcb0686d45f1", "uploaded_by_type": "", "tokens_processing_total": 833979} + "422": + application/json: {} + UpdateDocument: + speakeasy-default-update-document: + parameters: + path: + library_id: "3b900c67-d2b6-4637-93f2-3eff2c85f8dd" + document_id: "66f935fd-37ec-441f-bca5-b1129befcbca" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "6a5ec2ab-bd54-4cc8-a761-e51374243293", "library_id": "f8b3b9a7-bb4b-4b47-b3b2-bb6db5e92901", "hash": "", "mime_type": "", "extension": "gif", "size": null, "name": "", "created_at": "2025-11-09T02:41:11.680Z", "processing_status": "", "uploaded_by_id": "0f707dfd-bd39-42ad-9748-c0b305a13eb6", "uploaded_by_type": "", "tokens_processing_total": 170388} + "422": + application/json: {} + DeleteDocument: + speakeasy-default-delete-document: + parameters: + path: + library_id: "c728d742-7845-462b-84ad-2aacbaf1c7cf" + document_id: "ed3f5797-846a-4abe-8e30-39b2fd2323e0" + responses: + "422": + application/json: {} + GetDocumentTextContent: + speakeasy-default-get-document-text-content: + parameters: + path: + library_id: "12689dc1-50df-4a0d-8202-2757f7a8c141" + document_id: "9d4057e9-d112-437c-911e-6ee031389739" + responses: + "200": + application/json: {"text": ""} + "422": + application/json: {} + GetDocumentStatus: + speakeasy-default-get-document-status: + parameters: + path: + library_id: "41bb33c4-7e53-453d-bf21-398bb2862772" + document_id: "416b95cf-19c8-45af-84be-26aaa3ab3666" + responses: + "200": + application/json: {"document_id": "b5b43c40-8e91-41d9-933c-096ee588639a", "processing_status": ""} + "422": + application/json: {} + GetDocumentSignedUrl: + speakeasy-default-get-document-signed-url: + parameters: + path: + library_id: "2dbbe172-1374-41be-b03d-a088c733612e" + document_id: "b5d88764-47f1-4485-9df1-658775428344" + responses: + "200": + application/json: "" + "422": + application/json: {} + GetDocumentExtractedTextSignedUrl: + speakeasy-default-get-document-extracted-text-signed-url: + parameters: + path: + library_id: "46d040ce-ae2e-4891-a54c-cdab6a8f62d8" + document_id: "3eddbfe2-3fd7-47f5-984b-b378e6950e37" + responses: + "200": + application/json: "" + "422": + application/json: {} + ReprocessDocument: + speakeasy-default-reprocess-document: + parameters: + path: + library_id: "76d357e4-d891-40c6-9d1e-6d6ce5056ee0" + document_id: "09798d2b-8f46-46c6-9765-8054a82a4bb2" + responses: + "422": + application/json: {} + ListLibraryAccesses: + speakeasy-default-list-library-accesses: + parameters: + path: + library_id: "9eb628ef-f118-47eb-b3cc-9750c4ca5fb6" + responses: + "200": + application/json: {"data": [{"library_id": "98821ea0-f6e2-444d-b922-e649cd549a2a", "org_id": "a33230f8-b93d-4f45-80ce-b45e8dd8b5fe", "role": "", "share_with_type": "", "share_with_uuid": "0e1f6eb2-b59e-4e38-b916-382b3383c228"}]} + "422": + application/json: {} + UpdateOrCreateLibraryAccess: + speakeasy-default-update-or-create-library-access: + parameters: + path: + library_id: "88bb030c-1cb5-4231-ba13-742c56554876" + requestBody: + application/json: {"level": "Viewer", "share_with_uuid": "6a736283-c1fa-49b0-9b6d-ea9309c0a766", "share_with_type": "Workspace"} + responses: + "200": + application/json: {"library_id": "b783a30a-ca47-4c15-8095-dee3502846e5", "org_id": "6721ec8e-e0c0-4e8e-be83-3c01f2f884a5", "role": "", "share_with_type": "", "share_with_uuid": null} + "422": + application/json: {} + DeleteLibraryAccess: + speakeasy-default-delete-library-access: + parameters: + path: + library_id: "fc7ab1cf-e33c-4791-a6e0-95ff1f921c43" + requestBody: + application/json: {"share_with_uuid": "5818ddff-3568-40f1-a9e4-39d6cb9f5c94", "share_with_type": "Org"} + responses: + "200": + application/json: {"library_id": "6eeb1c0b-8c49-4745-8e3a-eef5bace0782", "org_id": "36550d6e-a514-4601-bd5b-7a0978aab0c7", "role": "", "share_with_type": "", "share_with_uuid": "023a9d84-8615-44a6-acd3-59b113a45c43"} + "422": + application/json: {} + UploadFile: + userExample: + requestBody: + multipart/form-data: {"file": "x-file: example.file"} + responses: + "200": + application/json: {"id": "e85980c9-409e-4a46-9304-36588f6292b0", "object": "file", "bytes": 13000, "created_at": 1759500189, "filename": "example.file.jsonl", "purpose": "fine-tune", "sample_type": "instruct", "num_lines": 2, "mimetype": "application/jsonl", "source": "upload", "signature": "d4821d2de1917341"} + ListFiles: + userExample: + parameters: + query: + page: 0 + page_size: 100 + include_total: true + responses: + "200": + application/json: {"data": [{"id": "", "object": "file", "bytes": 13000, "created_at": 1759491994, "filename": "", "purpose": "batch", "sample_type": "batch_result", "num_lines": 2, "mimetype": "application/jsonl", "source": "mistral", "signature": null}, {"id": "", "object": "file", "bytes": 13000, "created_at": 1759491994, "filename": "", "purpose": "batch", "sample_type": "batch_result", "num_lines": 2, "mimetype": "application/jsonl", "source": "mistral", "signature": null}], "object": "list", "total": 2} + RetrieveFile: + userExample: + parameters: + path: + file_id: "654a62d9-b7ee-49ac-835e-af4153e3c9ec" + responses: + "200": + application/json: {"id": "e85980c9-409e-4a46-9304-36588f6292b0", "object": "file", "bytes": 13000, "created_at": 1759500189, "filename": "example.file.jsonl", "purpose": "fine-tune", "sample_type": "instruct", "num_lines": 2, "mimetype": "application/jsonl", "source": "upload", "signature": "d4821d2de1917341", "deleted": false} + DeleteFile: + userExample: + parameters: + path: + file_id: "789c27a4-69de-47c6-b67f-cf6e56ce9f41" + responses: + "200": + application/json: {"id": "e85980c9-409e-4a46-9304-36588f6292b0", "object": "file", "deleted": true} + DownloadFile: + speakeasy-default-download-file: + parameters: + path: + file_id: "e2ba278e-eac9-4050-ae8e-ec433e124efb" + responses: + "200": + application/octet-stream: "x-file: example.file" + GetFileSignedUrl: + userExample: + parameters: + path: + file_id: "7a0c108d-9e6b-4c47-990d-a20cba50b283" + query: + expiry: 24 + responses: + "200": + application/json: {"url": "https://mistralaifilesapiprodswe.blob.core.windows.net/fine-tune/.../.../e85980c9409e4a46930436588f6292b0.jsonl?se=2025-10-04T14%3A16%3A17Z&sp=r&sv=2025-01-05&sr=b&sig=..."} + ListFineTuningJobs: + speakeasy-default-list-fine-tuning-jobs: + parameters: + query: + page: 0 + page_size: 100 + created_by_me: false + responses: + "200": + application/json: {"object": "list", "total": 677316} + CreateFineTuningJob: + speakeasy-default-create-fine-tuning-job: + requestBody: + application/json: {"model": "Countach", "invalid_sample_skip_percentage": 0, "hyperparameters": {"learning_rate": 0.0001}} + responses: + "200": + application/json: {"id": "18371b47-e157-4d80-8d09-2687df8868e8", "auto_start": false, "model": "Fiesta", "status": "FAILED", "created_at": 475667, "modified_at": 452225, "training_files": [], "object": "job", "job_type": "completion", "hyperparameters": {"learning_rate": 0.0001}} + GetFineTuningJob: + speakeasy-default-get-fine-tuning-job: + parameters: + path: + job_id: "2855f873-414e-4cf5-a46e-e589e39ee809" + responses: + "200": + application/json: {"id": "b9f4ad32-1400-4751-8e0d-16c09b4b26e6", "auto_start": true, "model": "LeBaron", "status": "QUEUED", "created_at": 458966, "modified_at": 377090, "training_files": ["52d812c3-b5fe-4866-878e-39a5910f91df"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "classifier_targets": [{"name": "", "labels": [], "weight": 6490.15, "loss_function": "single_class"}]} + CancelFineTuningJob: + speakeasy-default-cancel-fine-tuning-job: + parameters: + path: + job_id: "ee7d6f03-fcbb-43ca-8f17-0388c0832eb9" + responses: + "200": + application/json: {"id": "24b50383-3de5-4711-a14f-b71bbeccc6c5", "auto_start": true, "model": "Countach", "status": "CANCELLED", "created_at": 148194, "modified_at": 80833, "training_files": ["13ba2c85-5db5-4c14-94e4-2fcf030cecae", "85892e4f-5c84-4f38-bfb8-01072484489c", "723f89f0-65c0-43fa-9a9f-296acfe91134"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "classifier_targets": [{"name": "", "labels": ["", ""], "weight": 1717.09, "loss_function": "single_class"}]} + StartFineTuningJob: + speakeasy-default-start-fine-tuning-job: + parameters: + path: + job_id: "da371429-0ec2-4cea-b9c7-73ce3a1dd76f" + responses: + "200": + application/json: {"id": "2628c0c5-a98f-4d0b-a22a-fba0b0b23112", "auto_start": false, "model": "Model 3", "status": "QUEUED", "created_at": 139851, "modified_at": 571341, "training_files": ["856f394d-d216-41ab-8fa1-a42fba9e7734"], "object": "job", "job_type": "completion", "hyperparameters": {"learning_rate": 0.0001}} + ListBatchJobs: + speakeasy-default-list-batch-jobs: + parameters: + query: + page: 0 + page_size: 100 + created_by_me: false + order_by: "-created" + responses: + "200": + application/json: {"object": "list", "total": 853018} + CreateBatchJob: + speakeasy-default-create-batch-job: + requestBody: + application/json: {"endpoint": "/v1/classifications", "model": "mistral-small-latest", "timeout_hours": 24} + responses: + "200": + application/json: {"id": "", "object": "batch", "input_files": ["936962bc-f885-485f-914e-fe90c1d312f9", "02e65e71-6f9f-4c39-9a54-bba0acb1e912", "4c5d848d-d86e-43cb-a795-1eaba0c96608"], "endpoint": "", "errors": [], "status": "SUCCESS", "created_at": 346291, "total_requests": 784915, "completed_requests": 663597, "succeeded_requests": 195848, "failed_requests": 688098} + GetBatchJob: + speakeasy-default-get-batch-job: + parameters: + path: + job_id: "358c80a1-79bd-43f0-8f0e-8186713aa3ba" + responses: + "200": + application/json: {"id": "", "object": "batch", "input_files": ["782a7fa0-6ea1-4be9-bce9-9ff61f81530d"], "endpoint": "", "errors": [{"message": "", "count": 1}], "status": "SUCCESS", "created_at": 878725, "total_requests": 913781, "completed_requests": 964506, "succeeded_requests": 119373, "failed_requests": 490093} + CancelBatchJob: + speakeasy-default-cancel-batch-job: + parameters: + path: + job_id: "393537d7-8b33-4931-a289-7f61f8757eda" + responses: + "200": + application/json: {"id": "", "object": "batch", "input_files": ["7309e534-200e-43a4-83c5-dc4c2a14c745"], "endpoint": "", "errors": [], "status": "FAILED", "created_at": 157212, "total_requests": 188914, "completed_requests": 685483, "succeeded_requests": 127060, "failed_requests": 428561} + agents_api_v1_agents_delete_alias: + speakeasy-default-agents-api-v1-agents-delete-alias: + parameters: + path: + agent_id: "" + query: + alias: "" + responses: + "422": + application/json: {} + get_chat_completion_events_v1_observability_chat_completion_events_search_post: + speakeasy-default-get-chat-completion-events-v1-observability-chat-completion-events-search-post: + parameters: + query: + page_size: 50 + requestBody: + application/json: {"search_params": {"filters": null}} + responses: + "200": + application/json: {"completion_events": {}} + "400": + application/json: {"detail": {"message": "", "error_code": "AUTH_FORBIDDEN_WORKSPACE_NOT_FOUND"}} + get_chat_completion_event_ids_v1_observability_chat_completion_events_search_ids_post: + speakeasy-default-get-chat-completion-event-ids-v1-observability-chat-completion-events-search-ids-post: + requestBody: + application/json: {"search_params": {"filters": {"field": "", "op": "lt", "value": ""}}} + responses: + "200": + application/json: {"completion_event_ids": [""]} + "400": + application/json: {"detail": {"message": "", "error_code": null}} + get_chat_completion_event_v1_observability_chat_completion_events__event_id__get: + speakeasy-default-get-chat-completion-event-v1-observability-chat-completion-events-event-id-get: + parameters: + path: + event_id: "e79bf81b-b37f-425e-9dff-071a54592e44" + responses: + "200": + application/json: {"event_id": "", "correlation_id": "", "created_at": "2025-08-04T07:31:12.646Z", "extra_fields": {}, "nb_input_tokens": 337803, "nb_output_tokens": 297257, "enabled_tools": [{"key": ""}, {"key": "", "key1": "", "key2": ""}], "request_messages": [{"key": ""}, {"key": "", "key1": "", "key2": ""}], "response_messages": [{"key": "", "key1": "", "key2": ""}], "nb_messages": 229575, "chat_transcription_events": [{"audio_url": "https://considerate-tinderbox.com/", "model": "Cruze", "response_message": {}}]} + "400": + application/json: {"detail": {"message": "", "error_code": "AUTH_FORBIDDEN_ROLE_NOT_FOUND"}} + get_similar_chat_completion_events_v1_observability_chat_completion_events__event_id__similar_events_get: + speakeasy-default-get-similar-chat-completion-events-v1-observability-chat-completion-events-event-id-similar-events-get: parameters: path: - model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + event_id: "b7be6e08-d068-45fc-b77a-966232e92fd6" responses: "200": - application/json: {"id": "", "object": "model", "owned_by": "mistralai", "capabilities": {"completion_chat": true, "completion_fim": false, "function_calling": true, "fine_tuning": false, "vision": false, "classification": false}, "max_context_length": 32768, "type": "fine-tuned", "job": "Product Markets Facilitator", "root": "", "archived": false} - "422": - application/json: {} - delete_model_v1_models__model_id__delete: - speakeasy-default-delete-model-v1-models-model-id-delete: + application/json: {"completion_events": {}} + "400": + application/json: {"detail": {"message": "", "error_code": "EVALUATION_RUN_TRANSITION_ERROR"}} + judge_chat_completion_event_v1_observability_chat_completion_events__event_id__live_judging_post: + speakeasy-default-judge-chat-completion-event-v1-observability-chat-completion-events-event-id-live-judging-post: parameters: path: - model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + event_id: "dfcd5582-1373-4de5-af51-987464da561c" + requestBody: + application/json: {"judge_definition": {"name": "", "description": "total plain self-confidence candid hungrily partial astride cruelly brr", "model_name": "", "output": {"type": "CLASSIFICATION", "options": [{"value": "", "description": "indeed insolence delightfully following"}]}, "instructions": "", "tools": []}} + responses: + "200": + application/json: {"analysis": "", "answer": ""} + "400": + application/json: {"detail": {"message": "", "error_code": "DATASET_TASK_NOT_FOUND"}} + get_chat_completion_fields_v1_observability_chat_completion_fields_get: + speakeasy-default-get-chat-completion-fields-v1-observability-chat-completion-fields-get: + responses: + "200": + application/json: {"field_definitions": [{"name": "", "label": "", "type": "FLOAT", "supported_operators": []}], "field_groups": []} + "400": + application/json: {"detail": {"message": "", "error_code": "JUDGE_NOT_FOUND"}} + get_chat_completion_field_options_v1_observability_chat_completion_fields__field_name__options_get: + speakeasy-default-get-chat-completion-field-options-v1-observability-chat-completion-fields-field-name-options-get: + parameters: + path: + field_name: "" + query: + operator: "startswith" responses: "200": - application/json: {"id": "ft:open-mistral-7b:587a6b29:20240514:7e773925", "object": "model", "deleted": true} - "422": application/json: {} - jobs_api_routes_fine_tuning_update_fine_tuned_model: - speakeasy-default-jobs-api-routes-fine-tuning-update-fine-tuned-model: + "400": + application/json: {"detail": {"message": "", "error_code": "TEMPLATE_SYNTAX_ERROR"}} + get_chat_completion_field_options_counts_v1_observability_chat_completion_fields__field_name__options_counts_post: + ? speakeasy-default-get-chat-completion-field-options-counts-v1-observability-chat-completion-fields-field-name-options-counts-post + : parameters: + path: + field_name: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"counts": []} + "400": + application/json: {"detail": {"message": "", "error_code": "DATASET_RECORD_NOT_FOUND"}} + create_judge_v1_observability_judges_post: + speakeasy-default-create-judge-v1-observability-judges-post: + requestBody: + application/json: {"name": "", "description": "border freely down whenever broadly whenever restructure catalyze after", "model_name": "", "output": {"type": "REGRESSION", "min": 0, "min_description": "", "max": 1, "max_description": ""}, "instructions": "", "tools": ["", ""]} + responses: + "201": + application/json: {"id": "64b223b0-e106-43bb-8cc9-77162463295b", "created_at": "2026-03-11T13:01:21.858Z", "updated_at": "2024-02-24T09:21:22.966Z", "deleted_at": "2026-02-16T14:45:07.865Z", "owner_id": "cf47c12a-77ac-4d6f-aa5e-9c791792f5bb", "workspace_id": "268fd016-1a79-4091-9ec2-104ca1ea5adf", "name": "", "description": "typify intervention seemingly", "model_name": "", "output": {"type": "CLASSIFICATION", "options": [{"value": "", "description": "masquerade readily fen"}]}, "instructions": "", "tools": [""]} + "400": + application/json: {"detail": {"message": "", "error_code": "DATASET_RECORD_NOT_FOUND"}} + get_judges_v1_observability_judges_get: + speakeasy-default-get-judges-v1-observability-judges-get: + parameters: + query: + page_size: 50 + page: 1 + responses: + "200": + application/json: {"judges": {"count": 165283}} + "400": + application/json: {"detail": {"message": "", "error_code": "CAMPAIGN_NOT_FOUND"}} + get_judge_by_id_v1_observability_judges__judge_id__get: + speakeasy-default-get-judge-by-id-v1-observability-judges-judge-id-get: parameters: path: - model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + judge_id: "19ae5cf8-2ade-4a40-b9d2-730aaebe8429" + responses: + "200": + application/json: {"id": "88a908a1-116d-4887-b5ba-d57fd96451d3", "created_at": "2026-01-20T19:57:20.448Z", "updated_at": "2025-04-15T17:15:10.529Z", "deleted_at": "2026-05-08T22:17:53.176Z", "owner_id": "0fc619ee-fd86-480d-98da-9dc726fb311a", "workspace_id": "aa9b970b-e897-462a-8a4c-60902a0e81d3", "name": "", "description": "catalyst honestly brr underachieve per until free", "model_name": "", "output": {"type": "CLASSIFICATION", "options": [{"value": "", "description": "irritably for likewise wise linseed unethically handy"}]}, "instructions": "", "tools": ["", ""]} + "400": + application/json: {"detail": {"message": "", "error_code": "SEARCH_FILTER_TO_SQL_CONVERSION_ERROR"}} + delete_judge_v1_observability_judges__judge_id__delete: + speakeasy-default-delete-judge-v1-observability-judges-judge-id-delete: + parameters: + path: + judge_id: "80deecde-e10f-409c-a13a-c242d3760f6e" + responses: + "400": + application/json: {"detail": {"message": "", "error_code": "EVALUATION_RECORD_NOT_FOUND"}} + update_judge_v1_observability_judges__judge_id__put: + speakeasy-default-update-judge-v1-observability-judges-judge-id-put: + parameters: + path: + judge_id: "9f28c7db-1fb7-4e1c-b137-d7039561ddb7" + requestBody: + application/json: {"name": "", "description": "noteworthy and unless", "model_name": "", "output": {"type": "REGRESSION", "min": 0, "min_description": "", "max": 1, "max_description": ""}, "instructions": "", "tools": []} + responses: + "400": + application/json: {"detail": {"message": "", "error_code": "AUTH_FORBIDDEN_WORKSPACE_NOT_FOUND"}} + create_campaign_v1_observability_campaigns_post: + speakeasy-default-create-campaign-v1-observability-campaigns-post: + requestBody: + application/json: {"search_params": {"filters": {"field": "", "op": "lt", "value": ""}}, "judge_id": "9b501b9f-3525-44a7-a51a-5352679be9ed", "name": "", "description": "shakily triangular scotch requirement whether once oh", "max_nb_events": 232889} + responses: + "201": + application/json: {"id": "2c13806e-5da0-449e-aa8c-2efe20d619f9", "created_at": "2026-03-23T12:46:40.529Z", "updated_at": "2024-12-09T10:33:58.511Z", "deleted_at": "2024-03-23T06:04:33.659Z", "name": "", "owner_id": "92d6e73a-fda5-475c-8483-6f2477d27cb8", "workspace_id": "731e5ff9-f8e6-4f2e-9ec8-fa28e59f044e", "description": "artistic closely resolve yet untimely which", "max_nb_events": 562269, "search_params": {"filters": {"field": "", "op": "lt", "value": ""}}, "judge": {"id": "a4291d77-2586-4ec3-874f-fde6b8a25ea6", "created_at": "2024-10-20T09:21:44.933Z", "updated_at": "2026-12-21T16:40:13.059Z", "deleted_at": "2025-11-13T11:08:56.633Z", "owner_id": "f054cff6-2a46-43c8-bf5f-34726c713700", "workspace_id": "5141df7d-8618-4c38-971a-fbae043ac71a", "name": "", "description": "and brr striking save give", "model_name": "", "output": {"type": "CLASSIFICATION", "options": []}, "instructions": "", "tools": [""]}} + "400": + application/json: {"detail": {"message": "", "error_code": "SEARCH_FILTER_TO_SQL_CONVERSION_ERROR"}} + get_campaigns_v1_observability_campaigns_get: + speakeasy-default-get-campaigns-v1-observability-campaigns-get: + parameters: + query: + page_size: 50 + page: 1 + responses: + "200": + application/json: {"campaigns": {"count": 267257}} + "400": + application/json: {"detail": {"message": "", "error_code": "JUDGE_ALREADY_HAS_NEW_VERSION"}} + get_campaign_by_id_v1_observability_campaigns__campaign_id__get: + speakeasy-default-get-campaign-by-id-v1-observability-campaigns-campaign-id-get: + parameters: + path: + campaign_id: "fd7945d6-00e2-4852-9054-bcbb968d7f98" + responses: + "200": + application/json: {"id": "471e682e-fdeb-4e35-9d85-e02663dac589", "created_at": "2024-09-14T10:06:32.327Z", "updated_at": "2025-10-10T18:13:43.173Z", "deleted_at": "2026-05-08T12:03:39.691Z", "name": "", "owner_id": "86cda873-2f96-4f74-bcd0-92e6c505be69", "workspace_id": "4bfb0db9-d23f-432b-a2f3-1e36f1fb077c", "description": "event yet clearly yummy plus institute catalog", "max_nb_events": 567256, "search_params": {"filters": {}}, "judge": {"id": "1242c0b2-6c6b-463c-9e64-53616f48a9cd", "created_at": "2026-06-13T02:11:55.473Z", "updated_at": "2024-12-08T02:12:43.788Z", "deleted_at": "2025-05-03T05:53:54.100Z", "owner_id": "5a2445c5-eb01-490e-8653-b35964e59b07", "workspace_id": "308e0ead-b563-4544-9254-9c9ac1f4f270", "name": "", "description": "regularly carnival besides lone yippee woot softly besides even", "model_name": "", "output": {"type": "REGRESSION", "min": 0, "min_description": "", "max": 1, "max_description": ""}, "instructions": "", "tools": [""]}} + "400": + application/json: {"detail": {"message": "", "error_code": null}} + delete_campaign_v1_observability_campaigns__campaign_id__delete: + speakeasy-default-delete-campaign-v1-observability-campaigns-campaign-id-delete: + parameters: + path: + campaign_id: "90e07b45-8cf7-4081-8558-a786779e039d" + responses: + "400": + application/json: {"detail": {"message": "", "error_code": "JUDGE_MISTRAL_API_TIMEOUT"}} + get_campaign_status_by_id_v1_observability_campaigns__campaign_id__status_get: + speakeasy-default-get-campaign-status-by-id-v1-observability-campaigns-campaign-id-status-get: + parameters: + path: + campaign_id: "4b1dd9a5-8dc9-48e1-bd11-29443e959902" + responses: + "200": + application/json: {"status": "TIMED_OUT"} + "400": + application/json: {"detail": {"message": "", "error_code": "DATABASE_UNAVAILABLE"}} + get_campaign_selected_events_v1_observability_campaigns__campaign_id__selected_events_get: + speakeasy-default-get-campaign-selected-events-v1-observability-campaigns-campaign-id-selected-events-get: + parameters: + path: + campaign_id: "305b5e46-a650-4d8a-8b5b-d23ef90ec831" + query: + page_size: 50 + page: 1 + responses: + "200": + application/json: {"completion_events": {"count": 538671}} + "400": + application/json: {"detail": {"message": "", "error_code": null}} + create_dataset_v1_observability_datasets_post: + speakeasy-default-create-dataset-v1-observability-datasets-post: + requestBody: + application/json: {"name": "", "description": "citizen whoever sustenance necessary vibrant openly"} + responses: + "201": + application/json: {"id": "e86e57b5-7c22-4325-bd9a-1aa080190810", "created_at": "2026-02-21T13:59:16.796Z", "updated_at": "2026-05-02T06:33:42.170Z", "deleted_at": "2024-10-04T09:38:22.311Z", "name": "", "description": "faraway stained despite obtrude er whereas rough", "owner_id": "c9748a93-c271-44dd-8be4-eae95777dcf1", "workspace_id": "1c770558-393b-49ef-a65e-6953eebd09fe"} + "400": + application/json: {"detail": {"message": "", "error_code": "AGENT_MISTRAL_API_ERROR"}} + get_datasets_v1_observability_datasets_get: + speakeasy-default-get-datasets-v1-observability-datasets-get: + parameters: + query: + page_size: 50 + page: 1 + responses: + "200": + application/json: {"datasets": {"count": 734678}} + "400": + application/json: {"detail": {"message": "", "error_code": "DATABASE_TIMEOUT"}} + get_dataset_by_id_v1_observability_datasets__dataset_id__get: + speakeasy-default-get-dataset-by-id-v1-observability-datasets-dataset-id-get: + parameters: + path: + dataset_id: "036fa362-e080-4fa5-beff-a334a70efb58" + responses: + "200": + application/json: {"id": "a4355b62-5f75-44af-86e3-398b02d79718", "created_at": "2024-09-22T05:11:33.455Z", "updated_at": "2024-08-05T11:16:32.114Z", "deleted_at": "2024-11-17T02:39:46.669Z", "name": "", "description": "brr dearly under pish brr however careless ferret", "owner_id": "3500df1e-5139-4573-90c4-c40cc1553997", "workspace_id": "98f44a49-7d9c-44e0-819c-b87b8b697b40"} + "400": + application/json: {"detail": {"message": "", "error_code": "TEMPLATE_SYNTAX_ERROR"}} + delete_dataset_v1_observability_datasets__dataset_id__delete: + speakeasy-default-delete-dataset-v1-observability-datasets-dataset-id-delete: + parameters: + path: + dataset_id: "baf961a3-bb8e-4085-89ef-de9c5d8c4e77" + responses: + "400": + application/json: {"detail": {"message": "", "error_code": "JUDGE_MISTRAL_API_ERROR"}} + update_dataset_v1_observability_datasets__dataset_id__patch: + speakeasy-default-update-dataset-v1-observability-datasets-dataset-id-patch: + parameters: + path: + dataset_id: "95be9afc-fc05-44a6-af9f-2362de1224f9" requestBody: application/json: {} responses: "200": - application/json: {"id": "", "object": "model", "created": 124166, "owned_by": "", "workspace_id": "", "root": "", "root_version": "", "archived": true, "capabilities": {"completion_chat": true, "completion_fim": false, "function_calling": false, "fine_tuning": false, "classification": false}, "max_context_length": 32768, "job": "c4f8ef9a-6612-4f49-88fa-a80eb8116e46", "model_type": "completion"} - jobs_api_routes_fine_tuning_archive_fine_tuned_model: - speakeasy-default-jobs-api-routes-fine-tuning-archive-fine-tuned-model: + application/json: {"id": "321a1909-2e5b-44a4-9344-3f6730da59f3", "created_at": "2024-02-08T01:14:12.266Z", "updated_at": "2026-01-30T21:57:19.199Z", "deleted_at": "2024-09-01T12:04:00.540Z", "name": "", "description": "hm vivaciously grandiose ditch", "owner_id": "dd537278-359d-4d34-aa69-9fbf9968649e", "workspace_id": "4f07d08f-2c7c-489c-abf9-f4f9c6d4d1b5"} + "400": + application/json: {"detail": {"message": "", "error_code": "FEATURE_NOT_SUPPORTED"}} + get_dataset_records_v1_observability_datasets__dataset_id__records_get: + speakeasy-default-get-dataset-records-v1-observability-datasets-dataset-id-records-get: parameters: path: - model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + dataset_id: "444d2a88-e636-4bc0-ab6c-919bedaed112" + query: + page_size: 50 + page: 1 responses: "200": - application/json: {"id": "", "object": "model", "archived": true} - jobs_api_routes_fine_tuning_unarchive_fine_tuned_model: - speakeasy-default-jobs-api-routes-fine-tuning-unarchive-fine-tuned-model: + application/json: {"records": {"count": 428843}} + "400": + application/json: {"detail": {"message": "", "error_code": null}} + create_dataset_record_v1_observability_datasets__dataset_id__records_post: + speakeasy-default-create-dataset-record-v1-observability-datasets-dataset-id-records-post: parameters: path: - model_id: "ft:open-mistral-7b:587a6b29:20240514:7e773925" + dataset_id: "4c54ed13-1459-44e1-8696-1a6df06f7177" + requestBody: + application/json: {"payload": {"messages": [{"key": ""}, {"key": "", "key1": ""}]}, "properties": {"key": "", "key1": "", "key2": ""}} + responses: + "201": + application/json: {"id": "dd3d2088-f021-41f6-aa26-6b86d0352e3b", "created_at": "2025-08-03T16:57:36.654Z", "updated_at": "2024-08-13T19:23:55.490Z", "deleted_at": "2026-06-12T19:29:36.465Z", "dataset_id": "fa142dc2-521b-4396-b33d-045371fdfec0", "payload": {"messages": [{"key": ""}, {"key": "", "key1": ""}]}, "properties": {"key": "", "key1": "", "key2": ""}, "source": "DIRECT_INPUT"} + "400": + application/json: {"detail": {"message": "", "error_code": "SEARCH_SERVICE_UNAVAILABLE"}} + post_dataset_records_from_campaign_v1_observability_datasets__dataset_id__imports_from_campaign_post: + speakeasy-default-post-dataset-records-from-campaign-v1-observability-datasets-dataset-id-imports-from-campaign-post: + parameters: + path: + dataset_id: "306b5f31-e31c-4e06-9220-e3008c61bf1b" + requestBody: + application/json: {"campaign_id": "71a2e42d-7414-4fe6-89cb-44a2122b6f6b"} + responses: + "202": + application/json: {"id": "db513b3b-341e-4e14-953f-13e588b8c106", "created_at": "2026-07-10T21:30:19.189Z", "updated_at": "2025-08-15T09:09:46.978Z", "deleted_at": "2025-01-04T02:06:39.691Z", "creator_id": "9c74cc15-e7f7-4c15-903f-2485fcc52a87", "dataset_id": "d16b3225-1373-4338-b5d9-032cac7fed30", "workspace_id": "bd24c970-f6df-4a69-9911-63b52ad02f60", "status": "CANCELED"} + "400": + application/json: {"detail": {"message": "", "error_code": "JUDGE_CONVERSATION_FORMAT_ERROR"}} + post_dataset_records_from_explorer_v1_observability_datasets__dataset_id__imports_from_explorer_post: + speakeasy-default-post-dataset-records-from-explorer-v1-observability-datasets-dataset-id-imports-from-explorer-post: + parameters: + path: + dataset_id: "ee1930e9-54f7-4c68-aa8a-40fe5d2a3485" + requestBody: + application/json: {"completion_event_ids": ["", "", ""]} + responses: + "202": + application/json: {"id": "8c71ef83-5f8d-4ee8-8a8d-e4d0c5abc8e2", "created_at": "2026-05-31T08:20:12.578Z", "updated_at": "2025-02-03T03:31:36.033Z", "deleted_at": null, "creator_id": "7c5e163b-8c0d-4f60-9f6d-d44369ad1803", "dataset_id": "78461345-1124-43d7-943b-91676e5fb7a4", "workspace_id": "c97e6603-92cf-4635-95cf-00423feddaff", "status": "TERMINATED"} + "400": + application/json: {"detail": {"message": "", "error_code": "SEARCH_NOT_FOUND"}} + post_dataset_records_from_file_v1_observability_datasets__dataset_id__imports_from_file_post: + speakeasy-default-post-dataset-records-from-file-v1-observability-datasets-dataset-id-imports-from-file-post: + parameters: + path: + dataset_id: "1c96c925-cc58-4529-863d-9fe66a6f1924" + requestBody: + application/json: {"file_id": ""} + responses: + "202": + application/json: {"id": "8654123f-341f-49c3-8447-98828248facd", "created_at": "2026-12-16T17:56:34.179Z", "updated_at": "2026-04-20T22:41:58.691Z", "deleted_at": null, "creator_id": "eabdcb9a-cc81-4a95-a488-996d13c5a3b4", "dataset_id": "6a4ee4af-5d20-4a2a-a33f-1e652ecab674", "workspace_id": "a92c0b3a-fb84-4231-a417-58dd87ad39a2", "status": "COMPLETED"} + "400": + application/json: {"detail": {"message": "", "error_code": "SEARCH_SERVICE_UNAVAILABLE"}} + post_dataset_records_from_playground_v1_observability_datasets__dataset_id__imports_from_playground_post: + speakeasy-default-post-dataset-records-from-playground-v1-observability-datasets-dataset-id-imports-from-playground-post: + parameters: + path: + dataset_id: "5cb42584-5fcf-4837-997a-6a67c5e6900d" + requestBody: + application/json: {"conversation_ids": []} + responses: + "202": + application/json: {"id": "2cf93c3a-cd05-4a36-b3a6-e89bb5c172d6", "created_at": "2026-11-28T19:05:01.247Z", "updated_at": "2024-12-22T22:01:15.271Z", "deleted_at": "2026-09-14T02:10:46.354Z", "creator_id": "1b3ecd64-2756-4a66-9d66-9f22de0766e0", "dataset_id": "efac04d5-91fe-4307-9995-d43f9354c865", "workspace_id": "c838e342-2ead-4e36-82a1-c36678946451", "status": "COMPLETED"} + "400": + application/json: {"detail": {"message": "", "error_code": "EVALUATION_RECORD_NOT_FOUND"}} + post_dataset_records_from_dataset_v1_observability_datasets__dataset_id__imports_from_dataset_post: + speakeasy-default-post-dataset-records-from-dataset-v1-observability-datasets-dataset-id-imports-from-dataset-post: + parameters: + path: + dataset_id: "ada96a08-d724-4e5c-9111-aaf1bdb7d588" + requestBody: + application/json: {"dataset_record_ids": ["58fe798a-537b-4c61-9efc-d1d96d5d264a", "cfa1d197-deda-456e-906b-dd84dccfcd17"]} + responses: + "202": + application/json: {"id": "b97f7456-333f-481a-b1d7-b2fd0cabb81f", "created_at": "2026-07-07T08:57:39.299Z", "updated_at": "2025-04-06T16:16:54.540Z", "deleted_at": "2026-02-08T12:22:57.154Z", "creator_id": "008cae3e-ab6c-440d-a500-e1c0c6bfafea", "dataset_id": "92ce387e-43fe-4327-b337-87400761f84f", "workspace_id": "a231f2e2-3f68-4b37-9675-5bce4be8ce71", "status": "FAILED"} + "400": + application/json: {"detail": {"message": "", "error_code": "DATABASE_UNAVAILABLE"}} + export_dataset_to_jsonl_v1_observability_datasets__dataset_id__exports_to_jsonl_get: + speakeasy-default-export-dataset-to-jsonl-v1-observability-datasets-dataset-id-exports-to-jsonl-get: + parameters: + path: + dataset_id: "d521add6-d909-4a69-a460-cb880d87b773" responses: "200": - application/json: {"id": "", "object": "model", "archived": false} - agents_api_v1_conversations_start: - speakeasy-default-agents-api-v1-conversations-start: + application/json: {"file_url": "https://indolent-reasoning.net/"} + "400": + application/json: {"detail": {"message": "", "error_code": null}} + get_dataset_import_task_v1_observability_datasets__dataset_id__tasks__task_id__get: + speakeasy-default-get-dataset-import-task-v1-observability-datasets-dataset-id-tasks-task-id-get: + parameters: + path: + dataset_id: "b64b504e-58a2-4d52-979b-e2634b301235" + task_id: "1713cde2-dea1-410d-851e-8cea964ffa14" + responses: + "200": + application/json: {"id": "dc7499d8-7f09-4d2a-8e29-0a4d065145f5", "created_at": "2025-01-07T06:23:24.736Z", "updated_at": "2025-05-24T23:56:27.316Z", "deleted_at": "2026-05-23T10:58:23.820Z", "creator_id": "0e259d11-14ba-43d1-adfe-3d3e8a7b4e8d", "dataset_id": "58388b6a-c7f3-4124-9259-e560e7c0d1ad", "workspace_id": "9c1ec3b6-b03d-421a-824b-b1731697acd3", "status": "RUNNING"} + "400": + application/json: {"detail": {"message": "", "error_code": "DATABASE_ERROR"}} + get_dataset_import_tasks_v1_observability_datasets__dataset_id__tasks_get: + speakeasy-default-get-dataset-import-tasks-v1-observability-datasets-dataset-id-tasks-get: + parameters: + path: + dataset_id: "29903443-7f9c-42a6-9b6b-fc5cbef4191a" + query: + page_size: 50 + page: 1 + responses: + "200": + application/json: {"tasks": {"count": 578476}} + "400": + application/json: {"detail": {"message": "", "error_code": "EVALUATION_RUN_TRANSITION_IS_INVALID"}} + get_dataset_record_v1_observability_dataset_records__dataset_record_id__get: + speakeasy-default-get-dataset-record-v1-observability-dataset-records-dataset-record-id-get: + parameters: + path: + dataset_record_id: "ce995349-abbf-45c0-be75-885fc1c4b4c0" + responses: + "200": + application/json: {"id": "c96bcf85-ee78-44b5-a9dc-d8f146764c9a", "created_at": "2025-01-04T07:24:23.318Z", "updated_at": "2024-05-08T06:55:20.351Z", "deleted_at": null, "dataset_id": "6689327c-88fd-4189-8dcb-00bb54335fe3", "payload": {"messages": []}, "properties": {"key": ""}, "source": "DIRECT_INPUT"} + "400": + application/json: {"detail": {"message": "", "error_code": "DATABASE_ERROR"}} + delete_dataset_record_v1_observability_dataset_records__dataset_record_id__delete: + speakeasy-default-delete-dataset-record-v1-observability-dataset-records-dataset-record-id-delete: + parameters: + path: + dataset_record_id: "799fed99-80b4-4a9a-a15e-05352b811702" + responses: + "400": + application/json: {"detail": {"message": "", "error_code": "FEATURE_NOT_SUPPORTED"}} + delete_dataset_records_v1_observability_dataset_records_bulk_delete_post: + speakeasy-default-delete-dataset-records-v1-observability-dataset-records-bulk-delete-post: + requestBody: + application/json: {"dataset_record_ids": ["22fc78f7-e774-4ab5-b1ea-63852992ef31", "1c533b4f-882e-4bd0-9ef6-9933b825f8b1"]} + responses: + "400": + application/json: {"detail": {"message": "", "error_code": "JUDGE_CONVERSATION_FORMAT_ERROR"}} + judge_dataset_record_v1_observability_dataset_records__dataset_record_id__live_judging_post: + speakeasy-default-judge-dataset-record-v1-observability-dataset-records-dataset-record-id-live-judging-post: + parameters: + path: + dataset_record_id: "9de5d7a1-787a-45dd-b668-9f3407e76d8b" requestBody: - application/json: {"inputs": "", "stream": false} + application/json: {"judge_definition": {"name": "", "description": "wisely railway deceivingly arcade minion back what yowza outrun service", "model_name": "", "output": {"type": "CLASSIFICATION", "options": [{"value": "", "description": "spork excluding without retrospectivity bah next yearly"}]}, "instructions": "", "tools": [""]}} responses: "200": - application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [{"object": "entry", "type": "agent.handoff", "previous_agent_id": "", "previous_agent_name": "", "next_agent_id": "", "next_agent_name": ""}], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + application/json: {"analysis": "", "answer": ""} + "400": + application/json: {"detail": {"message": "", "error_code": "DATASET_TASK_NOT_FOUND"}} + update_dataset_record_payload_v1_observability_dataset_records__dataset_record_id__payload_put: + speakeasy-default-update-dataset-record-payload-v1-observability-dataset-records-dataset-record-id-payload-put: + parameters: + path: + dataset_record_id: "17506b15-748e-4e7c-9737-c97c44d04b0f" + requestBody: + application/json: {"payload": {"messages": [{"key": ""}, {}, {"key": ""}]}} + responses: + "400": + application/json: {"detail": {"message": "", "error_code": "EVALUATION_RUN_TRANSITION_IS_RUNNING_ALREADY"}} + update_dataset_record_properties_v1_observability_dataset_records__dataset_record_id__properties_put: + speakeasy-default-update-dataset-record-properties-v1-observability-dataset-records-dataset-record-id-properties-put: + parameters: + path: + dataset_record_id: "a4deefc5-0905-427e-ad15-1090ef9e216d" + requestBody: + application/json: {"properties": {"key": "", "key1": "", "key2": ""}} + responses: + "400": + application/json: {"detail": {"message": "", "error_code": null}} + connector_create_v1: + speakeasy-default-connector-create-v1: + requestBody: + application/json: {"name": "", "description": "unibody usually despite slushy wherever reward stingy from", "server": "https://royal-majority.net/"} + responses: + "201": + application/json: {"id": "3633ef72-f5c6-4354-b510-7167244672aa", "name": "", "description": "why yahoo zany potentially", "created_at": "2024-05-03T05:17:01.129Z", "modified_at": "2025-09-26T20:42:01.861Z"} "422": application/json: {} - agents_api_v1_conversations_list: - speakeasy-default-agents-api-v1-conversations-list: + connector_list_v1: + speakeasy-default-connector-list-v1: parameters: query: - page: 0 page_size: 100 responses: "200": - application/json: [{"object": "conversation", "id": "", "created_at": "2025-11-20T22:30:47.754Z", "updated_at": "2025-08-05T08:36:20.296Z", "agent_id": ""}] + application/json: {"items": [], "pagination": {"page_size": 600083}} "422": application/json: {} - agents_api_v1_conversations_get: - speakeasy-default-agents-api-v1-conversations-get: + connector_call_tool_v1: + speakeasy-default-connector-call-tool-v1: parameters: path: - conversation_id: "" + tool_name: "" + connector_id_or_name: "" + requestBody: + application/json: {} responses: "200": - application/json: {"object": "conversation", "id": "", "created_at": "2023-06-02T14:00:42.201Z", "updated_at": "2024-10-06T17:16:50.325Z", "agent_id": ""} + application/json: {"content": [{"type": "resource", "resource": {"uri": "https://good-certification.net", "text": ""}}]} "422": application/json: {} - agents_api_v1_conversations_append: - speakeasy-default-agents-api-v1-conversations-append: + connector_get_v1: + speakeasy-default-connector-get-v1: parameters: path: - conversation_id: "" - requestBody: - application/json: {"inputs": [], "stream": false, "store": true, "handoff_execution": "server"} + connector_id_or_name: "" + query: + fetch_customer_data: false + fetch_connection_secrets: false responses: "200": - application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + application/json: {"id": "f6d4a827-9530-4a4c-af7f-ac5d6264abbf", "name": "", "description": "diversity nudge pulverize offensively", "created_at": "2024-12-11T18:18:39.930Z", "modified_at": "2026-11-21T21:28:01.899Z"} "422": application/json: {} - agents_api_v1_conversations_history: - speakeasy-default-agents-api-v1-conversations-history: + connector_update_v1: + speakeasy-default-connector-update-v1: parameters: path: - conversation_id: "" + connector_id: "81d30634-113f-4dce-a89e-7786be2d8693" + requestBody: + application/json: {} responses: "200": - application/json: {"object": "conversation.history", "conversation_id": "", "entries": [{"object": "entry", "type": "tool.execution", "name": "image_generation", "arguments": ""}]} + application/json: {"id": "987e4f32-6930-41a7-8adf-6e893eddc3d9", "name": "", "description": "especially usually collaborate likewise svelte tightly very", "created_at": "2026-09-13T13:33:05.718Z", "modified_at": "2026-06-23T06:11:22.023Z"} "422": application/json: {} - agents_api_v1_conversations_messages: - speakeasy-default-agents-api-v1-conversations-messages: + connector_delete_v1: + speakeasy-default-connector-delete-v1: parameters: path: - conversation_id: "" + connector_id: "5c3269fe-6a18-4216-b1fb-b093005874cd" responses: "200": - application/json: {"object": "conversation.messages", "conversation_id": "", "messages": []} + application/json: {"message": ""} "422": application/json: {} - agents_api_v1_conversations_restart: - speakeasy-default-agents-api-v1-conversations-restart: + judge_conversation_v1_observability_judges__judge_id__live_judging_post: + speakeasy-default-judge-conversation-v1-observability-judges-judge-id-live-judging-post: parameters: path: - conversation_id: "" + judge_id: "7fb9f06a-22fb-45db-ad58-6a5715280755" requestBody: - application/json: {"inputs": "", "stream": false, "store": true, "handoff_execution": "server", "from_entry_id": ""} + application/json: {"messages": []} responses: "200": - application/json: {"object": "conversation.response", "conversation_id": "", "outputs": [], "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}} + application/json: {"analysis": "", "answer": 4277.83} + "400": + application/json: {"detail": {"message": "", "error_code": "TEMPLATE_SYNTAX_ERROR"}} + connector_get_auth_url_v1: + speakeasy-default-connector-get-auth-url-v1: + parameters: + path: + connector_id_or_name: "" + responses: + "200": + application/json: {"auth_url": "https://unlined-suv.com", "ttl": 786815} "422": application/json: {} - agents_api_v1_conversations_start_stream: - speakeasy-default-agents-api-v1-conversations-start-stream: + speech_v1_audio_speech_post: + speakeasy-default-speech-v1-audio-speech-post: requestBody: - application/json: {"inputs": [{"object": "entry", "type": "function.result", "tool_call_id": "", "result": ""}], "stream": true} + application/json: {"stream": false, "input": ""} responses: + "200": + application/json: {"audio_data": ""} "422": application/json: {} - agents_api_v1_conversations_append_stream: - speakeasy-default-agents-api-v1-conversations-append-stream: + list_voices_v1_audio_voices_get: + speakeasy-default-list-voices-v1-audio-voices-get: parameters: - path: - conversation_id: "" + query: + limit: 10 + offset: 0 + type: "all" + responses: + "200": + application/json: {"items": [{"name": "", "retention_notice": 30, "id": "c29472e8-7047-4227-ab06-14ac147f1ac9", "created_at": "2025-04-29T05:19:27.779Z", "user_id": ""}], "total": 911345, "page": 575844, "page_size": 996146, "total_pages": 441415} + "422": + application/json: {} + create_voice_v1_audio_voices_post: + speakeasy-default-create-voice-v1-audio-voices-post: requestBody: - application/json: {"inputs": "", "stream": true, "store": true, "handoff_execution": "server"} + application/json: {"name": "", "retention_notice": 30, "sample_audio": ""} responses: + "200": + application/json: {"name": "", "retention_notice": 30, "id": "40b08db1-3b52-4ceb-9a0a-1c667e00001b", "created_at": "2024-01-06T19:50:35.147Z", "user_id": ""} "422": application/json: {} - agents_api_v1_conversations_restart_stream: - speakeasy-default-agents-api-v1-conversations-restart-stream: + delete_voice_v1_audio_voices__voice_id__delete: + speakeasy-default-delete-voice-v1-audio-voices-voice-id-delete: parameters: path: - conversation_id: "" - requestBody: - application/json: {"inputs": [{"object": "entry", "type": "message.input", "role": "assistant", "content": "", "prefix": false}], "stream": true, "store": true, "handoff_execution": "server", "from_entry_id": ""} + voice_id: "f42bf0d7-8a10-4b98-bbfa-589a232209d2" responses: + "200": + application/json: {"name": "", "retention_notice": 30, "id": "35c3fb1b-bf2e-4c59-9fbc-1a07b5aae318", "created_at": "2025-07-16T21:02:12.020Z", "user_id": ""} "422": application/json: {} - agents_api_v1_agents_create: - speakeasy-default-agents-api-v1-agents-create: + update_voice_v1_audio_voices__voice_id__patch: + speakeasy-default-update-voice-v1-audio-voices-voice-id-patch: + parameters: + path: + voice_id: "030a6b20-e287-414d-9a77-6b76a4a56c9d" requestBody: - application/json: {"model": "LeBaron", "name": ""} + application/json: {} responses: "200": - application/json: {"model": "Ranchero", "name": "", "object": "agent", "id": "", "version": 316961, "created_at": "2025-03-26T19:00:51.430Z", "updated_at": "2023-04-28T15:08:02.110Z"} + application/json: {"name": "", "retention_notice": 30, "id": "b24f3587-b692-4c7e-8899-187f5eb636bb", "created_at": "2025-05-30T15:17:43.490Z", "user_id": ""} "422": application/json: {} - agents_api_v1_agents_list: - speakeasy-default-agents-api-v1-agents-list: + get_voice_v1_audio_voices__voice_id__get: + speakeasy-default-get-voice-v1-audio-voices-voice-id-get: parameters: - query: - page: 0 - page_size: 20 + path: + voice_id: "" responses: "200": - application/json: [{"model": "Impala", "name": "", "object": "agent", "id": "", "version": 43153, "created_at": "2024-04-26T15:54:09.954Z", "updated_at": "2024-02-11T18:27:55.607Z"}] + application/json: {"name": "", "retention_notice": 30, "id": "964aee3c-7963-421e-8b70-e81d1aae4671", "created_at": "2026-01-24T22:28:34.575Z", "user_id": ""} "422": application/json: {} - agents_api_v1_agents_get: - speakeasy-default-agents-api-v1-agents-get: + get_voice_sample_audio_v1_audio_voices__voice_id__sample_get: + speakeasy-default-get-voice-sample-audio-v1-audio-voices-voice-id-sample-get: parameters: path: - agent_id: "" + voice_id: "" responses: "200": - application/json: {"model": "Silverado", "name": "", "object": "agent", "id": "", "version": 845972, "created_at": "2025-08-21T03:10:48.135Z", "updated_at": "2024-11-11T17:15:57.309Z"} + application/json: "" + audio/wav: "x-file: example.file" "422": application/json: {} - agents_api_v1_agents_update: - speakeasy-default-agents-api-v1-agents-update: + connector_list_tools_v1: + speakeasy-default-connector-list-tools-v1: parameters: path: - agent_id: "" - requestBody: - application/json: {} + connector_id_or_name: "" + query: + page: 1 + page_size: 100 + refresh: false + pretty: false responses: "200": - application/json: {"model": "Model X", "name": "", "object": "agent", "id": "", "version": 799821, "created_at": "2025-10-20T17:35:08.067Z", "updated_at": "2023-11-16T08:47:13.265Z"} + application/json: [{}] "422": application/json: {} - agents_api_v1_agents_update_version: - speakeasy-default-agents-api-v1-agents-update-version: + jobs_api_routes_batch_delete_batch_job: + speakeasy-default-jobs-api-routes-batch-delete-batch-job: parameters: path: - agent_id: "" + job_id: "d9e71426-5791-49ad-b8d1-cf0d90d1b7d0" + responses: + "200": + application/json: {"id": "", "object": "batch", "deleted": true} + get_workflows_v1_workflows_get: + speakeasy-default-get-workflows-v1-workflows-get: + parameters: query: - version: 157995 + active_only: false + include_shared: true + limit: 50 responses: "200": - application/json: {"model": "XTS", "name": "", "object": "agent", "id": "", "version": 310764, "created_at": "2023-05-08T23:29:06.216Z", "updated_at": "2023-05-16T19:20:05.735Z"} + application/json: {"workflows": [], "next_cursor": "d354b4ce-6ab4-45a8-93bc-a2df586c46d4"} "422": application/json: {} - files_api_routes_upload_file: - speakeasy-default-files-api-routes-upload-file: - requestBody: - multipart/form-data: {"file": "x-file: example.file"} - responses: - "200": - application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "batch", "sample_type": "batch_result", "source": "upload"} - files_api_routes_list_files: - speakeasy-default-files-api-routes-list-files: + get_workflow_registrations_v1_workflows_registrations_get: + speakeasy-default-get-workflow-registrations-v1-workflows-registrations-get: parameters: query: - page: 0 - page_size: 100 + active_only: false + include_shared: true + with_workflow: false + limit: 50 responses: "200": - application/json: {"data": [{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "fine-tune", "sample_type": "batch_error", "source": "upload"}], "object": "", "total": 999335} - files_api_routes_retrieve_file: - speakeasy-default-files-api-routes-retrieve-file: + application/json: {"workflow_registrations": [], "next_cursor": "6b512fbb-9584-4ea5-bfdb-e90316f436fd", "workflow_versions": [{"id": "e6e0d049-e303-4710-bda9-61cd5196b1ec", "task_queue": "", "definition": {"input_schema": {"key": "", "key1": ""}, "enforce_determinism": false}, "workflow_id": "96d7cee5-611b-4a26-82d8-3e6c84cc894d", "compatible_with_chat_assistant": false}]} + "422": + application/json: {} + execute_workflow_v1_workflows__workflow_identifier__execute_post: + speakeasy-default-execute-workflow-v1-workflows-workflow-identifier-execute-post: parameters: path: - file_id: "f2a27685-ca4e-4dc2-9f2b-88c422c3e0f6" + workflow_identifier: "" + requestBody: + application/json: {"wait_for_result": false} responses: "200": - application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "bytes": 13000, "created_at": 1716963433, "filename": "files_upload.jsonl", "purpose": "batch", "sample_type": "instruct", "source": "repository", "deleted": false} - files_api_routes_delete_file: - speakeasy-default-files-api-routes-delete-file: + application/json: {"workflow_name": "", "execution_id": "", "root_execution_id": "", "status": "RUNNING", "start_time": "2026-01-16T18:23:52.214Z", "end_time": "2026-06-24T19:55:56.410Z", "result": ""} + "422": + application/json: {} + execute_workflow_registration_v1_workflows_registrations__workflow_registration_id__execute_post: + speakeasy-default-execute-workflow-registration-v1-workflows-registrations-workflow-registration-id-execute-post: parameters: path: - file_id: "3b6d45eb-e30b-416f-8019-f47e2e93d930" + workflow_registration_id: "de11d76a-e0fb-44dd-abd9-2e75fc275b94" + requestBody: + application/json: {"wait_for_result": false} responses: "200": - application/json: {"id": "497f6eca-6276-4993-bfeb-53cbbbba6f09", "object": "file", "deleted": false} - files_api_routes_download_file: - speakeasy-default-files-api-routes-download-file: + application/json: {"workflow_name": "", "execution_id": "", "root_execution_id": "", "status": "RETRYING_AFTER_ERROR", "start_time": "2025-02-03T00:07:08.284Z", "end_time": "2024-01-22T11:44:36.909Z", "result": ""} + "422": + application/json: {} + get_workflow_v1_workflows__workflow_identifier__get: + speakeasy-default-get-workflow-v1-workflows-workflow-identifier-get: parameters: path: - file_id: "f8919994-a4a1-46b2-8b5b-06335a4300ce" + workflow_identifier: "" responses: "200": - application/octet-stream: "x-file: example.file" - files_api_routes_get_signed_url: - speakeasy-default-files-api-routes-get-signed-url: + application/json: {"workflow": {"id": "7e6d5999-1f66-4311-8059-f056ead70099", "name": "", "display_name": "Clifton98", "type": "code", "customer_id": "7882a879-b763-4980-9480-235734fdf4f4", "workspace_id": "5be5bb5a-4e28-453d-b0f5-a506f3a5cd58", "available_in_chat_assistant": false, "is_technical": false, "on_behalf_of": false, "archived": false, "active": true}} + "422": + application/json: {} + update_workflow_v1_workflows__workflow_identifier__put: + speakeasy-default-update-workflow-v1-workflows-workflow-identifier-put: parameters: path: - file_id: "06a020ab-355c-49a6-b19d-304b7c01699f" - query: - expiry: 24 + workflow_identifier: "" + requestBody: + application/json: {} responses: "200": - application/json: {"url": "https://knotty-birdcage.net/"} - jobs_api_routes_fine_tuning_get_fine_tuning_jobs: - speakeasy-default-jobs-api-routes-fine-tuning-get-fine-tuning-jobs: + application/json: {"workflow": {"id": "db975768-c873-461d-b3e8-6f22f94c0b20", "name": "", "display_name": "Marilie.Keeling", "type": "code", "customer_id": "89b5718e-e6ee-4eb2-b9bd-53c5f9c1222a", "workspace_id": "2ddcd2cb-4f9d-4897-b286-e08bd0fbd54b", "available_in_chat_assistant": false, "is_technical": false, "on_behalf_of": false, "archived": false}} + "422": + application/json: {} + get_workflow_registration_v1_workflows_registrations__workflow_registration_id__get: + speakeasy-default-get-workflow-registration-v1-workflows-registrations-workflow-registration-id-get: parameters: + path: + workflow_registration_id: "c4d86c40-960f-4e9a-9d6f-ad8342d7aa83" query: - page: 0 - page_size: 100 - created_by_me: false - responses: - "200": - application/json: {"object": "list", "total": 843585} - jobs_api_routes_fine_tuning_create_fine_tuning_job: - speakeasy-default-jobs-api-routes-fine-tuning-create-fine-tuning-job: - requestBody: - application/json: {"model": "Camaro", "invalid_sample_skip_percentage": 0, "hyperparameters": {"learning_rate": 0.0001}} + with_workflow: false + include_shared: true responses: "200": - application/json: {"expected_duration_seconds": 220, "cost": 10, "cost_currency": "EUR", "train_tokens_per_step": 131072, "train_tokens": 1310720, "data_tokens": 305375, "deprecated": true, "details": "", "epochs": 4.2922, "training_steps": 10, "object": "job.metadata"} - jobs_api_routes_fine_tuning_get_fine_tuning_job: - speakeasy-default-jobs-api-routes-fine-tuning-get-fine-tuning-job: + application/json: {"workflow_registration": {"id": "db19a749-c9a8-4fc8-a04b-540b6b648c8f", "definition": {"input_schema": {"key": ""}, "enforce_determinism": false}, "workflow_id": "78b8c35a-8488-497f-80f4-8fef6fbbd4ad", "compatible_with_chat_assistant": false, "active": false}, "workflow_version": {"id": "e35a35c7-8a69-4bf2-a597-e2b0916c4c5e", "definition": {"input_schema": {"key": ""}, "enforce_determinism": false}, "workflow_id": "2238d5fa-45be-48d4-9705-a1852ab34b83", "compatible_with_chat_assistant": false, "active": false}} + "422": + application/json: {} + archive_workflow_v1_workflows__workflow_identifier__archive_put: + speakeasy-default-archive-workflow-v1-workflows-workflow-identifier-archive-put: parameters: path: - job_id: "c167a961-ffca-4bcf-93ac-6169468dd389" + workflow_identifier: "" responses: "200": - application/json: {"id": "babac92a-96fa-48c4-931c-f6f97e1bf24c", "auto_start": false, "model": "Spyder", "status": "FAILED", "created_at": 232438, "modified_at": 32259, "training_files": ["7a95c5a0-399d-4665-84c8-deab766d22dc"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "classifier_targets": [{"name": "", "labels": [], "weight": 5651, "loss_function": "single_class"}]} - jobs_api_routes_fine_tuning_cancel_fine_tuning_job: - speakeasy-default-jobs-api-routes-fine-tuning-cancel-fine-tuning-job: + application/json: {"workflow": {"id": "5efd36dc-5de7-4708-a17b-492eb93650e0", "name": "", "display_name": "Torrey_Rippin32", "type": "code", "customer_id": "93950b7e-25cf-45e9-9e16-558ac052306e", "workspace_id": "61923af7-6896-4605-9c48-c7d3cacb4732", "available_in_chat_assistant": false, "is_technical": false, "on_behalf_of": false, "archived": false}} + "422": + application/json: {} + unarchive_workflow_v1_workflows__workflow_identifier__unarchive_put: + speakeasy-default-unarchive-workflow-v1-workflows-workflow-identifier-unarchive-put: parameters: path: - job_id: "6188a2f6-7513-4e0f-89cc-3f8088523a49" + workflow_identifier: "" responses: "200": - application/json: {"id": "770b9cc0-1ab6-44de-a816-67010644e9fb", "auto_start": false, "model": "Volt", "status": "CANCELLATION_REQUESTED", "created_at": 546404, "modified_at": 180081, "training_files": ["45e621c6-ac30-4133-b6d1-fc0d1fe24c9f"], "object": "job", "job_type": "classifier", "hyperparameters": {"learning_rate": 0.0001}, "classifier_targets": [{"name": "", "labels": [""], "weight": 1298.58, "loss_function": "multi_class"}]} - jobs_api_routes_fine_tuning_start_fine_tuning_job: - speakeasy-default-jobs-api-routes-fine-tuning-start-fine-tuning-job: + application/json: {"workflow": {"id": "779e3e34-c64a-493c-bcbe-6d70947147e9", "name": "", "display_name": "Hal56", "type": "code", "customer_id": "f4fbcccc-06b3-4d08-9101-3035a013990a", "workspace_id": "ded5993d-1646-4bdb-a4ba-6b4280e38716", "available_in_chat_assistant": false, "is_technical": false, "on_behalf_of": false, "archived": false}} + "422": + application/json: {} + get_workflow_execution_v1_workflows_executions__execution_id__get: + speakeasy-default-get-workflow-execution-v1-workflows-executions-execution-id-get: parameters: path: - job_id: "56553e4d-0679-471e-b9ac-59a77d671103" + execution_id: "" responses: "200": - application/json: {"id": "68ad461a-676e-47fe-a07e-15e38f5082b5", "auto_start": false, "model": "Grand Cherokee", "status": "STARTED", "created_at": 134515, "modified_at": 192651, "training_files": ["39dabc3d-15eb-49ac-a549-69973f33acee"], "object": "job", "job_type": "completion", "hyperparameters": {"learning_rate": 0.0001}} - jobs_api_routes_batch_get_batch_jobs: - speakeasy-default-jobs-api-routes-batch-get-batch-jobs: + application/json: {"workflow_name": "", "execution_id": "", "root_execution_id": "", "status": "FAILED", "start_time": "2026-01-17T01:48:54.055Z", "end_time": "2024-04-12T09:56:57.081Z", "result": ""} + "422": + application/json: {} + get_workflow_execution_history_v1_workflows_executions__execution_id__history_get: + speakeasy-default-get-workflow-execution-history-v1-workflows-executions-execution-id-history-get: parameters: + path: + execution_id: "" query: - page: 0 - page_size: 100 - created_by_me: false + decode_payloads: true responses: "200": - application/json: {"object": "list", "total": 186589} - jobs_api_routes_batch_create_batch_job: - speakeasy-default-jobs-api-routes-batch-create-batch-job: + application/json: "" + "422": + application/json: {} + signal_workflow_execution_v1_workflows_executions__execution_id__signals_post: + speakeasy-default-signal-workflow-execution-v1-workflows-executions-execution-id-signals-post: + parameters: + path: + execution_id: "" requestBody: - application/json: {"input_files": ["fe3343a2-3b8d-404b-ba32-a78dede2614a"], "endpoint": "/v1/moderations", "timeout_hours": 24} + application/json: {"name": ""} responses: - "200": - application/json: {"id": "", "object": "batch", "input_files": ["7b2553d8-e17f-4df5-a862-a1678f6b5271", "8c618d9f-7d82-42ba-a284-d57d84f50a58", "c042f996-e842-441d-ae47-4e0850334e41"], "endpoint": "", "errors": [{"message": "", "count": 1}], "status": "SUCCESS", "created_at": 395527, "total_requests": 166919, "completed_requests": 258552, "succeeded_requests": 480980, "failed_requests": 684176} - jobs_api_routes_batch_get_batch_job: - speakeasy-default-jobs-api-routes-batch-get-batch-job: + "202": + application/json: {"message": "Signal accepted"} + "422": + application/json: {} + query_workflow_execution_v1_workflows_executions__execution_id__queries_post: + speakeasy-default-query-workflow-execution-v1-workflows-executions-execution-id-queries-post: parameters: path: - job_id: "4017dc9f-b629-42f4-9700-8c681b9e7f0f" + execution_id: "" + requestBody: + application/json: {"name": ""} responses: "200": - application/json: {"id": "", "object": "batch", "input_files": ["11b83f16-f2f9-4de4-a81f-203fff419c99"], "endpoint": "", "errors": [], "status": "TIMEOUT_EXCEEDED", "created_at": 900958, "total_requests": 458292, "completed_requests": 184893, "succeeded_requests": 104800, "failed_requests": 836210} - jobs_api_routes_batch_cancel_batch_job: - speakeasy-default-jobs-api-routes-batch-cancel-batch-job: + application/json: {"query_name": "", "result": ""} + "422": + application/json: {} + terminate_workflow_execution_v1_workflows_executions__execution_id__terminate_post: + speakeasy-default-terminate-workflow-execution-v1-workflows-executions-execution-id-terminate-post: parameters: path: - job_id: "4fb29d1c-535b-4f0a-a1cb-2167f86da569" + execution_id: "" responses: - "200": - application/json: {"id": "", "object": "batch", "input_files": ["8fd9d88a-66be-43fd-a816-ba509ca3ca85"], "endpoint": "", "errors": [], "status": "TIMEOUT_EXCEEDED", "created_at": 608251, "total_requests": 12693, "completed_requests": 203340, "succeeded_requests": 189291, "failed_requests": 969057} - chat_completion_v1_chat_completions_post: - speakeasy-default-chat-completion-v1-chat-completions-post: + "422": + application/json: {} + batch_terminate_workflow_executions_v1_workflows_executions_terminate_post: + speakeasy-default-batch-terminate-workflow-executions-v1-workflows-executions-terminate-post: requestBody: - application/json: {"model": "mistral-small-latest", "stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}]} + application/json: {"execution_ids": ["", ""]} responses: "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} + application/json: {} "422": application/json: {} - stream_chat: - speakeasy-default-stream-chat: - requestBody: - application/json: {"model": "mistral-small-latest", "stream": true, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}]} + cancel_workflow_execution_v1_workflows_executions__execution_id__cancel_post: + speakeasy-default-cancel-workflow-execution-v1-workflows-executions-execution-id-cancel-post: + parameters: + path: + execution_id: "" responses: "422": application/json: {} - fim_completion_v1_fim_completions_post: - speakeasy-default-fim-completion-v1-fim-completions-post: + batch_cancel_workflow_executions_v1_workflows_executions_cancel_post: + speakeasy-default-batch-cancel-workflow-executions-v1-workflows-executions-cancel-post: requestBody: - application/json: {"model": "codestral-2405", "top_p": 1, "stream": false, "prompt": "def", "suffix": "return a+b"} + application/json: {"execution_ids": []} responses: "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "codestral-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} + application/json: {} "422": application/json: {} - stream_fim: - speakeasy-default-stream-fim: + reset_workflow_v1_workflows_executions__execution_id__reset_post: + speakeasy-default-reset-workflow-v1-workflows-executions-execution-id-reset-post: + parameters: + path: + execution_id: "" requestBody: - application/json: {"model": "codestral-2405", "top_p": 1, "stream": true, "prompt": "def", "suffix": "return a+b"} + application/json: {"event_id": 24149, "exclude_signals": false, "exclude_updates": false} responses: "422": application/json: {} - agents_completion_v1_agents_completions_post: - speakeasy-default-agents-completion-v1-agents-completions-post: + update_workflow_execution_v1_workflows_executions__execution_id__updates_post: + speakeasy-default-update-workflow-execution-v1-workflows-executions-execution-id-updates-post: + parameters: + path: + execution_id: "" requestBody: - application/json: {"stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}], "agent_id": ""} + application/json: {"name": ""} responses: "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} + application/json: {"update_name": "", "result": ""} "422": application/json: {} - stream_agents: - speakeasy-default-stream-agents: - requestBody: - application/json: {"stream": true, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}], "agent_id": ""} + get_workflow_execution_trace_otel: + speakeasy-default-get-workflow-execution-trace-otel: + parameters: + path: + execution_id: "" responses: + "200": + application/json: {"workflow_name": "", "execution_id": "", "root_execution_id": "", "status": "COMPLETED", "start_time": "2025-04-04T13:52:04.739Z", "end_time": "2025-01-16T05:22:56.752Z", "result": "", "data_source": ""} "422": application/json: {} - embeddings_v1_embeddings_post: - speakeasy-default-embeddings-v1-embeddings-post: - requestBody: - application/json: {"model": "mistral-embed", "input": ["Embed this sentence.", "As well as this one."]} + get_workflow_execution_trace_summary: + speakeasy-default-get-workflow-execution-trace-summary: + parameters: + path: + execution_id: "" responses: "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "data": [{"object": "embedding", "embedding": [0.1, 0.2, 0.3], "index": 0}, {"object": "embedding", "embedding": [0.4, 0.5, 0.6], "index": 1}]} + application/json: {"workflow_name": "", "execution_id": "", "root_execution_id": "", "status": "COMPLETED", "start_time": "2026-02-04T14:37:36.534Z", "end_time": "2024-12-18T03:10:33.223Z", "result": ""} "422": application/json: {} - moderations_v1_moderations_post: - speakeasy-default-moderations-v1-moderations-post: - requestBody: - application/json: {"model": "Durango", "input": ["", ""]} + get_workflow_execution_trace_events: + speakeasy-default-get-workflow-execution-trace-events: + parameters: + path: + execution_id: "" + query: + merge_same_id_events: false + include_internal_events: false responses: "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Corvette", "results": [{}]} + application/json: {"workflow_name": "", "execution_id": "", "root_execution_id": "", "status": null, "start_time": "2025-11-12T16:59:23.068Z", "end_time": "2024-06-18T15:20:19.798Z", "result": ""} "422": application/json: {} - chat_moderations_v1_chat_moderations_post: - speakeasy-default-chat-moderations-v1-chat-moderations-post: - requestBody: - application/json: {"input": [{"content": "", "role": "tool"}], "model": "LeBaron"} + stream_v1_workflows_executions__execution_id__stream_get: + speakeasy-default-stream-v1-workflows-executions-execution-id-stream-get: + parameters: + path: + execution_id: "" + responses: + "422": + application/json: {} + get_workflow_metrics_v1_workflows__workflow_name__metrics_get: + speakeasy-default-get-workflow-metrics-v1-workflows-workflow-name-metrics-get: + parameters: + path: + workflow_name: "" responses: "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Explorer", "results": [{}]} + application/json: {"execution_count": {"value": 1600.39}, "success_count": {"value": 926320}, "error_count": {"value": 375789}, "average_latency_ms": {"value": 6385.25}, "latency_over_time": {"value": [[695318], [530573]]}, "retry_rate": {"value": 4629.08}} "422": application/json: {} - classifications_v1_classifications_post: - speakeasy-default-classifications-v1-classifications-post: - requestBody: - application/json: {"model": "Silverado", "input": [""]} + list_runs_v1_workflows_runs_get: + speakeasy-default-list-runs-v1-workflows-runs-get: + parameters: + query: + page_size: 50 responses: "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "ATS", "results": [{}, {"key": {"scores": {"key": 2080.19}}}]} + application/json: {"executions": [{"workflow_name": "", "execution_id": "", "root_execution_id": "", "status": "CONTINUED_AS_NEW", "start_time": "2025-04-05T20:23:16.180Z", "end_time": "2025-07-01T00:28:44.234Z"}]} "422": application/json: {} - chat_classifications_v1_chat_classifications_post: - speakeasy-default-chat-classifications-v1-chat-classifications-post: - requestBody: - application/json: {"model": "Camry", "input": [{"messages": [{"content": "", "role": "system"}]}]} + get_run_v1_workflows_runs__run_id__get: + speakeasy-default-get-run-v1-workflows-runs-run-id-get: + parameters: + path: + run_id: "553b071e-3d04-46aa-aa9a-0fca61dc60fa" responses: "200": - application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef", "model": "Altima", "results": [{}, {"key": {"scores": {"key": 1360.53, "key1": 5946.42}}}, {"key": {"scores": {"key": 1360.53, "key1": 5946.42}}}]} + application/json: {"workflow_name": "", "execution_id": "", "root_execution_id": "", "status": "TIMED_OUT", "start_time": "2026-12-15T16:20:06.129Z", "end_time": "2025-04-28T14:51:35.913Z", "result": ""} "422": application/json: {} - ocr_v1_ocr_post: - speakeasy-default-ocr-v1-ocr-post: - requestBody: - application/json: {"model": "CX-9", "document": {"image_url": {"url": "https://measly-scrap.com"}, "type": "image_url"}} + get_run_history_v1_workflows_runs__run_id__history_get: + speakeasy-default-get-run-history-v1-workflows-runs-run-id-history-get: + parameters: + path: + run_id: "f7296489-0212-4239-9e35-12fabfe8cd11" + query: + decode_payloads: true responses: "200": - application/json: {"pages": [{"index": 944919, "markdown": "", "images": [], "dimensions": {"dpi": 984283, "height": 453411, "width": 398292}}], "model": "Wrangler", "usage_info": {"pages_processed": 47064}} + application/json: "" "422": application/json: {} - libraries_list_v1: - speakeasy-default-libraries-list-v1: + get_schedules_v1_workflows_schedules_get: + speakeasy-default-get-schedules-v1-workflows-schedules-get: responses: "200": - application/json: {"data": [{"id": "bfc452fd-4bcb-46ec-9f68-ceea101e924d", "name": "", "created_at": "2024-01-31T13:50:47.409Z", "updated_at": "2023-04-09T15:28:24.261Z", "owner_id": "3fb92cf9-0fea-44d0-958f-16963601a1f0", "owner_type": "", "total_size": 811051, "nb_documents": 634577, "chunk_size": 502060}]} - libraries_create_v1: - speakeasy-default-libraries-create-v1: + application/json: {"schedules": []} + schedule_workflow_v1_workflows_schedules_post: + speakeasy-default-schedule-workflow-v1-workflows-schedules-post: requestBody: - application/json: {"name": ""} + application/json: {"schedule": {"input": ""}} responses: "201": - application/json: {"id": "7285d921-bbab-471e-a2df-600e096d8aca", "name": "", "created_at": "2025-12-10T18:12:15.618Z", "updated_at": "2023-12-29T15:14:03.343Z", "owner_id": "d5e2af8f-c98a-479e-aece-62d79ea6bab3", "owner_type": "", "total_size": 866940, "nb_documents": 123652, "chunk_size": 274694} + application/json: {"schedule_id": ""} "422": application/json: {} - libraries_get_v1: - speakeasy-default-libraries-get-v1: + unschedule_workflow_v1_workflows_schedules__schedule_id__delete: + speakeasy-default-unschedule-workflow-v1-workflows-schedules-schedule-id-delete: parameters: path: - library_id: "d0d23a1e-bfe5-45e7-b7bb-22a4ea78d47f" + schedule_id: "" + responses: + "422": + application/json: {} + receive_workflow_event_v1_workflows_events_post: + speakeasy-default-receive-workflow-event-v1-workflows-events-post: + requestBody: + application/json: {"event": {"event_id": "", "root_workflow_exec_id": "", "workflow_exec_id": "", "workflow_run_id": "", "workflow_name": "", "event_type": "CUSTOM_TASK_STARTED", "attributes": {"custom_task_id": "", "custom_task_type": ""}}} responses: "200": - application/json: {"id": "24e6ac5e-61cb-4f2c-b0c0-806dfd5d8dbf", "name": "", "created_at": "2023-01-19T09:20:07.756Z", "updated_at": "2023-05-28T00:39:57.656Z", "owner_id": "546a730e-7d06-4324-a4fd-2b7ff127978c", "owner_type": "", "total_size": 191122, "nb_documents": 932135, "chunk_size": null} + application/json: {"status": "error"} "422": application/json: {} - libraries_delete_v1: - speakeasy-default-libraries-delete-v1: - parameters: - path: - library_id: "6cad0b6e-fd2e-4d11-a48b-21d30fb7c17a" + receive_workflow_events_batch_v1_workflows_events_batch_post: + speakeasy-default-receive-workflow-events-batch-v1-workflows-events-batch-post: + requestBody: + application/json: {"events": [{"event_id": "", "root_workflow_exec_id": "", "workflow_exec_id": "", "workflow_run_id": "", "workflow_name": "", "event_type": "WORKFLOW_EXECUTION_STARTED", "attributes": {"task_id": "", "workflow_name": "", "input": {"type": "json", "value": ""}}}]} responses: "200": - application/json: {"id": "04e83772-3f8e-41d3-a053-763ed9937e07", "name": "", "created_at": "2025-03-15T23:45:26.060Z", "updated_at": "2024-08-03T06:23:12.129Z", "owner_id": "f636aa46-e1d5-4df4-966b-de4af27da6db", "owner_type": "", "total_size": 268102, "nb_documents": 821714, "chunk_size": null} + application/json: {"status": "success", "events_received": 650921} "422": application/json: {} - libraries_update_v1: - speakeasy-default-libraries-update-v1: + get_stream_events_v1_workflows_events_stream_get: + speakeasy-default-get-stream-events-v1-workflows-events-stream-get: parameters: - path: - library_id: "e01880c3-d0b5-4a29-8b1b-abdb8ce917e4" - requestBody: - application/json: {} + query: + scope: "*" + activity_name: "*" + activity_id: "*" + workflow_name: "*" + workflow_exec_id: "*" + root_workflow_exec_id: "*" + parent_workflow_exec_id: "*" + stream: "*" + start_seq: 0 + responses: + "422": + application/json: {} + get_workflow_events_v1_workflows_events_list_get: + speakeasy-default-get-workflow-events-v1-workflows-events-list-get: + parameters: + query: + limit: 100 responses: "200": - application/json: {"id": "c3bb20a7-df8c-4461-8cfb-9e2a978c00da", "name": "", "created_at": "2025-03-12T04:49:28.349Z", "updated_at": "2025-12-18T03:09:25.092Z", "owner_id": "734e66b8-ae70-4069-9ebb-7eb7ee3967d5", "owner_type": "", "total_size": 762363, "nb_documents": 896591, "chunk_size": 507889} + application/json: {"events": [{"event_id": "", "event_timestamp": 93683, "root_workflow_exec_id": "", "parent_workflow_exec_id": "", "workflow_exec_id": "", "workflow_run_id": "", "workflow_name": "", "event_type": "CUSTOM_TASK_STARTED", "attributes": {"custom_task_id": "", "custom_task_type": "", "payload": {"type": "json", "value": [{"path": "/sys", "value": "", "op": "remove"}]}}}]} "422": application/json: {} - libraries_documents_list_v1: - speakeasy-default-libraries-documents-list-v1: + list_deployments_v1_workflows_deployments_get: + speakeasy-default-list-deployments-v1-workflows-deployments-get: parameters: - path: - library_id: "5c3ca4cd-62bc-4c71-ad8a-1531ae80d078" query: - page_size: 100 - page: 0 - sort_by: "created_at" - sort_order: "desc" + active_only: true responses: "200": - application/json: {"pagination": {"total_items": 23246, "total_pages": 881485, "current_page": 173326, "page_size": 318395, "has_more": false}, "data": [{"id": "5106c0c7-30fb-4fd3-9083-129b77f9f509", "library_id": "71eb68a2-756e-48b0-9d2b-a04d7bf95ff5", "hash": "", "mime_type": "", "extension": "pdf", "size": 367159, "name": "", "created_at": "2024-09-24T04:50:43.988Z", "processing_status": "", "uploaded_by_id": "7d65f4d8-1997-479f-bfb4-535c0144b48c", "uploaded_by_type": "", "tokens_processing_total": 957230}]} + application/json: {"deployments": [{"id": "404cb7bc-ee61-4a2e-aff3-75f69cf3ca94", "name": "", "is_active": true, "created_at": "2026-10-31T16:44:16.117Z", "updated_at": "2025-01-02T22:50:15.704Z"}]} "422": application/json: {} - libraries_documents_upload_v1: - speakeasy-default-libraries-documents-upload-v1: + get_deployment_v1_workflows_deployments__name__get: + speakeasy-default-get-deployment-v1-workflows-deployments-name-get: parameters: path: - library_id: "a02150d9-5ee0-4877-b62c-28b1fcdf3b76" - requestBody: - multipart/form-data: {"file": "x-file: example.file"} + name: "" responses: "200": - application/json: {"id": "d40f9b56-c832-405d-aa99-b3e442254dd8", "library_id": "868d7955-009a-4433-bfc6-ad7b4be4e7e4", "hash": "", "mime_type": "", "extension": "m2v", "size": 418415, "name": "", "created_at": "2025-04-30T20:11:27.130Z", "processing_status": "", "uploaded_by_id": "7db8d896-09c9-438c-b6dc-aa5c70102b3f", "uploaded_by_type": "", "tokens_processing_total": 61161} + application/json: {"id": "c3310963-59e6-41a6-b644-84aca97cc893", "name": "", "is_active": true, "created_at": "2024-10-22T00:46:19.102Z", "updated_at": "2024-10-19T15:10:50.721Z", "workers": []} "422": application/json: {} - libraries_documents_get_v1: - speakeasy-default-libraries-documents-get-v1: + get_worker_info_v1_workflows_workers_whoami_get: + speakeasy-default-get-worker-info-v1-workflows-workers-whoami-get: + responses: + "200": + application/json: {"scheduler_url": "https://closed-passport.info/", "namespace": "", "tls": false} + connector_get_authentication_methods_v1: + speakeasy-default-connector-get-authentication-methods-v1: parameters: path: - library_id: "03d908c8-90a1-44fd-bf3a-8490fb7c9a03" - document_id: "90973aec-0508-4375-8b00-91d732414745" + connector_id_or_name: "" + responses: + "200": + application/json: [{"method_type": "none", "has_default_credentials": false}] + connector_list_organization_credentials_v1: + speakeasy-default-connector-list-organization-credentials-v1: + parameters: + path: + connector_id_or_name: "" + query: + fetch_default: false responses: "200": - application/json: {"id": "0de60230-717d-459a-8c0f-fbb9360c01be", "library_id": "e0bf3cf9-cd3b-405b-b842-ac7fcb9c373e", "hash": "", "mime_type": "", "extension": "jpe", "size": 402478, "name": "", "created_at": "2023-07-29T21:43:20.750Z", "processing_status": "", "uploaded_by_id": "d5eadabe-d7f2-4f87-a337-f80c192f886d", "uploaded_by_type": "", "tokens_processing_total": 793889} + application/json: {"credentials": [{"name": "", "authentication_type": "oauth2", "is_default": false}]} "422": application/json: {} - libraries_documents_update_v1: - speakeasy-default-libraries-documents-update-v1: + connector_create_or_update_organization_credentials_v1: + speakeasy-default-connector-create-or-update-organization-credentials-v1: parameters: path: - library_id: "3ddd8d93-dca5-4a6d-980d-173226c35742" - document_id: "2a25e44c-b160-40ca-b5c2-b65fb2fcae34" + connector_id_or_name: "" requestBody: - application/json: {} + application/json: {"name": ""} responses: "200": - application/json: {"id": "1111e519-9ba5-42de-9301-938fbfee59fc", "library_id": "70aac5e3-23f7-439b-bbef-090e4c1dbd6d", "hash": "", "mime_type": "", "extension": "m1v", "size": 802305, "name": "", "created_at": "2024-07-02T20:02:03.680Z", "processing_status": "", "uploaded_by_id": "08471957-b27d-4437-8242-57256727dc49", "uploaded_by_type": "", "tokens_processing_total": 806683} + application/json: {"message": ""} "422": application/json: {} - libraries_documents_delete_v1: - speakeasy-default-libraries-documents-delete-v1: + connector_list_workspace_credentials_v1: + speakeasy-default-connector-list-workspace-credentials-v1: parameters: path: - library_id: "005daae9-d42e-407d-82d7-2261c6a1496c" - document_id: "edc236b0-baff-49a9-884b-4ca36a258da4" + connector_id_or_name: "" + query: + fetch_default: false responses: + "200": + application/json: {"credentials": []} "422": application/json: {} - libraries_documents_get_text_content_v1: - speakeasy-default-libraries-documents-get-text-content-v1: + connector_create_or_update_workspace_credentials_v1: + speakeasy-default-connector-create-or-update-workspace-credentials-v1: parameters: path: - library_id: "1d177215-3b6b-45ba-9fa9-baf773223bec" - document_id: "60214c91-2aba-4692-a4e6-a53365de8caf" + connector_id_or_name: "" + requestBody: + application/json: {"name": ""} responses: "200": - application/json: {"text": ""} + application/json: {"message": ""} "422": application/json: {} - libraries_documents_get_status_v1: - speakeasy-default-libraries-documents-get-status-v1: + connector_list_user_credentials_v1: + speakeasy-default-connector-list-user-credentials-v1: parameters: path: - library_id: "e6906f70-368f-4155-80da-c1718f01bc43" - document_id: "2c904915-d831-4e9d-a345-8ce405bcef66" + connector_id_or_name: "" + query: + fetch_default: false + responses: + "200": + application/json: {"credentials": []} + "422": + application/json: {} + connector_create_or_update_user_credentials_v1: + speakeasy-default-connector-create-or-update-user-credentials-v1: + parameters: + path: + connector_id_or_name: "" + requestBody: + application/json: {"name": ""} responses: "200": - application/json: {"document_id": "90473b79-1fd5-437f-bee0-6638bdf69c90", "processing_status": ""} + application/json: {"message": ""} "422": application/json: {} - libraries_documents_get_signed_url_v1: - speakeasy-default-libraries-documents-get-signed-url-v1: + connector_delete_organization_credentials_v1: + speakeasy-default-connector-delete-organization-credentials-v1: parameters: path: - library_id: "23cf6904-a602-4ee8-9f5b-8efc557c336d" - document_id: "48598486-df71-4994-acbb-1133c72efa8c" + credentials_name: "" + connector_id_or_name: "" responses: "200": - application/json: "https://burdensome-jellyfish.name" + application/json: {"message": ""} "422": application/json: {} - libraries_documents_get_extracted_text_signed_url_v1: - speakeasy-default-libraries-documents-get-extracted-text-signed-url-v1: + connector_delete_workspace_credentials_v1: + speakeasy-default-connector-delete-workspace-credentials-v1: parameters: path: - library_id: "a6f15de3-1e82-4f95-af82-851499042ef8" - document_id: "9749d4f9-24e5-4ca2-99a3-a406863f805d" + credentials_name: "" + connector_id_or_name: "" responses: "200": - application/json: "https://athletic-disadvantage.info" + application/json: {"message": ""} "422": application/json: {} - libraries_documents_reprocess_v1: - speakeasy-default-libraries-documents-reprocess-v1: + connector_delete_user_credentials_v1: + speakeasy-default-connector-delete-user-credentials-v1: parameters: path: - library_id: "51b29371-de8f-4ba4-932b-a0bafb3a7f64" - document_id: "3052422c-49ca-45ac-a918-cadb35d61fd8" + credentials_name: "" + connector_id_or_name: "" responses: + "200": + application/json: {"message": ""} "422": application/json: {} - libraries_share_list_v1: - speakeasy-default-libraries-share-list-v1: - parameters: - path: - library_id: "d2169833-d8e2-416e-a372-76518d3d99c2" + get_configs_v1_rag_ingestion_pipeline_configurations_get: + speakeasy-default-get-configs-v1-rag-ingestion-pipeline-configurations-get: responses: "200": - application/json: {"data": [{"library_id": "26c08a7a-d226-4d29-b4d8-c08f0ad41dd1", "org_id": "254e3633-51b9-47a9-bc14-466ecf29d167", "role": "", "share_with_type": "", "share_with_uuid": "815eb88e-1f97-4782-863f-5fd00d37268b"}]} + application/json: [{"id": "bf1614ea-c74f-4b49-9415-f199d33c3281", "author_id": "", "name": "", "created_at": "2026-06-16T10:34:55.929Z", "modified_at": "2026-04-16T03:39:05.055Z", "last_run_time": "2026-12-11T13:45:06.230Z", "last_run_chunks_count": 69748, "total_chunks_count": 398669, "pipeline_composition": {"key": ""}}] + register_config_v1_rag_ingestion_pipeline_configurations_put: + speakeasy-default-register-config-v1-rag-ingestion-pipeline-configurations-put: + requestBody: + application/json: {"name": ""} + responses: + "200": + application/json: {"id": "18c459f4-028b-430d-b3b1-a9cc0d558710", "author_id": "", "name": "", "created_at": "2026-08-09T11:37:55.676Z", "modified_at": "2025-11-21T07:06:21.204Z", "last_run_time": null, "last_run_chunks_count": 540758, "total_chunks_count": 810454, "pipeline_composition": {"key": ""}} "422": application/json: {} - libraries_share_create_v1: - speakeasy-default-libraries-share-create-v1: + update_run_info_v1_rag_ingestion_pipeline_configurations__id__run_info_put: + speakeasy-default-update-run-info-v1-rag-ingestion-pipeline-configurations-id-run-info-put: parameters: path: - library_id: "36de3a24-5b1c-4c8f-9d84-d5642205a976" + id: "6b630c1b-b57e-4237-a015-ff6247cbbcf8" requestBody: - application/json: {"org_id": "aadd9ae1-f285-4437-884a-091c77efa6fd", "level": "Viewer", "share_with_uuid": "0ae92ecb-21ed-47c5-9f7e-0b2cbe325a20", "share_with_type": "User"} + application/json: {"execution_time": "2024-06-27T06:29:04.390Z", "chunks_count": 983906} responses: "200": - application/json: {"library_id": "45b3a5b2-8b81-4453-9130-ded7f1e5a366", "org_id": "0fa6e542-f04b-431e-a1be-76a9a92b0e68", "role": "", "share_with_type": "", "share_with_uuid": "cdbcc0c5-e577-4880-8ed3-f919421d4fc5"} + application/json: {"id": "42307a95-2f0a-45fe-a93e-784bb9cbe579", "author_id": "", "name": "", "created_at": "2024-06-11T03:24:52.044Z", "modified_at": "2026-04-02T07:19:18.488Z", "last_run_time": "2025-05-13T23:34:46.111Z", "last_run_chunks_count": 197616, "total_chunks_count": 256799, "pipeline_composition": {"key": "", "key1": ""}} "422": application/json: {} - libraries_share_delete_v1: - speakeasy-default-libraries-share-delete-v1: + pause_schedule_v1_workflows_schedules__schedule_id__pause_post: + speakeasy-default-pause-schedule-v1-workflows-schedules-schedule-id-pause-post: parameters: path: - library_id: "709e3cad-9fb2-4f4e-bf88-143cf1808107" - requestBody: - application/json: {"org_id": "0814a235-c2d0-4814-875a-4b85f93d3dc7", "share_with_uuid": "b843cc47-ce8f-4354-8cfc-5fcd7fb2865b", "share_with_type": "User"} + schedule_id: "" responses: - "200": - application/json: {"library_id": "7f9c6af4-e362-4cf1-9363-0409d51c2dfa", "org_id": "6b2cac3a-b29c-4d8f-bebb-0db06ec1bf97", "role": "", "share_with_type": "", "share_with_uuid": "618c78f1-41ca-45c3-8ef2-7d78898c7061"} "422": application/json: {} - audio_api_v1_transcriptions_post: - speakeasy-default-audio-api-v1-transcriptions-post: - requestBody: - multipart/form-data: {"model": "Model X", "stream": false} + resume_schedule_v1_workflows_schedules__schedule_id__resume_post: + speakeasy-default-resume-schedule-v1-workflows-schedules-schedule-id-resume-post: + parameters: + path: + schedule_id: "" responses: - "200": - application/json: {"model": "Beetle", "text": "", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "language": ""} - audio_api_v1_transcriptions_post_stream: - speakeasy-default-audio-api-v1-transcriptions-post-stream: - requestBody: - multipart/form-data: {"model": "Camry", "stream": true} + "422": + application/json: {} examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: | + ## Python SDK Changes: + * `mistral.workflows.executions.stream()`: `response.[].data.data.union(CustomTaskInProgressResponse).attributes.payload` **Changed** (Breaking ⚠️) + * `mistral.workflows.events.get_stream_events()`: `response.[].data.data` **Changed** (Breaking ⚠️) + * `mistral.workflows.events.get_workflow_events()`: `response.events[]` **Changed** (Breaking ⚠️) + * `mistral.events.get_stream_events()`: `response.[].data.data.union(CustomTaskInProgressResponse).attributes.payload` **Changed** (Breaking ⚠️) + * `mistral.events.get_workflow_events()`: `response.events[]` **Changed** (Breaking ⚠️) + * `mistral.beta.connectors.get_authentication_methods()`: `response.[].has_default_credentials` **Added** +generatedFiles: + - .gitattributes + - .vscode/settings.json + - USAGE.md + - docs/models/agent.md + - docs/models/agentconversation.md + - docs/models/agentconversationobject.md + - docs/models/agentcreationrequest.md + - docs/models/agentcreationrequesttools.md + - docs/models/agenthandoffdoneevent.md + - docs/models/agenthandoffdoneeventtype.md + - docs/models/agenthandoffentry.md + - docs/models/agenthandoffentryobject.md + - docs/models/agenthandoffentrytype.md + - docs/models/agenthandoffstartedevent.md + - docs/models/agenthandoffstartedeventtype.md + - docs/models/agentobject.md + - docs/models/agentsapiv1agentsdeleterequest.md + - docs/models/agentsapiv1agentsgetrequest.md + - docs/models/agentsapiv1agentslistrequest.md + - docs/models/agentsapiv1agentsupdaterequest.md + - docs/models/agentsapiv1agentsupdateversionrequest.md + - docs/models/agentsapiv1conversationsappendrequest.md + - docs/models/agentsapiv1conversationsappendstreamrequest.md + - docs/models/agentsapiv1conversationsdeleterequest.md + - docs/models/agentsapiv1conversationsgetrequest.md + - docs/models/agentsapiv1conversationsgetresponsev1conversationsget.md + - docs/models/agentsapiv1conversationshistoryrequest.md + - docs/models/agentsapiv1conversationslistrequest.md + - docs/models/agentsapiv1conversationsmessagesrequest.md + - docs/models/agentsapiv1conversationsrestartrequest.md + - docs/models/agentsapiv1conversationsrestartstreamrequest.md + - docs/models/agentscompletionrequest.md + - docs/models/agentscompletionrequestmessages.md + - docs/models/agentscompletionrequeststop.md + - docs/models/agentscompletionrequesttoolchoice.md + - docs/models/agentscompletionstreamrequest.md + - docs/models/agentscompletionstreamrequestmessages.md + - docs/models/agentscompletionstreamrequeststop.md + - docs/models/agentscompletionstreamrequesttoolchoice.md + - docs/models/agenttools.md + - docs/models/agentupdaterequest.md + - docs/models/agentupdaterequesttools.md + - docs/models/apiendpoint.md + - docs/models/archiveftmodelout.md + - docs/models/archiveftmodeloutobject.md + - docs/models/arguments.md + - docs/models/assistantmessage.md + - docs/models/assistantmessagecontent.md + - docs/models/assistantmessagerole.md + - docs/models/attributes.md + - docs/models/audiochunk.md + - docs/models/audiochunktype.md + - docs/models/audiotranscriptionrequest.md + - docs/models/audiotranscriptionrequeststream.md + - docs/models/basemodelcard.md + - docs/models/basemodelcardtype.md + - docs/models/batcherror.md + - docs/models/batchjobin.md + - docs/models/batchjobout.md + - docs/models/batchjoboutobject.md + - docs/models/batchjobsout.md + - docs/models/batchjobsoutobject.md + - docs/models/batchjobstatus.md + - docs/models/builtinconnectors.md + - docs/models/chatclassificationrequest.md + - docs/models/chatcompletionchoice.md + - docs/models/chatcompletionrequest.md + - docs/models/chatcompletionrequesttoolchoice.md + - docs/models/chatcompletionresponse.md + - docs/models/chatcompletionstreamrequest.md + - docs/models/chatcompletionstreamrequestmessages.md + - docs/models/chatcompletionstreamrequeststop.md + - docs/models/chatcompletionstreamrequesttoolchoice.md + - docs/models/chatmoderationrequest.md + - docs/models/chatmoderationrequestinputs.md + - docs/models/checkpointout.md + - docs/models/classificationrequest.md + - docs/models/classificationrequestinputs.md + - docs/models/classificationresponse.md + - docs/models/classificationtargetresult.md + - docs/models/classifierdetailedjobout.md + - docs/models/classifierdetailedjoboutintegrations.md + - docs/models/classifierdetailedjoboutjobtype.md + - docs/models/classifierdetailedjoboutobject.md + - docs/models/classifierdetailedjoboutstatus.md + - docs/models/classifierftmodelout.md + - docs/models/classifierftmodeloutmodeltype.md + - docs/models/classifierftmodeloutobject.md + - docs/models/classifierjobout.md + - docs/models/classifierjoboutintegrations.md + - docs/models/classifierjoboutjobtype.md + - docs/models/classifierjoboutobject.md + - docs/models/classifierjoboutstatus.md + - docs/models/classifiertargetin.md + - docs/models/classifiertargetout.md + - docs/models/classifiertrainingparameters.md + - docs/models/classifiertrainingparametersin.md + - docs/models/codeinterpretertool.md + - docs/models/codeinterpretertooltype.md + - docs/models/completionargs.md + - docs/models/completionargsstop.md + - docs/models/completionchunk.md + - docs/models/completiondetailedjobout.md + - docs/models/completiondetailedjoboutintegrations.md + - docs/models/completiondetailedjoboutjobtype.md + - docs/models/completiondetailedjoboutobject.md + - docs/models/completiondetailedjoboutrepositories.md + - docs/models/completiondetailedjoboutstatus.md + - docs/models/completionevent.md + - docs/models/completionftmodelout.md + - docs/models/completionftmodeloutobject.md + - docs/models/completionjobout.md + - docs/models/completionjoboutobject.md + - docs/models/completionresponsestreamchoice.md + - docs/models/completionresponsestreamchoicefinishreason.md + - docs/models/completiontrainingparameters.md + - docs/models/completiontrainingparametersin.md + - docs/models/content.md + - docs/models/contentchunk.md + - docs/models/conversationappendrequest.md + - docs/models/conversationappendrequesthandoffexecution.md + - docs/models/conversationappendstreamrequest.md + - docs/models/conversationappendstreamrequesthandoffexecution.md + - docs/models/conversationevents.md + - docs/models/conversationeventsdata.md + - docs/models/conversationhistory.md + - docs/models/conversationhistoryobject.md + - docs/models/conversationinputs.md + - docs/models/conversationmessages.md + - docs/models/conversationmessagesobject.md + - docs/models/conversationrequest.md + - docs/models/conversationresponse.md + - docs/models/conversationresponseobject.md + - docs/models/conversationrestartrequest.md + - docs/models/conversationrestartrequesthandoffexecution.md + - docs/models/conversationrestartstreamrequest.md + - docs/models/conversationrestartstreamrequesthandoffexecution.md + - docs/models/conversationstreamrequest.md + - docs/models/conversationstreamrequesthandoffexecution.md + - docs/models/conversationstreamrequesttools.md + - docs/models/conversationusageinfo.md + - docs/models/data.md + - docs/models/deletefileout.md + - docs/models/deletemodelout.md + - docs/models/deletemodelv1modelsmodeliddeleterequest.md + - docs/models/deltamessage.md + - docs/models/document.md + - docs/models/documentlibrarytool.md + - docs/models/documentlibrarytooltype.md + - docs/models/documentout.md + - docs/models/documenttextcontent.md + - docs/models/documentupdatein.md + - docs/models/documenturlchunk.md + - docs/models/documenturlchunktype.md + - docs/models/embeddingdtype.md + - docs/models/embeddingrequest.md + - docs/models/embeddingrequestinputs.md + - docs/models/embeddingresponse.md + - docs/models/embeddingresponsedata.md + - docs/models/encodingformat.md + - docs/models/entitytype.md + - docs/models/entries.md + - docs/models/eventout.md + - docs/models/file.md + - docs/models/filechunk.md + - docs/models/filepurpose.md + - docs/models/filesapiroutesdeletefilerequest.md + - docs/models/filesapiroutesdownloadfilerequest.md + - docs/models/filesapiroutesgetsignedurlrequest.md + - docs/models/filesapirouteslistfilesrequest.md + - docs/models/filesapiroutesretrievefilerequest.md + - docs/models/filesapiroutesuploadfilemultipartbodyparams.md + - docs/models/fileschema.md + - docs/models/filesignedurl.md + - docs/models/fimcompletionrequest.md + - docs/models/fimcompletionrequeststop.md + - docs/models/fimcompletionresponse.md + - docs/models/fimcompletionstreamrequest.md + - docs/models/fimcompletionstreamrequeststop.md + - docs/models/finetuneablemodeltype.md + - docs/models/finishreason.md + - docs/models/format_.md + - docs/models/ftclassifierlossfunction.md + - docs/models/ftmodelcapabilitiesout.md + - docs/models/ftmodelcard.md + - docs/models/ftmodelcardtype.md + - docs/models/function.md + - docs/models/functioncall.md + - docs/models/functioncallentry.md + - docs/models/functioncallentryarguments.md + - docs/models/functioncallentryobject.md + - docs/models/functioncallentrytype.md + - docs/models/functioncallevent.md + - docs/models/functioncalleventtype.md + - docs/models/functionname.md + - docs/models/functionresultentry.md + - docs/models/functionresultentryobject.md + - docs/models/functionresultentrytype.md + - docs/models/functiontool.md + - docs/models/functiontooltype.md + - docs/models/githubrepositoryin.md + - docs/models/githubrepositoryintype.md + - docs/models/githubrepositoryout.md + - docs/models/githubrepositoryouttype.md + - docs/models/handoffexecution.md + - docs/models/httpvalidationerror.md + - docs/models/hyperparameters.md + - docs/models/imagegenerationtool.md + - docs/models/imagegenerationtooltype.md + - docs/models/imageurl.md + - docs/models/imageurlchunk.md + - docs/models/imageurlchunkimageurl.md + - docs/models/imageurlchunktype.md + - docs/models/inputentries.md + - docs/models/inputs.md + - docs/models/instructrequest.md + - docs/models/instructrequestinputs.md + - docs/models/instructrequestinputsmessages.md + - docs/models/instructrequestmessages.md + - docs/models/integrations.md + - docs/models/jobin.md + - docs/models/jobinintegrations.md + - docs/models/jobinrepositories.md + - docs/models/jobmetadataout.md + - docs/models/jobsapiroutesbatchcancelbatchjobrequest.md + - docs/models/jobsapiroutesbatchgetbatchjobrequest.md + - docs/models/jobsapiroutesbatchgetbatchjobsrequest.md + - docs/models/jobsapiroutesfinetuningarchivefinetunedmodelrequest.md + - docs/models/jobsapiroutesfinetuningcancelfinetuningjobrequest.md + - docs/models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md + - docs/models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md + - docs/models/jobsapiroutesfinetuninggetfinetuningjobrequest.md + - docs/models/jobsapiroutesfinetuninggetfinetuningjobresponse.md + - docs/models/jobsapiroutesfinetuninggetfinetuningjobsrequest.md + - docs/models/jobsapiroutesfinetuningstartfinetuningjobrequest.md + - docs/models/jobsapiroutesfinetuningstartfinetuningjobresponse.md + - docs/models/jobsapiroutesfinetuningunarchivefinetunedmodelrequest.md + - docs/models/jobsapiroutesfinetuningupdatefinetunedmodelrequest.md + - docs/models/jobsapiroutesfinetuningupdatefinetunedmodelresponse.md + - docs/models/jobsout.md + - docs/models/jobsoutdata.md + - docs/models/jobsoutobject.md + - docs/models/jobtype.md + - docs/models/jsonschema.md + - docs/models/legacyjobmetadataout.md + - docs/models/legacyjobmetadataoutobject.md + - docs/models/librariesdeletev1request.md + - docs/models/librariesdocumentsdeletev1request.md + - docs/models/librariesdocumentsgetextractedtextsignedurlv1request.md + - docs/models/librariesdocumentsgetsignedurlv1request.md + - docs/models/librariesdocumentsgetstatusv1request.md + - docs/models/librariesdocumentsgettextcontentv1request.md + - docs/models/librariesdocumentsgetv1request.md + - docs/models/librariesdocumentslistv1request.md + - docs/models/librariesdocumentsreprocessv1request.md + - docs/models/librariesdocumentsupdatev1request.md + - docs/models/librariesdocumentsuploadv1documentupload.md + - docs/models/librariesdocumentsuploadv1request.md + - docs/models/librariesgetv1request.md + - docs/models/librariessharecreatev1request.md + - docs/models/librariessharedeletev1request.md + - docs/models/librariessharelistv1request.md + - docs/models/librariesupdatev1request.md + - docs/models/libraryin.md + - docs/models/libraryinupdate.md + - docs/models/libraryout.md + - docs/models/listdocumentout.md + - docs/models/listfilesout.md + - docs/models/listlibraryout.md + - docs/models/listsharingout.md + - docs/models/loc.md + - docs/models/messageentries.md + - docs/models/messageinputcontentchunks.md + - docs/models/messageinputentry.md + - docs/models/messageinputentrycontent.md + - docs/models/messageinputentryrole.md + - docs/models/messageinputentrytype.md + - docs/models/messageoutputcontentchunks.md + - docs/models/messageoutputentry.md + - docs/models/messageoutputentrycontent.md + - docs/models/messageoutputentryobject.md + - docs/models/messageoutputentryrole.md + - docs/models/messageoutputentrytype.md + - docs/models/messageoutputevent.md + - docs/models/messageoutputeventcontent.md + - docs/models/messageoutputeventrole.md + - docs/models/messageoutputeventtype.md + - docs/models/messages.md + - docs/models/metricout.md + - docs/models/mistralpromptmode.md + - docs/models/modelcapabilities.md + - docs/models/modelconversation.md + - docs/models/modelconversationobject.md + - docs/models/modelconversationtools.md + - docs/models/modellist.md + - docs/models/modeltype.md + - docs/models/moderationobject.md + - docs/models/moderationresponse.md + - docs/models/name.md + - docs/models/object.md + - docs/models/ocrimageobject.md + - docs/models/ocrpagedimensions.md + - docs/models/ocrpageobject.md + - docs/models/ocrrequest.md + - docs/models/ocrresponse.md + - docs/models/ocrtableobject.md + - docs/models/ocrusageinfo.md + - docs/models/one.md + - docs/models/outputcontentchunks.md + - docs/models/outputs.md + - docs/models/paginationinfo.md + - docs/models/prediction.md + - docs/models/processingstatusout.md + - docs/models/queryparamstatus.md + - docs/models/referencechunk.md + - docs/models/referencechunktype.md + - docs/models/repositories.md + - docs/models/requestsource.md + - docs/models/response1.md + - docs/models/responsebody.md + - docs/models/responsedoneevent.md + - docs/models/responsedoneeventtype.md + - docs/models/responseerrorevent.md + - docs/models/responseerroreventtype.md + - docs/models/responseformat.md + - docs/models/responseformats.md + - docs/models/responsestartedevent.md + - docs/models/responsestartedeventtype.md + - docs/models/retrievefileout.md + - docs/models/retrievemodelv1modelsmodelidgetrequest.md + - docs/models/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md + - docs/models/role.md + - docs/models/sampletype.md + - docs/models/security.md + - docs/models/shareenum.md + - docs/models/sharingdelete.md + - docs/models/sharingin.md + - docs/models/sharingout.md + - docs/models/source.md + - docs/models/ssetypes.md + - docs/models/status.md + - docs/models/stop.md + - docs/models/systemmessage.md + - docs/models/systemmessagecontent.md + - docs/models/systemmessagecontentchunks.md + - docs/models/tableformat.md + - docs/models/textchunk.md + - docs/models/textchunktype.md + - docs/models/thinkchunk.md + - docs/models/thinkchunktype.md + - docs/models/thinking.md + - docs/models/timestampgranularity.md + - docs/models/tool.md + - docs/models/toolcall.md + - docs/models/toolchoice.md + - docs/models/toolchoiceenum.md + - docs/models/toolexecutiondeltaevent.md + - docs/models/toolexecutiondeltaeventname.md + - docs/models/toolexecutiondeltaeventtype.md + - docs/models/toolexecutiondoneevent.md + - docs/models/toolexecutiondoneeventname.md + - docs/models/toolexecutiondoneeventtype.md + - docs/models/toolexecutionentry.md + - docs/models/toolexecutionentryobject.md + - docs/models/toolexecutionentrytype.md + - docs/models/toolexecutionstartedevent.md + - docs/models/toolexecutionstartedeventname.md + - docs/models/toolexecutionstartedeventtype.md + - docs/models/toolfilechunk.md + - docs/models/toolfilechunktype.md + - docs/models/toolmessage.md + - docs/models/toolmessagecontent.md + - docs/models/toolmessagerole.md + - docs/models/toolreferencechunk.md + - docs/models/toolreferencechunktype.md + - docs/models/tools.md + - docs/models/tooltypes.md + - docs/models/trainingfile.md + - docs/models/transcriptionresponse.md + - docs/models/transcriptionsegmentchunk.md + - docs/models/transcriptionstreamdone.md + - docs/models/transcriptionstreamdonetype.md + - docs/models/transcriptionstreamevents.md + - docs/models/transcriptionstreameventsdata.md + - docs/models/transcriptionstreameventtypes.md + - docs/models/transcriptionstreamlanguage.md + - docs/models/transcriptionstreamlanguagetype.md + - docs/models/transcriptionstreamsegmentdelta.md + - docs/models/transcriptionstreamsegmentdeltatype.md + - docs/models/transcriptionstreamtextdelta.md + - docs/models/transcriptionstreamtextdeltatype.md + - docs/models/two.md + - docs/models/type.md + - docs/models/unarchiveftmodelout.md + - docs/models/unarchiveftmodeloutobject.md + - docs/models/updateftmodelin.md + - docs/models/uploadfileout.md + - docs/models/usageinfo.md + - docs/models/usermessage.md + - docs/models/usermessagecontent.md + - docs/models/usermessagerole.md + - docs/models/utils/retryconfig.md + - docs/models/validationerror.md + - docs/models/wandbintegration.md + - docs/models/wandbintegrationout.md + - docs/models/wandbintegrationouttype.md + - docs/models/wandbintegrationtype.md + - docs/models/websearchpremiumtool.md + - docs/models/websearchpremiumtooltype.md + - docs/models/websearchtool.md + - docs/models/websearchtooltype.md + - docs/sdks/accesses/README.md + - docs/sdks/agents/README.md + - docs/sdks/audio/README.md + - docs/sdks/batch/README.md + - docs/sdks/beta/README.md + - docs/sdks/chat/README.md + - docs/sdks/classifiers/README.md + - docs/sdks/conversations/README.md + - docs/sdks/documents/README.md + - docs/sdks/embeddings/README.md + - docs/sdks/files/README.md + - docs/sdks/fim/README.md + - docs/sdks/finetuning/README.md + - docs/sdks/jobs/README.md + - docs/sdks/libraries/README.md + - docs/sdks/mistral/README.md + - docs/sdks/mistralagents/README.md + - docs/sdks/mistraljobs/README.md + - docs/sdks/models/README.md + - docs/sdks/ocr/README.md + - docs/sdks/transcriptions/README.md + - poetry.toml + - py.typed + - scripts/prepare_readme.py + - scripts/publish.sh + - src/mistralai/__init__.py + - src/mistralai/_hooks/__init__.py + - src/mistralai/_hooks/sdkhooks.py + - src/mistralai/_hooks/types.py + - src/mistralai/_version.py + - src/mistralai/accesses.py + - src/mistralai/agents.py + - src/mistralai/audio.py + - src/mistralai/basesdk.py + - src/mistralai/batch.py + - src/mistralai/beta.py + - src/mistralai/chat.py + - src/mistralai/classifiers.py + - src/mistralai/conversations.py + - src/mistralai/documents.py + - src/mistralai/embeddings.py + - src/mistralai/files.py + - src/mistralai/fim.py + - src/mistralai/fine_tuning.py + - src/mistralai/httpclient.py + - src/mistralai/jobs.py + - src/mistralai/libraries.py + - src/mistralai/mistral_agents.py + - src/mistralai/mistral_jobs.py + - src/mistralai/models/__init__.py + - src/mistralai/models/agent.py + - src/mistralai/models/agentconversation.py + - src/mistralai/models/agentcreationrequest.py + - src/mistralai/models/agenthandoffdoneevent.py + - src/mistralai/models/agenthandoffentry.py + - src/mistralai/models/agenthandoffstartedevent.py + - src/mistralai/models/agents_api_v1_agents_deleteop.py + - src/mistralai/models/agents_api_v1_agents_getop.py + - src/mistralai/models/agents_api_v1_agents_listop.py + - src/mistralai/models/agents_api_v1_agents_update_versionop.py + - src/mistralai/models/agents_api_v1_agents_updateop.py + - src/mistralai/models/agents_api_v1_conversations_append_streamop.py + - src/mistralai/models/agents_api_v1_conversations_appendop.py + - src/mistralai/models/agents_api_v1_conversations_deleteop.py + - src/mistralai/models/agents_api_v1_conversations_getop.py + - src/mistralai/models/agents_api_v1_conversations_historyop.py + - src/mistralai/models/agents_api_v1_conversations_listop.py + - src/mistralai/models/agents_api_v1_conversations_messagesop.py + - src/mistralai/models/agents_api_v1_conversations_restart_streamop.py + - src/mistralai/models/agents_api_v1_conversations_restartop.py + - src/mistralai/models/agentscompletionrequest.py + - src/mistralai/models/agentscompletionstreamrequest.py + - src/mistralai/models/agentupdaterequest.py + - src/mistralai/models/apiendpoint.py + - src/mistralai/models/archiveftmodelout.py + - src/mistralai/models/assistantmessage.py + - src/mistralai/models/audiochunk.py + - src/mistralai/models/audiotranscriptionrequest.py + - src/mistralai/models/audiotranscriptionrequeststream.py + - src/mistralai/models/basemodelcard.py + - src/mistralai/models/batcherror.py + - src/mistralai/models/batchjobin.py + - src/mistralai/models/batchjobout.py + - src/mistralai/models/batchjobsout.py + - src/mistralai/models/batchjobstatus.py + - src/mistralai/models/builtinconnectors.py + - src/mistralai/models/chatclassificationrequest.py + - src/mistralai/models/chatcompletionchoice.py + - src/mistralai/models/chatcompletionrequest.py + - src/mistralai/models/chatcompletionresponse.py + - src/mistralai/models/chatcompletionstreamrequest.py + - src/mistralai/models/chatmoderationrequest.py + - src/mistralai/models/checkpointout.py + - src/mistralai/models/classificationrequest.py + - src/mistralai/models/classificationresponse.py + - src/mistralai/models/classificationtargetresult.py + - src/mistralai/models/classifierdetailedjobout.py + - src/mistralai/models/classifierftmodelout.py + - src/mistralai/models/classifierjobout.py + - src/mistralai/models/classifiertargetin.py + - src/mistralai/models/classifiertargetout.py + - src/mistralai/models/classifiertrainingparameters.py + - src/mistralai/models/classifiertrainingparametersin.py + - src/mistralai/models/codeinterpretertool.py + - src/mistralai/models/completionargs.py + - src/mistralai/models/completionargsstop.py + - src/mistralai/models/completionchunk.py + - src/mistralai/models/completiondetailedjobout.py + - src/mistralai/models/completionevent.py + - src/mistralai/models/completionftmodelout.py + - src/mistralai/models/completionjobout.py + - src/mistralai/models/completionresponsestreamchoice.py + - src/mistralai/models/completiontrainingparameters.py + - src/mistralai/models/completiontrainingparametersin.py + - src/mistralai/models/contentchunk.py + - src/mistralai/models/conversationappendrequest.py + - src/mistralai/models/conversationappendstreamrequest.py + - src/mistralai/models/conversationevents.py + - src/mistralai/models/conversationhistory.py + - src/mistralai/models/conversationinputs.py + - src/mistralai/models/conversationmessages.py + - src/mistralai/models/conversationrequest.py + - src/mistralai/models/conversationresponse.py + - src/mistralai/models/conversationrestartrequest.py + - src/mistralai/models/conversationrestartstreamrequest.py + - src/mistralai/models/conversationstreamrequest.py + - src/mistralai/models/conversationusageinfo.py + - src/mistralai/models/delete_model_v1_models_model_id_deleteop.py + - src/mistralai/models/deletefileout.py + - src/mistralai/models/deletemodelout.py + - src/mistralai/models/deltamessage.py + - src/mistralai/models/documentlibrarytool.py + - src/mistralai/models/documentout.py + - src/mistralai/models/documenttextcontent.py + - src/mistralai/models/documentupdatein.py + - src/mistralai/models/documenturlchunk.py + - src/mistralai/models/embeddingdtype.py + - src/mistralai/models/embeddingrequest.py + - src/mistralai/models/embeddingresponse.py + - src/mistralai/models/embeddingresponsedata.py + - src/mistralai/models/encodingformat.py + - src/mistralai/models/entitytype.py + - src/mistralai/models/eventout.py + - src/mistralai/models/file.py + - src/mistralai/models/filechunk.py + - src/mistralai/models/filepurpose.py + - src/mistralai/models/files_api_routes_delete_fileop.py + - src/mistralai/models/files_api_routes_download_fileop.py + - src/mistralai/models/files_api_routes_get_signed_urlop.py + - src/mistralai/models/files_api_routes_list_filesop.py + - src/mistralai/models/files_api_routes_retrieve_fileop.py + - src/mistralai/models/files_api_routes_upload_fileop.py + - src/mistralai/models/fileschema.py + - src/mistralai/models/filesignedurl.py + - src/mistralai/models/fimcompletionrequest.py + - src/mistralai/models/fimcompletionresponse.py + - src/mistralai/models/fimcompletionstreamrequest.py + - src/mistralai/models/finetuneablemodeltype.py + - src/mistralai/models/ftclassifierlossfunction.py + - src/mistralai/models/ftmodelcapabilitiesout.py + - src/mistralai/models/ftmodelcard.py + - src/mistralai/models/function.py + - src/mistralai/models/functioncall.py + - src/mistralai/models/functioncallentry.py + - src/mistralai/models/functioncallentryarguments.py + - src/mistralai/models/functioncallevent.py + - src/mistralai/models/functionname.py + - src/mistralai/models/functionresultentry.py + - src/mistralai/models/functiontool.py + - src/mistralai/models/githubrepositoryin.py + - src/mistralai/models/githubrepositoryout.py + - src/mistralai/models/httpvalidationerror.py + - src/mistralai/models/imagegenerationtool.py + - src/mistralai/models/imageurl.py + - src/mistralai/models/imageurlchunk.py + - src/mistralai/models/inputentries.py + - src/mistralai/models/inputs.py + - src/mistralai/models/instructrequest.py + - src/mistralai/models/jobin.py + - src/mistralai/models/jobmetadataout.py + - src/mistralai/models/jobs_api_routes_batch_cancel_batch_jobop.py + - src/mistralai/models/jobs_api_routes_batch_get_batch_jobop.py + - src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py + - src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py + - src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py + - src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py + - src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py + - src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py + - src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py + - src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py + - src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py + - src/mistralai/models/jobsout.py + - src/mistralai/models/jsonschema.py + - src/mistralai/models/legacyjobmetadataout.py + - src/mistralai/models/libraries_delete_v1op.py + - src/mistralai/models/libraries_documents_delete_v1op.py + - src/mistralai/models/libraries_documents_get_extracted_text_signed_url_v1op.py + - src/mistralai/models/libraries_documents_get_signed_url_v1op.py + - src/mistralai/models/libraries_documents_get_status_v1op.py + - src/mistralai/models/libraries_documents_get_text_content_v1op.py + - src/mistralai/models/libraries_documents_get_v1op.py + - src/mistralai/models/libraries_documents_list_v1op.py + - src/mistralai/models/libraries_documents_reprocess_v1op.py + - src/mistralai/models/libraries_documents_update_v1op.py + - src/mistralai/models/libraries_documents_upload_v1op.py + - src/mistralai/models/libraries_get_v1op.py + - src/mistralai/models/libraries_share_create_v1op.py + - src/mistralai/models/libraries_share_delete_v1op.py + - src/mistralai/models/libraries_share_list_v1op.py + - src/mistralai/models/libraries_update_v1op.py + - src/mistralai/models/libraryin.py + - src/mistralai/models/libraryinupdate.py + - src/mistralai/models/libraryout.py + - src/mistralai/models/listdocumentout.py + - src/mistralai/models/listfilesout.py + - src/mistralai/models/listlibraryout.py + - src/mistralai/models/listsharingout.py + - src/mistralai/models/messageentries.py + - src/mistralai/models/messageinputcontentchunks.py + - src/mistralai/models/messageinputentry.py + - src/mistralai/models/messageoutputcontentchunks.py + - src/mistralai/models/messageoutputentry.py + - src/mistralai/models/messageoutputevent.py + - src/mistralai/models/metricout.py + - src/mistralai/models/mistralerror.py + - src/mistralai/models/mistralpromptmode.py + - src/mistralai/models/modelcapabilities.py + - src/mistralai/models/modelconversation.py + - src/mistralai/models/modellist.py + - src/mistralai/models/moderationobject.py + - src/mistralai/models/moderationresponse.py + - src/mistralai/models/no_response_error.py + - src/mistralai/models/ocrimageobject.py + - src/mistralai/models/ocrpagedimensions.py + - src/mistralai/models/ocrpageobject.py + - src/mistralai/models/ocrrequest.py + - src/mistralai/models/ocrresponse.py + - src/mistralai/models/ocrtableobject.py + - src/mistralai/models/ocrusageinfo.py + - src/mistralai/models/outputcontentchunks.py + - src/mistralai/models/paginationinfo.py + - src/mistralai/models/prediction.py + - src/mistralai/models/processingstatusout.py + - src/mistralai/models/referencechunk.py + - src/mistralai/models/requestsource.py + - src/mistralai/models/responsedoneevent.py + - src/mistralai/models/responseerrorevent.py + - src/mistralai/models/responseformat.py + - src/mistralai/models/responseformats.py + - src/mistralai/models/responsestartedevent.py + - src/mistralai/models/responsevalidationerror.py + - src/mistralai/models/retrieve_model_v1_models_model_id_getop.py + - src/mistralai/models/retrievefileout.py + - src/mistralai/models/sampletype.py + - src/mistralai/models/sdkerror.py + - src/mistralai/models/security.py + - src/mistralai/models/shareenum.py + - src/mistralai/models/sharingdelete.py + - src/mistralai/models/sharingin.py + - src/mistralai/models/sharingout.py + - src/mistralai/models/source.py + - src/mistralai/models/ssetypes.py + - src/mistralai/models/systemmessage.py + - src/mistralai/models/systemmessagecontentchunks.py + - src/mistralai/models/textchunk.py + - src/mistralai/models/thinkchunk.py + - src/mistralai/models/timestampgranularity.py + - src/mistralai/models/tool.py + - src/mistralai/models/toolcall.py + - src/mistralai/models/toolchoice.py + - src/mistralai/models/toolchoiceenum.py + - src/mistralai/models/toolexecutiondeltaevent.py + - src/mistralai/models/toolexecutiondoneevent.py + - src/mistralai/models/toolexecutionentry.py + - src/mistralai/models/toolexecutionstartedevent.py + - src/mistralai/models/toolfilechunk.py + - src/mistralai/models/toolmessage.py + - src/mistralai/models/toolreferencechunk.py + - src/mistralai/models/tooltypes.py + - src/mistralai/models/trainingfile.py + - src/mistralai/models/transcriptionresponse.py + - src/mistralai/models/transcriptionsegmentchunk.py + - src/mistralai/models/transcriptionstreamdone.py + - src/mistralai/models/transcriptionstreamevents.py + - src/mistralai/models/transcriptionstreameventtypes.py + - src/mistralai/models/transcriptionstreamlanguage.py + - src/mistralai/models/transcriptionstreamsegmentdelta.py + - src/mistralai/models/transcriptionstreamtextdelta.py + - src/mistralai/models/unarchiveftmodelout.py + - src/mistralai/models/updateftmodelin.py + - src/mistralai/models/uploadfileout.py + - src/mistralai/models/usageinfo.py + - src/mistralai/models/usermessage.py + - src/mistralai/models/validationerror.py + - src/mistralai/models/wandbintegration.py + - src/mistralai/models/wandbintegrationout.py + - src/mistralai/models/websearchpremiumtool.py + - src/mistralai/models/websearchtool.py + - src/mistralai/models_.py + - src/mistralai/ocr.py + - src/mistralai/py.typed + - src/mistralai/sdk.py + - src/mistralai/sdkconfiguration.py + - src/mistralai/transcriptions.py + - src/mistralai/types/__init__.py + - src/mistralai/types/basemodel.py + - src/mistralai/utils/__init__.py + - src/mistralai/utils/annotations.py + - src/mistralai/utils/datetimes.py + - src/mistralai/utils/enums.py + - src/mistralai/utils/eventstreaming.py + - src/mistralai/utils/forms.py + - src/mistralai/utils/headers.py + - src/mistralai/utils/logger.py + - src/mistralai/utils/metadata.py + - src/mistralai/utils/queryparams.py + - src/mistralai/utils/requestbodies.py + - src/mistralai/utils/retries.py + - src/mistralai/utils/security.py + - src/mistralai/utils/serializers.py + - src/mistralai/utils/unmarshal_json_response.py + - src/mistralai/utils/url.py + - src/mistralai/utils/values.py diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 116b0e26..a246d5a7 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -8,57 +8,84 @@ generation: useClassNamesForArrayFields: true fixes: nameResolutionDec2023: true - nameResolutionFeb2025: false + nameResolutionFeb2025: true parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true - securityFeb2025: false - sharedErrorComponentsApr2025: false + securityFeb2025: true + sharedErrorComponentsApr2025: true + sharedNestedComponentsJan2026: true + nameOverrideFeb2026: true + methodSignaturesApr2024: true auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + inferSSEOverload: true + schemas: + allOfMergeStrategy: shallowMerge + requestBodyFieldName: "" + versioningStrategy: automatic + persistentEdits: + enabled: "true" tests: generateTests: true generateNewTests: false skipResponseBodyAssertions: false python: - version: 1.9.11 + version: 2.4.5 additionalDependencies: dev: pytest: ^8.2.2 pytest-asyncio: ^0.23.7 + main: {} allowedRedefinedBuiltins: - id - object + - input + - dir + asyncMode: both authors: - Mistral baseErrorName: MistralError clientServerStatusCodesAsErrors: true + constFieldCasing: normal defaultErrorName: SDKError description: Python Client SDK for the Mistral AI API. enableCustomCodeRegions: true enumFormat: union envVarPrefix: MISTRAL fixFlags: + asyncPaginationSep2025: true + conflictResistantModelImportsFeb2026: true responseRequiredSep2024: true + flatAdditionalProperties: true flattenGlobalSecurity: true flattenRequests: true flatteningOrder: parameters-first + forwardCompatibleEnumsByDefault: true + forwardCompatibleUnionsByDefault: tagged-only imports: option: openapi paths: callbacks: "" - errors: "" + errors: errors operations: "" shared: "" webhooks: "" + inferUnionDiscriminators: true inputModelSuffix: input - maxMethodParams: 15 + license: "" + maxMethodParams: 999 methodArguments: infer-optional-args - moduleName: "" + moduleName: mistralai.client + multipartArrayFormat: standard outputModelSuffix: output - packageManager: poetry + packageManager: uv packageName: mistralai + preApplyUnionDiscriminators: true pytestFilterWarnings: [] pytestTimeout: 0 responseFormat: flat + sseFlatResponse: false templateVersion: v2 + useAsyncHooks: false diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f4582991..aa443ef1 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,64 +1,65 @@ -speakeasyVersion: 1.606.10 +speakeasyVersion: 1.761.1 sources: mistral-azure-source: sourceNamespace: mistral-openapi-azure - sourceRevisionDigest: sha256:670c460702ec74f7077491464a6dc5ee9d873969c80e812c48dbf4deb160e470 - sourceBlobDigest: sha256:5a3ebfa4cb00a015bb7bb03ec7442fc7e0b9c17ca66ab35d3045290b2ad87eac + sourceRevisionDigest: sha256:a6918148cb6fdd9108b7bef0ef41fe5c9e79b18c65c0b52fc4d2afecf6db2d4d + sourceBlobDigest: sha256:dded6b429a29c2889469b10d19aecd41be2db06cde1a8408510120c8abfd9553 tags: - latest + - speakeasy-sdk-regen-1773084953 mistral-google-cloud-source: sourceNamespace: mistral-openapi-google-cloud - sourceRevisionDigest: sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8 - sourceBlobDigest: sha256:3327f078a11596abdcbc21cd8a1adcf0b2aa474975cd9ab1feb745a2e50d555f + sourceRevisionDigest: sha256:b2406e82ec4ce411afc0c307d5a037c7737388bcc696bbb41884fe54e22831c9 + sourceBlobDigest: sha256:795c0e010501e770b07cd28f1d0253cdb8f1419381e828b26575fdf149c022da tags: - latest + - speakeasy-sdk-regen-1773084660 mistral-openapi: sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:eefc1f0b6a5e9ec673d317d61cad766290710b5fc369412491b75f732cccfedd - sourceBlobDigest: sha256:97767522559603de92a9738938e522cea4d558b2a854500acf6fe8d81f8ccfb8 + sourceRevisionDigest: sha256:6b325264f8e8a60caa875776438b07d4eb5b56283da0796b283e9c5597810e22 + sourceBlobDigest: sha256:11d21b003c903f5539d5d7a79cf8fe17d1d284b48e47da0009eac3866ad58899 tags: - latest - - speakeasy-sdk-regen-1759420102 targets: mistralai-azure-sdk: source: mistral-azure-source sourceNamespace: mistral-openapi-azure - sourceRevisionDigest: sha256:670c460702ec74f7077491464a6dc5ee9d873969c80e812c48dbf4deb160e470 - sourceBlobDigest: sha256:5a3ebfa4cb00a015bb7bb03ec7442fc7e0b9c17ca66ab35d3045290b2ad87eac + sourceRevisionDigest: sha256:a6918148cb6fdd9108b7bef0ef41fe5c9e79b18c65c0b52fc4d2afecf6db2d4d + sourceBlobDigest: sha256:dded6b429a29c2889469b10d19aecd41be2db06cde1a8408510120c8abfd9553 codeSamplesNamespace: mistral-openapi-azure-code-samples - codeSamplesRevisionDigest: sha256:e6802c97fd9783aa91cc0853de1a889944f699b88e0dafcf9fecd83de6e2c6c9 + codeSamplesRevisionDigest: sha256:b7620f11d5669423730c5790ef4a72bba3ab46dd453e6685edf420053abbcb30 mistralai-gcp-sdk: source: mistral-google-cloud-source sourceNamespace: mistral-openapi-google-cloud - sourceRevisionDigest: sha256:4a5343e63c6a78152e472b00ccc46d7bcb15594496bc94c8040039d3a9d4c5f8 - sourceBlobDigest: sha256:3327f078a11596abdcbc21cd8a1adcf0b2aa474975cd9ab1feb745a2e50d555f + sourceRevisionDigest: sha256:b2406e82ec4ce411afc0c307d5a037c7737388bcc696bbb41884fe54e22831c9 + sourceBlobDigest: sha256:795c0e010501e770b07cd28f1d0253cdb8f1419381e828b26575fdf149c022da codeSamplesNamespace: mistral-openapi-google-cloud-code-samples - codeSamplesRevisionDigest: sha256:03b3e82c20d10faa8622f14696632b96b1a2e8d747b266fff345061298d5f3e4 + codeSamplesRevisionDigest: sha256:c5a968a0454378d7f03ace500b309c0c709ea0b88d79700091d9ca7ea82c55a2 mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:eefc1f0b6a5e9ec673d317d61cad766290710b5fc369412491b75f732cccfedd - sourceBlobDigest: sha256:97767522559603de92a9738938e522cea4d558b2a854500acf6fe8d81f8ccfb8 + sourceRevisionDigest: sha256:6b325264f8e8a60caa875776438b07d4eb5b56283da0796b283e9c5597810e22 + sourceBlobDigest: sha256:11d21b003c903f5539d5d7a79cf8fe17d1d284b48e47da0009eac3866ad58899 codeSamplesNamespace: mistral-openapi-code-samples - codeSamplesRevisionDigest: sha256:8ed158c9c1ed8252f86b620219dd93e9650b45e7c6403cda7fdd9b4ee0d17dac + codeSamplesRevisionDigest: sha256:95c443855a95966259bd108beec0cbdb8238f6f753dc4b021bf833d398e86c0c workflow: workflowVersion: 1.0.0 - speakeasyVersion: 1.606.10 + speakeasyVersion: 1.761.1 sources: mistral-azure-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:v2 mistral-google-cloud-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:v2 mistral-openapi: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:v2 targets: mistralai-azure-sdk: target: python source: mistral-azure-source - output: ./packages/mistralai_azure + output: ./packages/azure publish: pypi: token: $pypi_token @@ -69,7 +70,7 @@ workflow: mistralai-gcp-sdk: target: python source: mistral-google-cloud-source - output: ./packages/mistralai_gcp + output: ./packages/gcp publish: pypi: token: $pypi_token diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 3156d149..5e708727 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -1,20 +1,20 @@ workflowVersion: 1.0.0 -speakeasyVersion: 1.606.10 +speakeasyVersion: 1.761.1 sources: mistral-azure-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:v2 mistral-google-cloud-source: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:v2 mistral-openapi: inputs: - - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main + - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:v2 targets: mistralai-azure-sdk: target: python source: mistral-azure-source - output: ./packages/mistralai_azure + output: ./packages/azure publish: pypi: token: $pypi_token @@ -25,7 +25,7 @@ targets: mistralai-gcp-sdk: target: python source: mistral-google-cloud-source - output: ./packages/mistralai_gcp + output: ./packages/gcp publish: pypi: token: $pypi_token diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..6a8cb9d5 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,37 @@ +# Repository Guide + +This repository is mostly generated code. + +Before editing or approving a PR, check the top of the file: + +```python +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +``` + +If that marker is present, do not hand-edit the file. Changes should be made in the upstream source or generator inputs, then regenerated. + +## What We Own + +The main hand-maintained surface is listed in `.genignore`. + +At the repo root, that currently includes files such as: + +- `pyproject.toml` +- `examples/*` +- `utils/*` +- `src/mistralai/extra/*` +- `pylintrc` +- `scripts/prepare_readme.py` + +There are also package-specific ownership files: + +- `packages/gcp/.genignore` +- `packages/azure/.genignore` + +If a file is not listed in the relevant `.genignore` and it has the generated header, assume it should not be edited directly. + +## PR Review Rule Of Thumb + +- Prefer PRs that change hand-owned files listed in `.genignore`. +- Be skeptical of direct edits to generated SDK files under `src/`, `docs/`, or `packages/*/src/`. +- If a generated file changed, look for the corresponding source/config change that explains the regeneration. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 00000000..47dc3e3d --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/MIGRATION.md b/MIGRATION.md index 7ccdf9c0..bf25c4f6 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,242 +1,122 @@ - -# Migration Guide for MistralAI Client from 0.\*.\* to 1.0.0 - -We have made significant changes to the `mistralai` library to improve its usability and consistency. This guide will help you migrate your code from the old client to the new one. - -## Major Changes - -1. **Unified Client Class**: - - The `MistralClient` and `MistralAsyncClient` classes have been consolidated into a single `Mistral` class. - - This simplifies the API by providing a single entry point for both synchronous and asynchronous operations. - -2. **Method Names and Structure**: - - The method names and structure have been updated for better clarity and consistency. - - For example: - - `client.chat` is now `client.chat.complete` for non-streaming calls - - `client.chat_stream` is now `client.chat.stream` for streaming calls - - Async `client.chat` is now `client.chat.complete_async` for async non-streaming calls - - Async `client.chat_stream` is now `client.chat.stream_async` for async streaming calls - - -## Method changes - -### Sync - -| Old Methods | New Methods | -| -------------------------- | -------------------------------- | -| `MistralCLient` | `Mistral` | -| `client.chat` | `client.chat.complete` | -| `client.chat_stream` | `client.chat.stream` | -| `client.completions` | `client.fim.complete` | -| `client.completions_stream`| `client.fim.stream` | -| `client.embeddings` | `client.embeddings.create` | -| `client.list_models` | `client.models.list` | -| `client.delete_model` | `client.models.delete` | -| `client.files.create` | `client.files.upload` | -| `client.files.list` | `client.files.list` | -| `client.files.retrieve` | `client.files.retrieve` | -| `client.files.delete` | `client.files.delete` | -| `client.jobs.create` | `client.fine_tuning.jobs.create` | -| `client.jobs.list` | `client.fine_tuning.jobs.list` | -| `client.jobs.retrieve` | `client.fine_tuning.jobs.get` | -| `client.jobs.cancel` | `client.fine_tuning.jobs.cancel` | - -### Async - -| Old Methods | New Methods | -| -------------------------------- | -------------------------------------- | -| `MistralAsyncClient` | `Mistral` | -| `async_client.chat` | `client.chat.complete_async` | -| `async_client.chat_stream` | `client.chat.stream_async` | -| `async_client.completions` | `client.fim.complete_async` | -| `async_client.completions_stream`| `client.fim.stream_async` | -| `async_client.embeddings` | `client.embeddings.create_async` | -| `async_client.list_models` | `client.models.list_async` | -| `async_client.delete_model` | `client.models.delete_async` | -| `async_client.files.create` | `client.files.upload_async` | -| `async_client.files.list` | `client.files.list_async` | -| `async_client.files.retrieve` | `client.files.retrieve_async` | -| `async_client.files.delete` | `client.files.delete_async` | -| `async_client.jobs.create` | `client.fine_tuning.jobs.create_async` | -| `async_client.jobs.list` | `client.fine_tuning.jobs.list_async` | -| `async_client.jobs.retrieve` | `client.fine_tuning.jobs.get_async` | -| `async_client.jobs.cancel` | `client.fine_tuning.jobs.cancel_async` | - -### Message Changes - -The `ChatMessage` class has been replaced with a more flexible system. You can now use the `SystemMessage`, `UserMessage`, `AssistantMessage`, and `ToolMessage` classes to create messages. - -The return object of the stream call methods have been modified to `chunk.data.choices[0].delta.content` from `chunk.choices[0].delta.content`. - -## Example Migrations - -### Example 1: Non-Streaming Chat - -**Old:** -```python -from mistralai.client import MistralClient -from mistralai.models.chat_completion import ChatMessage - -api_key = os.environ["MISTRAL_API_KEY"] -model = "mistral-large-latest" - -client = MistralClient(api_key=api_key) - -messages = [ - ChatMessage(role="user", content="What is the best French cheese?") -] - -# No streaming -chat_response = client.chat( - model=model, - messages=messages, -) - -print(chat_response.choices[0].message.content) -``` - -**New:** - -```python -import os - -from mistralai import Mistral, UserMessage - -api_key = os.environ["MISTRAL_API_KEY"] -model = "mistral-large-latest" - -client = Mistral(api_key=api_key) - -messages = [ - { - "role": "user", - "content": "What is the best French cheese?", - }, -] -# Or using the new message classes -# messages = [ -# UserMessage(content="What is the best French cheese?"), -# ] - -chat_response = client.chat.complete( - model=model, - messages=messages, -) - -print(chat_response.choices[0].message.content) -``` - -### Example 2: Streaming Chat - -**Old:** - -```python -from mistralai.client import MistralClient -from mistralai.models.chat_completion import ChatMessage - -api_key = os.environ["MISTRAL_API_KEY"] -model = "mistral-large-latest" - -client = MistralClient(api_key=api_key) - -messages = [ - ChatMessage(role="user", content="What is the best French cheese?") -] - -# With streaming -stream_response = client.chat_stream(model=model, messages=messages) - -for chunk in stream_response: - print(chunk.choices[0].delta.content) -``` -**New:** -```python -import os - -from mistralai import Mistral, UserMessage - -api_key = os.environ["MISTRAL_API_KEY"] -model = "mistral-large-latest" - -client = Mistral(api_key=api_key) - -messages = [ - { - "role": "user", - "content": "What is the best French cheese?", - }, -] -# Or using the new message classes -# messages = [ -# UserMessage(content="What is the best French cheese?"), -# ] - -stream_response = client.chat.stream( - model=model, - messages=messages, -) - -for chunk in stream_response: - print(chunk.data.choices[0].delta.content) - -``` - -### Example 3: Async - -**Old:** -```python -from mistralai.async_client import MistralAsyncClient -from mistralai.models.chat_completion import ChatMessage - -api_key = os.environ["MISTRAL_API_KEY"] -model = "mistral-large-latest" - -client = MistralAsyncClient(api_key=api_key) - -messages = [ - ChatMessage(role="user", content="What is the best French cheese?") -] - -# With async -async_response = client.chat_stream(model=model, messages=messages) - -async for chunk in async_response: - print(chunk.choices[0].delta.content) -``` - -**New:** -```python -import asyncio -import os - -from mistralai import Mistral, UserMessage - - -async def main(): - client = Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), - ) - - messages = [ - { - "role": "user", - "content": "What is the best French cheese?", - }, - ] - # Or using the new message classes - # messages = [ - # UserMessage( - # content="What is the best French cheese?", - # ), - # ] - async_response = await client.chat.stream_async( - messages=messages, - model="mistral-large-latest", - ) - - async for chunk in async_response: - print(chunk.data.choices[0].delta.content) - - -asyncio.run(main()) -``` +# Migration Guide: v1.x to v2.x + +## Import Changes + +All SDK imports move from `mistralai` to `mistralai.client`: + +| v1 | v2 | +|---|---| +| `from mistralai import Mistral` | `from mistralai.client import Mistral` | +| `from mistralai.models import ...` | `from mistralai.client.models import ...` | +| `from mistralai.types import ...` | `from mistralai.client.types import ...` | +| `from mistralai.utils import ...` | `from mistralai.client.utils import ...` | + +`mistralai.extra` is unchanged (`RunContext`, `MCPClientSTDIO`, `MCPClientSSE`, `response_format_from_pydantic_model`, etc. stay at `mistralai.extra`). + +## Azure & GCP + +Azure and GCP are now namespace sub-packages under `mistralai`, no longer separate top-level packages. + +| v1 | v2 | +|---|---| +| `from mistralai_azure import MistralAzure` | `from mistralai.azure.client import MistralAzure` | +| `from mistralai_azure.models import ...` | `from mistralai.azure.client.models import ...` | +| `from mistralai_gcp import MistralGoogleCloud` | `from mistralai.gcp.client import MistralGCP` | +| `from mistralai_gcp.models import ...` | `from mistralai.gcp.client.models import ...` | +GCP class renamed `MistralGoogleCloud` -> `MistralGCP`. + +## Type Renames + +42 request/response types renamed to follow `{Verb}{Entity}Request` / `{Verb}{Entity}Response` / `{Entity}` conventions. Core types (`Mistral`, `UserMessage`, `AssistantMessage`, `File`, `FunctionTool`, `ResponseFormat`, etc.) keep the same name — just different import path. + +Only one user-facing type rename: `Tools` -> `ConversationRequestTool`. + +
+Full rename table (42 schemas) + +| v1 | v2 | +|---|---| +| `AgentCreationRequest` | `CreateAgentRequest` | +| `AgentUpdateRequest` | `UpdateAgentRequest` | +| `ArchiveFTModelOut` | `ArchiveModelResponse` | +| `BatchJobIn` | `CreateBatchJobRequest` | +| `BatchJobOut` | `BatchJob` | +| `BatchJobsOut` | `ListBatchJobsResponse` | +| `CheckpointOut` | `Checkpoint` | +| `ClassifierDetailedJobOut` | `ClassifierFineTuningJobDetails` | +| `ClassifierFTModelOut` | `ClassifierFineTunedModel` | +| `ClassifierJobOut` | `ClassifierFineTuningJob` | +| `ClassifierTargetIn` | `ClassifierTarget` | +| `ClassifierTargetOut` | `ClassifierTargetResult` | +| `ClassifierTrainingParametersIn` | `ClassifierTrainingParameters` | +| `CompletionDetailedJobOut` | `CompletionFineTuningJobDetails` | +| `CompletionFTModelOut` | `CompletionFineTunedModel` | +| `CompletionJobOut` | `CompletionFineTuningJob` | +| `CompletionTrainingParametersIn` | `CompletionTrainingParameters` | +| `ConversationAppendRequestBase` | `AppendConversationRequest` | +| `ConversationRestartRequestBase` | `RestartConversationRequest` | +| `DeleteFileOut` | `DeleteFileResponse` | +| `DocumentOut` | `Document` | +| `DocumentUpdateIn` | `UpdateDocumentRequest` | +| `EventOut` | `Event` | +| `FTModelCapabilitiesOut` | `FineTunedModelCapabilities` | +| `FileSignedURL` | `GetSignedUrlResponse` | +| `GithubRepositoryOut` | `GithubRepository` | +| `JobIn` | `CreateFineTuningJobRequest` | +| `JobMetadataOut` | `JobMetadata` | +| `JobsOut` | `ListFineTuningJobsResponse` | +| `LegacyJobMetadataOut` | `LegacyJobMetadata` | +| `LibraryIn` | `CreateLibraryRequest` | +| `LibraryInUpdate` | `UpdateLibraryRequest` | +| `LibraryOut` | `Library` | +| `ListDocumentOut` | `ListDocumentsResponse` | +| `ListFilesOut` | `ListFilesResponse` | +| `ListLibraryOut` | `ListLibrariesResponse` | +| `MetricOut` | `Metric` | +| `RetrieveFileOut` | `RetrieveFileResponse` | +| `UnarchiveFTModelOut` | `UnarchiveModelResponse` | +| `UpdateFTModelIn` | `UpdateModelRequest` | +| `UploadFileOut` | `UploadFileResponse` | +| `WandbIntegrationOut` | `WandbIntegrationResult` | + +
+ +## Other Changes + +- `FunctionTool.type` changed from `Optional[FunctionToolType]` to `Literal["function"]` (functionally equivalent if you omit `type`) +- Enums now accept unknown values for forward compatibility with API changes +- Forward-compatible unions: discriminated unions get an `Unknown` variant + +## What Did NOT Change + +- All method names (`chat.complete`, `chat.stream`, `embeddings.create`, `fim.complete`, `files.upload`, `models.list`, `fine_tuning.jobs.create`, etc.) +- Zero endpoints added/removed, zero path changes +- Python minimum `>=3.10` +- Installation: `pip install mistralai` + +--- + +
+

Legacy: Migrating from v0.x to v1.x

+ +> **Note:** The v1.x examples below use v1-style imports (e.g., `from mistralai import Mistral`). If you're on v2.x, combine these API changes with the [v1 to v2 import changes](#migration-guide-v1x-to-v2x) above. + +`MistralClient`/`MistralAsyncClient` consolidated into `Mistral`. `ChatMessage` replaced with `UserMessage`, `AssistantMessage`, etc. Streaming chunks now at `chunk.data.choices[0].delta.content`. + +| v0.x | v1.x | +|---|---| +| `MistralClient` | `Mistral` | +| `client.chat` | `client.chat.complete` | +| `client.chat_stream` | `client.chat.stream` | +| `client.completions` | `client.fim.complete` | +| `client.completions_stream` | `client.fim.stream` | +| `client.embeddings` | `client.embeddings.create` | +| `client.list_models` | `client.models.list` | +| `client.delete_model` | `client.models.delete` | +| `client.files.create` | `client.files.upload` | +| `client.jobs.create` | `client.fine_tuning.jobs.create` | +| `client.jobs.list` | `client.fine_tuning.jobs.list` | +| `client.jobs.retrieve` | `client.fine_tuning.jobs.get` | +| `client.jobs.cancel` | `client.fine_tuning.jobs.cancel` | + +
diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..bba024ad --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +.PHONY: help generate test-generate update-speakeasy-version check-config + +help: + @echo "Available targets:" + @echo " make generate Generate all SDKs (main, Azure, GCP)" + @echo " make test-generate Test SDK generation locally" + @echo " make update-speakeasy-version VERSION=x.y.z Update Speakeasy CLI version" + @echo " make check-config Check gen.yaml against recommended defaults" + @echo "" + @echo "Note: Production SDK generation is done via GitHub Actions:" + @echo " .github/workflows/sdk_generation_mistralai_sdk.yaml" + +# Generate all SDKs (main, Azure, GCP) +generate: + speakeasy run -t all + +# Test SDK generation locally. +# For production, use GitHub Actions: .github/workflows/sdk_generation_mistralai_sdk.yaml +# This uses the Speakeasy CLI version defined in .speakeasy/workflow.yaml +test-generate: + speakeasy run --skip-versioning + +# Check gen.yaml configuration against Speakeasy recommended defaults +check-config: + speakeasy configure generation check + +# Update the Speakeasy CLI version (the code generator tool). +# This modifies speakeasyVersion in .speakeasy/workflow.yaml and regenerates the SDK. +# Usage: make update-speakeasy-version VERSION=1.685.0 +update-speakeasy-version: +ifndef VERSION + $(error VERSION is required. This is the Speakeasy CLI version (e.g., 1.685.0)) +endif + uv run inv update-speakeasy --version "$(VERSION)" --targets "all" diff --git a/README-PYPI.md b/README-PYPI.md new file mode 100644 index 00000000..67cd2cbe --- /dev/null +++ b/README-PYPI.md @@ -0,0 +1,1205 @@ +# Mistral Python Client + +## Migrating from v1 + +If you are upgrading from v1 to v2, check the [migration guide](https://github.com/mistralai/client-python/blob/main/MIGRATION.md) for details on breaking changes and how to update your code. + +## API Key Setup + +Before you begin, you will need a Mistral AI API key. + +1. Get your own Mistral API Key: +2. Set your Mistral API Key as an environment variable. You only need to do this once. + +```bash +# set Mistral API Key (using zsh for example) +$ echo 'export MISTRAL_API_KEY=[your_key_here]' >> ~/.zshenv + +# reload the environment (or just quit and open a new terminal) +$ source ~/.zshenv +``` + + +## Summary + +Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. + + + +## Table of Contents + +* [Mistral Python Client](#mistral-python-client) + * [Migrating from v1](#migrating-from-v1) + * [API Key Setup](#api-key-setup) + * [SDK Installation](#sdk-installation) + * [SDK Example Usage](#sdk-example-usage) + * [Providers' SDKs Example Usage](#providers-sdks-example-usage) + * [Available Resources and Operations](#available-resources-and-operations) + * [Server-sent event streaming](#server-sent-event-streaming) + * [Pagination](#pagination) + * [File uploads](#file-uploads) + * [Retries](#retries) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) + * [Custom HTTP Client](#custom-http-client) + * [Authentication](#authentication) + * [Resource Management](#resource-management) + * [Debugging](#debugging) + * [IDE Support](#ide-support) +* [Development](#development) + * [Contributions](#contributions) + + + + +## SDK Installation + +> [!NOTE] +> **Python version upgrade policy** +> +> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated. + +The SDK can be installed with *uv*, *pip*, or *poetry* package managers. + +### uv + +*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities. + +```bash +uv add mistralai +``` + +### PIP + +*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line. + +```bash +pip install mistralai +``` + +### Poetry + +*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies. + +```bash +poetry add mistralai +``` + +### Shell and script usage with `uv` + +You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so: + +```shell +uvx --from mistralai python +``` + +It's also possible to write a standalone Python script without needing to set up a whole project like so: + +```python +#!/usr/bin/env -S uv run --script +# /// script +# requires-python = ">=3.10" +# dependencies = [ +# "mistralai", +# ] +# /// + +from mistralai.client import Mistral + +sdk = Mistral( + # SDK arguments +) + +# Rest of script here... +``` + +Once that is saved to a file, you can run it with `uv run script.py` where +`script.py` can be replaced with the actual file name. + + +### Agents extra dependencies + +When using the agents related feature it is required to add the `agents` extra dependencies. This can be added when +installing the package: + +```bash +pip install "mistralai[agents]" +``` + +> Note: These features require Python 3.10+ (the SDK minimum). + +### Additional packages + +Additional `mistralai-*` packages (e.g. `mistralai-workflows`) can be installed separately and are available under the `mistralai` namespace: + +```bash +pip install mistralai-workflows +``` + + +## SDK Example Usage + +### Create Chat Completions + +This example shows how to create chat completions. + +```python +# Synchronous Example +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.chat.complete(model="mistral-large-latest", messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], stream=False, response_format={ + "type": "text", + }) + + # Handle response + print(res) +``` + +
+ +The same SDK client can also be used to make asynchronous requests by importing asyncio. + +```python +# Asynchronous Example +import asyncio +from mistralai.client import Mistral +import os + +async def main(): + + async with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), + ) as mistral: + + res = await mistral.chat.complete_async(model="mistral-large-latest", messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], stream=False, response_format={ + "type": "text", + }) + + # Handle response + print(res) + +asyncio.run(main()) +``` + +### Upload a file + +This example shows how to upload a file. + +```python +# Synchronous Example +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.files.upload(file={ + "file_name": "example.file", + "content": open("example.file", "rb"), + }, visibility="workspace") + + # Handle response + print(res) +``` + +
+ +The same SDK client can also be used to make asynchronous requests by importing asyncio. + +```python +# Asynchronous Example +import asyncio +from mistralai.client import Mistral +import os + +async def main(): + + async with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), + ) as mistral: + + res = await mistral.files.upload_async(file={ + "file_name": "example.file", + "content": open("example.file", "rb"), + }, visibility="workspace") + + # Handle response + print(res) + +asyncio.run(main()) +``` + +### Create Agents Completions + +This example shows how to create agents completions. + +```python +# Synchronous Example +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.agents.complete(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], agent_id="", stream=False, response_format={ + "type": "text", + }) + + # Handle response + print(res) +``` + +
+ +The same SDK client can also be used to make asynchronous requests by importing asyncio. + +```python +# Asynchronous Example +import asyncio +from mistralai.client import Mistral +import os + +async def main(): + + async with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), + ) as mistral: + + res = await mistral.agents.complete_async(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], agent_id="", stream=False, response_format={ + "type": "text", + }) + + # Handle response + print(res) + +asyncio.run(main()) +``` + +### Create Embedding Request + +This example shows how to create embedding request. + +```python +# Synchronous Example +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.embeddings.create(model="mistral-embed", inputs=[ + "Embed this sentence.", + "As well as this one.", + ]) + + # Handle response + print(res) +``` + +
+ +The same SDK client can also be used to make asynchronous requests by importing asyncio. + +```python +# Asynchronous Example +import asyncio +from mistralai.client import Mistral +import os + +async def main(): + + async with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), + ) as mistral: + + res = await mistral.embeddings.create_async(model="mistral-embed", inputs=[ + "Embed this sentence.", + "As well as this one.", + ]) + + # Handle response + print(res) + +asyncio.run(main()) +``` + + + +### More examples + +You can run the examples in the `examples/` directory using `uv run`. + + +## Providers' SDKs Example Usage + +### Azure AI + +**Prerequisites** + +Before you begin, ensure you have `AZURE_ENDPOINT` and an `AZURE_API_KEY`. To obtain these, you will need to deploy Mistral on Azure AI. +See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/). + +**Step 1: Install** + +```bash +pip install mistralai +``` + +**Step 2: Example Usage** + +Here's a basic example to get you started. You can also run [the example in the `examples` directory](https://github.com/mistralai/client-python/blob/main/examples/azure). + +```python +import os +from mistralai.azure.client import MistralAzure + +# The SDK automatically injects api-version as a query parameter +client = MistralAzure( + api_key=os.environ["AZURE_API_KEY"], + server_url=os.environ["AZURE_ENDPOINT"], + api_version="2024-05-01-preview", # Optional, this is the default +) + +res = client.chat.complete( + model=os.environ["AZURE_MODEL"], + messages=[ + { + "role": "user", + "content": "Hello there!", + } + ], +) +print(res.choices[0].message.content) +``` + +### Google Cloud + + +**Prerequisites** + +Before you begin, you will need to create a Google Cloud project and enable the Mistral API. To do this, follow the instructions [here](https://docs.mistral.ai/deployment/cloud/vertex/). + +To run this locally you will also need to ensure you are authenticated with Google Cloud. You can do this by running + +```bash +gcloud auth application-default login +``` + +**Step 1: Install** + +```bash +pip install mistralai +# For GCP authentication support (required): +pip install "mistralai[gcp]" +``` + +**Step 2: Example Usage** + +Here's a basic example to get you started. You can also run [the example in the `examples` directory](https://github.com/mistralai/client-python/blob/main/examples/gcp). + +The SDK automatically: +- Detects credentials via `google.auth.default()` +- Auto-refreshes tokens when they expire +- Builds the Vertex AI URL from `project_id` and `region` + +```python +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +client = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected from credentials + region="us-central1", # Default: europe-west4 +) + +res = client.chat.complete( + model="mistral-small-2503", + messages=[ + { + "role": "user", + "content": "Hello there!", + } + ], +) +print(res.choices[0].message.content) +``` + + + +## Available Resources and Operations + +
+Available methods + +### [Agents](https://github.com/mistralai/client-python/blob/main/docs/sdks/agents/README.md) + +* [complete](https://github.com/mistralai/client-python/blob/main/docs/sdks/agents/README.md#complete) - Agents Completion +* [stream](https://github.com/mistralai/client-python/blob/main/docs/sdks/agents/README.md#stream) - Stream Agents completion + +### [Audio.Speech](https://github.com/mistralai/client-python/blob/main/docs/sdks/speech/README.md) + +* [complete](https://github.com/mistralai/client-python/blob/main/docs/sdks/speech/README.md#complete) - Speech + +### [Audio.Transcriptions](https://github.com/mistralai/client-python/blob/main/docs/sdks/transcriptions/README.md) + +* [complete](https://github.com/mistralai/client-python/blob/main/docs/sdks/transcriptions/README.md#complete) - Create Transcription +* [stream](https://github.com/mistralai/client-python/blob/main/docs/sdks/transcriptions/README.md#stream) - Create Streaming Transcription (SSE) + +### [Audio.Voices](https://github.com/mistralai/client-python/blob/main/docs/sdks/voices/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/voices/README.md#list) - List all voices +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/voices/README.md#create) - Create a new voice +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/voices/README.md#delete) - Delete a custom voice +* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/voices/README.md#update) - Update voice metadata +* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/voices/README.md#get) - Get voice details +* [get_sample_audio](https://github.com/mistralai/client-python/blob/main/docs/sdks/voices/README.md#get_sample_audio) - Get voice sample audio + +### [Batch.Jobs](https://github.com/mistralai/client-python/blob/main/docs/sdks/batchjobs/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/batchjobs/README.md#list) - Get Batch Jobs +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/batchjobs/README.md#create) - Create Batch Job +* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/batchjobs/README.md#get) - Get Batch Job +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/batchjobs/README.md#delete) - Delete Batch Job +* [cancel](https://github.com/mistralai/client-python/blob/main/docs/sdks/batchjobs/README.md#cancel) - Cancel Batch Job + +### [Beta.Agents](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md) + +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#create) - Create a agent that can be used within a conversation. +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#list) - List agent entities. +* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#get) - Retrieve an agent entity. +* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#update) - Update an agent entity. +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#delete) - Delete an agent entity. +* [update_version](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#update_version) - Update an agent version. +* [list_versions](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#list_versions) - List all versions of an agent. +* [get_version](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#get_version) - Retrieve a specific version of an agent. +* [create_version_alias](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#create_version_alias) - Create or update an agent version alias. +* [list_version_aliases](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#list_version_aliases) - List all aliases for an agent. +* [delete_version_alias](https://github.com/mistralai/client-python/blob/main/docs/sdks/betaagents/README.md#delete_version_alias) - Delete an agent version alias. + +### [Beta.Connectors](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md) + +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#create) - Create a new connector. +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#list) - List all connectors. +* [get_auth_url](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#get_auth_url) - Get the auth URL for a connector. +* [call_tool](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#call_tool) - Call Connector Tool +* [list_tools](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#list_tools) - List tools for a connector. +* [get_authentication_methods](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#get_authentication_methods) - Get authentication methods for a connector. +* [list_organization_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#list_organization_credentials) - List organization credentials for a connector. +* [create_or_update_organization_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#create_or_update_organization_credentials) - Create or update organization credentials for a connector. +* [list_workspace_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#list_workspace_credentials) - List workspace credentials for a connector. +* [create_or_update_workspace_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#create_or_update_workspace_credentials) - Create or update workspace credentials for a connector. +* [list_user_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#list_user_credentials) - List user credentials for a connector. +* [create_or_update_user_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#create_or_update_user_credentials) - Create or update user credentials for a connector. +* [delete_organization_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#delete_organization_credentials) - Delete organization credentials for a connector. +* [delete_workspace_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#delete_workspace_credentials) - Delete workspace credentials for a connector. +* [delete_user_credentials](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#delete_user_credentials) - Delete user credentials for a connector. +* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#get) - Get a connector. +* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#update) - Update a connector. +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/connectors/README.md#delete) - Delete a connector. + +### [Beta.Conversations](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md) + +* [start](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#start) - Create a conversation and append entries to it. +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#list) - List all created conversations. +* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#get) - Retrieve a conversation information. +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#delete) - Delete a conversation. +* [append](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#append) - Append new entries to an existing conversation. +* [get_history](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#get_history) - Retrieve all entries in a conversation. +* [get_messages](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#get_messages) - Retrieve all messages in a conversation. +* [restart](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#restart) - Restart a conversation starting from a given entry. +* [start_stream](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#start_stream) - Create a conversation and append entries to it. +* [append_stream](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#append_stream) - Append new entries to an existing conversation. +* [restart_stream](https://github.com/mistralai/client-python/blob/main/docs/sdks/conversations/README.md#restart_stream) - Restart a conversation starting from a given entry. + +### [Beta.Libraries](https://github.com/mistralai/client-python/blob/main/docs/sdks/libraries/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/libraries/README.md#list) - List all libraries you have access to. +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/libraries/README.md#create) - Create a new Library. +* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/libraries/README.md#get) - Detailed information about a specific Library. +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/libraries/README.md#delete) - Delete a library and all of it's document. +* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/libraries/README.md#update) - Update a library. + +#### [Beta.Libraries.Accesses](https://github.com/mistralai/client-python/blob/main/docs/sdks/accesses/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/accesses/README.md#list) - List all of the access to this library. +* [update_or_create](https://github.com/mistralai/client-python/blob/main/docs/sdks/accesses/README.md#update_or_create) - Create or update an access level. +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/accesses/README.md#delete) - Delete an access level. + +#### [Beta.Libraries.Documents](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#list) - List documents in a given library. +* [upload](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#upload) - Upload a new document. +* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#get) - Retrieve the metadata of a specific document. +* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#update) - Update the metadata of a specific document. +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#delete) - Delete a document. +* [text_content](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#text_content) - Retrieve the text content of a specific document. +* [status](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#status) - Retrieve the processing status of a specific document. +* [get_signed_url](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#get_signed_url) - Retrieve the signed URL of a specific document. +* [extracted_text_signed_url](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#extracted_text_signed_url) - Retrieve the signed URL of text extracted from a given document. +* [reprocess](https://github.com/mistralai/client-python/blob/main/docs/sdks/documents/README.md#reprocess) - Reprocess a document. + +### [Beta.Observability.Campaigns](https://github.com/mistralai/client-python/blob/main/docs/sdks/campaigns/README.md) + +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/campaigns/README.md#create) - Create and start a new campaign +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/campaigns/README.md#list) - Get all campaigns +* [fetch](https://github.com/mistralai/client-python/blob/main/docs/sdks/campaigns/README.md#fetch) - Get campaign by id +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/campaigns/README.md#delete) - Delete a campaign +* [fetch_status](https://github.com/mistralai/client-python/blob/main/docs/sdks/campaigns/README.md#fetch_status) - Get campaign status by campaign id +* [list_events](https://github.com/mistralai/client-python/blob/main/docs/sdks/campaigns/README.md#list_events) - Get event ids that were selected by the given campaign + +### [Beta.Observability.ChatCompletionEvents](https://github.com/mistralai/client-python/blob/main/docs/sdks/chatcompletionevents/README.md) + +* [search](https://github.com/mistralai/client-python/blob/main/docs/sdks/chatcompletionevents/README.md#search) - Get Chat Completion Events +* [search_ids](https://github.com/mistralai/client-python/blob/main/docs/sdks/chatcompletionevents/README.md#search_ids) - Alternative to /search that returns only the IDs and that can return many IDs at once +* [fetch](https://github.com/mistralai/client-python/blob/main/docs/sdks/chatcompletionevents/README.md#fetch) - Get Chat Completion Event +* [fetch_similar_events](https://github.com/mistralai/client-python/blob/main/docs/sdks/chatcompletionevents/README.md#fetch_similar_events) - Get Similar Chat Completion Events +* [judge](https://github.com/mistralai/client-python/blob/main/docs/sdks/chatcompletionevents/README.md#judge) - Run Judge on an event based on the given options + +#### [Beta.Observability.ChatCompletionEvents.Fields](https://github.com/mistralai/client-python/blob/main/docs/sdks/fields/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/fields/README.md#list) - Get Chat Completion Fields +* [fetch_options](https://github.com/mistralai/client-python/blob/main/docs/sdks/fields/README.md#fetch_options) - Get Chat Completion Field Options +* [fetch_option_counts](https://github.com/mistralai/client-python/blob/main/docs/sdks/fields/README.md#fetch_option_counts) - Get Chat Completion Field Options Counts + +### [Beta.Observability.Datasets](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md) + +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#create) - Create a new empty dataset +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#list) - List existing datasets +* [fetch](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#fetch) - Get dataset by id +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#delete) - Delete a dataset +* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#update) - Patch dataset +* [list_records](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#list_records) - List existing records in the dataset +* [create_record](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#create_record) - Add a conversation to the dataset +* [import_from_campaign](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_campaign) - Populate the dataset with a campaign +* [import_from_explorer](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_explorer) - Populate the dataset with samples from the explorer +* [import_from_file](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_file) - Populate the dataset with samples from an uploaded file +* [import_from_playground](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_playground) - Populate the dataset with samples from the playground +* [import_from_dataset_records](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#import_from_dataset_records) - Populate the dataset with samples from another dataset +* [export_to_jsonl](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#export_to_jsonl) - Export to the Files API and retrieve presigned URL to download the resulting JSONL file +* [fetch_task](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#fetch_task) - Get status of a dataset import task +* [list_tasks](https://github.com/mistralai/client-python/blob/main/docs/sdks/datasets/README.md#list_tasks) - List import tasks for the given dataset + +#### [Beta.Observability.Datasets.Records](https://github.com/mistralai/client-python/blob/main/docs/sdks/records/README.md) + +* [fetch](https://github.com/mistralai/client-python/blob/main/docs/sdks/records/README.md#fetch) - Get the content of a given conversation from a dataset +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/records/README.md#delete) - Delete a record from a dataset +* [bulk_delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/records/README.md#bulk_delete) - Delete multiple records from datasets +* [judge](https://github.com/mistralai/client-python/blob/main/docs/sdks/records/README.md#judge) - Run Judge on a dataset record based on the given options +* [update_payload](https://github.com/mistralai/client-python/blob/main/docs/sdks/records/README.md#update_payload) - Update a dataset record conversation payload +* [update_properties](https://github.com/mistralai/client-python/blob/main/docs/sdks/records/README.md#update_properties) - Update conversation properties + +### [Beta.Observability.Judges](https://github.com/mistralai/client-python/blob/main/docs/sdks/judges/README.md) + +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/judges/README.md#create) - Create a new judge +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/judges/README.md#list) - Get judges with optional filtering and search +* [fetch](https://github.com/mistralai/client-python/blob/main/docs/sdks/judges/README.md#fetch) - Get judge by id +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/judges/README.md#delete) - Delete a judge +* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/judges/README.md#update) - Update a judge +* [judge_conversation](https://github.com/mistralai/client-python/blob/main/docs/sdks/judges/README.md#judge_conversation) - Run a saved judge on a conversation + +### [Beta.Rag.IngestionPipelineConfigurations](https://github.com/mistralai/client-python/blob/main/docs/sdks/ingestionpipelineconfigurations/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/ingestionpipelineconfigurations/README.md#list) - List ingestion pipeline configurations +* [register](https://github.com/mistralai/client-python/blob/main/docs/sdks/ingestionpipelineconfigurations/README.md#register) - Register Config +* [update_run_info](https://github.com/mistralai/client-python/blob/main/docs/sdks/ingestionpipelineconfigurations/README.md#update_run_info) - Update Run Info + +### [Chat](https://github.com/mistralai/client-python/blob/main/docs/sdks/chat/README.md) + +* [complete](https://github.com/mistralai/client-python/blob/main/docs/sdks/chat/README.md#complete) - Chat Completion +* [stream](https://github.com/mistralai/client-python/blob/main/docs/sdks/chat/README.md#stream) - Stream chat completion + +### [Classifiers](https://github.com/mistralai/client-python/blob/main/docs/sdks/classifiers/README.md) + +* [moderate](https://github.com/mistralai/client-python/blob/main/docs/sdks/classifiers/README.md#moderate) - Moderations +* [moderate_chat](https://github.com/mistralai/client-python/blob/main/docs/sdks/classifiers/README.md#moderate_chat) - Chat Moderations +* [classify](https://github.com/mistralai/client-python/blob/main/docs/sdks/classifiers/README.md#classify) - Classifications +* [classify_chat](https://github.com/mistralai/client-python/blob/main/docs/sdks/classifiers/README.md#classify_chat) - Chat Classifications + +### [Embeddings](https://github.com/mistralai/client-python/blob/main/docs/sdks/embeddings/README.md) + +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/embeddings/README.md#create) - Embeddings + +### [Events](https://github.com/mistralai/client-python/blob/main/docs/sdks/events/README.md) + +* [get_stream_events](https://github.com/mistralai/client-python/blob/main/docs/sdks/events/README.md#get_stream_events) - Get Stream Events +* [get_workflow_events](https://github.com/mistralai/client-python/blob/main/docs/sdks/events/README.md#get_workflow_events) - Get Workflow Events + +### [Files](https://github.com/mistralai/client-python/blob/main/docs/sdks/files/README.md) + +* [upload](https://github.com/mistralai/client-python/blob/main/docs/sdks/files/README.md#upload) - Upload File +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/files/README.md#list) - List Files +* [retrieve](https://github.com/mistralai/client-python/blob/main/docs/sdks/files/README.md#retrieve) - Retrieve File +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/files/README.md#delete) - Delete File +* [download](https://github.com/mistralai/client-python/blob/main/docs/sdks/files/README.md#download) - Download File +* [get_signed_url](https://github.com/mistralai/client-python/blob/main/docs/sdks/files/README.md#get_signed_url) - Get Signed Url + +### [Fim](https://github.com/mistralai/client-python/blob/main/docs/sdks/fim/README.md) + +* [complete](https://github.com/mistralai/client-python/blob/main/docs/sdks/fim/README.md#complete) - Fim Completion +* [stream](https://github.com/mistralai/client-python/blob/main/docs/sdks/fim/README.md#stream) - Stream fim completion + +### [FineTuning.Jobs](https://github.com/mistralai/client-python/blob/main/docs/sdks/finetuningjobs/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/finetuningjobs/README.md#list) - Get Fine Tuning Jobs +* [create](https://github.com/mistralai/client-python/blob/main/docs/sdks/finetuningjobs/README.md#create) - Create Fine Tuning Job +* [get](https://github.com/mistralai/client-python/blob/main/docs/sdks/finetuningjobs/README.md#get) - Get Fine Tuning Job +* [cancel](https://github.com/mistralai/client-python/blob/main/docs/sdks/finetuningjobs/README.md#cancel) - Cancel Fine Tuning Job +* [start](https://github.com/mistralai/client-python/blob/main/docs/sdks/finetuningjobs/README.md#start) - Start Fine Tuning Job + +### [Models](https://github.com/mistralai/client-python/blob/main/docs/sdks/models/README.md) + +* [list](https://github.com/mistralai/client-python/blob/main/docs/sdks/models/README.md#list) - List Models +* [retrieve](https://github.com/mistralai/client-python/blob/main/docs/sdks/models/README.md#retrieve) - Retrieve Model +* [delete](https://github.com/mistralai/client-python/blob/main/docs/sdks/models/README.md#delete) - Delete Model +* [update](https://github.com/mistralai/client-python/blob/main/docs/sdks/models/README.md#update) - Update Fine Tuned Model +* [archive](https://github.com/mistralai/client-python/blob/main/docs/sdks/models/README.md#archive) - Archive Fine Tuned Model +* [unarchive](https://github.com/mistralai/client-python/blob/main/docs/sdks/models/README.md#unarchive) - Unarchive Fine Tuned Model + +### [Ocr](https://github.com/mistralai/client-python/blob/main/docs/sdks/ocr/README.md) + +* [process](https://github.com/mistralai/client-python/blob/main/docs/sdks/ocr/README.md#process) - OCR + +### [Workflows](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md) + +* [get_workflows](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#get_workflows) - Get Workflows +* [get_workflow_registrations](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#get_workflow_registrations) - Get Workflow Registrations +* [execute_workflow](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#execute_workflow) - Execute Workflow +* [~~execute_workflow_registration~~](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#execute_workflow_registration) - Execute Workflow Registration :warning: **Deprecated** +* [get_workflow](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#get_workflow) - Get Workflow +* [update_workflow](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#update_workflow) - Update Workflow +* [get_workflow_registration](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#get_workflow_registration) - Get Workflow Registration +* [archive_workflow](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#archive_workflow) - Archive Workflow +* [unarchive_workflow](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflows/README.md#unarchive_workflow) - Unarchive Workflow + +#### [Workflows.Deployments](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md) + +* [list_deployments](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md#list_deployments) - List Deployments +* [get_deployment](https://github.com/mistralai/client-python/blob/main/docs/sdks/deployments/README.md#get_deployment) - Get Deployment + +#### [Workflows.Events](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflowsevents/README.md) + +* [get_stream_events](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflowsevents/README.md#get_stream_events) - Get Stream Events +* [get_workflow_events](https://github.com/mistralai/client-python/blob/main/docs/sdks/workflowsevents/README.md#get_workflow_events) - Get Workflow Events + +#### [Workflows.Executions](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md) + +* [get_workflow_execution](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#get_workflow_execution) - Get Workflow Execution +* [get_workflow_execution_history](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#get_workflow_execution_history) - Get Workflow Execution History +* [signal_workflow_execution](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#signal_workflow_execution) - Signal Workflow Execution +* [query_workflow_execution](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#query_workflow_execution) - Query Workflow Execution +* [terminate_workflow_execution](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#terminate_workflow_execution) - Terminate Workflow Execution +* [batch_terminate_workflow_executions](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#batch_terminate_workflow_executions) - Batch Terminate Workflow Executions +* [cancel_workflow_execution](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#cancel_workflow_execution) - Cancel Workflow Execution +* [batch_cancel_workflow_executions](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#batch_cancel_workflow_executions) - Batch Cancel Workflow Executions +* [reset_workflow](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#reset_workflow) - Reset Workflow +* [update_workflow_execution](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#update_workflow_execution) - Update Workflow Execution +* [get_workflow_execution_trace_otel](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#get_workflow_execution_trace_otel) - Get Workflow Execution Trace Otel +* [get_workflow_execution_trace_summary](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#get_workflow_execution_trace_summary) - Get Workflow Execution Trace Summary +* [get_workflow_execution_trace_events](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#get_workflow_execution_trace_events) - Get Workflow Execution Trace Events +* [stream](https://github.com/mistralai/client-python/blob/main/docs/sdks/executions/README.md#stream) - Stream + +#### [Workflows.Metrics](https://github.com/mistralai/client-python/blob/main/docs/sdks/metrics/README.md) + +* [get_workflow_metrics](https://github.com/mistralai/client-python/blob/main/docs/sdks/metrics/README.md#get_workflow_metrics) - Get Workflow Metrics + +#### [Workflows.Runs](https://github.com/mistralai/client-python/blob/main/docs/sdks/runs/README.md) + +* [list_runs](https://github.com/mistralai/client-python/blob/main/docs/sdks/runs/README.md#list_runs) - List Runs +* [get_run](https://github.com/mistralai/client-python/blob/main/docs/sdks/runs/README.md#get_run) - Get Run +* [get_run_history](https://github.com/mistralai/client-python/blob/main/docs/sdks/runs/README.md#get_run_history) - Get Run History + +#### [Workflows.Schedules](https://github.com/mistralai/client-python/blob/main/docs/sdks/schedules/README.md) + +* [get_schedules](https://github.com/mistralai/client-python/blob/main/docs/sdks/schedules/README.md#get_schedules) - Get Schedules +* [schedule_workflow](https://github.com/mistralai/client-python/blob/main/docs/sdks/schedules/README.md#schedule_workflow) - Schedule Workflow +* [unschedule_workflow](https://github.com/mistralai/client-python/blob/main/docs/sdks/schedules/README.md#unschedule_workflow) - Unschedule Workflow +* [pause_schedule](https://github.com/mistralai/client-python/blob/main/docs/sdks/schedules/README.md#pause_schedule) - Pause Schedule +* [resume_schedule](https://github.com/mistralai/client-python/blob/main/docs/sdks/schedules/README.md#resume_schedule) - Resume Schedule + +
+ + + +## Server-sent event streaming + +[Server-sent events][mdn-sse] are used to stream content from certain +operations. These operations will expose the stream as [Generator][generator] that +can be consumed using a simple `for` loop. The loop will +terminate when the server no longer has any events to send and closes the +underlying connection. + +The stream is also a [Context Manager][context-manager] and can be used with the `with` statement and will close the +underlying connection when the context is exited. + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + +[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events +[generator]: https://book.pythontips.com/en/latest/generators.html +[context-manager]: https://book.pythontips.com/en/latest/context_managers.html + + + +## Pagination + +Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the +returned response object will have a `Next` method that can be called to pull down the next group of results. If the +return value of `Next` is `None`, then there are no more pages to be fetched. + +Here's an example of one such pagination call: +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.get_workflows(active_only=False, include_shared=True, limit=50) + + while res is not None: + # Handle items + + res = res.next() + +``` + + + +## File uploads + +Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request. + +> [!TIP] +> +> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files. +> + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.transcriptions.complete(model="Model X", diarize=False) + + # Handle response + print(res) + +``` + + + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: +```python +from mistralai.client import Mistral +from mistralai.client.utils import BackoffStrategy, RetryConfig +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }, + RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: +```python +from mistralai.client import Mistral +from mistralai.client.utils import BackoffStrategy, RetryConfig +import os + + +with Mistral( + retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + + + +## Error Handling + +[`MistralError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/mistralerror.py) is the base class for all HTTP error responses. It has the following properties: + +| Property | Type | Description | +| ------------------ | ---------------- | --------------------------------------------------------------------------------------- | +| `err.message` | `str` | Error message | +| `err.status_code` | `int` | HTTP response status code eg `404` | +| `err.headers` | `httpx.Headers` | HTTP response headers | +| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. | +| `err.raw_response` | `httpx.Response` | Raw HTTP response | +| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). | + +### Example +```python +from mistralai.client import Mistral, errors +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + res = None + try: + + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + + + except errors.MistralError as e: + # The base class for HTTP error responses + print(e.message) + print(e.status_code) + print(e.body) + print(e.headers) + print(e.raw_response) + + # Depending on the method different errors may be thrown + if isinstance(e, errors.HTTPValidationError): + print(e.data.detail) # Optional[List[models.ValidationError]] +``` + +### Error Classes +**Primary error:** +* [`MistralError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/mistralerror.py): The base class for HTTP error responses. + +
Less common errors (7) + +
+ +**Network errors:** +* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors. + * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server. + * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out. + + +**Inherit from [`MistralError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/mistralerror.py)**: +* [`HTTPValidationError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 116 of 183 methods.* +* [`ObservabilityError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/observabilityerror.py): Bad Request - Invalid request parameters or data. Applicable to 41 of 183 methods.* +* [`ResponseValidationError`](https://github.com/mistralai/client-python/blob/main/src/mistralai/client/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute. + +
+ +\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable. + + + +## Server Selection + +### Select Server by Name + +You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: + +| Name | Server | Description | +| ---- | ------------------------ | -------------------- | +| `eu` | `https://api.mistral.ai` | EU Production server | + +#### Example + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + server="eu", + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + +### Override Server URL Per-Client + +The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: +```python +from mistralai.client import Mistral +import os + + +with Mistral( + server_url="https://api.mistral.ai", + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + + + +## Custom HTTP Client + +The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. +Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. +This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. + +For example, you could specify a header for every request that this sdk makes as follows: +```python +from mistralai.client import Mistral +import httpx + +http_client = httpx.Client(headers={"x-custom-header": "someValue"}) +s = Mistral(client=http_client) +``` + +or you could wrap the client with your own custom logic: +```python +from mistralai.client import Mistral +from mistralai.client.httpclient import AsyncHttpClient +import httpx + +class CustomClient(AsyncHttpClient): + client: AsyncHttpClient + + def __init__(self, client: AsyncHttpClient): + self.client = client + + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + request.headers["Client-Level-Header"] = "added by client" + + return await self.client.send( + request, stream=stream, auth=auth, follow_redirects=follow_redirects + ) + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + return self.client.build_request( + method, + url, + content=content, + data=data, + files=files, + json=json, + params=params, + headers=headers, + cookies=cookies, + timeout=timeout, + extensions=extensions, + ) + +s = Mistral(async_client=CustomClient(httpx.AsyncClient())) +``` + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | Environment Variable | +| --------- | ---- | ----------- | -------------------- | +| `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` | + +To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example: +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + + + +## Resource Management + +The `Mistral` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application. + +[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers + +```python +from mistralai.client import Mistral +import os +def main(): + + with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), + ) as mistral: + # Rest of application here... + + +# Or when using async: +async def amain(): + + async with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), + ) as mistral: + # Rest of application here... +``` + + + +## Debugging + +You can setup your SDK to emit debug logs for SDK requests and responses. + +You can pass your own logger class directly into your SDK. +```python +from mistralai.client import Mistral +import logging + +logging.basicConfig(level=logging.DEBUG) +s = Mistral(debug_logger=logging.getLogger("mistralai.client")) +``` + +You can also enable a default debug logger by setting an environment variable `MISTRAL_DEBUG` to true. + + + +## IDE Support + +### PyCharm + +Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin. + +- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/) + + + + +# Development + +## Contributions + +While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. +We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. diff --git a/README.md b/README.md index 65b0f7b0..2a3bedff 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Mistral Python Client -## Migration warning - -This documentation is for Mistral AI SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md) +## Migrating from v1 + +If you are upgrading from v1 to v2, check the [migration guide](https://github.com/mistralai/client-python/blob/main/MIGRATION.md) for details on breaking changes and how to update your code. ## API Key Setup @@ -29,13 +29,14 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo ## Table of Contents * [Mistral Python Client](#mistral-python-client) - * [Migration warning](#migration-warning) + * [Migrating from v1](#migrating-from-v1) * [API Key Setup](#api-key-setup) * [SDK Installation](#sdk-installation) * [SDK Example Usage](#sdk-example-usage) * [Providers' SDKs Example Usage](#providers-sdks-example-usage) * [Available Resources and Operations](#available-resources-and-operations) * [Server-sent event streaming](#server-sent-event-streaming) + * [Pagination](#pagination) * [File uploads](#file-uploads) * [Retries](#retries) * [Error Handling](#error-handling) @@ -97,13 +98,13 @@ It's also possible to write a standalone Python script without needing to set up ```python #!/usr/bin/env -S uv run --script # /// script -# requires-python = ">=3.9" +# requires-python = ">=3.10" # dependencies = [ # "mistralai", # ] # /// -from mistralai import Mistral +from mistralai.client import Mistral sdk = Mistral( # SDK arguments @@ -118,15 +119,22 @@ Once that is saved to a file, you can run it with `uv run script.py` where ### Agents extra dependencies -When using the agents related feature it is required to add the `agents` extra dependencies. This can be added when +When using the agents related feature it is required to add the `agents` extra dependencies. This can be added when installing the package: ```bash pip install "mistralai[agents]" ``` -> Note: Because of some of our dependencies, these features are only available for python version higher or equal to -> 3.10. +> Note: These features require Python 3.10+ (the SDK minimum). + +### Additional packages + +Additional `mistralai-*` packages (e.g. `mistralai-workflows`) can be installed separately and are available under the `mistralai` namespace: + +```bash +pip install mistralai-workflows +``` ## SDK Example Usage @@ -137,7 +145,7 @@ This example shows how to create chat completions. ```python # Synchronous Example -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -145,12 +153,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.chat.complete(model="mistral-small-latest", messages=[ + res = mistral.chat.complete(model="mistral-large-latest", messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], stream=False) + ], stream=False, response_format={ + "type": "text", + }) # Handle response print(res) @@ -159,10 +169,11 @@ with Mistral(
The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio -from mistralai import Mistral +from mistralai.client import Mistral import os async def main(): @@ -171,12 +182,14 @@ async def main(): api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = await mistral.chat.complete_async(model="mistral-small-latest", messages=[ + res = await mistral.chat.complete_async(model="mistral-large-latest", messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], stream=False) + ], stream=False, response_format={ + "type": "text", + }) # Handle response print(res) @@ -190,7 +203,7 @@ This example shows how to upload a file. ```python # Synchronous Example -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -201,7 +214,7 @@ with Mistral( res = mistral.files.upload(file={ "file_name": "example.file", "content": open("example.file", "rb"), - }) + }, visibility="workspace") # Handle response print(res) @@ -210,10 +223,11 @@ with Mistral(
The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio -from mistralai import Mistral +from mistralai.client import Mistral import os async def main(): @@ -225,7 +239,7 @@ async def main(): res = await mistral.files.upload_async(file={ "file_name": "example.file", "content": open("example.file", "rb"), - }) + }, visibility="workspace") # Handle response print(res) @@ -239,7 +253,7 @@ This example shows how to create agents completions. ```python # Synchronous Example -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -249,10 +263,12 @@ with Mistral( res = mistral.agents.complete(messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], agent_id="", stream=False) + ], agent_id="", stream=False, response_format={ + "type": "text", + }) # Handle response print(res) @@ -261,10 +277,11 @@ with Mistral(
The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio -from mistralai import Mistral +from mistralai.client import Mistral import os async def main(): @@ -275,10 +292,12 @@ async def main(): res = await mistral.agents.complete_async(messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], agent_id="", stream=False) + ], agent_id="", stream=False, response_format={ + "type": "text", + }) # Handle response print(res) @@ -292,7 +311,7 @@ This example shows how to create embedding request. ```python # Synchronous Example -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -312,10 +331,11 @@ with Mistral(
The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio -from mistralai import Mistral +from mistralai.client import Mistral import os async def main(): @@ -339,7 +359,7 @@ asyncio.run(main()) ### More examples -You can run the examples in the `examples/` directory using `poetry run` or by entering the virtual environment using `poetry shell`. +You can run the examples in the `examples/` directory using `uv run`. ## Providers' SDKs Example Usage @@ -348,38 +368,41 @@ You can run the examples in the `examples/` directory using `poetry run` or by e **Prerequisites** -Before you begin, ensure you have `AZUREAI_ENDPOINT` and an `AZURE_API_KEY`. To obtain these, you will need to deploy Mistral on Azure AI. +Before you begin, ensure you have `AZURE_ENDPOINT` and an `AZURE_API_KEY`. To obtain these, you will need to deploy Mistral on Azure AI. See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/). +**Step 1: Install** + +```bash +pip install mistralai +``` + +**Step 2: Example Usage** + Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure). ```python -import asyncio import os +from mistralai.azure.client import MistralAzure -from mistralai_azure import MistralAzure - +# The SDK automatically injects api-version as a query parameter client = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") + api_key=os.environ["AZURE_API_KEY"], + server_url=os.environ["AZURE_ENDPOINT"], + api_version="2024-05-01-preview", # Optional, this is the default ) -async def main() -> None: - res = await client.chat.complete_async( - max_tokens= 100, - temperature= 0.5, - messages= [ - { - "content": "Hello there!", - "role": "user" - } - ] - ) - print(res) - -asyncio.run(main()) +res = client.chat.complete( + model=os.environ["AZURE_MODEL"], + messages=[ + { + "role": "user", + "content": "Hello there!", + } + ], +) +print(res.choices[0].message.content) ``` -The documentation for the Azure SDK is available [here](packages/mistralai_azure/README.md). ### Google Cloud @@ -396,40 +419,43 @@ gcloud auth application-default login **Step 1: Install** -Install the extras dependencies specific to Google Cloud: - ```bash -pip install mistralai[gcp] +pip install mistralai +# For GCP authentication support (required): +pip install "mistralai[gcp]" ``` **Step 2: Example Usage** -Here's a basic example to get you started. +Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/gcp). -```python -import asyncio -from mistralai_gcp import MistralGoogleCloud - -client = MistralGoogleCloud() +The SDK automatically: +- Detects credentials via `google.auth.default()` +- Auto-refreshes tokens when they expire +- Builds the Vertex AI URL from `project_id` and `region` +```python +import os +from mistralai.gcp.client import MistralGCP -async def main() -> None: - res = await client.chat.complete_async( - model= "mistral-small-2402", - messages= [ - { - "content": "Hello there!", - "role": "user" - } - ] - ) - print(res) +# The SDK auto-detects credentials and builds the Vertex AI URL +client = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected from credentials + region="us-central1", # Default: europe-west4 +) -asyncio.run(main()) +res = client.chat.complete( + model="mistral-small-2503", + messages=[ + { + "role": "user", + "content": "Hello there!", + } + ], +) +print(res.choices[0].message.content) ``` -The documentation for the GCP SDK is available [here](packages/mistralai_gcp/README.md). - ## Available Resources and Operations @@ -437,45 +463,78 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA
Available methods -### [agents](docs/sdks/agents/README.md) +### [Agents](docs/sdks/agents/README.md) * [complete](docs/sdks/agents/README.md#complete) - Agents Completion * [stream](docs/sdks/agents/README.md#stream) - Stream Agents completion -### [audio](docs/sdks/audio/README.md) +### [Audio.Speech](docs/sdks/speech/README.md) +* [complete](docs/sdks/speech/README.md#complete) - Speech -#### [audio.transcriptions](docs/sdks/transcriptions/README.md) +### [Audio.Transcriptions](docs/sdks/transcriptions/README.md) * [complete](docs/sdks/transcriptions/README.md#complete) - Create Transcription -* [stream](docs/sdks/transcriptions/README.md#stream) - Create streaming transcription (SSE) - -### [batch](docs/sdks/batch/README.md) - - -#### [batch.jobs](docs/sdks/mistraljobs/README.md) - -* [list](docs/sdks/mistraljobs/README.md#list) - Get Batch Jobs -* [create](docs/sdks/mistraljobs/README.md#create) - Create Batch Job -* [get](docs/sdks/mistraljobs/README.md#get) - Get Batch Job -* [cancel](docs/sdks/mistraljobs/README.md#cancel) - Cancel Batch Job - -### [beta](docs/sdks/beta/README.md) - - -#### [beta.agents](docs/sdks/mistralagents/README.md) - -* [create](docs/sdks/mistralagents/README.md#create) - Create a agent that can be used within a conversation. -* [list](docs/sdks/mistralagents/README.md#list) - List agent entities. -* [get](docs/sdks/mistralagents/README.md#get) - Retrieve an agent entity. -* [update](docs/sdks/mistralagents/README.md#update) - Update an agent entity. -* [update_version](docs/sdks/mistralagents/README.md#update_version) - Update an agent version. - -#### [beta.conversations](docs/sdks/conversations/README.md) +* [stream](docs/sdks/transcriptions/README.md#stream) - Create Streaming Transcription (SSE) + +### [Audio.Voices](docs/sdks/voices/README.md) + +* [list](docs/sdks/voices/README.md#list) - List all voices +* [create](docs/sdks/voices/README.md#create) - Create a new voice +* [delete](docs/sdks/voices/README.md#delete) - Delete a custom voice +* [update](docs/sdks/voices/README.md#update) - Update voice metadata +* [get](docs/sdks/voices/README.md#get) - Get voice details +* [get_sample_audio](docs/sdks/voices/README.md#get_sample_audio) - Get voice sample audio + +### [Batch.Jobs](docs/sdks/batchjobs/README.md) + +* [list](docs/sdks/batchjobs/README.md#list) - Get Batch Jobs +* [create](docs/sdks/batchjobs/README.md#create) - Create Batch Job +* [get](docs/sdks/batchjobs/README.md#get) - Get Batch Job +* [delete](docs/sdks/batchjobs/README.md#delete) - Delete Batch Job +* [cancel](docs/sdks/batchjobs/README.md#cancel) - Cancel Batch Job + +### [Beta.Agents](docs/sdks/betaagents/README.md) + +* [create](docs/sdks/betaagents/README.md#create) - Create a agent that can be used within a conversation. +* [list](docs/sdks/betaagents/README.md#list) - List agent entities. +* [get](docs/sdks/betaagents/README.md#get) - Retrieve an agent entity. +* [update](docs/sdks/betaagents/README.md#update) - Update an agent entity. +* [delete](docs/sdks/betaagents/README.md#delete) - Delete an agent entity. +* [update_version](docs/sdks/betaagents/README.md#update_version) - Update an agent version. +* [list_versions](docs/sdks/betaagents/README.md#list_versions) - List all versions of an agent. +* [get_version](docs/sdks/betaagents/README.md#get_version) - Retrieve a specific version of an agent. +* [create_version_alias](docs/sdks/betaagents/README.md#create_version_alias) - Create or update an agent version alias. +* [list_version_aliases](docs/sdks/betaagents/README.md#list_version_aliases) - List all aliases for an agent. +* [delete_version_alias](docs/sdks/betaagents/README.md#delete_version_alias) - Delete an agent version alias. + +### [Beta.Connectors](docs/sdks/connectors/README.md) + +* [create](docs/sdks/connectors/README.md#create) - Create a new connector. +* [list](docs/sdks/connectors/README.md#list) - List all connectors. +* [get_auth_url](docs/sdks/connectors/README.md#get_auth_url) - Get the auth URL for a connector. +* [call_tool](docs/sdks/connectors/README.md#call_tool) - Call Connector Tool +* [list_tools](docs/sdks/connectors/README.md#list_tools) - List tools for a connector. +* [get_authentication_methods](docs/sdks/connectors/README.md#get_authentication_methods) - Get authentication methods for a connector. +* [list_organization_credentials](docs/sdks/connectors/README.md#list_organization_credentials) - List organization credentials for a connector. +* [create_or_update_organization_credentials](docs/sdks/connectors/README.md#create_or_update_organization_credentials) - Create or update organization credentials for a connector. +* [list_workspace_credentials](docs/sdks/connectors/README.md#list_workspace_credentials) - List workspace credentials for a connector. +* [create_or_update_workspace_credentials](docs/sdks/connectors/README.md#create_or_update_workspace_credentials) - Create or update workspace credentials for a connector. +* [list_user_credentials](docs/sdks/connectors/README.md#list_user_credentials) - List user credentials for a connector. +* [create_or_update_user_credentials](docs/sdks/connectors/README.md#create_or_update_user_credentials) - Create or update user credentials for a connector. +* [delete_organization_credentials](docs/sdks/connectors/README.md#delete_organization_credentials) - Delete organization credentials for a connector. +* [delete_workspace_credentials](docs/sdks/connectors/README.md#delete_workspace_credentials) - Delete workspace credentials for a connector. +* [delete_user_credentials](docs/sdks/connectors/README.md#delete_user_credentials) - Delete user credentials for a connector. +* [get](docs/sdks/connectors/README.md#get) - Get a connector. +* [update](docs/sdks/connectors/README.md#update) - Update a connector. +* [delete](docs/sdks/connectors/README.md#delete) - Delete a connector. + +### [Beta.Conversations](docs/sdks/conversations/README.md) * [start](docs/sdks/conversations/README.md#start) - Create a conversation and append entries to it. * [list](docs/sdks/conversations/README.md#list) - List all created conversations. * [get](docs/sdks/conversations/README.md#get) - Retrieve a conversation information. +* [delete](docs/sdks/conversations/README.md#delete) - Delete a conversation. * [append](docs/sdks/conversations/README.md#append) - Append new entries to an existing conversation. * [get_history](docs/sdks/conversations/README.md#get_history) - Retrieve all entries in a conversation. * [get_messages](docs/sdks/conversations/README.md#get_messages) - Retrieve all messages in a conversation. @@ -484,7 +543,7 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA * [append_stream](docs/sdks/conversations/README.md#append_stream) - Append new entries to an existing conversation. * [restart_stream](docs/sdks/conversations/README.md#restart_stream) - Restart a conversation starting from a given entry. -#### [beta.libraries](docs/sdks/libraries/README.md) +### [Beta.Libraries](docs/sdks/libraries/README.md) * [list](docs/sdks/libraries/README.md#list) - List all libraries you have access to. * [create](docs/sdks/libraries/README.md#create) - Create a new Library. @@ -492,15 +551,15 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA * [delete](docs/sdks/libraries/README.md#delete) - Delete a library and all of it's document. * [update](docs/sdks/libraries/README.md#update) - Update a library. -#### [beta.libraries.accesses](docs/sdks/accesses/README.md) +#### [Beta.Libraries.Accesses](docs/sdks/accesses/README.md) * [list](docs/sdks/accesses/README.md#list) - List all of the access to this library. * [update_or_create](docs/sdks/accesses/README.md#update_or_create) - Create or update an access level. * [delete](docs/sdks/accesses/README.md#delete) - Delete an access level. -#### [beta.libraries.documents](docs/sdks/documents/README.md) +#### [Beta.Libraries.Documents](docs/sdks/documents/README.md) -* [list](docs/sdks/documents/README.md#list) - List document in a given library. +* [list](docs/sdks/documents/README.md#list) - List documents in a given library. * [upload](docs/sdks/documents/README.md#upload) - Upload a new document. * [get](docs/sdks/documents/README.md#get) - Retrieve the metadata of a specific document. * [update](docs/sdks/documents/README.md#update) - Update the metadata of a specific document. @@ -511,23 +570,93 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA * [extracted_text_signed_url](docs/sdks/documents/README.md#extracted_text_signed_url) - Retrieve the signed URL of text extracted from a given document. * [reprocess](docs/sdks/documents/README.md#reprocess) - Reprocess a document. -### [chat](docs/sdks/chat/README.md) +### [Beta.Observability.Campaigns](docs/sdks/campaigns/README.md) + +* [create](docs/sdks/campaigns/README.md#create) - Create and start a new campaign +* [list](docs/sdks/campaigns/README.md#list) - Get all campaigns +* [fetch](docs/sdks/campaigns/README.md#fetch) - Get campaign by id +* [delete](docs/sdks/campaigns/README.md#delete) - Delete a campaign +* [fetch_status](docs/sdks/campaigns/README.md#fetch_status) - Get campaign status by campaign id +* [list_events](docs/sdks/campaigns/README.md#list_events) - Get event ids that were selected by the given campaign + +### [Beta.Observability.ChatCompletionEvents](docs/sdks/chatcompletionevents/README.md) + +* [search](docs/sdks/chatcompletionevents/README.md#search) - Get Chat Completion Events +* [search_ids](docs/sdks/chatcompletionevents/README.md#search_ids) - Alternative to /search that returns only the IDs and that can return many IDs at once +* [fetch](docs/sdks/chatcompletionevents/README.md#fetch) - Get Chat Completion Event +* [fetch_similar_events](docs/sdks/chatcompletionevents/README.md#fetch_similar_events) - Get Similar Chat Completion Events +* [judge](docs/sdks/chatcompletionevents/README.md#judge) - Run Judge on an event based on the given options + +#### [Beta.Observability.ChatCompletionEvents.Fields](docs/sdks/fields/README.md) + +* [list](docs/sdks/fields/README.md#list) - Get Chat Completion Fields +* [fetch_options](docs/sdks/fields/README.md#fetch_options) - Get Chat Completion Field Options +* [fetch_option_counts](docs/sdks/fields/README.md#fetch_option_counts) - Get Chat Completion Field Options Counts + +### [Beta.Observability.Datasets](docs/sdks/datasets/README.md) + +* [create](docs/sdks/datasets/README.md#create) - Create a new empty dataset +* [list](docs/sdks/datasets/README.md#list) - List existing datasets +* [fetch](docs/sdks/datasets/README.md#fetch) - Get dataset by id +* [delete](docs/sdks/datasets/README.md#delete) - Delete a dataset +* [update](docs/sdks/datasets/README.md#update) - Patch dataset +* [list_records](docs/sdks/datasets/README.md#list_records) - List existing records in the dataset +* [create_record](docs/sdks/datasets/README.md#create_record) - Add a conversation to the dataset +* [import_from_campaign](docs/sdks/datasets/README.md#import_from_campaign) - Populate the dataset with a campaign +* [import_from_explorer](docs/sdks/datasets/README.md#import_from_explorer) - Populate the dataset with samples from the explorer +* [import_from_file](docs/sdks/datasets/README.md#import_from_file) - Populate the dataset with samples from an uploaded file +* [import_from_playground](docs/sdks/datasets/README.md#import_from_playground) - Populate the dataset with samples from the playground +* [import_from_dataset_records](docs/sdks/datasets/README.md#import_from_dataset_records) - Populate the dataset with samples from another dataset +* [export_to_jsonl](docs/sdks/datasets/README.md#export_to_jsonl) - Export to the Files API and retrieve presigned URL to download the resulting JSONL file +* [fetch_task](docs/sdks/datasets/README.md#fetch_task) - Get status of a dataset import task +* [list_tasks](docs/sdks/datasets/README.md#list_tasks) - List import tasks for the given dataset + +#### [Beta.Observability.Datasets.Records](docs/sdks/records/README.md) + +* [fetch](docs/sdks/records/README.md#fetch) - Get the content of a given conversation from a dataset +* [delete](docs/sdks/records/README.md#delete) - Delete a record from a dataset +* [bulk_delete](docs/sdks/records/README.md#bulk_delete) - Delete multiple records from datasets +* [judge](docs/sdks/records/README.md#judge) - Run Judge on a dataset record based on the given options +* [update_payload](docs/sdks/records/README.md#update_payload) - Update a dataset record conversation payload +* [update_properties](docs/sdks/records/README.md#update_properties) - Update conversation properties + +### [Beta.Observability.Judges](docs/sdks/judges/README.md) + +* [create](docs/sdks/judges/README.md#create) - Create a new judge +* [list](docs/sdks/judges/README.md#list) - Get judges with optional filtering and search +* [fetch](docs/sdks/judges/README.md#fetch) - Get judge by id +* [delete](docs/sdks/judges/README.md#delete) - Delete a judge +* [update](docs/sdks/judges/README.md#update) - Update a judge +* [judge_conversation](docs/sdks/judges/README.md#judge_conversation) - Run a saved judge on a conversation + +### [Beta.Rag.IngestionPipelineConfigurations](docs/sdks/ingestionpipelineconfigurations/README.md) + +* [list](docs/sdks/ingestionpipelineconfigurations/README.md#list) - List ingestion pipeline configurations +* [register](docs/sdks/ingestionpipelineconfigurations/README.md#register) - Register Config +* [update_run_info](docs/sdks/ingestionpipelineconfigurations/README.md#update_run_info) - Update Run Info + +### [Chat](docs/sdks/chat/README.md) * [complete](docs/sdks/chat/README.md#complete) - Chat Completion * [stream](docs/sdks/chat/README.md#stream) - Stream chat completion -### [classifiers](docs/sdks/classifiers/README.md) +### [Classifiers](docs/sdks/classifiers/README.md) * [moderate](docs/sdks/classifiers/README.md#moderate) - Moderations * [moderate_chat](docs/sdks/classifiers/README.md#moderate_chat) - Chat Moderations * [classify](docs/sdks/classifiers/README.md#classify) - Classifications * [classify_chat](docs/sdks/classifiers/README.md#classify_chat) - Chat Classifications -### [embeddings](docs/sdks/embeddings/README.md) +### [Embeddings](docs/sdks/embeddings/README.md) * [create](docs/sdks/embeddings/README.md#create) - Embeddings -### [files](docs/sdks/files/README.md) +### [Events](docs/sdks/events/README.md) + +* [get_stream_events](docs/sdks/events/README.md#get_stream_events) - Get Stream Events +* [get_workflow_events](docs/sdks/events/README.md#get_workflow_events) - Get Workflow Events + +### [Files](docs/sdks/files/README.md) * [upload](docs/sdks/files/README.md#upload) - Upload File * [list](docs/sdks/files/README.md#list) - List Files @@ -536,24 +665,20 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA * [download](docs/sdks/files/README.md#download) - Download File * [get_signed_url](docs/sdks/files/README.md#get_signed_url) - Get Signed Url -### [fim](docs/sdks/fim/README.md) +### [Fim](docs/sdks/fim/README.md) * [complete](docs/sdks/fim/README.md#complete) - Fim Completion * [stream](docs/sdks/fim/README.md#stream) - Stream fim completion -### [fine_tuning](docs/sdks/finetuning/README.md) - - -#### [fine_tuning.jobs](docs/sdks/jobs/README.md) +### [FineTuning.Jobs](docs/sdks/finetuningjobs/README.md) -* [list](docs/sdks/jobs/README.md#list) - Get Fine Tuning Jobs -* [create](docs/sdks/jobs/README.md#create) - Create Fine Tuning Job -* [get](docs/sdks/jobs/README.md#get) - Get Fine Tuning Job -* [cancel](docs/sdks/jobs/README.md#cancel) - Cancel Fine Tuning Job -* [start](docs/sdks/jobs/README.md#start) - Start Fine Tuning Job +* [list](docs/sdks/finetuningjobs/README.md#list) - Get Fine Tuning Jobs +* [create](docs/sdks/finetuningjobs/README.md#create) - Create Fine Tuning Job +* [get](docs/sdks/finetuningjobs/README.md#get) - Get Fine Tuning Job +* [cancel](docs/sdks/finetuningjobs/README.md#cancel) - Cancel Fine Tuning Job +* [start](docs/sdks/finetuningjobs/README.md#start) - Start Fine Tuning Job - -### [models](docs/sdks/models/README.md) +### [Models](docs/sdks/models/README.md) * [list](docs/sdks/models/README.md#list) - List Models * [retrieve](docs/sdks/models/README.md#retrieve) - Retrieve Model @@ -562,10 +687,67 @@ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/REA * [archive](docs/sdks/models/README.md#archive) - Archive Fine Tuned Model * [unarchive](docs/sdks/models/README.md#unarchive) - Unarchive Fine Tuned Model -### [ocr](docs/sdks/ocr/README.md) +### [Ocr](docs/sdks/ocr/README.md) * [process](docs/sdks/ocr/README.md#process) - OCR +### [Workflows](docs/sdks/workflows/README.md) + +* [get_workflows](docs/sdks/workflows/README.md#get_workflows) - Get Workflows +* [get_workflow_registrations](docs/sdks/workflows/README.md#get_workflow_registrations) - Get Workflow Registrations +* [execute_workflow](docs/sdks/workflows/README.md#execute_workflow) - Execute Workflow +* [~~execute_workflow_registration~~](docs/sdks/workflows/README.md#execute_workflow_registration) - Execute Workflow Registration :warning: **Deprecated** +* [get_workflow](docs/sdks/workflows/README.md#get_workflow) - Get Workflow +* [update_workflow](docs/sdks/workflows/README.md#update_workflow) - Update Workflow +* [get_workflow_registration](docs/sdks/workflows/README.md#get_workflow_registration) - Get Workflow Registration +* [archive_workflow](docs/sdks/workflows/README.md#archive_workflow) - Archive Workflow +* [unarchive_workflow](docs/sdks/workflows/README.md#unarchive_workflow) - Unarchive Workflow + +#### [Workflows.Deployments](docs/sdks/deployments/README.md) + +* [list_deployments](docs/sdks/deployments/README.md#list_deployments) - List Deployments +* [get_deployment](docs/sdks/deployments/README.md#get_deployment) - Get Deployment + +#### [Workflows.Events](docs/sdks/workflowsevents/README.md) + +* [get_stream_events](docs/sdks/workflowsevents/README.md#get_stream_events) - Get Stream Events +* [get_workflow_events](docs/sdks/workflowsevents/README.md#get_workflow_events) - Get Workflow Events + +#### [Workflows.Executions](docs/sdks/executions/README.md) + +* [get_workflow_execution](docs/sdks/executions/README.md#get_workflow_execution) - Get Workflow Execution +* [get_workflow_execution_history](docs/sdks/executions/README.md#get_workflow_execution_history) - Get Workflow Execution History +* [signal_workflow_execution](docs/sdks/executions/README.md#signal_workflow_execution) - Signal Workflow Execution +* [query_workflow_execution](docs/sdks/executions/README.md#query_workflow_execution) - Query Workflow Execution +* [terminate_workflow_execution](docs/sdks/executions/README.md#terminate_workflow_execution) - Terminate Workflow Execution +* [batch_terminate_workflow_executions](docs/sdks/executions/README.md#batch_terminate_workflow_executions) - Batch Terminate Workflow Executions +* [cancel_workflow_execution](docs/sdks/executions/README.md#cancel_workflow_execution) - Cancel Workflow Execution +* [batch_cancel_workflow_executions](docs/sdks/executions/README.md#batch_cancel_workflow_executions) - Batch Cancel Workflow Executions +* [reset_workflow](docs/sdks/executions/README.md#reset_workflow) - Reset Workflow +* [update_workflow_execution](docs/sdks/executions/README.md#update_workflow_execution) - Update Workflow Execution +* [get_workflow_execution_trace_otel](docs/sdks/executions/README.md#get_workflow_execution_trace_otel) - Get Workflow Execution Trace Otel +* [get_workflow_execution_trace_summary](docs/sdks/executions/README.md#get_workflow_execution_trace_summary) - Get Workflow Execution Trace Summary +* [get_workflow_execution_trace_events](docs/sdks/executions/README.md#get_workflow_execution_trace_events) - Get Workflow Execution Trace Events +* [stream](docs/sdks/executions/README.md#stream) - Stream + +#### [Workflows.Metrics](docs/sdks/metrics/README.md) + +* [get_workflow_metrics](docs/sdks/metrics/README.md#get_workflow_metrics) - Get Workflow Metrics + +#### [Workflows.Runs](docs/sdks/runs/README.md) + +* [list_runs](docs/sdks/runs/README.md#list_runs) - List Runs +* [get_run](docs/sdks/runs/README.md#get_run) - Get Run +* [get_run_history](docs/sdks/runs/README.md#get_run_history) - Get Run History + +#### [Workflows.Schedules](docs/sdks/schedules/README.md) + +* [get_schedules](docs/sdks/schedules/README.md#get_schedules) - Get Schedules +* [schedule_workflow](docs/sdks/schedules/README.md#schedule_workflow) - Schedule Workflow +* [unschedule_workflow](docs/sdks/schedules/README.md#unschedule_workflow) - Unschedule Workflow +* [pause_schedule](docs/sdks/schedules/README.md#pause_schedule) - Pause Schedule +* [resume_schedule](docs/sdks/schedules/README.md#resume_schedule) - Resume Schedule +
@@ -582,7 +764,7 @@ The stream is also a [Context Manager][context-manager] and can be used with the underlying connection when the context is exited. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -590,14 +772,9 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.start_stream(inputs=[ - { - "object": "entry", - "type": "function.result", - "tool_call_id": "", - "result": "", - }, - ], stream=True) + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }) with res as event_stream: for event in event_stream: @@ -611,6 +788,33 @@ with Mistral( [context-manager]: https://book.pythontips.com/en/latest/context_managers.html + +## Pagination + +Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the +returned response object will have a `Next` method that can be called to pull down the next group of results. If the +return value of `Next` is `None`, then there are no more pages to be fetched. + +Here's an example of one such pagination call: +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.get_workflows(active_only=False, include_shared=True, limit=50) + + while res is not None: + # Handle items + + res = res.next() + +``` + + ## File uploads @@ -622,7 +826,7 @@ Certain SDK methods accept file objects as part of a request body or multi-part > ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -630,10 +834,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.libraries.documents.upload(library_id="a02150d9-5ee0-4877-b62c-28b1fcdf3b76", file={ - "file_name": "example.file", - "content": open("example.file", "rb"), - }) + res = mistral.audio.transcriptions.complete(model="Model X", diarize=False) # Handle response print(res) @@ -648,8 +849,8 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python -from mistralai import Mistral -from mistralai.utils import BackoffStrategy, RetryConfig +from mistralai.client import Mistral +from mistralai.client.utils import BackoffStrategy, RetryConfig import os @@ -657,18 +858,22 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.models.list(, + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }, RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - # Handle response - print(res) + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) ``` If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python -from mistralai import Mistral -from mistralai.utils import BackoffStrategy, RetryConfig +from mistralai.client import Mistral +from mistralai.client.utils import BackoffStrategy, RetryConfig import os @@ -677,10 +882,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.models.list() + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ - # Handle response - print(res) + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) ``` @@ -688,7 +897,7 @@ with Mistral( ## Error Handling -[`MistralError`](./src/mistralai/models/mistralerror.py) is the base class for all HTTP error responses. It has the following properties: +[`MistralError`](./src/mistralai/client/errors/mistralerror.py) is the base class for all HTTP error responses. It has the following properties: | Property | Type | Description | | ------------------ | ---------------- | --------------------------------------------------------------------------------------- | @@ -701,8 +910,7 @@ with Mistral( ### Example ```python -import mistralai -from mistralai import Mistral, models +from mistralai.client import Mistral, errors import os @@ -712,13 +920,17 @@ with Mistral( res = None try: - res = mistral.models.list() + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ - # Handle response - print(res) + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) - except models.MistralError as e: + except errors.MistralError as e: # The base class for HTTP error responses print(e.message) print(e.status_code) @@ -727,15 +939,15 @@ with Mistral( print(e.raw_response) # Depending on the method different errors may be thrown - if isinstance(e, models.HTTPValidationError): - print(e.data.detail) # Optional[List[mistralai.ValidationError]] + if isinstance(e, errors.HTTPValidationError): + print(e.data.detail) # Optional[List[models.ValidationError]] ``` ### Error Classes **Primary error:** -* [`MistralError`](./src/mistralai/models/mistralerror.py): The base class for HTTP error responses. +* [`MistralError`](./src/mistralai/client/errors/mistralerror.py): The base class for HTTP error responses. -
Less common errors (6) +
Less common errors (7)
@@ -745,9 +957,10 @@ with Mistral( * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out. -**Inherit from [`MistralError`](./src/mistralai/models/mistralerror.py)**: -* [`HTTPValidationError`](./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 47 of 68 methods.* -* [`ResponseValidationError`](./src/mistralai/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute. +**Inherit from [`MistralError`](./src/mistralai/client/errors/mistralerror.py)**: +* [`HTTPValidationError`](./src/mistralai/client/errors/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 116 of 183 methods.* +* [`ObservabilityError`](./src/mistralai/client/errors/observabilityerror.py): Bad Request - Invalid request parameters or data. Applicable to 41 of 183 methods.* +* [`ResponseValidationError`](./src/mistralai/client/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
@@ -768,7 +981,7 @@ You can override the default server globally by passing a server name to the `se #### Example ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -777,10 +990,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.models.list() + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ - # Handle response - print(res) + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) ``` @@ -788,7 +1005,7 @@ with Mistral( The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -797,10 +1014,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.models.list() + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ - # Handle response - print(res) + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) ``` @@ -814,7 +1035,7 @@ This allows you to wrap the client with your own custom logic, such as adding cu For example, you could specify a header for every request that this sdk makes as follows: ```python -from mistralai import Mistral +from mistralai.client import Mistral import httpx http_client = httpx.Client(headers={"x-custom-header": "someValue"}) @@ -823,8 +1044,8 @@ s = Mistral(client=http_client) or you could wrap the client with your own custom logic: ```python -from mistralai import Mistral -from mistralai.httpclient import AsyncHttpClient +from mistralai.client import Mistral +from mistralai.client.httpclient import AsyncHttpClient import httpx class CustomClient(AsyncHttpClient): @@ -899,7 +1120,7 @@ This SDK supports the following security scheme globally: To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example: ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -907,10 +1128,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.models.list() + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ - # Handle response - print(res) + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) ``` @@ -923,7 +1148,7 @@ The `Mistral` class implements the context manager protocol and registers a fina [context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers ```python -from mistralai import Mistral +from mistralai.client import Mistral import os def main(): @@ -950,11 +1175,11 @@ You can setup your SDK to emit debug logs for SDK requests and responses. You can pass your own logger class directly into your SDK. ```python -from mistralai import Mistral +from mistralai.client import Mistral import logging logging.basicConfig(level=logging.DEBUG) -s = Mistral(debug_logger=logging.getLogger("mistralai")) +s = Mistral(debug_logger=logging.getLogger("mistralai.client")) ``` You can also enable a default debug logger by setting an environment variable `MISTRAL_DEBUG` to true. @@ -977,4 +1202,4 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u ## Contributions While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. -We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. \ No newline at end of file +We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. diff --git a/RELEASES.md b/RELEASES.md index b65d9d0c..2f69eacf 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -328,4 +328,314 @@ Based on: ### Generated - [python v1.9.11] . ### Releases -- [PyPI v1.9.11] https://pypi.org/project/mistralai/1.9.11 - . \ No newline at end of file +- [PyPI v1.9.11] https://pypi.org/project/mistralai/1.9.11 - . + +## 2025-12-16 19:44:09 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.606.10 (2.687.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.10.0] . +### Releases +- [PyPI v1.10.0] https://pypi.org/project/mistralai/1.10.0 - . + +## 2026-01-15 18:39:22 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.606.10 (2.687.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.10.1] . +### Releases +- [PyPI v1.10.1] https://pypi.org/project/mistralai/1.10.1 - . + +## 2026-01-22 11:16:25 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.685.0 (2.794.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.11.1] . +### Releases +- [PyPI v1.11.1] https://pypi.org/project/mistralai/1.11.1 - . + +## 2026-02-01 21:20:42 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.685.0 (2.794.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.12.0] . +### Releases +- [PyPI v1.12.0] https://pypi.org/project/mistralai/1.12.0 - . + +## 2026-02-25 17:32:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0b1] . +### Releases +- [PyPI v2.0.0b1] https://pypi.org/project/mistralai/2.0.0b1 - . + +## 2026-02-27 15:12:59 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0rc1] . +### Releases +- [PyPI v2.0.0rc1] https://pypi.org/project/mistralai/2.0.0rc1 - . + +## 2026-03-09 19:22:03 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0] . +### Releases +- [PyPI v2.0.0] https://pypi.org/project/mistralai/2.0.0 - . + +## 2026-03-11 17:15:32 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.1] . +### Releases +- [PyPI v2.0.1] https://pypi.org/project/mistralai/2.0.1 - . + +## 2026-03-13 13:04:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.2] . +### Releases +- [PyPI v2.0.2] https://pypi.org/project/mistralai/2.0.2 - . + +## 2026-03-13 19:33:58 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.3] . +### Releases +- [PyPI v2.0.3] https://pypi.org/project/mistralai/2.0.3 - . + +## 2026-03-16 15:21:10 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.4] . +### Releases +- [PyPI v2.0.4] https://pypi.org/project/mistralai/2.0.4 - . + +## 2026-03-18 15:16:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.5] . +### Releases +- [PyPI v2.0.5] https://pypi.org/project/mistralai/2.0.5 - . + +## 2026-03-20 08:07:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.1.0] . +### Releases +- [PyPI v2.1.0] https://pypi.org/project/mistralai/2.1.0 - . + +## 2026-03-20 12:16:07 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.1.1] . +### Releases +- [PyPI v2.1.1] https://pypi.org/project/mistralai/2.1.1 - . + +## 2026-03-20 14:40:56 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.1.2] . +### Releases +- [PyPI v2.1.2] https://pypi.org/project/mistralai/2.1.2 - . + +## 2026-03-23 14:35:45 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.1.3] . +### Releases +- [PyPI v2.1.3] https://pypi.org/project/mistralai/2.1.3 - . + +## 2026-03-30 14:56:34 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.2.0rc1] . +### Releases +- [PyPI v2.2.0rc1] https://pypi.org/project/mistralai/2.2.0rc1 - . + +## 2026-03-30 15:55:53 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.2.0rc2] . +### Releases +- [PyPI v2.2.0rc2] https://pypi.org/project/mistralai/2.2.0rc2 - . + +## 2026-03-30 17:24:31 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.2.0rc3] . +### Releases +- [PyPI v2.2.0rc3] https://pypi.org/project/mistralai/2.2.0rc3 - . + +## 2026-03-31 11:09:18 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.754.0 (2.862.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.2.0] . +### Releases +- [PyPI v2.2.0] https://pypi.org/project/mistralai/2.2.0 - . + +## 2026-04-03 12:19:06 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.3.0] . +### Releases +- [PyPI v2.3.0] https://pypi.org/project/mistralai/2.3.0 - . + +## 2026-04-07 13:52:53 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.3.1] . +### Releases +- [PyPI v2.3.1] https://pypi.org/project/mistralai/2.3.1 - . + +## 2026-04-10 13:42:26 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.3.2] . +### Releases +- [PyPI v2.3.2] https://pypi.org/project/mistralai/2.3.2 - . + +## 2026-04-14 12:16:24 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.0rc1] . +### Releases +- [PyPI v2.4.0rc1] https://pypi.org/project/mistralai/2.4.0rc1 - . + +## 2026-04-14 15:44:42 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.0rc2] . +### Releases +- [PyPI v2.4.0rc2] https://pypi.org/project/mistralai/2.4.0rc2 - . + +## 2026-04-16 10:13:01 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.0] . +### Releases +- [PyPI v2.4.0] https://pypi.org/project/mistralai/2.4.0 - . + +## 2026-04-21 13:15:47 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.1] . +### Releases +- [PyPI v2.4.1] https://pypi.org/project/mistralai/2.4.1 - . + +## 2026-04-23 14:15:34 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.2] . +### Releases +- [PyPI v2.4.2] https://pypi.org/project/mistralai/2.4.2 - . + +## 2026-04-27 12:18:00 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.3] . +### Releases +- [PyPI v2.4.3] https://pypi.org/project/mistralai/2.4.3 - . + +## 2026-04-30 12:00:09 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.4] . +### Releases +- [PyPI v2.4.4] https://pypi.org/project/mistralai/2.4.4 - . + +## 2026-05-07 11:13:37 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.761.1 (2.879.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.4.5] . +### Releases +- [PyPI v2.4.5] https://pypi.org/project/mistralai/2.4.5 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index b15a88aa..bb01b160 100644 --- a/USAGE.md +++ b/USAGE.md @@ -5,7 +5,7 @@ This example shows how to create chat completions. ```python # Synchronous Example -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -13,24 +13,27 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.chat.complete(model="mistral-small-latest", messages=[ + res = mistral.chat.complete(model="mistral-large-latest", messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], stream=False) + ], stream=False, response_format={ + "type": "text", + }) # Handle response print(res) ``` -
+
The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio -from mistralai import Mistral +from mistralai.client import Mistral import os async def main(): @@ -39,12 +42,14 @@ async def main(): api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = await mistral.chat.complete_async(model="mistral-small-latest", messages=[ + res = await mistral.chat.complete_async(model="mistral-large-latest", messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], stream=False) + ], stream=False, response_format={ + "type": "text", + }) # Handle response print(res) @@ -58,7 +63,7 @@ This example shows how to upload a file. ```python # Synchronous Example -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -69,19 +74,20 @@ with Mistral( res = mistral.files.upload(file={ "file_name": "example.file", "content": open("example.file", "rb"), - }) + }, visibility="workspace") # Handle response print(res) ``` -
+
The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio -from mistralai import Mistral +from mistralai.client import Mistral import os async def main(): @@ -93,7 +99,7 @@ async def main(): res = await mistral.files.upload_async(file={ "file_name": "example.file", "content": open("example.file", "rb"), - }) + }, visibility="workspace") # Handle response print(res) @@ -107,7 +113,7 @@ This example shows how to create agents completions. ```python # Synchronous Example -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -117,22 +123,25 @@ with Mistral( res = mistral.agents.complete(messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], agent_id="", stream=False) + ], agent_id="", stream=False, response_format={ + "type": "text", + }) # Handle response print(res) ``` -
+
The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio -from mistralai import Mistral +from mistralai.client import Mistral import os async def main(): @@ -143,10 +152,12 @@ async def main(): res = await mistral.agents.complete_async(messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], agent_id="", stream=False) + ], agent_id="", stream=False, response_format={ + "type": "text", + }) # Handle response print(res) @@ -156,11 +167,11 @@ asyncio.run(main()) ### Create Embedding Request -This example shows how to create embedding request. +This example shows how to create an embedding request. ```python # Synchronous Example -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -177,13 +188,14 @@ with Mistral( print(res) ``` -
+
The same SDK client can also be used to make asynchronous requests by importing asyncio. + ```python # Asynchronous Example import asyncio -from mistralai import Mistral +from mistralai.client import Mistral import os async def main(): diff --git a/docs/models/httpvalidationerror.md b/docs/errors/httpvalidationerror.md similarity index 100% rename from docs/models/httpvalidationerror.md rename to docs/errors/httpvalidationerror.md diff --git a/docs/errors/observabilityerror.md b/docs/errors/observabilityerror.md new file mode 100644 index 00000000..615552c3 --- /dev/null +++ b/docs/errors/observabilityerror.md @@ -0,0 +1,8 @@ +# ObservabilityError + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `detail` | [models.ObservabilityErrorDetail](../models/observabilityerrordetail.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/activitytaskcompletedattributesresponse.md b/docs/models/activitytaskcompletedattributesresponse.md new file mode 100644 index 00000000..43c92fe2 --- /dev/null +++ b/docs/models/activitytaskcompletedattributesresponse.md @@ -0,0 +1,12 @@ +# ActivityTaskCompletedAttributesResponse + +Attributes for activity task completed events. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the activity task within the workflow. | +| `activity_name` | *str* | :heavy_check_mark: | The registered name of the activity being executed. | +| `result` | [models.JSONPayloadResponse](../models/jsonpayloadresponse.md) | :heavy_check_mark: | A payload containing arbitrary JSON data.

Used for complete state snapshots or final results.
When encrypted, the value field contains base64-encoded encrypted data
and encoding_options indicates the type of encryption applied. | \ No newline at end of file diff --git a/docs/models/activitytaskcompletedresponse.md b/docs/models/activitytaskcompletedresponse.md new file mode 100644 index 00000000..56a64631 --- /dev/null +++ b/docs/models/activitytaskcompletedresponse.md @@ -0,0 +1,20 @@ +# ActivityTaskCompletedResponse + +Emitted when an activity task completes successfully. + +Contains timing information about the successful execution. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["ACTIVITY_TASK_COMPLETED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.ActivityTaskCompletedAttributesResponse](../models/activitytaskcompletedattributesresponse.md) | :heavy_check_mark: | Attributes for activity task completed events. | \ No newline at end of file diff --git a/docs/models/activitytaskfailedattributes.md b/docs/models/activitytaskfailedattributes.md new file mode 100644 index 00000000..5cb9cafe --- /dev/null +++ b/docs/models/activitytaskfailedattributes.md @@ -0,0 +1,13 @@ +# ActivityTaskFailedAttributes + +Attributes for activity task failed events (final failure after all retries). + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the activity task within the workflow. | +| `activity_name` | *str* | :heavy_check_mark: | The registered name of the activity being executed. | +| `attempt` | *int* | :heavy_check_mark: | The final attempt number that failed (1-indexed). | +| `failure` | [models.Failure](../models/failure.md) | :heavy_check_mark: | Represents an error or exception that occurred during execution. | \ No newline at end of file diff --git a/docs/models/activitytaskfailedresponse.md b/docs/models/activitytaskfailedresponse.md new file mode 100644 index 00000000..0853f68d --- /dev/null +++ b/docs/models/activitytaskfailedresponse.md @@ -0,0 +1,20 @@ +# ActivityTaskFailedResponse + +Emitted when an activity task fails after exhausting all retry attempts. + +This is a terminal event indicating the activity could not complete successfully. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["ACTIVITY_TASK_FAILED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.ActivityTaskFailedAttributes](../models/activitytaskfailedattributes.md) | :heavy_check_mark: | Attributes for activity task failed events (final failure after all retries). | \ No newline at end of file diff --git a/docs/models/activitytaskretryingattributes.md b/docs/models/activitytaskretryingattributes.md new file mode 100644 index 00000000..92166076 --- /dev/null +++ b/docs/models/activitytaskretryingattributes.md @@ -0,0 +1,13 @@ +# ActivityTaskRetryingAttributes + +Attributes for activity task retrying events. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the activity task within the workflow. | +| `activity_name` | *str* | :heavy_check_mark: | The registered name of the activity being executed. | +| `attempt` | *int* | :heavy_check_mark: | The attempt number that failed (1-indexed). | +| `failure` | [models.Failure](../models/failure.md) | :heavy_check_mark: | Represents an error or exception that occurred during execution. | \ No newline at end of file diff --git a/docs/models/activitytaskretryingresponse.md b/docs/models/activitytaskretryingresponse.md new file mode 100644 index 00000000..8b7bdd42 --- /dev/null +++ b/docs/models/activitytaskretryingresponse.md @@ -0,0 +1,20 @@ +# ActivityTaskRetryingResponse + +Emitted when an activity task fails and will be retried. + +Contains information about the failed attempt and the error that occurred. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["ACTIVITY_TASK_RETRYING"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.ActivityTaskRetryingAttributes](../models/activitytaskretryingattributes.md) | :heavy_check_mark: | Attributes for activity task retrying events. | \ No newline at end of file diff --git a/docs/models/activitytaskstartedattributesresponse.md b/docs/models/activitytaskstartedattributesresponse.md new file mode 100644 index 00000000..dd97ff85 --- /dev/null +++ b/docs/models/activitytaskstartedattributesresponse.md @@ -0,0 +1,12 @@ +# ActivityTaskStartedAttributesResponse + +Attributes for activity task started events. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the activity task within the workflow. | +| `activity_name` | *str* | :heavy_check_mark: | The registered name of the activity being executed. | +| `input` | [models.JSONPayloadResponse](../models/jsonpayloadresponse.md) | :heavy_check_mark: | A payload containing arbitrary JSON data.

Used for complete state snapshots or final results.
When encrypted, the value field contains base64-encoded encrypted data
and encoding_options indicates the type of encryption applied. | \ No newline at end of file diff --git a/docs/models/activitytaskstartedresponse.md b/docs/models/activitytaskstartedresponse.md new file mode 100644 index 00000000..1aee1533 --- /dev/null +++ b/docs/models/activitytaskstartedresponse.md @@ -0,0 +1,21 @@ +# ActivityTaskStartedResponse + +Emitted when an activity task begins execution. + +This is the first event for an activity, emitted on the first attempt only. +Subsequent retry attempts emit ACTIVITY_TASK_RETRYING instead. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["ACTIVITY_TASK_STARTED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.ActivityTaskStartedAttributesResponse](../models/activitytaskstartedattributesresponse.md) | :heavy_check_mark: | Attributes for activity task started events. | \ No newline at end of file diff --git a/docs/models/agent.md b/docs/models/agent.md index 686fae75..94e8b035 100644 --- a/docs/models/agent.md +++ b/docs/models/agent.md @@ -6,14 +6,20 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | | `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | -| `tools` | List[[models.AgentTools](../models/agenttools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | +| `tools` | List[[models.AgentTool](../models/agenttool.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | | `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | `model` | *str* | :heavy_check_mark: | N/A | | `name` | *str* | :heavy_check_mark: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | -| `object` | [Optional[models.AgentObject]](../models/agentobject.md) | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `object` | *Optional[Literal["agent"]]* | :heavy_minus_sign: | N/A | | `id` | *str* | :heavy_check_mark: | N/A | | `version` | *int* | :heavy_check_mark: | N/A | +| `versions` | List[*int*] | :heavy_check_mark: | N/A | | `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | \ No newline at end of file +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `deployment_chat` | *bool* | :heavy_check_mark: | N/A | +| `source` | *str* | :heavy_check_mark: | N/A | +| `version_message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/agentaliasresponse.md b/docs/models/agentaliasresponse.md new file mode 100644 index 00000000..aa531ec5 --- /dev/null +++ b/docs/models/agentaliasresponse.md @@ -0,0 +1,11 @@ +# AgentAliasResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `alias` | *str* | :heavy_check_mark: | N/A | +| `version` | *int* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentconversation.md b/docs/models/agentconversation.md index 772cc80e..451f6fb8 100644 --- a/docs/models/agentconversation.md +++ b/docs/models/agentconversation.md @@ -3,12 +3,14 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. | -| `object` | [Optional[models.AgentConversationObject]](../models/agentconversationobject.md) | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `agent_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Custom metadata for the conversation. | +| `object` | *Optional[Literal["conversation"]]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `agent_version` | [OptionalNullable[models.AgentConversationAgentVersion]](../models/agentconversationagentversion.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/agentconversationagentversion.md b/docs/models/agentconversationagentversion.md new file mode 100644 index 00000000..668a8dc0 --- /dev/null +++ b/docs/models/agentconversationagentversion.md @@ -0,0 +1,17 @@ +# AgentConversationAgentVersion + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + diff --git a/docs/models/agentconversationobject.md b/docs/models/agentconversationobject.md deleted file mode 100644 index ea7cc75c..00000000 --- a/docs/models/agentconversationobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# AgentConversationObject - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `CONVERSATION` | conversation | \ No newline at end of file diff --git a/docs/models/agentcreationrequest.md b/docs/models/agentcreationrequest.md deleted file mode 100644 index 34060d9a..00000000 --- a/docs/models/agentcreationrequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# AgentCreationRequest - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | -| `tools` | List[[models.AgentCreationRequestTools](../models/agentcreationrequesttools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | -| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | -| `model` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/agentcreationrequesttools.md b/docs/models/agentcreationrequesttools.md deleted file mode 100644 index c2525850..00000000 --- a/docs/models/agentcreationrequesttools.md +++ /dev/null @@ -1,41 +0,0 @@ -# AgentCreationRequestTools - - -## Supported Types - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.FunctionTool` - -```python -value: models.FunctionTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - diff --git a/docs/models/agenthandoffdoneevent.md b/docs/models/agenthandoffdoneevent.md index c0039f41..6bfcc3d8 100644 --- a/docs/models/agenthandoffdoneevent.md +++ b/docs/models/agenthandoffdoneevent.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `type` | [Optional[models.AgentHandoffDoneEventType]](../models/agenthandoffdoneeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `next_agent_id` | *str* | :heavy_check_mark: | N/A | -| `next_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *Literal["agent.handoff.done"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `next_agent_id` | *str* | :heavy_check_mark: | N/A | +| `next_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agenthandoffdoneeventtype.md b/docs/models/agenthandoffdoneeventtype.md deleted file mode 100644 index c864ce43..00000000 --- a/docs/models/agenthandoffdoneeventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# AgentHandoffDoneEventType - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `AGENT_HANDOFF_DONE` | agent.handoff.done | \ No newline at end of file diff --git a/docs/models/agenthandoffentry.md b/docs/models/agenthandoffentry.md index 8831b0eb..2b689ec7 100644 --- a/docs/models/agenthandoffentry.md +++ b/docs/models/agenthandoffentry.md @@ -3,14 +3,14 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `object` | [Optional[models.AgentHandoffEntryObject]](../models/agenthandoffentryobject.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.AgentHandoffEntryType]](../models/agenthandoffentrytype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `previous_agent_id` | *str* | :heavy_check_mark: | N/A | -| `previous_agent_name` | *str* | :heavy_check_mark: | N/A | -| `next_agent_id` | *str* | :heavy_check_mark: | N/A | -| `next_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `object` | *Optional[Literal["entry"]]* | :heavy_minus_sign: | N/A | +| `type` | *Optional[Literal["agent.handoff"]]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `previous_agent_id` | *str* | :heavy_check_mark: | N/A | +| `previous_agent_name` | *str* | :heavy_check_mark: | N/A | +| `next_agent_id` | *str* | :heavy_check_mark: | N/A | +| `next_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agenthandoffentryobject.md b/docs/models/agenthandoffentryobject.md deleted file mode 100644 index 4bb876fb..00000000 --- a/docs/models/agenthandoffentryobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# AgentHandoffEntryObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `ENTRY` | entry | \ No newline at end of file diff --git a/docs/models/agenthandoffentrytype.md b/docs/models/agenthandoffentrytype.md deleted file mode 100644 index 527ebceb..00000000 --- a/docs/models/agenthandoffentrytype.md +++ /dev/null @@ -1,8 +0,0 @@ -# AgentHandoffEntryType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `AGENT_HANDOFF` | agent.handoff | \ No newline at end of file diff --git a/docs/models/agenthandoffstartedevent.md b/docs/models/agenthandoffstartedevent.md index 035cd02a..518b5a0c 100644 --- a/docs/models/agenthandoffstartedevent.md +++ b/docs/models/agenthandoffstartedevent.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `type` | [Optional[models.AgentHandoffStartedEventType]](../models/agenthandoffstartedeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `previous_agent_id` | *str* | :heavy_check_mark: | N/A | -| `previous_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *Literal["agent.handoff.started"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `previous_agent_id` | *str* | :heavy_check_mark: | N/A | +| `previous_agent_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agenthandoffstartedeventtype.md b/docs/models/agenthandoffstartedeventtype.md deleted file mode 100644 index 4ffaff15..00000000 --- a/docs/models/agenthandoffstartedeventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# AgentHandoffStartedEventType - - -## Values - -| Name | Value | -| ----------------------- | ----------------------- | -| `AGENT_HANDOFF_STARTED` | agent.handoff.started | \ No newline at end of file diff --git a/docs/models/agentobject.md b/docs/models/agentobject.md deleted file mode 100644 index 70e143b0..00000000 --- a/docs/models/agentobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# AgentObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `AGENT` | agent | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentscreateorupdatealiasrequest.md b/docs/models/agentsapiv1agentscreateorupdatealiasrequest.md new file mode 100644 index 00000000..79406434 --- /dev/null +++ b/docs/models/agentsapiv1agentscreateorupdatealiasrequest.md @@ -0,0 +1,10 @@ +# AgentsAPIV1AgentsCreateOrUpdateAliasRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `alias` | *str* | :heavy_check_mark: | N/A | +| `version` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentsdeletealiasrequest.md b/docs/models/agentsapiv1agentsdeletealiasrequest.md new file mode 100644 index 00000000..8e95c0c3 --- /dev/null +++ b/docs/models/agentsapiv1agentsdeletealiasrequest.md @@ -0,0 +1,9 @@ +# AgentsAPIV1AgentsDeleteAliasRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `alias` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentsdeleterequest.md b/docs/models/agentsapiv1agentsdeleterequest.md new file mode 100644 index 00000000..2799f418 --- /dev/null +++ b/docs/models/agentsapiv1agentsdeleterequest.md @@ -0,0 +1,8 @@ +# AgentsAPIV1AgentsDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `agent_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentsgetagentversion.md b/docs/models/agentsapiv1agentsgetagentversion.md new file mode 100644 index 00000000..7fb9f2d5 --- /dev/null +++ b/docs/models/agentsapiv1agentsgetagentversion.md @@ -0,0 +1,17 @@ +# AgentsAPIV1AgentsGetAgentVersion + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/agentsapiv1agentsgetrequest.md b/docs/models/agentsapiv1agentsgetrequest.md index b46ac23d..ceffe009 100644 --- a/docs/models/agentsapiv1agentsgetrequest.md +++ b/docs/models/agentsapiv1agentsgetrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `agent_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `agent_version` | [OptionalNullable[models.AgentsAPIV1AgentsGetAgentVersion]](../models/agentsapiv1agentsgetagentversion.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentsgetversionrequest.md b/docs/models/agentsapiv1agentsgetversionrequest.md new file mode 100644 index 00000000..96a73589 --- /dev/null +++ b/docs/models/agentsapiv1agentsgetversionrequest.md @@ -0,0 +1,9 @@ +# AgentsAPIV1AgentsGetVersionRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `version` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentslistrequest.md b/docs/models/agentsapiv1agentslistrequest.md index b5bcee62..4785a54c 100644 --- a/docs/models/agentsapiv1agentslistrequest.md +++ b/docs/models/agentsapiv1agentslistrequest.md @@ -3,7 +3,13 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number (0-indexed) | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of agents per page | +| `deployment_chat` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `sources` | List[[models.RequestSource](../models/requestsource.md)] | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by agent name | +| `search` | *OptionalNullable[str]* | :heavy_minus_sign: | Search agents by name or ID | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentslistversionaliasesrequest.md b/docs/models/agentsapiv1agentslistversionaliasesrequest.md new file mode 100644 index 00000000..3083bf92 --- /dev/null +++ b/docs/models/agentsapiv1agentslistversionaliasesrequest.md @@ -0,0 +1,8 @@ +# AgentsAPIV1AgentsListVersionAliasesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `agent_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentslistversionsrequest.md b/docs/models/agentsapiv1agentslistversionsrequest.md new file mode 100644 index 00000000..91831700 --- /dev/null +++ b/docs/models/agentsapiv1agentslistversionsrequest.md @@ -0,0 +1,10 @@ +# AgentsAPIV1AgentsListVersionsRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number (0-indexed) | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of versions per page | \ No newline at end of file diff --git a/docs/models/agentsapiv1agentsupdaterequest.md b/docs/models/agentsapiv1agentsupdaterequest.md index f60f8e5b..7ef60bec 100644 --- a/docs/models/agentsapiv1agentsupdaterequest.md +++ b/docs/models/agentsapiv1agentsupdaterequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | `agent_id` | *str* | :heavy_check_mark: | N/A | -| `agent_update_request` | [models.AgentUpdateRequest](../models/agentupdaterequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| `update_agent_request` | [models.UpdateAgentRequest](../models/updateagentrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1conversationsdeleterequest.md b/docs/models/agentsapiv1conversationsdeleterequest.md new file mode 100644 index 00000000..c6eed281 --- /dev/null +++ b/docs/models/agentsapiv1conversationsdeleterequest.md @@ -0,0 +1,8 @@ +# AgentsAPIV1ConversationsDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `conversation_id` | *str* | :heavy_check_mark: | ID of the conversation from which we are fetching metadata. | \ No newline at end of file diff --git a/docs/models/agentsapiv1conversationsgetresponsev1conversationsget.md b/docs/models/agentsapiv1conversationsgetresponsev1conversationsget.md deleted file mode 100644 index 4bc836f3..00000000 --- a/docs/models/agentsapiv1conversationsgetresponsev1conversationsget.md +++ /dev/null @@ -1,19 +0,0 @@ -# AgentsAPIV1ConversationsGetResponseV1ConversationsGet - -Successful Response - - -## Supported Types - -### `models.ModelConversation` - -```python -value: models.ModelConversation = /* values here */ -``` - -### `models.AgentConversation` - -```python -value: models.AgentConversation = /* values here */ -``` - diff --git a/docs/models/agentsapiv1conversationslistrequest.md b/docs/models/agentsapiv1conversationslistrequest.md index 528a055a..62c9011f 100644 --- a/docs/models/agentsapiv1conversationslistrequest.md +++ b/docs/models/agentsapiv1conversationslistrequest.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | | `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/agentsapiv1conversationslistresponse.md b/docs/models/agentsapiv1conversationslistresponse.md new file mode 100644 index 00000000..b233ee20 --- /dev/null +++ b/docs/models/agentsapiv1conversationslistresponse.md @@ -0,0 +1,17 @@ +# AgentsAPIV1ConversationsListResponse + + +## Supported Types + +### `models.ModelConversation` + +```python +value: models.ModelConversation = /* values here */ +``` + +### `models.AgentConversation` + +```python +value: models.AgentConversation = /* values here */ +``` + diff --git a/docs/models/agentscompletionrequest.md b/docs/models/agentscompletionrequest.md index 73615ed9..3253fee1 100644 --- a/docs/models/agentscompletionrequest.md +++ b/docs/models/agentscompletionrequest.md @@ -3,20 +3,24 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.AgentsCompletionRequestStop]](../models/agentscompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `messages` | List[[models.AgentsCompletionRequestMessages](../models/agentscompletionrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.AgentsCompletionRequestToolChoice]](../models/agentscompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [OptionalNullable[models.AgentsCompletionRequestStop]](../models/agentscompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.AgentsCompletionRequestMessage](../models/agentscompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.AgentsCompletionRequestTool](../models/agentscompletionrequesttool.md)] | :heavy_minus_sign: | N/A | | +| `tool_choice` | [Optional[models.AgentsCompletionRequestToolChoice]](../models/agentscompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | \ No newline at end of file diff --git a/docs/models/agentscompletionrequestmessage.md b/docs/models/agentscompletionrequestmessage.md new file mode 100644 index 00000000..957703b5 --- /dev/null +++ b/docs/models/agentscompletionrequestmessage.md @@ -0,0 +1,29 @@ +# AgentsCompletionRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/docs/models/agentscompletionrequestmessages.md b/docs/models/agentscompletionrequestmessages.md deleted file mode 100644 index d6a1e691..00000000 --- a/docs/models/agentscompletionrequestmessages.md +++ /dev/null @@ -1,29 +0,0 @@ -# AgentsCompletionRequestMessages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/docs/models/agentscompletionrequesttool.md b/docs/models/agentscompletionrequesttool.md new file mode 100644 index 00000000..c2035866 --- /dev/null +++ b/docs/models/agentscompletionrequesttool.md @@ -0,0 +1,47 @@ +# AgentsCompletionRequestTool + + +## Supported Types + +### `models.Tool` + +```python +value: models.Tool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + diff --git a/docs/models/agentscompletionstreamrequest.md b/docs/models/agentscompletionstreamrequest.md index b0aac6c1..29659238 100644 --- a/docs/models/agentscompletionstreamrequest.md +++ b/docs/models/agentscompletionstreamrequest.md @@ -3,20 +3,24 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.AgentsCompletionStreamRequestStop]](../models/agentscompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `messages` | List[[models.AgentsCompletionStreamRequestMessages](../models/agentscompletionstreamrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.AgentsCompletionStreamRequestToolChoice]](../models/agentscompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [OptionalNullable[models.AgentsCompletionStreamRequestStop]](../models/agentscompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.AgentsCompletionStreamRequestMessage](../models/agentscompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.AgentsCompletionStreamRequestTool](../models/agentscompletionstreamrequesttool.md)] | :heavy_minus_sign: | N/A | | +| `tool_choice` | [Optional[models.AgentsCompletionStreamRequestToolChoice]](../models/agentscompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | \ No newline at end of file diff --git a/docs/models/agentscompletionstreamrequestmessage.md b/docs/models/agentscompletionstreamrequestmessage.md new file mode 100644 index 00000000..6ccf4244 --- /dev/null +++ b/docs/models/agentscompletionstreamrequestmessage.md @@ -0,0 +1,29 @@ +# AgentsCompletionStreamRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/docs/models/agentscompletionstreamrequestmessages.md b/docs/models/agentscompletionstreamrequestmessages.md deleted file mode 100644 index 1bc736af..00000000 --- a/docs/models/agentscompletionstreamrequestmessages.md +++ /dev/null @@ -1,29 +0,0 @@ -# AgentsCompletionStreamRequestMessages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/docs/models/agentscompletionstreamrequesttool.md b/docs/models/agentscompletionstreamrequesttool.md new file mode 100644 index 00000000..6a11b042 --- /dev/null +++ b/docs/models/agentscompletionstreamrequesttool.md @@ -0,0 +1,47 @@ +# AgentsCompletionStreamRequestTool + + +## Supported Types + +### `models.Tool` + +```python +value: models.Tool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + diff --git a/docs/models/agenttool.md b/docs/models/agenttool.md new file mode 100644 index 00000000..0722e955 --- /dev/null +++ b/docs/models/agenttool.md @@ -0,0 +1,47 @@ +# AgentTool + + +## Supported Types + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.FunctionTool` + +```python +value: models.FunctionTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + diff --git a/docs/models/agenttools.md b/docs/models/agenttools.md deleted file mode 100644 index 15891f56..00000000 --- a/docs/models/agenttools.md +++ /dev/null @@ -1,41 +0,0 @@ -# AgentTools - - -## Supported Types - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.FunctionTool` - -```python -value: models.FunctionTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - diff --git a/docs/models/agentupdaterequest.md b/docs/models/agentupdaterequest.md deleted file mode 100644 index 9da03d03..00000000 --- a/docs/models/agentupdaterequest.md +++ /dev/null @@ -1,14 +0,0 @@ -# AgentUpdateRequest - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | -| `tools` | List[[models.AgentUpdateRequestTools](../models/agentupdaterequesttools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | -| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/agentupdaterequesttools.md b/docs/models/agentupdaterequesttools.md deleted file mode 100644 index 1752ee68..00000000 --- a/docs/models/agentupdaterequesttools.md +++ /dev/null @@ -1,41 +0,0 @@ -# AgentUpdateRequestTools - - -## Supported Types - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.FunctionTool` - -```python -value: models.FunctionTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - diff --git a/docs/models/and_.md b/docs/models/and_.md new file mode 100644 index 00000000..591b7bb3 --- /dev/null +++ b/docs/models/and_.md @@ -0,0 +1,17 @@ +# And + + +## Supported Types + +### `models.FilterGroup` + +```python +value: models.FilterGroup = /* values here */ +``` + +### `models.FilterCondition` + +```python +value: models.FilterCondition = /* values here */ +``` + diff --git a/docs/models/annotations.md b/docs/models/annotations.md new file mode 100644 index 00000000..2a23157c --- /dev/null +++ b/docs/models/annotations.md @@ -0,0 +1,10 @@ +# Annotations + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `audience` | List[[models.Audience](../models/audience.md)] | :heavy_minus_sign: | N/A | +| `priority` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/answer.md b/docs/models/answer.md new file mode 100644 index 00000000..324a8e4e --- /dev/null +++ b/docs/models/answer.md @@ -0,0 +1,17 @@ +# Answer + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/apiendpoint.md b/docs/models/apiendpoint.md index 8d83a26f..e049d40a 100644 --- a/docs/models/apiendpoint.md +++ b/docs/models/apiendpoint.md @@ -1,17 +1,26 @@ # APIEndpoint +## Example Usage + +```python +from mistralai.client.models import APIEndpoint + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: APIEndpoint = "/v1/chat/completions" +``` + ## Values -| Name | Value | -| ------------------------------ | ------------------------------ | -| `ROOT_V1_CHAT_COMPLETIONS` | /v1/chat/completions | -| `ROOT_V1_EMBEDDINGS` | /v1/embeddings | -| `ROOT_V1_FIM_COMPLETIONS` | /v1/fim/completions | -| `ROOT_V1_MODERATIONS` | /v1/moderations | -| `ROOT_V1_CHAT_MODERATIONS` | /v1/chat/moderations | -| `ROOT_V1_OCR` | /v1/ocr | -| `ROOT_V1_CLASSIFICATIONS` | /v1/classifications | -| `ROOT_V1_CHAT_CLASSIFICATIONS` | /v1/chat/classifications | -| `ROOT_V1_CONVERSATIONS` | /v1/conversations | -| `ROOT_V1_AUDIO_TRANSCRIPTIONS` | /v1/audio/transcriptions | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"/v1/chat/completions"` +- `"/v1/embeddings"` +- `"/v1/fim/completions"` +- `"/v1/moderations"` +- `"/v1/chat/moderations"` +- `"/v1/ocr"` +- `"/v1/classifications"` +- `"/v1/chat/classifications"` +- `"/v1/conversations"` +- `"/v1/audio/transcriptions"` diff --git a/docs/models/apikeyauth.md b/docs/models/apikeyauth.md new file mode 100644 index 00000000..1fbff10e --- /dev/null +++ b/docs/models/apikeyauth.md @@ -0,0 +1,9 @@ +# APIKeyAuth + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `type` | *Literal["api-key"]* | :heavy_check_mark: | N/A | +| `value` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/archiveftmodelout.md b/docs/models/archiveftmodelout.md deleted file mode 100644 index 46a9e755..00000000 --- a/docs/models/archiveftmodelout.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArchiveFTModelOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `object` | [Optional[models.ArchiveFTModelOutObject]](../models/archiveftmodeloutobject.md) | :heavy_minus_sign: | N/A | -| `archived` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/archiveftmodeloutobject.md b/docs/models/archiveftmodeloutobject.md deleted file mode 100644 index f6f46889..00000000 --- a/docs/models/archiveftmodeloutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# ArchiveFTModelOutObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `MODEL` | model | \ No newline at end of file diff --git a/docs/models/archivemodelresponse.md b/docs/models/archivemodelresponse.md new file mode 100644 index 00000000..276656d1 --- /dev/null +++ b/docs/models/archivemodelresponse.md @@ -0,0 +1,10 @@ +# ArchiveModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `object` | *Optional[Literal["model"]]* | :heavy_minus_sign: | N/A | +| `archived` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/archiveworkflowv1workflowsworkflowidentifierarchiveputrequest.md b/docs/models/archiveworkflowv1workflowsworkflowidentifierarchiveputrequest.md new file mode 100644 index 00000000..6ebe540a --- /dev/null +++ b/docs/models/archiveworkflowv1workflowsworkflowidentifierarchiveputrequest.md @@ -0,0 +1,8 @@ +# ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/assistantmessage.md b/docs/models/assistantmessage.md index 3d0bd90b..9ef63837 100644 --- a/docs/models/assistantmessage.md +++ b/docs/models/assistantmessage.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `role` | *Optional[Literal["assistant"]]* | :heavy_minus_sign: | N/A | | `content` | [OptionalNullable[models.AssistantMessageContent]](../models/assistantmessagecontent.md) | :heavy_minus_sign: | N/A | | `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | -| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | -| `role` | [Optional[models.AssistantMessageRole]](../models/assistantmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | \ No newline at end of file diff --git a/docs/models/assistantmessagerole.md b/docs/models/assistantmessagerole.md deleted file mode 100644 index 658229e7..00000000 --- a/docs/models/assistantmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# AssistantMessageRole - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ASSISTANT` | assistant | \ No newline at end of file diff --git a/docs/models/attributes.md b/docs/models/attributes.md new file mode 100644 index 00000000..147708d9 --- /dev/null +++ b/docs/models/attributes.md @@ -0,0 +1,59 @@ +# Attributes + + +## Supported Types + +### `bool` + +```python +value: bool = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + +### `datetime` + +```python +value: datetime = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + +### `List[int]` + +```python +value: List[int] = /* values here */ +``` + +### `List[float]` + +```python +value: List[float] = /* values here */ +``` + +### `List[bool]` + +```python +value: List[bool] = /* values here */ +``` + diff --git a/docs/models/audience.md b/docs/models/audience.md new file mode 100644 index 00000000..186d913e --- /dev/null +++ b/docs/models/audience.md @@ -0,0 +1,18 @@ +# Audience + +## Example Usage + +```python +from mistralai.client.models import Audience + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Audience = "user" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"user"` +- `"assistant"` diff --git a/docs/models/audiochunk.md b/docs/models/audiochunk.md index c443e7ad..1ba8b0f5 100644 --- a/docs/models/audiochunk.md +++ b/docs/models/audiochunk.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `input_audio` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.AudioChunkType]](../models/audiochunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `type` | *Literal["input_audio"]* | :heavy_check_mark: | N/A | +| `input_audio` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/audiochunktype.md b/docs/models/audiochunktype.md deleted file mode 100644 index 46ebf372..00000000 --- a/docs/models/audiochunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# AudioChunkType - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `INPUT_AUDIO` | input_audio | \ No newline at end of file diff --git a/docs/models/audiocontent.md b/docs/models/audiocontent.md new file mode 100644 index 00000000..64ab6d26 --- /dev/null +++ b/docs/models/audiocontent.md @@ -0,0 +1,15 @@ +# AudioContent + +Audio content for a message. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | *Literal["audio"]* | :heavy_check_mark: | N/A | +| `data` | *str* | :heavy_check_mark: | N/A | +| `mime_type` | *str* | :heavy_check_mark: | N/A | +| `annotations` | [OptionalNullable[models.Annotations]](../models/annotations.md) | :heavy_minus_sign: | N/A | +| `meta` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/audioencoding.md b/docs/models/audioencoding.md new file mode 100644 index 00000000..34b80490 --- /dev/null +++ b/docs/models/audioencoding.md @@ -0,0 +1,22 @@ +# AudioEncoding + +## Example Usage + +```python +from mistralai.client.models import AudioEncoding + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: AudioEncoding = "pcm_s16le" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"pcm_s16le"` +- `"pcm_s32le"` +- `"pcm_f16le"` +- `"pcm_f32le"` +- `"pcm_mulaw"` +- `"pcm_alaw"` diff --git a/docs/models/audioformat.md b/docs/models/audioformat.md new file mode 100644 index 00000000..d174ab99 --- /dev/null +++ b/docs/models/audioformat.md @@ -0,0 +1,9 @@ +# AudioFormat + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `encoding` | [models.AudioEncoding](../models/audioencoding.md) | :heavy_check_mark: | N/A | +| `sample_rate` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/audiotranscriptionrequest.md b/docs/models/audiotranscriptionrequest.md index e876de18..80bd5301 100644 --- a/docs/models/audiotranscriptionrequest.md +++ b/docs/models/audiotranscriptionrequest.md @@ -3,13 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | N/A | -| `file` | [Optional[models.File]](../models/file.md) | :heavy_minus_sign: | N/A | -| `file_url` | *OptionalNullable[str]* | :heavy_minus_sign: | Url of a file to be transcribed | -| `file_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of a file uploaded to /v1/files | -| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | Language of the audio, e.g. 'en'. Providing the language can boost accuracy. | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `stream` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | -| `timestamp_granularities` | List[[models.TimestampGranularity](../models/timestampgranularity.md)] | :heavy_minus_sign: | Granularities of timestamps to include in the response. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to be used. | **Example 1:** voxtral-mini-latest
**Example 2:** voxtral-mini-2507 | +| `file` | [Optional[models.File]](../models/file.md) | :heavy_minus_sign: | N/A | | +| `file_url` | *OptionalNullable[str]* | :heavy_minus_sign: | Url of a file to be transcribed | | +| `file_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of a file uploaded to /v1/files | | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | Language of the audio, e.g. 'en'. Providing the language can boost accuracy. | | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | +| `stream` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | | +| `diarize` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `context_bias` | List[*str*] | :heavy_minus_sign: | N/A | | +| `timestamp_granularities` | List[[models.TimestampGranularity](../models/timestampgranularity.md)] | :heavy_minus_sign: | Granularities of timestamps to include in the response. | | \ No newline at end of file diff --git a/docs/models/audiotranscriptionrequeststream.md b/docs/models/audiotranscriptionrequeststream.md index 975e437a..5d64964d 100644 --- a/docs/models/audiotranscriptionrequeststream.md +++ b/docs/models/audiotranscriptionrequeststream.md @@ -12,4 +12,6 @@ | `language` | *OptionalNullable[str]* | :heavy_minus_sign: | Language of the audio, e.g. 'en'. Providing the language can boost accuracy. | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `stream` | *Optional[Literal[True]]* | :heavy_minus_sign: | N/A | +| `diarize` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `context_bias` | List[*str*] | :heavy_minus_sign: | N/A | | `timestamp_granularities` | List[[models.TimestampGranularity](../models/timestampgranularity.md)] | :heavy_minus_sign: | Granularities of timestamps to include in the response. | \ No newline at end of file diff --git a/docs/models/authdata.md b/docs/models/authdata.md new file mode 100644 index 00000000..d0784e66 --- /dev/null +++ b/docs/models/authdata.md @@ -0,0 +1,9 @@ +# AuthData + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `client_id` | *str* | :heavy_check_mark: | N/A | +| `client_secret` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/authenticationconfiguration.md b/docs/models/authenticationconfiguration.md new file mode 100644 index 00000000..6644875e --- /dev/null +++ b/docs/models/authenticationconfiguration.md @@ -0,0 +1,10 @@ +# AuthenticationConfiguration + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `authentication_type` | [models.OutboundAuthenticationType](../models/outboundauthenticationtype.md) | :heavy_check_mark: | N/A | +| `is_default` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/authorization.md b/docs/models/authorization.md new file mode 100644 index 00000000..11ea5c6a --- /dev/null +++ b/docs/models/authorization.md @@ -0,0 +1,17 @@ +# Authorization + + +## Supported Types + +### `models.APIKeyAuth` + +```python +value: models.APIKeyAuth = /* values here */ +``` + +### `models.OAuth2TokenAuth` + +```python +value: models.OAuth2TokenAuth = /* values here */ +``` + diff --git a/docs/models/authurlresponse.md b/docs/models/authurlresponse.md new file mode 100644 index 00000000..f8401a8e --- /dev/null +++ b/docs/models/authurlresponse.md @@ -0,0 +1,9 @@ +# AuthURLResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `auth_url` | *str* | :heavy_check_mark: | N/A | +| `ttl` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/basefielddefinition.md b/docs/models/basefielddefinition.md new file mode 100644 index 00000000..3d721d91 --- /dev/null +++ b/docs/models/basefielddefinition.md @@ -0,0 +1,12 @@ +# BaseFieldDefinition + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `label` | *str* | :heavy_check_mark: | N/A | +| `type` | [models.BaseFieldDefinitionType](../models/basefielddefinitiontype.md) | :heavy_check_mark: | N/A | +| `group` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `supported_operators` | List[[models.SupportedOperator](../models/supportedoperator.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/basefielddefinitiontype.md b/docs/models/basefielddefinitiontype.md new file mode 100644 index 00000000..355242b9 --- /dev/null +++ b/docs/models/basefielddefinitiontype.md @@ -0,0 +1,24 @@ +# BaseFieldDefinitionType + +## Example Usage + +```python +from mistralai.client.models import BaseFieldDefinitionType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BaseFieldDefinitionType = "ENUM" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"ENUM"` +- `"TEXT"` +- `"INT"` +- `"FLOAT"` +- `"BOOL"` +- `"TIMESTAMP"` +- `"ARRAY"` +- `"MAP"` diff --git a/docs/models/basemodelcard.md b/docs/models/basemodelcard.md index 58ad5e25..2a5e7515 100644 --- a/docs/models/basemodelcard.md +++ b/docs/models/basemodelcard.md @@ -3,18 +3,18 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `object` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `created` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `owned_by` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `capabilities` | [models.ModelCapabilities](../models/modelcapabilities.md) | :heavy_check_mark: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `aliases` | List[*str*] | :heavy_minus_sign: | N/A | -| `deprecation` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `deprecation_replacement_model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `default_model_temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.BaseModelCardType]](../models/basemodelcardtype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `object` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `created` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `owned_by` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `capabilities` | [models.ModelCapabilities](../models/modelcapabilities.md) | :heavy_check_mark: | This is populated by Harmattan, but some fields have a name
that we don't want to expose in the API. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `aliases` | List[*str*] | :heavy_minus_sign: | N/A | +| `deprecation` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `deprecation_replacement_model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `default_model_temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `type` | *Literal["base"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/basemodelcardtype.md b/docs/models/basemodelcardtype.md deleted file mode 100644 index 4a40ce76..00000000 --- a/docs/models/basemodelcardtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# BaseModelCardType - - -## Values - -| Name | Value | -| ------ | ------ | -| `BASE` | base | \ No newline at end of file diff --git a/docs/models/basetaskstatus.md b/docs/models/basetaskstatus.md new file mode 100644 index 00000000..bb781fd1 --- /dev/null +++ b/docs/models/basetaskstatus.md @@ -0,0 +1,24 @@ +# BaseTaskStatus + +## Example Usage + +```python +from mistralai.client.models import BaseTaskStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BaseTaskStatus = "RUNNING" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"RUNNING"` +- `"COMPLETED"` +- `"FAILED"` +- `"CANCELED"` +- `"TERMINATED"` +- `"CONTINUED_AS_NEW"` +- `"TIMED_OUT"` +- `"UNKNOWN"` diff --git a/docs/models/batchexecutionbody.md b/docs/models/batchexecutionbody.md new file mode 100644 index 00000000..9c31e334 --- /dev/null +++ b/docs/models/batchexecutionbody.md @@ -0,0 +1,8 @@ +# BatchExecutionBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `execution_ids` | List[*str*] | :heavy_check_mark: | List of execution IDs to process | \ No newline at end of file diff --git a/docs/models/batchexecutionresponse.md b/docs/models/batchexecutionresponse.md new file mode 100644 index 00000000..394b6d86 --- /dev/null +++ b/docs/models/batchexecutionresponse.md @@ -0,0 +1,8 @@ +# BatchExecutionResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `results` | Dict[str, [models.BatchExecutionResult](../models/batchexecutionresult.md)] | :heavy_minus_sign: | Mapping of execution_id to result with status and optional error message | \ No newline at end of file diff --git a/docs/models/batchexecutionresult.md b/docs/models/batchexecutionresult.md new file mode 100644 index 00000000..57107bba --- /dev/null +++ b/docs/models/batchexecutionresult.md @@ -0,0 +1,9 @@ +# BatchExecutionResult + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `status` | *str* | :heavy_check_mark: | Status of the operation (success/failure) | +| `error` | *OptionalNullable[str]* | :heavy_minus_sign: | Error message if operation failed | \ No newline at end of file diff --git a/docs/models/batchjob.md b/docs/models/batchjob.md new file mode 100644 index 00000000..162e2cff --- /dev/null +++ b/docs/models/batchjob.md @@ -0,0 +1,26 @@ +# BatchJob + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `object` | *Optional[Literal["batch"]]* | :heavy_minus_sign: | N/A | +| `input_files` | List[*str*] | :heavy_check_mark: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `endpoint` | *str* | :heavy_check_mark: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `output_file` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `error_file` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `errors` | List[[models.BatchError](../models/batcherror.md)] | :heavy_check_mark: | N/A | +| `outputs` | List[Dict[str, *Any*]] | :heavy_minus_sign: | N/A | +| `status` | [models.BatchJobStatus](../models/batchjobstatus.md) | :heavy_check_mark: | N/A | +| `created_at` | *int* | :heavy_check_mark: | N/A | +| `total_requests` | *int* | :heavy_check_mark: | N/A | +| `completed_requests` | *int* | :heavy_check_mark: | N/A | +| `succeeded_requests` | *int* | :heavy_check_mark: | N/A | +| `failed_requests` | *int* | :heavy_check_mark: | N/A | +| `started_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `completed_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/batchjobin.md b/docs/models/batchjobin.md deleted file mode 100644 index b5b13786..00000000 --- a/docs/models/batchjobin.md +++ /dev/null @@ -1,13 +0,0 @@ -# BatchJobIn - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `input_files` | List[*str*] | :heavy_check_mark: | N/A | -| `endpoint` | [models.APIEndpoint](../models/apiendpoint.md) | :heavy_check_mark: | N/A | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A | -| `timeout_hours` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/batchjobout.md b/docs/models/batchjobout.md deleted file mode 100644 index b66fff08..00000000 --- a/docs/models/batchjobout.md +++ /dev/null @@ -1,25 +0,0 @@ -# BatchJobOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `object` | [Optional[models.BatchJobOutObject]](../models/batchjoboutobject.md) | :heavy_minus_sign: | N/A | -| `input_files` | List[*str*] | :heavy_check_mark: | N/A | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | -| `endpoint` | *str* | :heavy_check_mark: | N/A | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `output_file` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `error_file` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `errors` | List[[models.BatchError](../models/batcherror.md)] | :heavy_check_mark: | N/A | -| `status` | [models.BatchJobStatus](../models/batchjobstatus.md) | :heavy_check_mark: | N/A | -| `created_at` | *int* | :heavy_check_mark: | N/A | -| `total_requests` | *int* | :heavy_check_mark: | N/A | -| `completed_requests` | *int* | :heavy_check_mark: | N/A | -| `succeeded_requests` | *int* | :heavy_check_mark: | N/A | -| `failed_requests` | *int* | :heavy_check_mark: | N/A | -| `started_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `completed_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/batchjoboutobject.md b/docs/models/batchjoboutobject.md deleted file mode 100644 index 64ae8965..00000000 --- a/docs/models/batchjoboutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# BatchJobOutObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `BATCH` | batch | \ No newline at end of file diff --git a/docs/models/batchjobsout.md b/docs/models/batchjobsout.md deleted file mode 100644 index a76cfdcc..00000000 --- a/docs/models/batchjobsout.md +++ /dev/null @@ -1,10 +0,0 @@ -# BatchJobsOut - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `data` | List[[models.BatchJobOut](../models/batchjobout.md)] | :heavy_minus_sign: | N/A | -| `object` | [Optional[models.BatchJobsOutObject]](../models/batchjobsoutobject.md) | :heavy_minus_sign: | N/A | -| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/batchjobsoutobject.md b/docs/models/batchjobsoutobject.md deleted file mode 100644 index d4bf9f65..00000000 --- a/docs/models/batchjobsoutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# BatchJobsOutObject - - -## Values - -| Name | Value | -| ------ | ------ | -| `LIST` | list | \ No newline at end of file diff --git a/docs/models/batchjobstatus.md b/docs/models/batchjobstatus.md index 64617b31..7473cb1f 100644 --- a/docs/models/batchjobstatus.md +++ b/docs/models/batchjobstatus.md @@ -1,14 +1,23 @@ # BatchJobStatus +## Example Usage + +```python +from mistralai.client.models import BatchJobStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BatchJobStatus = "QUEUED" +``` + ## Values -| Name | Value | -| ------------------------ | ------------------------ | -| `QUEUED` | QUEUED | -| `RUNNING` | RUNNING | -| `SUCCESS` | SUCCESS | -| `FAILED` | FAILED | -| `TIMEOUT_EXCEEDED` | TIMEOUT_EXCEEDED | -| `CANCELLATION_REQUESTED` | CANCELLATION_REQUESTED | -| `CANCELLED` | CANCELLED | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"QUEUED"` +- `"RUNNING"` +- `"SUCCESS"` +- `"FAILED"` +- `"TIMEOUT_EXCEEDED"` +- `"CANCELLATION_REQUESTED"` +- `"CANCELLED"` diff --git a/docs/models/batchrequest.md b/docs/models/batchrequest.md new file mode 100644 index 00000000..6ee3b394 --- /dev/null +++ b/docs/models/batchrequest.md @@ -0,0 +1,9 @@ +# BatchRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `custom_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `body` | Dict[str, *Any*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/blobresourcecontents.md b/docs/models/blobresourcecontents.md new file mode 100644 index 00000000..c862e537 --- /dev/null +++ b/docs/models/blobresourcecontents.md @@ -0,0 +1,14 @@ +# BlobResourceContents + +Binary contents of a resource. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `uri` | *str* | :heavy_check_mark: | N/A | +| `mime_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `meta` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `blob` | *str* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/builtinconnectors.md b/docs/models/builtinconnectors.md index f96f5044..11dfd48a 100644 --- a/docs/models/builtinconnectors.md +++ b/docs/models/builtinconnectors.md @@ -1,12 +1,21 @@ # BuiltInConnectors +## Example Usage + +```python +from mistralai.client.models import BuiltInConnectors + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: BuiltInConnectors = "web_search" +``` + ## Values -| Name | Value | -| -------------------- | -------------------- | -| `WEB_SEARCH` | web_search | -| `WEB_SEARCH_PREMIUM` | web_search_premium | -| `CODE_INTERPRETER` | code_interpreter | -| `IMAGE_GENERATION` | image_generation | -| `DOCUMENT_LIBRARY` | document_library | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"web_search"` +- `"web_search_premium"` +- `"code_interpreter"` +- `"image_generation"` +- `"document_library"` diff --git a/docs/models/campaign.md b/docs/models/campaign.md new file mode 100644 index 00000000..1f2a7a36 --- /dev/null +++ b/docs/models/campaign.md @@ -0,0 +1,18 @@ +# Campaign + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `deleted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `owner_id` | *str* | :heavy_check_mark: | N/A | +| `workspace_id` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `max_nb_events` | *int* | :heavy_check_mark: | N/A | +| `search_params` | [models.FilterPayload](../models/filterpayload.md) | :heavy_check_mark: | N/A | +| `judge` | [models.Judge](../models/judge.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/cancelworkflowexecutionv1workflowsexecutionsexecutionidcancelpostrequest.md b/docs/models/cancelworkflowexecutionv1workflowsexecutionsexecutionidcancelpostrequest.md new file mode 100644 index 00000000..4968d664 --- /dev/null +++ b/docs/models/cancelworkflowexecutionv1workflowsexecutionsexecutionidcancelpostrequest.md @@ -0,0 +1,8 @@ +# CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `execution_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatclassificationrequest.md b/docs/models/chatclassificationrequest.md index 910d62ae..ba9c95ea 100644 --- a/docs/models/chatclassificationrequest.md +++ b/docs/models/chatclassificationrequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `model` | *str* | :heavy_check_mark: | N/A | -| `inputs` | [models.Inputs](../models/inputs.md) | :heavy_check_mark: | Chat to classify | \ No newline at end of file +| `input` | [models.Inputs](../models/inputs.md) | :heavy_check_mark: | Chat to classify | \ No newline at end of file diff --git a/docs/models/chatcompletionchoice.md b/docs/models/chatcompletionchoice.md index d77d286e..79d24a33 100644 --- a/docs/models/chatcompletionchoice.md +++ b/docs/models/chatcompletionchoice.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `index` | *int* | :heavy_check_mark: | N/A | 0 | -| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | | -| `finish_reason` | [models.FinishReason](../models/finishreason.md) | :heavy_check_mark: | N/A | stop | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `index` | *int* | :heavy_check_mark: | N/A | 0 | +| `message` | [Optional[models.AssistantMessage]](../models/assistantmessage.md) | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.DeltaMessage](../models/deltamessage.md)] | :heavy_minus_sign: | N/A | | +| `finish_reason` | [models.ChatCompletionChoiceFinishReason](../models/chatcompletionchoicefinishreason.md) | :heavy_check_mark: | N/A | stop | \ No newline at end of file diff --git a/docs/models/chatcompletionchoicefinishreason.md b/docs/models/chatcompletionchoicefinishreason.md new file mode 100644 index 00000000..c2892726 --- /dev/null +++ b/docs/models/chatcompletionchoicefinishreason.md @@ -0,0 +1,21 @@ +# ChatCompletionChoiceFinishReason + +## Example Usage + +```python +from mistralai.client.models import ChatCompletionChoiceFinishReason + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ChatCompletionChoiceFinishReason = "stop" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"stop"` +- `"length"` +- `"model_length"` +- `"error"` +- `"tool_calls"` diff --git a/docs/models/chatcompletionevent.md b/docs/models/chatcompletionevent.md new file mode 100644 index 00000000..500192f6 --- /dev/null +++ b/docs/models/chatcompletionevent.md @@ -0,0 +1,18 @@ +# ChatCompletionEvent + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | N/A | +| `correlation_id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `extra_fields` | Dict[str, [Nullable[models.ChatCompletionEventExtraFields]](../models/chatcompletioneventextrafields.md)] | :heavy_check_mark: | N/A | +| `nb_input_tokens` | *int* | :heavy_check_mark: | N/A | +| `nb_output_tokens` | *int* | :heavy_check_mark: | N/A | +| `enabled_tools` | List[Dict[str, *Any*]] | :heavy_check_mark: | N/A | +| `request_messages` | List[Dict[str, *Any*]] | :heavy_check_mark: | N/A | +| `response_messages` | List[Dict[str, *Any*]] | :heavy_check_mark: | N/A | +| `nb_messages` | *int* | :heavy_check_mark: | N/A | +| `chat_transcription_events` | List[[models.ChatTranscriptionEvent](../models/chattranscriptionevent.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatcompletioneventextrafields.md b/docs/models/chatcompletioneventextrafields.md new file mode 100644 index 00000000..d63b251d --- /dev/null +++ b/docs/models/chatcompletioneventextrafields.md @@ -0,0 +1,47 @@ +# ChatCompletionEventExtraFields + + +## Supported Types + +### `bool` + +```python +value: bool = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + +### `datetime` + +```python +value: datetime = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + +### `Dict[str, str]` + +```python +value: Dict[str, str] = /* values here */ +``` + diff --git a/docs/models/chatcompletioneventpreview.md b/docs/models/chatcompletioneventpreview.md new file mode 100644 index 00000000..855e8ab0 --- /dev/null +++ b/docs/models/chatcompletioneventpreview.md @@ -0,0 +1,13 @@ +# ChatCompletionEventPreview + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | N/A | +| `correlation_id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `extra_fields` | Dict[str, [Nullable[models.ChatCompletionEventPreviewExtraFields]](../models/chatcompletioneventpreviewextrafields.md)] | :heavy_check_mark: | N/A | +| `nb_input_tokens` | *int* | :heavy_check_mark: | N/A | +| `nb_output_tokens` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatcompletioneventpreviewextrafields.md b/docs/models/chatcompletioneventpreviewextrafields.md new file mode 100644 index 00000000..5bcec6a0 --- /dev/null +++ b/docs/models/chatcompletioneventpreviewextrafields.md @@ -0,0 +1,47 @@ +# ChatCompletionEventPreviewExtraFields + + +## Supported Types + +### `bool` + +```python +value: bool = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + +### `datetime` + +```python +value: datetime = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + +### `Dict[str, str]` + +```python +value: Dict[str, str] = /* values here */ +``` + diff --git a/docs/models/chatcompletionrequest.md b/docs/models/chatcompletionrequest.md index a9806a4d..4f98ef96 100644 --- a/docs/models/chatcompletionrequest.md +++ b/docs/models/chatcompletionrequest.md @@ -3,23 +3,27 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. | mistral-small-latest | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.Stop]](../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `messages` | List[[models.Messages](../models/messages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](https://docs.mistral.ai/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](https://docs.mistral.ai/models) for model descriptions. | mistral-large-latest | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [OptionalNullable[models.ChatCompletionRequestStop]](../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.ChatCompletionRequestMessage](../models/chatcompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.ChatCompletionRequestTool](../models/chatcompletionrequesttool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file diff --git a/docs/models/chatcompletionrequestmessage.md b/docs/models/chatcompletionrequestmessage.md new file mode 100644 index 00000000..91e9e062 --- /dev/null +++ b/docs/models/chatcompletionrequestmessage.md @@ -0,0 +1,29 @@ +# ChatCompletionRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/packages/mistralai_azure/docs/models/chatcompletionrequeststop.md b/docs/models/chatcompletionrequeststop.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionrequeststop.md rename to docs/models/chatcompletionrequeststop.md diff --git a/docs/models/chatcompletionrequesttool.md b/docs/models/chatcompletionrequesttool.md new file mode 100644 index 00000000..572d12ca --- /dev/null +++ b/docs/models/chatcompletionrequesttool.md @@ -0,0 +1,47 @@ +# ChatCompletionRequestTool + + +## Supported Types + +### `models.Tool` + +```python +value: models.Tool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + diff --git a/docs/models/chatcompletionrequesttoolchoice.md b/docs/models/chatcompletionrequesttoolchoice.md index 1646528d..dc82a8ef 100644 --- a/docs/models/chatcompletionrequesttoolchoice.md +++ b/docs/models/chatcompletionrequesttoolchoice.md @@ -1,5 +1,7 @@ # ChatCompletionRequestToolChoice +Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + ## Supported Types diff --git a/docs/models/chatcompletionstreamrequest.md b/docs/models/chatcompletionstreamrequest.md index 6faeb411..6409f474 100644 --- a/docs/models/chatcompletionstreamrequest.md +++ b/docs/models/chatcompletionstreamrequest.md @@ -3,23 +3,27 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. | mistral-small-latest | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.ChatCompletionStreamRequestStop]](../models/chatcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `messages` | List[[models.ChatCompletionStreamRequestMessages](../models/chatcompletionstreamrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](https://docs.mistral.ai/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](https://docs.mistral.ai/models) for model descriptions. | mistral-large-latest | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [OptionalNullable[models.ChatCompletionStreamRequestStop]](../models/chatcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.ChatCompletionStreamRequestMessage](../models/chatcompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.ChatCompletionStreamRequestTool](../models/chatcompletionstreamrequesttool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file diff --git a/docs/models/chatcompletionstreamrequestmessage.md b/docs/models/chatcompletionstreamrequestmessage.md new file mode 100644 index 00000000..2e4e93ac --- /dev/null +++ b/docs/models/chatcompletionstreamrequestmessage.md @@ -0,0 +1,29 @@ +# ChatCompletionStreamRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/docs/models/chatcompletionstreamrequestmessages.md b/docs/models/chatcompletionstreamrequestmessages.md deleted file mode 100644 index 47990611..00000000 --- a/docs/models/chatcompletionstreamrequestmessages.md +++ /dev/null @@ -1,29 +0,0 @@ -# ChatCompletionStreamRequestMessages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/docs/models/chatcompletionstreamrequesttool.md b/docs/models/chatcompletionstreamrequesttool.md new file mode 100644 index 00000000..48998fcb --- /dev/null +++ b/docs/models/chatcompletionstreamrequesttool.md @@ -0,0 +1,47 @@ +# ChatCompletionStreamRequestTool + + +## Supported Types + +### `models.Tool` + +```python +value: models.Tool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + diff --git a/docs/models/chatcompletionstreamrequesttoolchoice.md b/docs/models/chatcompletionstreamrequesttoolchoice.md index cce0ca3e..43f3ca38 100644 --- a/docs/models/chatcompletionstreamrequesttoolchoice.md +++ b/docs/models/chatcompletionstreamrequesttoolchoice.md @@ -1,5 +1,7 @@ # ChatCompletionStreamRequestToolChoice +Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + ## Supported Types diff --git a/docs/models/chatmoderationrequest.md b/docs/models/chatmoderationrequest.md index 69b6c1dc..f252482d 100644 --- a/docs/models/chatmoderationrequest.md +++ b/docs/models/chatmoderationrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `inputs` | [models.ChatModerationRequestInputs](../models/chatmoderationrequestinputs.md) | :heavy_check_mark: | Chat to classify | -| `model` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `inputs` | [models.ChatModerationRequestInputs3](../models/chatmoderationrequestinputs3.md) | :heavy_check_mark: | Chat to classify | +| `model` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatmoderationrequestinputs.md b/docs/models/chatmoderationrequestinputs.md deleted file mode 100644 index cf775d60..00000000 --- a/docs/models/chatmoderationrequestinputs.md +++ /dev/null @@ -1,19 +0,0 @@ -# ChatModerationRequestInputs - -Chat to classify - - -## Supported Types - -### `List[models.One]` - -```python -value: List[models.One] = /* values here */ -``` - -### `List[List[models.Two]]` - -```python -value: List[List[models.Two]] = /* values here */ -``` - diff --git a/docs/models/chatmoderationrequestinputs1.md b/docs/models/chatmoderationrequestinputs1.md new file mode 100644 index 00000000..e15b8a84 --- /dev/null +++ b/docs/models/chatmoderationrequestinputs1.md @@ -0,0 +1,29 @@ +# ChatModerationRequestInputs1 + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/docs/models/chatmoderationrequestinputs2.md b/docs/models/chatmoderationrequestinputs2.md new file mode 100644 index 00000000..f40a4ebe --- /dev/null +++ b/docs/models/chatmoderationrequestinputs2.md @@ -0,0 +1,29 @@ +# ChatModerationRequestInputs2 + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/docs/models/chatmoderationrequestinputs3.md b/docs/models/chatmoderationrequestinputs3.md new file mode 100644 index 00000000..ff1c6ea3 --- /dev/null +++ b/docs/models/chatmoderationrequestinputs3.md @@ -0,0 +1,19 @@ +# ChatModerationRequestInputs3 + +Chat to classify + + +## Supported Types + +### `List[models.ChatModerationRequestInputs1]` + +```python +value: List[models.ChatModerationRequestInputs1] = /* values here */ +``` + +### `List[List[models.ChatModerationRequestInputs2]]` + +```python +value: List[List[models.ChatModerationRequestInputs2]] = /* values here */ +``` + diff --git a/docs/models/chattranscriptionevent.md b/docs/models/chattranscriptionevent.md new file mode 100644 index 00000000..c2a38ed5 --- /dev/null +++ b/docs/models/chattranscriptionevent.md @@ -0,0 +1,10 @@ +# ChatTranscriptionEvent + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `audio_url` | *str* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `response_message` | Dict[str, *Any*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/checkpoint.md b/docs/models/checkpoint.md new file mode 100644 index 00000000..f7f35530 --- /dev/null +++ b/docs/models/checkpoint.md @@ -0,0 +1,10 @@ +# Checkpoint + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `metrics` | [models.Metric](../models/metric.md) | :heavy_check_mark: | Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase). | | +| `step_number` | *int* | :heavy_check_mark: | The step number that the checkpoint was created at. | | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the checkpoint was created. | 1716963433 | \ No newline at end of file diff --git a/docs/models/checkpointout.md b/docs/models/checkpointout.md deleted file mode 100644 index 053592d2..00000000 --- a/docs/models/checkpointout.md +++ /dev/null @@ -1,10 +0,0 @@ -# CheckpointOut - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `metrics` | [models.MetricOut](../models/metricout.md) | :heavy_check_mark: | Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase). | | -| `step_number` | *int* | :heavy_check_mark: | The step number that the checkpoint was created at. | | -| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the checkpoint was created. | 1716963433 | \ No newline at end of file diff --git a/docs/models/classificationrequest.md b/docs/models/classificationrequest.md index b9befc89..99cdc4a0 100644 --- a/docs/models/classificationrequest.md +++ b/docs/models/classificationrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. | -| `inputs` | [models.ClassificationRequestInputs](../models/classificationrequestinputs.md) | :heavy_check_mark: | Text to classify. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-moderation-latest | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `inputs` | [models.ClassificationRequestInputs](../models/classificationrequestinputs.md) | :heavy_check_mark: | Text to classify. | | \ No newline at end of file diff --git a/docs/models/classifierdetailedjobout.md b/docs/models/classifierdetailedjobout.md deleted file mode 100644 index ccc88f89..00000000 --- a/docs/models/classifierdetailedjobout.md +++ /dev/null @@ -1,26 +0,0 @@ -# ClassifierDetailedJobOut - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `auto_start` | *bool* | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | The name of the model to fine-tune. | -| `status` | [models.ClassifierDetailedJobOutStatus](../models/classifierdetailedjoboutstatus.md) | :heavy_check_mark: | N/A | -| `created_at` | *int* | :heavy_check_mark: | N/A | -| `modified_at` | *int* | :heavy_check_mark: | N/A | -| `training_files` | List[*str*] | :heavy_check_mark: | N/A | -| `validation_files` | List[*str*] | :heavy_minus_sign: | N/A | -| `object` | [Optional[models.ClassifierDetailedJobOutObject]](../models/classifierdetailedjoboutobject.md) | :heavy_minus_sign: | N/A | -| `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `integrations` | List[[models.ClassifierDetailedJobOutIntegrations](../models/classifierdetailedjoboutintegrations.md)] | :heavy_minus_sign: | N/A | -| `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `metadata` | [OptionalNullable[models.JobMetadataOut]](../models/jobmetadataout.md) | :heavy_minus_sign: | N/A | -| `job_type` | [Optional[models.ClassifierDetailedJobOutJobType]](../models/classifierdetailedjoboutjobtype.md) | :heavy_minus_sign: | N/A | -| `hyperparameters` | [models.ClassifierTrainingParameters](../models/classifiertrainingparameters.md) | :heavy_check_mark: | N/A | -| `events` | List[[models.EventOut](../models/eventout.md)] | :heavy_minus_sign: | Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here. | -| `checkpoints` | List[[models.CheckpointOut](../models/checkpointout.md)] | :heavy_minus_sign: | N/A | -| `classifier_targets` | List[[models.ClassifierTargetOut](../models/classifiertargetout.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/classifierdetailedjoboutintegrations.md b/docs/models/classifierdetailedjoboutintegrations.md deleted file mode 100644 index 5a09465e..00000000 --- a/docs/models/classifierdetailedjoboutintegrations.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClassifierDetailedJobOutIntegrations - - -## Supported Types - -### `models.WandbIntegrationOut` - -```python -value: models.WandbIntegrationOut = /* values here */ -``` - diff --git a/docs/models/classifierdetailedjoboutjobtype.md b/docs/models/classifierdetailedjoboutjobtype.md deleted file mode 100644 index 0d1c6573..00000000 --- a/docs/models/classifierdetailedjoboutjobtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ClassifierDetailedJobOutJobType - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `CLASSIFIER` | classifier | \ No newline at end of file diff --git a/docs/models/classifierdetailedjoboutobject.md b/docs/models/classifierdetailedjoboutobject.md deleted file mode 100644 index 08cbcffc..00000000 --- a/docs/models/classifierdetailedjoboutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# ClassifierDetailedJobOutObject - - -## Values - -| Name | Value | -| ----- | ----- | -| `JOB` | job | \ No newline at end of file diff --git a/docs/models/classifierdetailedjoboutstatus.md b/docs/models/classifierdetailedjoboutstatus.md deleted file mode 100644 index c3118aaf..00000000 --- a/docs/models/classifierdetailedjoboutstatus.md +++ /dev/null @@ -1,17 +0,0 @@ -# ClassifierDetailedJobOutStatus - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `QUEUED` | QUEUED | -| `STARTED` | STARTED | -| `VALIDATING` | VALIDATING | -| `VALIDATED` | VALIDATED | -| `RUNNING` | RUNNING | -| `FAILED_VALIDATION` | FAILED_VALIDATION | -| `FAILED` | FAILED | -| `SUCCESS` | SUCCESS | -| `CANCELLED` | CANCELLED | -| `CANCELLATION_REQUESTED` | CANCELLATION_REQUESTED | \ No newline at end of file diff --git a/docs/models/classifierfinetunedmodel.md b/docs/models/classifierfinetunedmodel.md new file mode 100644 index 00000000..9fa69cbb --- /dev/null +++ b/docs/models/classifierfinetunedmodel.md @@ -0,0 +1,23 @@ +# ClassifierFineTunedModel + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `object` | *Optional[Literal["model"]]* | :heavy_minus_sign: | N/A | +| `created` | *int* | :heavy_check_mark: | N/A | +| `owned_by` | *str* | :heavy_check_mark: | N/A | +| `workspace_id` | *str* | :heavy_check_mark: | N/A | +| `root` | *str* | :heavy_check_mark: | N/A | +| `root_version` | *str* | :heavy_check_mark: | N/A | +| `archived` | *bool* | :heavy_check_mark: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `capabilities` | [models.FineTunedModelCapabilities](../models/finetunedmodelcapabilities.md) | :heavy_check_mark: | N/A | +| `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `aliases` | List[*str*] | :heavy_minus_sign: | N/A | +| `job` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `classifier_targets` | List[[models.ClassifierTargetResult](../models/classifiertargetresult.md)] | :heavy_check_mark: | N/A | +| `model_type` | *Literal["classifier"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/classifierfinetuningjob.md b/docs/models/classifierfinetuningjob.md new file mode 100644 index 00000000..123a51d8 --- /dev/null +++ b/docs/models/classifierfinetuningjob.md @@ -0,0 +1,23 @@ +# ClassifierFineTuningJob + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the job. | +| `auto_start` | *bool* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `status` | [models.ClassifierFineTuningJobStatus](../models/classifierfinetuningjobstatus.md) | :heavy_check_mark: | The current status of the fine-tuning job. | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was created. | +| `modified_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | +| `training_files` | List[*str*] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | +| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | +| `object` | *Optional[Literal["job"]]* | :heavy_minus_sign: | The object type of the fine-tuning job. | +| `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `"my-great-model"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`. | +| `integrations` | List[[models.ClassifierFineTuningJobIntegration](../models/classifierfinetuningjobintegration.md)] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | +| `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of tokens trained. | +| `metadata` | [OptionalNullable[models.JobMetadata]](../models/jobmetadata.md) | :heavy_minus_sign: | N/A | +| `job_type` | *Literal["classifier"]* | :heavy_check_mark: | The type of job (`FT` for fine-tuning). | +| `hyperparameters` | [models.ClassifierTrainingParameters](../models/classifiertrainingparameters.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/classifierfinetuningjobdetails.md b/docs/models/classifierfinetuningjobdetails.md new file mode 100644 index 00000000..d4a17eca --- /dev/null +++ b/docs/models/classifierfinetuningjobdetails.md @@ -0,0 +1,26 @@ +# ClassifierFineTuningJobDetails + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the job. | +| `auto_start` | *bool* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `status` | [models.ClassifierFineTuningJobDetailsStatus](../models/classifierfinetuningjobdetailsstatus.md) | :heavy_check_mark: | The current status of the fine-tuning job. | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was created. | +| `modified_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | +| `training_files` | List[*str*] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | +| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | +| `object` | *Optional[Literal["job"]]* | :heavy_minus_sign: | The object type of the fine-tuning job. | +| `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `"my-great-model"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`. | +| `integrations` | List[[models.ClassifierFineTuningJobDetailsIntegration](../models/classifierfinetuningjobdetailsintegration.md)] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | +| `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of tokens trained. | +| `metadata` | [OptionalNullable[models.JobMetadata]](../models/jobmetadata.md) | :heavy_minus_sign: | N/A | +| `job_type` | *Literal["classifier"]* | :heavy_check_mark: | The type of job (`FT` for fine-tuning). | +| `hyperparameters` | [models.ClassifierTrainingParameters](../models/classifiertrainingparameters.md) | :heavy_check_mark: | N/A | +| `events` | List[[models.Event](../models/event.md)] | :heavy_minus_sign: | Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here. | +| `checkpoints` | List[[models.Checkpoint](../models/checkpoint.md)] | :heavy_minus_sign: | N/A | +| `classifier_targets` | List[[models.ClassifierTargetResult](../models/classifiertargetresult.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/classifierfinetuningjobdetailsintegration.md b/docs/models/classifierfinetuningjobdetailsintegration.md new file mode 100644 index 00000000..438a35d9 --- /dev/null +++ b/docs/models/classifierfinetuningjobdetailsintegration.md @@ -0,0 +1,11 @@ +# ClassifierFineTuningJobDetailsIntegration + + +## Supported Types + +### `models.WandbIntegrationResult` + +```python +value: models.WandbIntegrationResult = /* values here */ +``` + diff --git a/docs/models/classifierfinetuningjobdetailsstatus.md b/docs/models/classifierfinetuningjobdetailsstatus.md new file mode 100644 index 00000000..589d37a1 --- /dev/null +++ b/docs/models/classifierfinetuningjobdetailsstatus.md @@ -0,0 +1,28 @@ +# ClassifierFineTuningJobDetailsStatus + +The current status of the fine-tuning job. + +## Example Usage + +```python +from mistralai.client.models import ClassifierFineTuningJobDetailsStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ClassifierFineTuningJobDetailsStatus = "QUEUED" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"QUEUED"` +- `"STARTED"` +- `"VALIDATING"` +- `"VALIDATED"` +- `"RUNNING"` +- `"FAILED_VALIDATION"` +- `"FAILED"` +- `"SUCCESS"` +- `"CANCELLED"` +- `"CANCELLATION_REQUESTED"` diff --git a/docs/models/classifierfinetuningjobintegration.md b/docs/models/classifierfinetuningjobintegration.md new file mode 100644 index 00000000..820aee4c --- /dev/null +++ b/docs/models/classifierfinetuningjobintegration.md @@ -0,0 +1,11 @@ +# ClassifierFineTuningJobIntegration + + +## Supported Types + +### `models.WandbIntegrationResult` + +```python +value: models.WandbIntegrationResult = /* values here */ +``` + diff --git a/docs/models/classifierfinetuningjobstatus.md b/docs/models/classifierfinetuningjobstatus.md new file mode 100644 index 00000000..c25d73a6 --- /dev/null +++ b/docs/models/classifierfinetuningjobstatus.md @@ -0,0 +1,28 @@ +# ClassifierFineTuningJobStatus + +The current status of the fine-tuning job. + +## Example Usage + +```python +from mistralai.client.models import ClassifierFineTuningJobStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ClassifierFineTuningJobStatus = "QUEUED" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"QUEUED"` +- `"STARTED"` +- `"VALIDATING"` +- `"VALIDATED"` +- `"RUNNING"` +- `"FAILED_VALIDATION"` +- `"FAILED"` +- `"SUCCESS"` +- `"CANCELLED"` +- `"CANCELLATION_REQUESTED"` diff --git a/docs/models/classifierftmodelout.md b/docs/models/classifierftmodelout.md deleted file mode 100644 index dd9e8bf9..00000000 --- a/docs/models/classifierftmodelout.md +++ /dev/null @@ -1,23 +0,0 @@ -# ClassifierFTModelOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `object` | [Optional[models.ClassifierFTModelOutObject]](../models/classifierftmodeloutobject.md) | :heavy_minus_sign: | N/A | -| `created` | *int* | :heavy_check_mark: | N/A | -| `owned_by` | *str* | :heavy_check_mark: | N/A | -| `workspace_id` | *str* | :heavy_check_mark: | N/A | -| `root` | *str* | :heavy_check_mark: | N/A | -| `root_version` | *str* | :heavy_check_mark: | N/A | -| `archived` | *bool* | :heavy_check_mark: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `capabilities` | [models.FTModelCapabilitiesOut](../models/ftmodelcapabilitiesout.md) | :heavy_check_mark: | N/A | -| `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `aliases` | List[*str*] | :heavy_minus_sign: | N/A | -| `job` | *str* | :heavy_check_mark: | N/A | -| `classifier_targets` | List[[models.ClassifierTargetOut](../models/classifiertargetout.md)] | :heavy_check_mark: | N/A | -| `model_type` | [Optional[models.ClassifierFTModelOutModelType]](../models/classifierftmodeloutmodeltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/classifierftmodeloutmodeltype.md b/docs/models/classifierftmodeloutmodeltype.md deleted file mode 100644 index e1e7e465..00000000 --- a/docs/models/classifierftmodeloutmodeltype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ClassifierFTModelOutModelType - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `CLASSIFIER` | classifier | \ No newline at end of file diff --git a/docs/models/classifierftmodeloutobject.md b/docs/models/classifierftmodeloutobject.md deleted file mode 100644 index 9fe05bcf..00000000 --- a/docs/models/classifierftmodeloutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# ClassifierFTModelOutObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `MODEL` | model | \ No newline at end of file diff --git a/docs/models/classifierjobout.md b/docs/models/classifierjobout.md deleted file mode 100644 index aa1d3ca9..00000000 --- a/docs/models/classifierjobout.md +++ /dev/null @@ -1,23 +0,0 @@ -# ClassifierJobOut - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the job. | -| `auto_start` | *bool* | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | The name of the model to fine-tune. | -| `status` | [models.ClassifierJobOutStatus](../models/classifierjoboutstatus.md) | :heavy_check_mark: | The current status of the fine-tuning job. | -| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was created. | -| `modified_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | -| `training_files` | List[*str*] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | -| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | -| `object` | [Optional[models.ClassifierJobOutObject]](../models/classifierjoboutobject.md) | :heavy_minus_sign: | The object type of the fine-tuning job. | -| `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | -| `integrations` | List[[models.ClassifierJobOutIntegrations](../models/classifierjoboutintegrations.md)] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | -| `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of tokens trained. | -| `metadata` | [OptionalNullable[models.JobMetadataOut]](../models/jobmetadataout.md) | :heavy_minus_sign: | N/A | -| `job_type` | [Optional[models.ClassifierJobOutJobType]](../models/classifierjoboutjobtype.md) | :heavy_minus_sign: | The type of job (`FT` for fine-tuning). | -| `hyperparameters` | [models.ClassifierTrainingParameters](../models/classifiertrainingparameters.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/classifierjoboutintegrations.md b/docs/models/classifierjoboutintegrations.md deleted file mode 100644 index d938d0b9..00000000 --- a/docs/models/classifierjoboutintegrations.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClassifierJobOutIntegrations - - -## Supported Types - -### `models.WandbIntegrationOut` - -```python -value: models.WandbIntegrationOut = /* values here */ -``` - diff --git a/docs/models/classifierjoboutjobtype.md b/docs/models/classifierjoboutjobtype.md deleted file mode 100644 index 7f5236fa..00000000 --- a/docs/models/classifierjoboutjobtype.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassifierJobOutJobType - -The type of job (`FT` for fine-tuning). - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `CLASSIFIER` | classifier | \ No newline at end of file diff --git a/docs/models/classifierjoboutobject.md b/docs/models/classifierjoboutobject.md deleted file mode 100644 index 1b42d547..00000000 --- a/docs/models/classifierjoboutobject.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassifierJobOutObject - -The object type of the fine-tuning job. - - -## Values - -| Name | Value | -| ----- | ----- | -| `JOB` | job | \ No newline at end of file diff --git a/docs/models/classifierjoboutstatus.md b/docs/models/classifierjoboutstatus.md deleted file mode 100644 index 4520f164..00000000 --- a/docs/models/classifierjoboutstatus.md +++ /dev/null @@ -1,19 +0,0 @@ -# ClassifierJobOutStatus - -The current status of the fine-tuning job. - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `QUEUED` | QUEUED | -| `STARTED` | STARTED | -| `VALIDATING` | VALIDATING | -| `VALIDATED` | VALIDATED | -| `RUNNING` | RUNNING | -| `FAILED_VALIDATION` | FAILED_VALIDATION | -| `FAILED` | FAILED | -| `SUCCESS` | SUCCESS | -| `CANCELLED` | CANCELLED | -| `CANCELLATION_REQUESTED` | CANCELLATION_REQUESTED | \ No newline at end of file diff --git a/docs/models/classifiertarget.md b/docs/models/classifiertarget.md new file mode 100644 index 00000000..f8c99e2e --- /dev/null +++ b/docs/models/classifiertarget.md @@ -0,0 +1,11 @@ +# ClassifierTarget + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `labels` | List[*str*] | :heavy_check_mark: | N/A | +| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `loss_function` | [OptionalNullable[models.FTClassifierLossFunction]](../models/ftclassifierlossfunction.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/classifiertargetin.md b/docs/models/classifiertargetin.md deleted file mode 100644 index 78cab67b..00000000 --- a/docs/models/classifiertargetin.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClassifierTargetIn - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `name` | *str* | :heavy_check_mark: | N/A | -| `labels` | List[*str*] | :heavy_check_mark: | N/A | -| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `loss_function` | [OptionalNullable[models.FTClassifierLossFunction]](../models/ftclassifierlossfunction.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/classifiertargetout.md b/docs/models/classifiertargetout.md deleted file mode 100644 index 57535ae5..00000000 --- a/docs/models/classifiertargetout.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClassifierTargetOut - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `name` | *str* | :heavy_check_mark: | N/A | -| `labels` | List[*str*] | :heavy_check_mark: | N/A | -| `weight` | *float* | :heavy_check_mark: | N/A | -| `loss_function` | [models.FTClassifierLossFunction](../models/ftclassifierlossfunction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/classifiertargetresult.md b/docs/models/classifiertargetresult.md new file mode 100644 index 00000000..ccadc623 --- /dev/null +++ b/docs/models/classifiertargetresult.md @@ -0,0 +1,11 @@ +# ClassifierTargetResult + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `labels` | List[*str*] | :heavy_check_mark: | N/A | +| `weight` | *float* | :heavy_check_mark: | N/A | +| `loss_function` | [models.FTClassifierLossFunction](../models/ftclassifierlossfunction.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/classifiertrainingparameters.md b/docs/models/classifiertrainingparameters.md index 3b6f3be6..6c6da1bd 100644 --- a/docs/models/classifiertrainingparameters.md +++ b/docs/models/classifiertrainingparameters.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `learning_rate` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `weight_decay` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `warmup_fraction` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `seq_len` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | +| `learning_rate` | *Optional[float]* | :heavy_minus_sign: | A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process. | +| `weight_decay` | *OptionalNullable[float]* | :heavy_minus_sign: | (Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large. | +| `warmup_fraction` | *OptionalNullable[float]* | :heavy_minus_sign: | (Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune) | +| `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `seq_len` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/classifiertrainingparametersin.md b/docs/models/classifiertrainingparametersin.md deleted file mode 100644 index 1287c973..00000000 --- a/docs/models/classifiertrainingparametersin.md +++ /dev/null @@ -1,15 +0,0 @@ -# ClassifierTrainingParametersIn - -The fine-tuning hyperparameter settings used in a classifier fine-tune job. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | -| `learning_rate` | *Optional[float]* | :heavy_minus_sign: | A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process. | -| `weight_decay` | *OptionalNullable[float]* | :heavy_minus_sign: | (Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large. | -| `warmup_fraction` | *OptionalNullable[float]* | :heavy_minus_sign: | (Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune) | -| `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `seq_len` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/codeinterpretertool.md b/docs/models/codeinterpretertool.md index d5ad789e..6302fc62 100644 --- a/docs/models/codeinterpretertool.md +++ b/docs/models/codeinterpretertool.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `type` | [Optional[models.CodeInterpreterToolType]](../models/codeinterpretertooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["code_interpreter"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/codeinterpretertooltype.md b/docs/models/codeinterpretertooltype.md deleted file mode 100644 index f704b65e..00000000 --- a/docs/models/codeinterpretertooltype.md +++ /dev/null @@ -1,8 +0,0 @@ -# CodeInterpreterToolType - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `CODE_INTERPRETER` | code_interpreter | \ No newline at end of file diff --git a/docs/models/completionargs.md b/docs/models/completionargs.md index 0d108225..51f7ff30 100644 --- a/docs/models/completionargs.md +++ b/docs/models/completionargs.md @@ -5,15 +5,16 @@ White-listed arguments from the completion API ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `stop` | [OptionalNullable[models.CompletionArgsStop]](../models/completionargsstop.md) | :heavy_minus_sign: | N/A | -| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `prediction` | [OptionalNullable[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | -| `response_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | -| `tool_choice` | [Optional[models.ToolChoiceEnum]](../models/toolchoiceenum.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `stop` | [OptionalNullable[models.CompletionArgsStop]](../models/completionargsstop.md) | :heavy_minus_sign: | N/A | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `prediction` | [OptionalNullable[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | +| `response_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tool_choice` | [Optional[models.ToolChoiceEnum]](../models/toolchoiceenum.md) | :heavy_minus_sign: | N/A | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/completiondetailedjobout.md b/docs/models/completiondetailedjobout.md deleted file mode 100644 index 84613080..00000000 --- a/docs/models/completiondetailedjobout.md +++ /dev/null @@ -1,26 +0,0 @@ -# CompletionDetailedJobOut - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `auto_start` | *bool* | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | The name of the model to fine-tune. | -| `status` | [models.CompletionDetailedJobOutStatus](../models/completiondetailedjoboutstatus.md) | :heavy_check_mark: | N/A | -| `created_at` | *int* | :heavy_check_mark: | N/A | -| `modified_at` | *int* | :heavy_check_mark: | N/A | -| `training_files` | List[*str*] | :heavy_check_mark: | N/A | -| `validation_files` | List[*str*] | :heavy_minus_sign: | N/A | -| `object` | [Optional[models.CompletionDetailedJobOutObject]](../models/completiondetailedjoboutobject.md) | :heavy_minus_sign: | N/A | -| `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `integrations` | List[[models.CompletionDetailedJobOutIntegrations](../models/completiondetailedjoboutintegrations.md)] | :heavy_minus_sign: | N/A | -| `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `metadata` | [OptionalNullable[models.JobMetadataOut]](../models/jobmetadataout.md) | :heavy_minus_sign: | N/A | -| `job_type` | [Optional[models.CompletionDetailedJobOutJobType]](../models/completiondetailedjoboutjobtype.md) | :heavy_minus_sign: | N/A | -| `hyperparameters` | [models.CompletionTrainingParameters](../models/completiontrainingparameters.md) | :heavy_check_mark: | N/A | -| `repositories` | List[[models.CompletionDetailedJobOutRepositories](../models/completiondetailedjoboutrepositories.md)] | :heavy_minus_sign: | N/A | -| `events` | List[[models.EventOut](../models/eventout.md)] | :heavy_minus_sign: | Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here. | -| `checkpoints` | List[[models.CheckpointOut](../models/checkpointout.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completiondetailedjoboutintegrations.md b/docs/models/completiondetailedjoboutintegrations.md deleted file mode 100644 index af6bbcc5..00000000 --- a/docs/models/completiondetailedjoboutintegrations.md +++ /dev/null @@ -1,11 +0,0 @@ -# CompletionDetailedJobOutIntegrations - - -## Supported Types - -### `models.WandbIntegrationOut` - -```python -value: models.WandbIntegrationOut = /* values here */ -``` - diff --git a/docs/models/completiondetailedjoboutjobtype.md b/docs/models/completiondetailedjoboutjobtype.md deleted file mode 100644 index fb24db0c..00000000 --- a/docs/models/completiondetailedjoboutjobtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# CompletionDetailedJobOutJobType - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `COMPLETION` | completion | \ No newline at end of file diff --git a/docs/models/completiondetailedjoboutobject.md b/docs/models/completiondetailedjoboutobject.md deleted file mode 100644 index 1bec88e5..00000000 --- a/docs/models/completiondetailedjoboutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# CompletionDetailedJobOutObject - - -## Values - -| Name | Value | -| ----- | ----- | -| `JOB` | job | \ No newline at end of file diff --git a/docs/models/completiondetailedjoboutrepositories.md b/docs/models/completiondetailedjoboutrepositories.md deleted file mode 100644 index 4f9727c3..00000000 --- a/docs/models/completiondetailedjoboutrepositories.md +++ /dev/null @@ -1,11 +0,0 @@ -# CompletionDetailedJobOutRepositories - - -## Supported Types - -### `models.GithubRepositoryOut` - -```python -value: models.GithubRepositoryOut = /* values here */ -``` - diff --git a/docs/models/completiondetailedjoboutstatus.md b/docs/models/completiondetailedjoboutstatus.md deleted file mode 100644 index b80525ba..00000000 --- a/docs/models/completiondetailedjoboutstatus.md +++ /dev/null @@ -1,17 +0,0 @@ -# CompletionDetailedJobOutStatus - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `QUEUED` | QUEUED | -| `STARTED` | STARTED | -| `VALIDATING` | VALIDATING | -| `VALIDATED` | VALIDATED | -| `RUNNING` | RUNNING | -| `FAILED_VALIDATION` | FAILED_VALIDATION | -| `FAILED` | FAILED | -| `SUCCESS` | SUCCESS | -| `CANCELLED` | CANCELLED | -| `CANCELLATION_REQUESTED` | CANCELLATION_REQUESTED | \ No newline at end of file diff --git a/docs/models/completionfinetunedmodel.md b/docs/models/completionfinetunedmodel.md new file mode 100644 index 00000000..26bcdb17 --- /dev/null +++ b/docs/models/completionfinetunedmodel.md @@ -0,0 +1,22 @@ +# CompletionFineTunedModel + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `object` | *Optional[Literal["model"]]* | :heavy_minus_sign: | N/A | +| `created` | *int* | :heavy_check_mark: | N/A | +| `owned_by` | *str* | :heavy_check_mark: | N/A | +| `workspace_id` | *str* | :heavy_check_mark: | N/A | +| `root` | *str* | :heavy_check_mark: | N/A | +| `root_version` | *str* | :heavy_check_mark: | N/A | +| `archived` | *bool* | :heavy_check_mark: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `capabilities` | [models.FineTunedModelCapabilities](../models/finetunedmodelcapabilities.md) | :heavy_check_mark: | N/A | +| `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `aliases` | List[*str*] | :heavy_minus_sign: | N/A | +| `job` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `model_type` | *Literal["completion"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/completionfinetuningjob.md b/docs/models/completionfinetuningjob.md new file mode 100644 index 00000000..c022fbfa --- /dev/null +++ b/docs/models/completionfinetuningjob.md @@ -0,0 +1,24 @@ +# CompletionFineTuningJob + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the job. | +| `auto_start` | *bool* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `status` | [models.CompletionFineTuningJobStatus](../models/completionfinetuningjobstatus.md) | :heavy_check_mark: | The current status of the fine-tuning job. | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was created. | +| `modified_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | +| `training_files` | List[*str*] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | +| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | +| `object` | *Optional[Literal["job"]]* | :heavy_minus_sign: | The object type of the fine-tuning job. | +| `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `"my-great-model"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`. | +| `integrations` | List[[models.CompletionFineTuningJobIntegration](../models/completionfinetuningjobintegration.md)] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | +| `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of tokens trained. | +| `metadata` | [OptionalNullable[models.JobMetadata]](../models/jobmetadata.md) | :heavy_minus_sign: | N/A | +| `job_type` | *Literal["completion"]* | :heavy_check_mark: | The type of job (`FT` for fine-tuning). | +| `hyperparameters` | [models.CompletionTrainingParameters](../models/completiontrainingparameters.md) | :heavy_check_mark: | N/A | +| `repositories` | List[[models.CompletionFineTuningJobRepository](../models/completionfinetuningjobrepository.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completionfinetuningjobdetails.md b/docs/models/completionfinetuningjobdetails.md new file mode 100644 index 00000000..e092e510 --- /dev/null +++ b/docs/models/completionfinetuningjobdetails.md @@ -0,0 +1,26 @@ +# CompletionFineTuningJobDetails + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the job. | +| `auto_start` | *bool* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `status` | [models.CompletionFineTuningJobDetailsStatus](../models/completionfinetuningjobdetailsstatus.md) | :heavy_check_mark: | The current status of the fine-tuning job. | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was created. | +| `modified_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | +| `training_files` | List[*str*] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | +| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | +| `object` | *Optional[Literal["job"]]* | :heavy_minus_sign: | The object type of the fine-tuning job. | +| `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `"my-great-model"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`. | +| `integrations` | List[[models.CompletionFineTuningJobDetailsIntegration](../models/completionfinetuningjobdetailsintegration.md)] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | +| `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of tokens trained. | +| `metadata` | [OptionalNullable[models.JobMetadata]](../models/jobmetadata.md) | :heavy_minus_sign: | N/A | +| `job_type` | *Literal["completion"]* | :heavy_check_mark: | The type of job (`FT` for fine-tuning). | +| `hyperparameters` | [models.CompletionTrainingParameters](../models/completiontrainingparameters.md) | :heavy_check_mark: | N/A | +| `repositories` | List[[models.CompletionFineTuningJobDetailsRepository](../models/completionfinetuningjobdetailsrepository.md)] | :heavy_minus_sign: | N/A | +| `events` | List[[models.Event](../models/event.md)] | :heavy_minus_sign: | Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here. | +| `checkpoints` | List[[models.Checkpoint](../models/checkpoint.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completionfinetuningjobdetailsintegration.md b/docs/models/completionfinetuningjobdetailsintegration.md new file mode 100644 index 00000000..38f6a349 --- /dev/null +++ b/docs/models/completionfinetuningjobdetailsintegration.md @@ -0,0 +1,11 @@ +# CompletionFineTuningJobDetailsIntegration + + +## Supported Types + +### `models.WandbIntegrationResult` + +```python +value: models.WandbIntegrationResult = /* values here */ +``` + diff --git a/docs/models/completionfinetuningjobdetailsrepository.md b/docs/models/completionfinetuningjobdetailsrepository.md new file mode 100644 index 00000000..c6bd67cd --- /dev/null +++ b/docs/models/completionfinetuningjobdetailsrepository.md @@ -0,0 +1,11 @@ +# CompletionFineTuningJobDetailsRepository + + +## Supported Types + +### `models.GithubRepository` + +```python +value: models.GithubRepository = /* values here */ +``` + diff --git a/docs/models/completionfinetuningjobdetailsstatus.md b/docs/models/completionfinetuningjobdetailsstatus.md new file mode 100644 index 00000000..6de580b8 --- /dev/null +++ b/docs/models/completionfinetuningjobdetailsstatus.md @@ -0,0 +1,28 @@ +# CompletionFineTuningJobDetailsStatus + +The current status of the fine-tuning job. + +## Example Usage + +```python +from mistralai.client.models import CompletionFineTuningJobDetailsStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: CompletionFineTuningJobDetailsStatus = "QUEUED" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"QUEUED"` +- `"STARTED"` +- `"VALIDATING"` +- `"VALIDATED"` +- `"RUNNING"` +- `"FAILED_VALIDATION"` +- `"FAILED"` +- `"SUCCESS"` +- `"CANCELLED"` +- `"CANCELLATION_REQUESTED"` diff --git a/docs/models/completionfinetuningjobintegration.md b/docs/models/completionfinetuningjobintegration.md new file mode 100644 index 00000000..dbe57417 --- /dev/null +++ b/docs/models/completionfinetuningjobintegration.md @@ -0,0 +1,11 @@ +# CompletionFineTuningJobIntegration + + +## Supported Types + +### `models.WandbIntegrationResult` + +```python +value: models.WandbIntegrationResult = /* values here */ +``` + diff --git a/docs/models/completionfinetuningjobrepository.md b/docs/models/completionfinetuningjobrepository.md new file mode 100644 index 00000000..54225e27 --- /dev/null +++ b/docs/models/completionfinetuningjobrepository.md @@ -0,0 +1,11 @@ +# CompletionFineTuningJobRepository + + +## Supported Types + +### `models.GithubRepository` + +```python +value: models.GithubRepository = /* values here */ +``` + diff --git a/docs/models/completionfinetuningjobstatus.md b/docs/models/completionfinetuningjobstatus.md new file mode 100644 index 00000000..1fd78b9d --- /dev/null +++ b/docs/models/completionfinetuningjobstatus.md @@ -0,0 +1,28 @@ +# CompletionFineTuningJobStatus + +The current status of the fine-tuning job. + +## Example Usage + +```python +from mistralai.client.models import CompletionFineTuningJobStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: CompletionFineTuningJobStatus = "QUEUED" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"QUEUED"` +- `"STARTED"` +- `"VALIDATING"` +- `"VALIDATED"` +- `"RUNNING"` +- `"FAILED_VALIDATION"` +- `"FAILED"` +- `"SUCCESS"` +- `"CANCELLED"` +- `"CANCELLATION_REQUESTED"` diff --git a/docs/models/completionftmodelout.md b/docs/models/completionftmodelout.md deleted file mode 100644 index cd085825..00000000 --- a/docs/models/completionftmodelout.md +++ /dev/null @@ -1,22 +0,0 @@ -# CompletionFTModelOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `object` | [Optional[models.CompletionFTModelOutObject]](../models/completionftmodeloutobject.md) | :heavy_minus_sign: | N/A | -| `created` | *int* | :heavy_check_mark: | N/A | -| `owned_by` | *str* | :heavy_check_mark: | N/A | -| `workspace_id` | *str* | :heavy_check_mark: | N/A | -| `root` | *str* | :heavy_check_mark: | N/A | -| `root_version` | *str* | :heavy_check_mark: | N/A | -| `archived` | *bool* | :heavy_check_mark: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `capabilities` | [models.FTModelCapabilitiesOut](../models/ftmodelcapabilitiesout.md) | :heavy_check_mark: | N/A | -| `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `aliases` | List[*str*] | :heavy_minus_sign: | N/A | -| `job` | *str* | :heavy_check_mark: | N/A | -| `model_type` | [Optional[models.ModelType]](../models/modeltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completionftmodeloutobject.md b/docs/models/completionftmodeloutobject.md deleted file mode 100644 index 6f9d858c..00000000 --- a/docs/models/completionftmodeloutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# CompletionFTModelOutObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `MODEL` | model | \ No newline at end of file diff --git a/docs/models/completionjobout.md b/docs/models/completionjobout.md deleted file mode 100644 index cb471746..00000000 --- a/docs/models/completionjobout.md +++ /dev/null @@ -1,24 +0,0 @@ -# CompletionJobOut - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the job. | -| `auto_start` | *bool* | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | The name of the model to fine-tune. | -| `status` | [models.Status](../models/status.md) | :heavy_check_mark: | The current status of the fine-tuning job. | -| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was created. | -| `modified_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | -| `training_files` | List[*str*] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | -| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | -| `object` | [Optional[models.CompletionJobOutObject]](../models/completionjoboutobject.md) | :heavy_minus_sign: | The object type of the fine-tuning job. | -| `fine_tuned_model` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | -| `integrations` | List[[models.Integrations](../models/integrations.md)] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | -| `trained_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of tokens trained. | -| `metadata` | [OptionalNullable[models.JobMetadataOut]](../models/jobmetadataout.md) | :heavy_minus_sign: | N/A | -| `job_type` | [Optional[models.JobType]](../models/jobtype.md) | :heavy_minus_sign: | The type of job (`FT` for fine-tuning). | -| `hyperparameters` | [models.CompletionTrainingParameters](../models/completiontrainingparameters.md) | :heavy_check_mark: | N/A | -| `repositories` | List[[models.Repositories](../models/repositories.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completionjoboutobject.md b/docs/models/completionjoboutobject.md deleted file mode 100644 index 712b107d..00000000 --- a/docs/models/completionjoboutobject.md +++ /dev/null @@ -1,10 +0,0 @@ -# CompletionJobOutObject - -The object type of the fine-tuning job. - - -## Values - -| Name | Value | -| ----- | ----- | -| `JOB` | job | \ No newline at end of file diff --git a/docs/models/completionresponsestreamchoicefinishreason.md b/docs/models/completionresponsestreamchoicefinishreason.md index 0fece473..3e8c30ec 100644 --- a/docs/models/completionresponsestreamchoicefinishreason.md +++ b/docs/models/completionresponsestreamchoicefinishreason.md @@ -1,11 +1,20 @@ # CompletionResponseStreamChoiceFinishReason +## Example Usage + +```python +from mistralai.client.models import CompletionResponseStreamChoiceFinishReason + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: CompletionResponseStreamChoiceFinishReason = "stop" +``` + ## Values -| Name | Value | -| ------------ | ------------ | -| `STOP` | stop | -| `LENGTH` | length | -| `ERROR` | error | -| `TOOL_CALLS` | tool_calls | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"stop"` +- `"length"` +- `"error"` +- `"tool_calls"` diff --git a/docs/models/completiontrainingparameters.md b/docs/models/completiontrainingparameters.md index 4746a95d..9228221e 100644 --- a/docs/models/completiontrainingparameters.md +++ b/docs/models/completiontrainingparameters.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `learning_rate` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `weight_decay` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `warmup_fraction` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `seq_len` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `fim_ratio` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | +| `learning_rate` | *Optional[float]* | :heavy_minus_sign: | A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process. | +| `weight_decay` | *OptionalNullable[float]* | :heavy_minus_sign: | (Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large. | +| `warmup_fraction` | *OptionalNullable[float]* | :heavy_minus_sign: | (Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune) | +| `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `seq_len` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `fim_ratio` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completiontrainingparametersin.md b/docs/models/completiontrainingparametersin.md deleted file mode 100644 index 9fcc714e..00000000 --- a/docs/models/completiontrainingparametersin.md +++ /dev/null @@ -1,16 +0,0 @@ -# CompletionTrainingParametersIn - -The fine-tuning hyperparameter settings used in a fine-tune job. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | -| `learning_rate` | *Optional[float]* | :heavy_minus_sign: | A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process. | -| `weight_decay` | *OptionalNullable[float]* | :heavy_minus_sign: | (Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large. | -| `warmup_fraction` | *OptionalNullable[float]* | :heavy_minus_sign: | (Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune) | -| `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `seq_len` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `fim_ratio` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/confidencescoresgranularity.md b/docs/models/confidencescoresgranularity.md new file mode 100644 index 00000000..29646c91 --- /dev/null +++ b/docs/models/confidencescoresgranularity.md @@ -0,0 +1,14 @@ +# ConfidenceScoresGranularity + +## Example Usage + +```python +from mistralai.client.models import ConfidenceScoresGranularity +value: ConfidenceScoresGranularity = "word" +``` + + +## Values + +- `"word"` +- `"page"` diff --git a/docs/models/confirmation.md b/docs/models/confirmation.md new file mode 100644 index 00000000..c8709384 --- /dev/null +++ b/docs/models/confirmation.md @@ -0,0 +1,14 @@ +# Confirmation + +## Example Usage + +```python +from mistralai.client.models import Confirmation +value: Confirmation = "allow" +``` + + +## Values + +- `"allow"` +- `"deny"` diff --git a/docs/models/connectioncredentials.md b/docs/models/connectioncredentials.md new file mode 100644 index 00000000..7e892399 --- /dev/null +++ b/docs/models/connectioncredentials.md @@ -0,0 +1,10 @@ +# ConnectionCredentials + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `oauth` | [OptionalNullable[models.OAuth2Token]](../models/oauth2token.md) | :heavy_minus_sign: | N/A | +| `headers` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `bearer_token` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connector.md b/docs/models/connector.md new file mode 100644 index 00000000..29f8ad07 --- /dev/null +++ b/docs/models/connector.md @@ -0,0 +1,15 @@ +# Connector + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `server` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `auth_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectorauthenticationheader.md b/docs/models/connectorauthenticationheader.md new file mode 100644 index 00000000..c545b571 --- /dev/null +++ b/docs/models/connectorauthenticationheader.md @@ -0,0 +1,10 @@ +# ConnectorAuthenticationHeader + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `is_required` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `is_secret` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectorcalltoolrequest.md b/docs/models/connectorcalltoolrequest.md new file mode 100644 index 00000000..9ef7a351 --- /dev/null +++ b/docs/models/connectorcalltoolrequest.md @@ -0,0 +1,10 @@ +# ConnectorCallToolRequest + +Request body for calling an MCP tool. + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `arguments` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectorcalltoolv1request.md b/docs/models/connectorcalltoolv1request.md new file mode 100644 index 00000000..dea7083d --- /dev/null +++ b/docs/models/connectorcalltoolv1request.md @@ -0,0 +1,11 @@ +# ConnectorCallToolV1Request + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `tool_name` | *str* | :heavy_check_mark: | N/A | +| `credentials_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `connector_call_tool_request` | [models.ConnectorCallToolRequest](../models/connectorcalltoolrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorcreateorupdateorganizationcredentialsv1request.md b/docs/models/connectorcreateorupdateorganizationcredentialsv1request.md new file mode 100644 index 00000000..2797bebf --- /dev/null +++ b/docs/models/connectorcreateorupdateorganizationcredentialsv1request.md @@ -0,0 +1,9 @@ +# ConnectorCreateOrUpdateOrganizationCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `credentials_create_or_update` | [models.CredentialsCreateOrUpdate](../models/credentialscreateorupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorcreateorupdateusercredentialsv1request.md b/docs/models/connectorcreateorupdateusercredentialsv1request.md new file mode 100644 index 00000000..3e763722 --- /dev/null +++ b/docs/models/connectorcreateorupdateusercredentialsv1request.md @@ -0,0 +1,9 @@ +# ConnectorCreateOrUpdateUserCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `credentials_create_or_update` | [models.CredentialsCreateOrUpdate](../models/credentialscreateorupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorcreateorupdateworkspacecredentialsv1request.md b/docs/models/connectorcreateorupdateworkspacecredentialsv1request.md new file mode 100644 index 00000000..310cdcde --- /dev/null +++ b/docs/models/connectorcreateorupdateworkspacecredentialsv1request.md @@ -0,0 +1,9 @@ +# ConnectorCreateOrUpdateWorkspaceCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `credentials_create_or_update` | [models.CredentialsCreateOrUpdate](../models/credentialscreateorupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectordeleteorganizationcredentialsv1request.md b/docs/models/connectordeleteorganizationcredentialsv1request.md new file mode 100644 index 00000000..eaf4d00c --- /dev/null +++ b/docs/models/connectordeleteorganizationcredentialsv1request.md @@ -0,0 +1,9 @@ +# ConnectorDeleteOrganizationCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `credentials_name` | *str* | :heavy_check_mark: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectordeleteusercredentialsv1request.md b/docs/models/connectordeleteusercredentialsv1request.md new file mode 100644 index 00000000..fd52cf92 --- /dev/null +++ b/docs/models/connectordeleteusercredentialsv1request.md @@ -0,0 +1,9 @@ +# ConnectorDeleteUserCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `credentials_name` | *str* | :heavy_check_mark: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectordeletev1request.md b/docs/models/connectordeletev1request.md new file mode 100644 index 00000000..e50c7296 --- /dev/null +++ b/docs/models/connectordeletev1request.md @@ -0,0 +1,8 @@ +# ConnectorDeleteV1Request + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `connector_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectordeleteworkspacecredentialsv1request.md b/docs/models/connectordeleteworkspacecredentialsv1request.md new file mode 100644 index 00000000..3bc3d7c9 --- /dev/null +++ b/docs/models/connectordeleteworkspacecredentialsv1request.md @@ -0,0 +1,9 @@ +# ConnectorDeleteWorkspaceCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `credentials_name` | *str* | :heavy_check_mark: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorgetauthenticationmethodsv1request.md b/docs/models/connectorgetauthenticationmethodsv1request.md new file mode 100644 index 00000000..3a62c010 --- /dev/null +++ b/docs/models/connectorgetauthenticationmethodsv1request.md @@ -0,0 +1,8 @@ +# ConnectorGetAuthenticationMethodsV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorgetauthurlv1request.md b/docs/models/connectorgetauthurlv1request.md new file mode 100644 index 00000000..7d6b94ff --- /dev/null +++ b/docs/models/connectorgetauthurlv1request.md @@ -0,0 +1,10 @@ +# ConnectorGetAuthURLV1Request + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `app_return_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `credentials_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorgetv1request.md b/docs/models/connectorgetv1request.md new file mode 100644 index 00000000..c45148b9 --- /dev/null +++ b/docs/models/connectorgetv1request.md @@ -0,0 +1,10 @@ +# ConnectorGetV1Request + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `fetch_customer_data` | *Optional[bool]* | :heavy_minus_sign: | Fetch the customer data associated with the connector (e.g. customer secrets / config). | +| `fetch_connection_secrets` | *Optional[bool]* | :heavy_minus_sign: | Fetch the general connection secrets associated with the connector. | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorlistorganizationcredentialsv1request.md b/docs/models/connectorlistorganizationcredentialsv1request.md new file mode 100644 index 00000000..53ce36db --- /dev/null +++ b/docs/models/connectorlistorganizationcredentialsv1request.md @@ -0,0 +1,10 @@ +# ConnectorListOrganizationCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `auth_type` | [OptionalNullable[models.OutboundAuthenticationType]](../models/outboundauthenticationtype.md) | :heavy_minus_sign: | N/A | +| `fetch_default` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorlisttoolsv1request.md b/docs/models/connectorlisttoolsv1request.md new file mode 100644 index 00000000..e9c21374 --- /dev/null +++ b/docs/models/connectorlisttoolsv1request.md @@ -0,0 +1,13 @@ +# ConnectorListToolsV1Request + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `refresh` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `pretty` | *Optional[bool]* | :heavy_minus_sign: | Return a simplified payload with only name, description, annotations, and a compact inputSchema. | +| `credentials_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorlistusercredentialsv1request.md b/docs/models/connectorlistusercredentialsv1request.md new file mode 100644 index 00000000..2c9547d5 --- /dev/null +++ b/docs/models/connectorlistusercredentialsv1request.md @@ -0,0 +1,10 @@ +# ConnectorListUserCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `auth_type` | [OptionalNullable[models.OutboundAuthenticationType]](../models/outboundauthenticationtype.md) | :heavy_minus_sign: | N/A | +| `fetch_default` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorlistv1request.md b/docs/models/connectorlistv1request.md new file mode 100644 index 00000000..6b9a287e --- /dev/null +++ b/docs/models/connectorlistv1request.md @@ -0,0 +1,10 @@ +# ConnectorListV1Request + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `query_filters` | [Optional[models.ConnectorsQueryFilters]](../models/connectorsqueryfilters.md) | :heavy_minus_sign: | N/A | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectorlistworkspacecredentialsv1request.md b/docs/models/connectorlistworkspacecredentialsv1request.md new file mode 100644 index 00000000..573869b2 --- /dev/null +++ b/docs/models/connectorlistworkspacecredentialsv1request.md @@ -0,0 +1,10 @@ +# ConnectorListWorkspaceCredentialsV1Request + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `auth_type` | [OptionalNullable[models.OutboundAuthenticationType]](../models/outboundauthenticationtype.md) | :heavy_minus_sign: | N/A | +| `fetch_default` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorsqueryfilters.md b/docs/models/connectorsqueryfilters.md new file mode 100644 index 00000000..aea47e14 --- /dev/null +++ b/docs/models/connectorsqueryfilters.md @@ -0,0 +1,9 @@ +# ConnectorsQueryFilters + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter for active connectors for a given user, workspace and organization. | +| `fetch_connection_secrets` | *Optional[bool]* | :heavy_minus_sign: | Fetch connection secrets. | \ No newline at end of file diff --git a/docs/models/connectortool.md b/docs/models/connectortool.md new file mode 100644 index 00000000..af5cc03b --- /dev/null +++ b/docs/models/connectortool.md @@ -0,0 +1,18 @@ +# ConnectorTool + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `system_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `locale` | [OptionalNullable[models.ConnectorToolLocale]](../models/connectortoollocale.md) | :heavy_minus_sign: | N/A | +| `jsonschema` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `execution_config` | [Nullable[models.ExecutionConfig]](../models/executionconfig.md) | :heavy_check_mark: | N/A | +| `visibility` | [models.ResourceVisibility](../models/resourcevisibility.md) | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectortoolcallmetadata.md b/docs/models/connectortoolcallmetadata.md new file mode 100644 index 00000000..4d44a2d0 --- /dev/null +++ b/docs/models/connectortoolcallmetadata.md @@ -0,0 +1,14 @@ +# ConnectorToolCallMetadata + +Metadata wrapper for MCP tool call responses. + +Nests MCP-specific fields under `mcp_meta` to avoid collisions with other +metadata keys (e.g. `tool_call_result`) in Harmattan's streaming deltas. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `mcp_meta` | [OptionalNullable[models.ConnectorToolResultMetadata]](../models/connectortoolresultmetadata.md) | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectortoolcallresponse.md b/docs/models/connectortoolcallresponse.md new file mode 100644 index 00000000..1c51b9ac --- /dev/null +++ b/docs/models/connectortoolcallresponse.md @@ -0,0 +1,18 @@ +# ConnectorToolCallResponse + +Response from calling an MCP tool. + +We override mcp_types.CallToolResult because: +- Models only support `content`, not `structuredContent` at top level +- Downstream consumers (le-chat, etc.) need structuredContent/isError/_meta via metadata + +SYNC: Keep in sync with Harmattan (orchestrator) for harmonized tool result processing. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `content` | List[[models.ConnectorToolCallResponseContent](../models/connectortoolcallresponsecontent.md)] | :heavy_check_mark: | N/A | +| `metadata` | [OptionalNullable[models.ConnectorToolCallMetadata]](../models/connectortoolcallmetadata.md) | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectortoolcallresponsecontent.md b/docs/models/connectortoolcallresponsecontent.md new file mode 100644 index 00000000..d7f93eda --- /dev/null +++ b/docs/models/connectortoolcallresponsecontent.md @@ -0,0 +1,35 @@ +# ConnectorToolCallResponseContent + + +## Supported Types + +### `models.TextContent` + +```python +value: models.TextContent = /* values here */ +``` + +### `models.ImageContent` + +```python +value: models.ImageContent = /* values here */ +``` + +### `models.AudioContent` + +```python +value: models.AudioContent = /* values here */ +``` + +### `models.ResourceLink` + +```python +value: models.ResourceLink = /* values here */ +``` + +### `models.EmbeddedResource` + +```python +value: models.EmbeddedResource = /* values here */ +``` + diff --git a/docs/models/connectortoollocale.md b/docs/models/connectortoollocale.md new file mode 100644 index 00000000..b882c419 --- /dev/null +++ b/docs/models/connectortoollocale.md @@ -0,0 +1,10 @@ +# ConnectorToolLocale + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `name` | Dict[str, *str*] | :heavy_check_mark: | N/A | +| `description` | Dict[str, *str*] | :heavy_check_mark: | N/A | +| `usage_sentence` | Dict[str, *str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectortoolresultmetadata.md b/docs/models/connectortoolresultmetadata.md new file mode 100644 index 00000000..77a327dc --- /dev/null +++ b/docs/models/connectortoolresultmetadata.md @@ -0,0 +1,13 @@ +# ConnectorToolResultMetadata + +MCP-specific result metadata (isError, structuredContent, _meta). + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `is_error` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `structured_content` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `meta` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/connectorupdatev1request.md b/docs/models/connectorupdatev1request.md new file mode 100644 index 00000000..db9cc9b4 --- /dev/null +++ b/docs/models/connectorupdatev1request.md @@ -0,0 +1,9 @@ +# ConnectorUpdateV1Request + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `update_connector_request` | [models.UpdateConnectorRequest](../models/updateconnectorrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/content.md b/docs/models/content.md deleted file mode 100644 index a833dc2c..00000000 --- a/docs/models/content.md +++ /dev/null @@ -1,17 +0,0 @@ -# Content - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[models.ContentChunk]` - -```python -value: List[models.ContentChunk] = /* values here */ -``` - diff --git a/docs/models/context.md b/docs/models/context.md new file mode 100644 index 00000000..107f1bd4 --- /dev/null +++ b/docs/models/context.md @@ -0,0 +1,7 @@ +# Context + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/conversationappendrequest.md b/docs/models/conversationappendrequest.md index 1cdb584b..471fcc31 100644 --- a/docs/models/conversationappendrequest.md +++ b/docs/models/conversationappendrequest.md @@ -5,8 +5,9 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `inputs` | [Optional[models.ConversationInputs]](../models/conversationinputs.md) | :heavy_minus_sign: | N/A | +| `stream` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationAppendRequestHandoffExecution]](../models/conversationappendrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | -| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | \ No newline at end of file +| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `tool_confirmations` | List[[models.ToolCallConfirmation](../models/toolcallconfirmation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/conversationappendrequesthandoffexecution.md b/docs/models/conversationappendrequesthandoffexecution.md index 7418b36a..70cef2ed 100644 --- a/docs/models/conversationappendrequesthandoffexecution.md +++ b/docs/models/conversationappendrequesthandoffexecution.md @@ -1,9 +1,14 @@ # ConversationAppendRequestHandoffExecution +## Example Usage + +```python +from mistralai.client.models import ConversationAppendRequestHandoffExecution +value: ConversationAppendRequestHandoffExecution = "client" +``` + ## Values -| Name | Value | -| -------- | -------- | -| `CLIENT` | client | -| `SERVER` | server | \ No newline at end of file +- `"client"` +- `"server"` diff --git a/docs/models/conversationappendstreamrequest.md b/docs/models/conversationappendstreamrequest.md index a8516ea7..a54d5d3e 100644 --- a/docs/models/conversationappendstreamrequest.md +++ b/docs/models/conversationappendstreamrequest.md @@ -5,8 +5,9 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `inputs` | [Optional[models.ConversationInputs]](../models/conversationinputs.md) | :heavy_minus_sign: | N/A | +| `stream` | *Optional[Literal[True]]* | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationAppendStreamRequestHandoffExecution]](../models/conversationappendstreamrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | -| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | \ No newline at end of file +| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `tool_confirmations` | List[[models.ToolCallConfirmation](../models/toolcallconfirmation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/conversationappendstreamrequesthandoffexecution.md b/docs/models/conversationappendstreamrequesthandoffexecution.md index 1bbced3e..dea51978 100644 --- a/docs/models/conversationappendstreamrequesthandoffexecution.md +++ b/docs/models/conversationappendstreamrequesthandoffexecution.md @@ -1,9 +1,14 @@ # ConversationAppendStreamRequestHandoffExecution +## Example Usage + +```python +from mistralai.client.models import ConversationAppendStreamRequestHandoffExecution +value: ConversationAppendStreamRequestHandoffExecution = "client" +``` + ## Values -| Name | Value | -| -------- | -------- | -| `CLIENT` | client | -| `SERVER` | server | \ No newline at end of file +- `"client"` +- `"server"` diff --git a/docs/models/conversationhistory.md b/docs/models/conversationhistory.md index ebb1d513..daefe336 100644 --- a/docs/models/conversationhistory.md +++ b/docs/models/conversationhistory.md @@ -5,8 +5,8 @@ Retrieve all entries in a conversation. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `object` | [Optional[models.ConversationHistoryObject]](../models/conversationhistoryobject.md) | :heavy_minus_sign: | N/A | -| `conversation_id` | *str* | :heavy_check_mark: | N/A | -| `entries` | List[[models.Entries](../models/entries.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `object` | *Optional[Literal["conversation.history"]]* | :heavy_minus_sign: | N/A | +| `conversation_id` | *str* | :heavy_check_mark: | N/A | +| `entries` | List[[models.Entry](../models/entry.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/conversationhistoryobject.md b/docs/models/conversationhistoryobject.md deleted file mode 100644 index a14e7f9c..00000000 --- a/docs/models/conversationhistoryobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# ConversationHistoryObject - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `CONVERSATION_HISTORY` | conversation.history | \ No newline at end of file diff --git a/docs/models/conversationmessages.md b/docs/models/conversationmessages.md index c3f00979..8fa51571 100644 --- a/docs/models/conversationmessages.md +++ b/docs/models/conversationmessages.md @@ -5,8 +5,8 @@ Similar to the conversation history but only keep the messages ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `object` | [Optional[models.ConversationMessagesObject]](../models/conversationmessagesobject.md) | :heavy_minus_sign: | N/A | -| `conversation_id` | *str* | :heavy_check_mark: | N/A | -| `messages` | List[[models.MessageEntries](../models/messageentries.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `object` | *Optional[Literal["conversation.messages"]]* | :heavy_minus_sign: | N/A | +| `conversation_id` | *str* | :heavy_check_mark: | N/A | +| `messages` | List[[models.MessageEntries](../models/messageentries.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/conversationmessagesobject.md b/docs/models/conversationmessagesobject.md deleted file mode 100644 index db3a441b..00000000 --- a/docs/models/conversationmessagesobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# ConversationMessagesObject - - -## Values - -| Name | Value | -| ----------------------- | ----------------------- | -| `CONVERSATION_MESSAGES` | conversation.messages | \ No newline at end of file diff --git a/docs/models/conversationpayload.md b/docs/models/conversationpayload.md new file mode 100644 index 00000000..481f18e6 --- /dev/null +++ b/docs/models/conversationpayload.md @@ -0,0 +1,9 @@ +# ConversationPayload + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `messages` | List[Dict[str, *Any*]] | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/conversationrequest.md b/docs/models/conversationrequest.md index 141533e7..6a5dc206 100644 --- a/docs/models/conversationrequest.md +++ b/docs/models/conversationrequest.md @@ -3,16 +3,19 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | -| `handoff_execution` | [OptionalNullable[models.HandoffExecution]](../models/handoffexecution.md) | :heavy_minus_sign: | N/A | -| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `tools` | List[[models.Tools](../models/tools.md)] | :heavy_minus_sign: | N/A | -| `completion_args` | [OptionalNullable[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | +| `stream` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | +| `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `handoff_execution` | [OptionalNullable[models.ConversationRequestHandoffExecution]](../models/conversationrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | +| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `tools` | List[[models.ConversationRequestTool](../models/conversationrequesttool.md)] | :heavy_minus_sign: | N/A | +| `completion_args` | [OptionalNullable[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | N/A | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_version` | [OptionalNullable[models.ConversationRequestAgentVersion]](../models/conversationrequestagentversion.md) | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/conversationrequestagentversion.md b/docs/models/conversationrequestagentversion.md new file mode 100644 index 00000000..9f251821 --- /dev/null +++ b/docs/models/conversationrequestagentversion.md @@ -0,0 +1,17 @@ +# ConversationRequestAgentVersion + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + diff --git a/docs/models/conversationrequesthandoffexecution.md b/docs/models/conversationrequesthandoffexecution.md new file mode 100644 index 00000000..de9dc287 --- /dev/null +++ b/docs/models/conversationrequesthandoffexecution.md @@ -0,0 +1,14 @@ +# ConversationRequestHandoffExecution + +## Example Usage + +```python +from mistralai.client.models import ConversationRequestHandoffExecution +value: ConversationRequestHandoffExecution = "client" +``` + + +## Values + +- `"client"` +- `"server"` diff --git a/docs/models/conversationrequesttool.md b/docs/models/conversationrequesttool.md new file mode 100644 index 00000000..5a58e6d1 --- /dev/null +++ b/docs/models/conversationrequesttool.md @@ -0,0 +1,47 @@ +# ConversationRequestTool + + +## Supported Types + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.FunctionTool` + +```python +value: models.FunctionTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + diff --git a/docs/models/conversationresponse.md b/docs/models/conversationresponse.md index 38cdadd0..414755d3 100644 --- a/docs/models/conversationresponse.md +++ b/docs/models/conversationresponse.md @@ -5,9 +5,10 @@ The response after appending new entries to the conversation. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `object` | [Optional[models.ConversationResponseObject]](../models/conversationresponseobject.md) | :heavy_minus_sign: | N/A | -| `conversation_id` | *str* | :heavy_check_mark: | N/A | -| `outputs` | List[[models.Outputs](../models/outputs.md)] | :heavy_check_mark: | N/A | -| `usage` | [models.ConversationUsageInfo](../models/conversationusageinfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `object` | *Optional[Literal["conversation.response"]]* | :heavy_minus_sign: | N/A | +| `conversation_id` | *str* | :heavy_check_mark: | N/A | +| `outputs` | List[[models.ConversationResponseOutput](../models/conversationresponseoutput.md)] | :heavy_check_mark: | N/A | +| `usage` | [models.ConversationUsageInfo](../models/conversationusageinfo.md) | :heavy_check_mark: | N/A | +| `guardrails` | List[Dict[str, *Any*]] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/conversationresponseobject.md b/docs/models/conversationresponseobject.md deleted file mode 100644 index bea66e52..00000000 --- a/docs/models/conversationresponseobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# ConversationResponseObject - - -## Values - -| Name | Value | -| ----------------------- | ----------------------- | -| `CONVERSATION_RESPONSE` | conversation.response | \ No newline at end of file diff --git a/docs/models/conversationresponseoutput.md b/docs/models/conversationresponseoutput.md new file mode 100644 index 00000000..fe8ad1b5 --- /dev/null +++ b/docs/models/conversationresponseoutput.md @@ -0,0 +1,29 @@ +# ConversationResponseOutput + + +## Supported Types + +### `models.MessageOutputEntry` + +```python +value: models.MessageOutputEntry = /* values here */ +``` + +### `models.ToolExecutionEntry` + +```python +value: models.ToolExecutionEntry = /* values here */ +``` + +### `models.FunctionCallEntry` + +```python +value: models.FunctionCallEntry = /* values here */ +``` + +### `models.AgentHandoffEntry` + +```python +value: models.AgentHandoffEntry = /* values here */ +``` + diff --git a/docs/models/conversationrestartrequest.md b/docs/models/conversationrestartrequest.md index 61679df6..be0f2289 100644 --- a/docs/models/conversationrestartrequest.md +++ b/docs/models/conversationrestartrequest.md @@ -7,9 +7,12 @@ Request to restart a new conversation from a given entry in the conversation. | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `inputs` | [Optional[models.ConversationInputs]](../models/conversationinputs.md) | :heavy_minus_sign: | N/A | +| `stream` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationRestartRequestHandoffExecution]](../models/conversationrestartrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | | `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | -| `from_entry_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Custom metadata for the conversation. | +| `from_entry_id` | *str* | :heavy_check_mark: | N/A | +| `agent_version` | [OptionalNullable[models.ConversationRestartRequestAgentVersion]](../models/conversationrestartrequestagentversion.md) | :heavy_minus_sign: | Specific version of the agent to use when restarting. If not provided, uses the current version. | \ No newline at end of file diff --git a/docs/models/conversationrestartrequestagentversion.md b/docs/models/conversationrestartrequestagentversion.md new file mode 100644 index 00000000..019ba301 --- /dev/null +++ b/docs/models/conversationrestartrequestagentversion.md @@ -0,0 +1,19 @@ +# ConversationRestartRequestAgentVersion + +Specific version of the agent to use when restarting. If not provided, uses the current version. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + diff --git a/docs/models/conversationrestartrequesthandoffexecution.md b/docs/models/conversationrestartrequesthandoffexecution.md index 5790624b..4e202d69 100644 --- a/docs/models/conversationrestartrequesthandoffexecution.md +++ b/docs/models/conversationrestartrequesthandoffexecution.md @@ -1,9 +1,14 @@ # ConversationRestartRequestHandoffExecution +## Example Usage + +```python +from mistralai.client.models import ConversationRestartRequestHandoffExecution +value: ConversationRestartRequestHandoffExecution = "client" +``` + ## Values -| Name | Value | -| -------- | -------- | -| `CLIENT` | client | -| `SERVER` | server | \ No newline at end of file +- `"client"` +- `"server"` diff --git a/docs/models/conversationrestartstreamrequest.md b/docs/models/conversationrestartstreamrequest.md index 9548b336..f99a6e34 100644 --- a/docs/models/conversationrestartstreamrequest.md +++ b/docs/models/conversationrestartstreamrequest.md @@ -7,9 +7,12 @@ Request to restart a new conversation from a given entry in the conversation. | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `inputs` | [Optional[models.ConversationInputs]](../models/conversationinputs.md) | :heavy_minus_sign: | N/A | +| `stream` | *Optional[Literal[True]]* | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationRestartStreamRequestHandoffExecution]](../models/conversationrestartstreamrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | | `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | -| `from_entry_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Custom metadata for the conversation. | +| `from_entry_id` | *str* | :heavy_check_mark: | N/A | +| `agent_version` | [OptionalNullable[models.ConversationRestartStreamRequestAgentVersion]](../models/conversationrestartstreamrequestagentversion.md) | :heavy_minus_sign: | Specific version of the agent to use when restarting. If not provided, uses the current version. | \ No newline at end of file diff --git a/docs/models/conversationrestartstreamrequestagentversion.md b/docs/models/conversationrestartstreamrequestagentversion.md new file mode 100644 index 00000000..9e006300 --- /dev/null +++ b/docs/models/conversationrestartstreamrequestagentversion.md @@ -0,0 +1,19 @@ +# ConversationRestartStreamRequestAgentVersion + +Specific version of the agent to use when restarting. If not provided, uses the current version. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + diff --git a/docs/models/conversationrestartstreamrequesthandoffexecution.md b/docs/models/conversationrestartstreamrequesthandoffexecution.md index 97266b43..9d2c5633 100644 --- a/docs/models/conversationrestartstreamrequesthandoffexecution.md +++ b/docs/models/conversationrestartstreamrequesthandoffexecution.md @@ -1,9 +1,14 @@ # ConversationRestartStreamRequestHandoffExecution +## Example Usage + +```python +from mistralai.client.models import ConversationRestartStreamRequestHandoffExecution +value: ConversationRestartStreamRequestHandoffExecution = "client" +``` + ## Values -| Name | Value | -| -------- | -------- | -| `CLIENT` | client | -| `SERVER` | server | \ No newline at end of file +- `"client"` +- `"server"` diff --git a/docs/models/conversationsource.md b/docs/models/conversationsource.md new file mode 100644 index 00000000..ee88d9d4 --- /dev/null +++ b/docs/models/conversationsource.md @@ -0,0 +1,20 @@ +# ConversationSource + +## Example Usage + +```python +from mistralai.client.models import ConversationSource + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ConversationSource = "EXPLORER" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"EXPLORER"` +- `"UPLOADED_FILE"` +- `"DIRECT_INPUT"` +- `"PLAYGROUND"` diff --git a/docs/models/conversationstreamrequest.md b/docs/models/conversationstreamrequest.md index a571e2af..af50989c 100644 --- a/docs/models/conversationstreamrequest.md +++ b/docs/models/conversationstreamrequest.md @@ -6,13 +6,16 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | `inputs` | [models.ConversationInputs](../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `stream` | *Optional[Literal[True]]* | :heavy_minus_sign: | N/A | | `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | `handoff_execution` | [OptionalNullable[models.ConversationStreamRequestHandoffExecution]](../models/conversationstreamrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | | `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `tools` | List[[models.ConversationStreamRequestTools](../models/conversationstreamrequesttools.md)] | :heavy_minus_sign: | N/A | +| `tools` | List[[models.ConversationStreamRequestTool](../models/conversationstreamrequesttool.md)] | :heavy_minus_sign: | N/A | | `completion_args` | [OptionalNullable[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | N/A | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_version` | [OptionalNullable[models.ConversationStreamRequestAgentVersion]](../models/conversationstreamrequestagentversion.md) | :heavy_minus_sign: | N/A | | `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/conversationstreamrequestagentversion.md b/docs/models/conversationstreamrequestagentversion.md new file mode 100644 index 00000000..52ee9672 --- /dev/null +++ b/docs/models/conversationstreamrequestagentversion.md @@ -0,0 +1,17 @@ +# ConversationStreamRequestAgentVersion + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + diff --git a/docs/models/conversationstreamrequesthandoffexecution.md b/docs/models/conversationstreamrequesthandoffexecution.md index c98e194c..247bfd23 100644 --- a/docs/models/conversationstreamrequesthandoffexecution.md +++ b/docs/models/conversationstreamrequesthandoffexecution.md @@ -1,9 +1,14 @@ # ConversationStreamRequestHandoffExecution +## Example Usage + +```python +from mistralai.client.models import ConversationStreamRequestHandoffExecution +value: ConversationStreamRequestHandoffExecution = "client" +``` + ## Values -| Name | Value | -| -------- | -------- | -| `CLIENT` | client | -| `SERVER` | server | \ No newline at end of file +- `"client"` +- `"server"` diff --git a/docs/models/conversationstreamrequesttool.md b/docs/models/conversationstreamrequesttool.md new file mode 100644 index 00000000..82ef640a --- /dev/null +++ b/docs/models/conversationstreamrequesttool.md @@ -0,0 +1,47 @@ +# ConversationStreamRequestTool + + +## Supported Types + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.FunctionTool` + +```python +value: models.FunctionTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + diff --git a/docs/models/conversationstreamrequesttools.md b/docs/models/conversationstreamrequesttools.md deleted file mode 100644 index 700c8448..00000000 --- a/docs/models/conversationstreamrequesttools.md +++ /dev/null @@ -1,41 +0,0 @@ -# ConversationStreamRequestTools - - -## Supported Types - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.FunctionTool` - -```python -value: models.FunctionTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - diff --git a/docs/models/createagentrequest.md b/docs/models/createagentrequest.md new file mode 100644 index 00000000..e9665545 --- /dev/null +++ b/docs/models/createagentrequest.md @@ -0,0 +1,17 @@ +# CreateAgentRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | +| `tools` | List[[models.CreateAgentRequestTool](../models/createagentrequesttool.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | +| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `version_message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/createagentrequesttool.md b/docs/models/createagentrequesttool.md new file mode 100644 index 00000000..e45d57bc --- /dev/null +++ b/docs/models/createagentrequesttool.md @@ -0,0 +1,47 @@ +# CreateAgentRequestTool + + +## Supported Types + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.FunctionTool` + +```python +value: models.FunctionTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + diff --git a/docs/models/createbatchjobrequest.md b/docs/models/createbatchjobrequest.md new file mode 100644 index 00000000..1f27a563 --- /dev/null +++ b/docs/models/createbatchjobrequest.md @@ -0,0 +1,14 @@ +# CreateBatchJobRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input_files` | List[*str*] | :heavy_minus_sign: | A list of `.jsonl` files for batch inference.
Each line must be a JSON object with a `body` field containing the request payload:
```json
{"custom_id": "0", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French cheese?"}]}}
{"custom_id": "1", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French wine?"}]}}
``` | | +| `requests` | List[[models.BatchRequest](../models/batchrequest.md)] | :heavy_minus_sign: | N/A | | +| `endpoint` | [models.APIEndpoint](../models/apiendpoint.md) | :heavy_check_mark: | N/A | | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The model to be used for batch inference. | **Example 1:** mistral-small-latest
**Example 2:** mistral-medium-latest | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here. | | +| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | The metadata of your choice to be associated with the batch inference job. | | +| `timeout_hours` | *Optional[int]* | :heavy_minus_sign: | The timeout in hours for the batch inference job. | | \ No newline at end of file diff --git a/docs/models/createcampaignrequest.md b/docs/models/createcampaignrequest.md new file mode 100644 index 00000000..2e81d26d --- /dev/null +++ b/docs/models/createcampaignrequest.md @@ -0,0 +1,12 @@ +# CreateCampaignRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `search_params` | [models.FilterPayload](../models/filterpayload.md) | :heavy_check_mark: | N/A | +| `judge_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `max_nb_events` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createconnectorrequest.md b/docs/models/createconnectorrequest.md new file mode 100644 index 00000000..111c460a --- /dev/null +++ b/docs/models/createconnectorrequest.md @@ -0,0 +1,16 @@ +# CreateConnectorRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes. | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional human-readable title for the connector. | +| `description` | *str* | :heavy_check_mark: | The description of the connector. | +| `icon_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The optional url of the icon you want to associate to the connector. | +| `visibility` | [Optional[models.ResourceVisibility]](../models/resourcevisibility.md) | :heavy_minus_sign: | N/A | +| `server` | *str* | :heavy_check_mark: | The url of the MCP server. | +| `headers` | Dict[str, *Any*] | :heavy_minus_sign: | Optional organization-level headers to be sent with the request to the mcp server. | +| `auth_data` | [OptionalNullable[models.AuthData]](../models/authdata.md) | :heavy_minus_sign: | Optional additional authentication data for the connector. | +| `system_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional system prompt for the connector. | \ No newline at end of file diff --git a/docs/models/createdatasetrecordrequest.md b/docs/models/createdatasetrecordrequest.md new file mode 100644 index 00000000..3ea0d68d --- /dev/null +++ b/docs/models/createdatasetrecordrequest.md @@ -0,0 +1,9 @@ +# CreateDatasetRecordRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `payload` | [models.ConversationPayload](../models/conversationpayload.md) | :heavy_check_mark: | N/A | +| `properties` | Dict[str, *Any*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createdatasetrecordv1observabilitydatasetsdatasetidrecordspostrequest.md b/docs/models/createdatasetrecordv1observabilitydatasetsdatasetidrecordspostrequest.md new file mode 100644 index 00000000..7fe42faa --- /dev/null +++ b/docs/models/createdatasetrecordv1observabilitydatasetsdatasetidrecordspostrequest.md @@ -0,0 +1,9 @@ +# CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `create_dataset_record_request` | [models.CreateDatasetRecordRequest](../models/createdatasetrecordrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createdatasetrequest.md b/docs/models/createdatasetrequest.md new file mode 100644 index 00000000..d4c16643 --- /dev/null +++ b/docs/models/createdatasetrequest.md @@ -0,0 +1,9 @@ +# CreateDatasetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createfileresponse.md b/docs/models/createfileresponse.md new file mode 100644 index 00000000..84be4dc6 --- /dev/null +++ b/docs/models/createfileresponse.md @@ -0,0 +1,20 @@ +# CreateFileResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the file. | 497f6eca-6276-4993-bfeb-53cbbbba6f09 | +| `object` | *str* | :heavy_check_mark: | The object type, which is always "file". | file | +| `size_bytes` | *int* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | +| `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | +| `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | +| `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | +| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `mimetype` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | +| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `expires_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `visibility` | [OptionalNullable[models.FileVisibility]](../models/filevisibility.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/createfinetuningjobrequest.md b/docs/models/createfinetuningjobrequest.md new file mode 100644 index 00000000..a93e323d --- /dev/null +++ b/docs/models/createfinetuningjobrequest.md @@ -0,0 +1,18 @@ +# CreateFineTuningJobRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | N/A | +| `training_files` | List[[models.TrainingFile](../models/trainingfile.md)] | :heavy_minus_sign: | N/A | +| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` | +| `integrations` | List[[models.CreateFineTuningJobRequestIntegration](../models/createfinetuningjobrequestintegration.md)] | :heavy_minus_sign: | A list of integrations to enable for your fine-tuning job. | +| `auto_start` | *Optional[bool]* | :heavy_minus_sign: | This field will be required in a future release. | +| `invalid_sample_skip_percentage` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `job_type` | [OptionalNullable[models.FineTuneableModelType]](../models/finetuneablemodeltype.md) | :heavy_minus_sign: | N/A | +| `hyperparameters` | [models.Hyperparameters](../models/hyperparameters.md) | :heavy_check_mark: | N/A | +| `repositories` | List[[models.CreateFineTuningJobRequestRepository](../models/createfinetuningjobrequestrepository.md)] | :heavy_minus_sign: | N/A | +| `classifier_targets` | List[[models.ClassifierTarget](../models/classifiertarget.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/createfinetuningjobrequestintegration.md b/docs/models/createfinetuningjobrequestintegration.md new file mode 100644 index 00000000..0054a4a6 --- /dev/null +++ b/docs/models/createfinetuningjobrequestintegration.md @@ -0,0 +1,11 @@ +# CreateFineTuningJobRequestIntegration + + +## Supported Types + +### `models.WandbIntegration` + +```python +value: models.WandbIntegration = /* values here */ +``` + diff --git a/docs/models/createfinetuningjobrequestrepository.md b/docs/models/createfinetuningjobrequestrepository.md new file mode 100644 index 00000000..42b6c6ca --- /dev/null +++ b/docs/models/createfinetuningjobrequestrepository.md @@ -0,0 +1,11 @@ +# CreateFineTuningJobRequestRepository + + +## Supported Types + +### `models.CreateGithubRepositoryRequest` + +```python +value: models.CreateGithubRepositoryRequest = /* values here */ +``` + diff --git a/docs/models/creategithubrepositoryrequest.md b/docs/models/creategithubrepositoryrequest.md new file mode 100644 index 00000000..502afa7b --- /dev/null +++ b/docs/models/creategithubrepositoryrequest.md @@ -0,0 +1,13 @@ +# CreateGithubRepositoryRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `type` | *Literal["github"]* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `owner` | *str* | :heavy_check_mark: | N/A | +| `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createingestionpipelineconfigurationrequest.md b/docs/models/createingestionpipelineconfigurationrequest.md new file mode 100644 index 00000000..f6aeb210 --- /dev/null +++ b/docs/models/createingestionpipelineconfigurationrequest.md @@ -0,0 +1,9 @@ +# CreateIngestionPipelineConfigurationRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `pipeline_composition` | Dict[str, *str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/createjudgerequest.md b/docs/models/createjudgerequest.md new file mode 100644 index 00000000..ccb1119a --- /dev/null +++ b/docs/models/createjudgerequest.md @@ -0,0 +1,13 @@ +# CreateJudgeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `model_name` | *str* | :heavy_check_mark: | N/A | +| `output` | [models.CreateJudgeRequestOutput](../models/createjudgerequestoutput.md) | :heavy_check_mark: | N/A | +| `instructions` | *str* | :heavy_check_mark: | N/A | +| `tools` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/createjudgerequestoutput.md b/docs/models/createjudgerequestoutput.md new file mode 100644 index 00000000..a7267671 --- /dev/null +++ b/docs/models/createjudgerequestoutput.md @@ -0,0 +1,17 @@ +# CreateJudgeRequestOutput + + +## Supported Types + +### `models.JudgeClassificationOutput` + +```python +value: models.JudgeClassificationOutput = /* values here */ +``` + +### `models.JudgeRegressionOutput` + +```python +value: models.JudgeRegressionOutput = /* values here */ +``` + diff --git a/docs/models/createlibraryrequest.md b/docs/models/createlibraryrequest.md new file mode 100644 index 00000000..07ff97d0 --- /dev/null +++ b/docs/models/createlibraryrequest.md @@ -0,0 +1,11 @@ +# CreateLibraryRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `chunk_size` | *OptionalNullable[int]* | :heavy_minus_sign: | The size of the chunks (in characters) to split document text into. Must be between 256 and 32768. | +| `owner_type` | [OptionalNullable[models.OwnerType]](../models/ownertype.md) | :heavy_minus_sign: | Determines who owns the created library. 'User' creates a private library accessible only to its owner. 'Workspace' creates a library shared with the workspace. Defaults to 'Workspace' for API key sessions. Only API keys with the 'Private and shared connectors' connector access scope can create private, user-owned libraries. | \ No newline at end of file diff --git a/docs/models/credentialscreateorupdate.md b/docs/models/credentialscreateorupdate.md new file mode 100644 index 00000000..c544d7c6 --- /dev/null +++ b/docs/models/credentialscreateorupdate.md @@ -0,0 +1,12 @@ +# CredentialsCreateOrUpdate + +Request to create or update non-OAuth2 credentials for a connector. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name of the credentials. Use this name to access or modify your credentials. | +| `is_default` | *OptionalNullable[bool]* | :heavy_minus_sign: | Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. | +| `credentials` | [OptionalNullable[models.ConnectionCredentials]](../models/connectioncredentials.md) | :heavy_minus_sign: | The credential data (headers, bearer_token). | \ No newline at end of file diff --git a/docs/models/credentialsresponse.md b/docs/models/credentialsresponse.md new file mode 100644 index 00000000..1c9a8596 --- /dev/null +++ b/docs/models/credentialsresponse.md @@ -0,0 +1,9 @@ +# CredentialsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `credentials` | List[[models.AuthenticationConfiguration](../models/authenticationconfiguration.md)] | :heavy_check_mark: | N/A | +| `connector_preset_credentials_for_auth` | List[[models.OutboundAuthenticationType](../models/outboundauthenticationtype.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/customconnector.md b/docs/models/customconnector.md new file mode 100644 index 00000000..0a0b6921 --- /dev/null +++ b/docs/models/customconnector.md @@ -0,0 +1,11 @@ +# CustomConnector + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `type` | *Literal["connector"]* | :heavy_check_mark: | N/A | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `authorization` | [OptionalNullable[models.Authorization]](../models/authorization.md) | :heavy_minus_sign: | N/A | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/customtaskcanceledattributes.md b/docs/models/customtaskcanceledattributes.md new file mode 100644 index 00000000..3a5facdd --- /dev/null +++ b/docs/models/customtaskcanceledattributes.md @@ -0,0 +1,12 @@ +# CustomTaskCanceledAttributes + +Attributes for custom task canceled events. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `custom_task_id` | *str* | :heavy_check_mark: | Unique identifier for the custom task within the workflow. | +| `custom_task_type` | *str* | :heavy_check_mark: | The type/category of the custom task (e.g., 'llm_call', 'api_request'). | +| `reason` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reason provided for the cancellation. | \ No newline at end of file diff --git a/docs/models/customtaskcanceledresponse.md b/docs/models/customtaskcanceledresponse.md new file mode 100644 index 00000000..0bcee227 --- /dev/null +++ b/docs/models/customtaskcanceledresponse.md @@ -0,0 +1,20 @@ +# CustomTaskCanceledResponse + +Emitted when a custom task is canceled. + +Indicates the task was explicitly stopped before completion. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["CUSTOM_TASK_CANCELED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.CustomTaskCanceledAttributes](../models/customtaskcanceledattributes.md) | :heavy_check_mark: | Attributes for custom task canceled events. | \ No newline at end of file diff --git a/docs/models/customtaskcompletedattributesresponse.md b/docs/models/customtaskcompletedattributesresponse.md new file mode 100644 index 00000000..4c7cbfa2 --- /dev/null +++ b/docs/models/customtaskcompletedattributesresponse.md @@ -0,0 +1,12 @@ +# CustomTaskCompletedAttributesResponse + +Attributes for custom task completed events. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `custom_task_id` | *str* | :heavy_check_mark: | Unique identifier for the custom task within the workflow. | +| `custom_task_type` | *str* | :heavy_check_mark: | The type/category of the custom task (e.g., 'llm_call', 'api_request'). | +| `payload` | [models.JSONPayloadResponse](../models/jsonpayloadresponse.md) | :heavy_check_mark: | A payload containing arbitrary JSON data.

Used for complete state snapshots or final results.
When encrypted, the value field contains base64-encoded encrypted data
and encoding_options indicates the type of encryption applied. | \ No newline at end of file diff --git a/docs/models/customtaskcompletedresponse.md b/docs/models/customtaskcompletedresponse.md new file mode 100644 index 00000000..6871184f --- /dev/null +++ b/docs/models/customtaskcompletedresponse.md @@ -0,0 +1,20 @@ +# CustomTaskCompletedResponse + +Emitted when a custom task completes successfully. + +Contains the final result of the task execution. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["CUSTOM_TASK_COMPLETED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.CustomTaskCompletedAttributesResponse](../models/customtaskcompletedattributesresponse.md) | :heavy_check_mark: | Attributes for custom task completed events. | \ No newline at end of file diff --git a/docs/models/customtaskfailedattributes.md b/docs/models/customtaskfailedattributes.md new file mode 100644 index 00000000..f4e3ab2d --- /dev/null +++ b/docs/models/customtaskfailedattributes.md @@ -0,0 +1,12 @@ +# CustomTaskFailedAttributes + +Attributes for custom task failed events. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `custom_task_id` | *str* | :heavy_check_mark: | Unique identifier for the custom task within the workflow. | +| `custom_task_type` | *str* | :heavy_check_mark: | The type/category of the custom task (e.g., 'llm_call', 'api_request'). | +| `failure` | [models.Failure](../models/failure.md) | :heavy_check_mark: | Represents an error or exception that occurred during execution. | \ No newline at end of file diff --git a/docs/models/customtaskfailedresponse.md b/docs/models/customtaskfailedresponse.md new file mode 100644 index 00000000..e14e4afa --- /dev/null +++ b/docs/models/customtaskfailedresponse.md @@ -0,0 +1,20 @@ +# CustomTaskFailedResponse + +Emitted when a custom task fails. + +Contains details about the failure for debugging and error handling. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["CUSTOM_TASK_FAILED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.CustomTaskFailedAttributes](../models/customtaskfailedattributes.md) | :heavy_check_mark: | Attributes for custom task failed events. | \ No newline at end of file diff --git a/docs/models/customtaskinprogressattributesresponse.md b/docs/models/customtaskinprogressattributesresponse.md new file mode 100644 index 00000000..d55b8137 --- /dev/null +++ b/docs/models/customtaskinprogressattributesresponse.md @@ -0,0 +1,12 @@ +# CustomTaskInProgressAttributesResponse + +Attributes for custom task in-progress events with streaming updates. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `custom_task_id` | *str* | :heavy_check_mark: | Unique identifier for the custom task within the workflow. | +| `custom_task_type` | *str* | :heavy_check_mark: | The type/category of the custom task (e.g., 'llm_call', 'api_request'). | +| `payload` | [models.Payload](../models/payload.md) | :heavy_check_mark: | The current state or incremental update for the task. | \ No newline at end of file diff --git a/docs/models/customtaskinprogressresponse.md b/docs/models/customtaskinprogressresponse.md new file mode 100644 index 00000000..72afa91f --- /dev/null +++ b/docs/models/customtaskinprogressresponse.md @@ -0,0 +1,21 @@ +# CustomTaskInProgressResponse + +Emitted during custom task execution to report progress. + +This event supports streaming updates via JSON or JSON Patch payloads, +enabling real-time progress tracking for long-running tasks. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["CUSTOM_TASK_IN_PROGRESS"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.CustomTaskInProgressAttributesResponse](../models/customtaskinprogressattributesresponse.md) | :heavy_check_mark: | Attributes for custom task in-progress events with streaming updates. | \ No newline at end of file diff --git a/docs/models/customtaskstartedattributesresponse.md b/docs/models/customtaskstartedattributesresponse.md new file mode 100644 index 00000000..41cd66a9 --- /dev/null +++ b/docs/models/customtaskstartedattributesresponse.md @@ -0,0 +1,12 @@ +# CustomTaskStartedAttributesResponse + +Attributes for custom task started events. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `custom_task_id` | *str* | :heavy_check_mark: | Unique identifier for the custom task within the workflow. | +| `custom_task_type` | *str* | :heavy_check_mark: | The type/category of the custom task (e.g., 'llm_call', 'api_request'). | +| `payload` | [Optional[models.JSONPayloadResponse]](../models/jsonpayloadresponse.md) | :heavy_minus_sign: | A payload containing arbitrary JSON data.

Used for complete state snapshots or final results.
When encrypted, the value field contains base64-encoded encrypted data
and encoding_options indicates the type of encryption applied. | \ No newline at end of file diff --git a/docs/models/customtaskstartedresponse.md b/docs/models/customtaskstartedresponse.md new file mode 100644 index 00000000..80b1b08b --- /dev/null +++ b/docs/models/customtaskstartedresponse.md @@ -0,0 +1,21 @@ +# CustomTaskStartedResponse + +Emitted when a custom task begins execution. + +Custom tasks represent user-defined units of work within a workflow, +such as LLM calls, API requests, or data processing steps. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["CUSTOM_TASK_STARTED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.CustomTaskStartedAttributesResponse](../models/customtaskstartedattributesresponse.md) | :heavy_check_mark: | Attributes for custom task started events. | \ No newline at end of file diff --git a/docs/models/customtasktimedoutattributes.md b/docs/models/customtasktimedoutattributes.md new file mode 100644 index 00000000..b302b076 --- /dev/null +++ b/docs/models/customtasktimedoutattributes.md @@ -0,0 +1,12 @@ +# CustomTaskTimedOutAttributes + +Attributes for custom task timed out events. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `custom_task_id` | *str* | :heavy_check_mark: | Unique identifier for the custom task within the workflow. | +| `custom_task_type` | *str* | :heavy_check_mark: | The type/category of the custom task (e.g., 'llm_call', 'api_request'). | +| `timeout_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of timeout that occurred. | \ No newline at end of file diff --git a/docs/models/customtasktimedoutresponse.md b/docs/models/customtasktimedoutresponse.md new file mode 100644 index 00000000..75d49743 --- /dev/null +++ b/docs/models/customtasktimedoutresponse.md @@ -0,0 +1,20 @@ +# CustomTaskTimedOutResponse + +Emitted when a custom task exceeds its timeout. + +Indicates the task did not complete within its configured time limit. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["CUSTOM_TASK_TIMED_OUT"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.CustomTaskTimedOutAttributes](../models/customtasktimedoutattributes.md) | :heavy_check_mark: | Attributes for custom task timed out events. | \ No newline at end of file diff --git a/docs/models/data.md b/docs/models/data.md deleted file mode 100644 index 95dc8d28..00000000 --- a/docs/models/data.md +++ /dev/null @@ -1,17 +0,0 @@ -# Data - - -## Supported Types - -### `models.BaseModelCard` - -```python -value: models.BaseModelCard = /* values here */ -``` - -### `models.FTModelCard` - -```python -value: models.FTModelCard = /* values here */ -``` - diff --git a/docs/models/dataset.md b/docs/models/dataset.md new file mode 100644 index 00000000..9d235433 --- /dev/null +++ b/docs/models/dataset.md @@ -0,0 +1,15 @@ +# Dataset + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `deleted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `owner_id` | *str* | :heavy_check_mark: | N/A | +| `workspace_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/datasetimporttask.md b/docs/models/datasetimporttask.md new file mode 100644 index 00000000..21e6130f --- /dev/null +++ b/docs/models/datasetimporttask.md @@ -0,0 +1,17 @@ +# DatasetImportTask + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `deleted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `creator_id` | *str* | :heavy_check_mark: | N/A | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `workspace_id` | *str* | :heavy_check_mark: | N/A | +| `status` | [models.BaseTaskStatus](../models/basetaskstatus.md) | :heavy_check_mark: | N/A | +| `progress` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/datasetpreview.md b/docs/models/datasetpreview.md new file mode 100644 index 00000000..f729908d --- /dev/null +++ b/docs/models/datasetpreview.md @@ -0,0 +1,15 @@ +# DatasetPreview + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `deleted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `owner_id` | *str* | :heavy_check_mark: | N/A | +| `workspace_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/datasetrecord.md b/docs/models/datasetrecord.md new file mode 100644 index 00000000..dbc7c3d0 --- /dev/null +++ b/docs/models/datasetrecord.md @@ -0,0 +1,15 @@ +# DatasetRecord + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `deleted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `payload` | [models.ConversationPayload](../models/conversationpayload.md) | :heavy_check_mark: | N/A | +| `properties` | Dict[str, *Any*] | :heavy_check_mark: | N/A | +| `source` | [models.ConversationSource](../models/conversationsource.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/deletebatchjobresponse.md b/docs/models/deletebatchjobresponse.md new file mode 100644 index 00000000..d0df2d19 --- /dev/null +++ b/docs/models/deletebatchjobresponse.md @@ -0,0 +1,10 @@ +# DeleteBatchJobResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `object` | *Optional[Literal["batch"]]* | :heavy_minus_sign: | N/A | +| `deleted` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/deletecampaignv1observabilitycampaignscampaigniddeleterequest.md b/docs/models/deletecampaignv1observabilitycampaignscampaigniddeleterequest.md new file mode 100644 index 00000000..4114509d --- /dev/null +++ b/docs/models/deletecampaignv1observabilitycampaignscampaigniddeleterequest.md @@ -0,0 +1,8 @@ +# DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/deletedatasetrecordsrequest.md b/docs/models/deletedatasetrecordsrequest.md new file mode 100644 index 00000000..1afc46d6 --- /dev/null +++ b/docs/models/deletedatasetrecordsrequest.md @@ -0,0 +1,8 @@ +# DeleteDatasetRecordsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `dataset_record_ids` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/deletedatasetrecordv1observabilitydatasetrecordsdatasetrecordiddeleterequest.md b/docs/models/deletedatasetrecordv1observabilitydatasetrecordsdatasetrecordiddeleterequest.md new file mode 100644 index 00000000..b2425068 --- /dev/null +++ b/docs/models/deletedatasetrecordv1observabilitydatasetrecordsdatasetrecordiddeleterequest.md @@ -0,0 +1,8 @@ +# DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/deletedatasetv1observabilitydatasetsdatasetiddeleterequest.md b/docs/models/deletedatasetv1observabilitydatasetsdatasetiddeleterequest.md new file mode 100644 index 00000000..4557d3c6 --- /dev/null +++ b/docs/models/deletedatasetv1observabilitydatasetsdatasetiddeleterequest.md @@ -0,0 +1,8 @@ +# DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/deletefileout.md b/docs/models/deletefileout.md deleted file mode 100644 index 4709cc49..00000000 --- a/docs/models/deletefileout.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteFileOut - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *str* | :heavy_check_mark: | The ID of the deleted file. | 497f6eca-6276-4993-bfeb-53cbbbba6f09 | -| `object` | *str* | :heavy_check_mark: | The object type that was deleted | file | -| `deleted` | *bool* | :heavy_check_mark: | The deletion status. | false | \ No newline at end of file diff --git a/docs/models/deletefileresponse.md b/docs/models/deletefileresponse.md new file mode 100644 index 00000000..2c3e1c23 --- /dev/null +++ b/docs/models/deletefileresponse.md @@ -0,0 +1,10 @@ +# DeleteFileResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The ID of the deleted file. | 497f6eca-6276-4993-bfeb-53cbbbba6f09 | +| `object` | *str* | :heavy_check_mark: | The object type that was deleted | file | +| `deleted` | *bool* | :heavy_check_mark: | The deletion status. | true | \ No newline at end of file diff --git a/docs/models/deletejudgev1observabilityjudgesjudgeiddeleterequest.md b/docs/models/deletejudgev1observabilityjudgesjudgeiddeleterequest.md new file mode 100644 index 00000000..44042efc --- /dev/null +++ b/docs/models/deletejudgev1observabilityjudgesjudgeiddeleterequest.md @@ -0,0 +1,8 @@ +# DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `judge_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/deletemodelout.md b/docs/models/deletemodelout.md deleted file mode 100644 index 5fd4df7a..00000000 --- a/docs/models/deletemodelout.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteModelOut - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The ID of the deleted model. | ft:open-mistral-7b:587a6b29:20240514:7e773925 | -| `object` | *Optional[str]* | :heavy_minus_sign: | The object type that was deleted | | -| `deleted` | *Optional[bool]* | :heavy_minus_sign: | The deletion status | true | \ No newline at end of file diff --git a/docs/models/deletemodelresponse.md b/docs/models/deletemodelresponse.md new file mode 100644 index 00000000..3a9f853b --- /dev/null +++ b/docs/models/deletemodelresponse.md @@ -0,0 +1,10 @@ +# DeleteModelResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The ID of the deleted model. | ft:open-mistral-7b:587a6b29:20240514:7e773925 | +| `object` | *Optional[str]* | :heavy_minus_sign: | The object type that was deleted. | | +| `deleted` | *Optional[bool]* | :heavy_minus_sign: | The deletion status. | true | \ No newline at end of file diff --git a/docs/models/deletevoicev1audiovoicesvoiceiddeleterequest.md b/docs/models/deletevoicev1audiovoicesvoiceiddeleterequest.md new file mode 100644 index 00000000..0afc04f2 --- /dev/null +++ b/docs/models/deletevoicev1audiovoicesvoiceiddeleterequest.md @@ -0,0 +1,8 @@ +# DeleteVoiceV1AudioVoicesVoiceIDDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `voice_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/deltamessage.md b/docs/models/deltamessage.md index 61deabbf..c2395e1b 100644 --- a/docs/models/deltamessage.md +++ b/docs/models/deltamessage.md @@ -3,8 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `content` | [OptionalNullable[models.Content]](../models/content.md) | :heavy_minus_sign: | N/A | -| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `content` | [OptionalNullable[models.DeltaMessageContent]](../models/deltamessagecontent.md) | :heavy_minus_sign: | N/A | +| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | +| `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `index` | *OptionalNullable[int]* | :heavy_minus_sign: | If the completion returns multiple messages, this is to specify which message this delta is for. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/deltamessagecontent.md b/docs/models/deltamessagecontent.md new file mode 100644 index 00000000..8142772d --- /dev/null +++ b/docs/models/deltamessagecontent.md @@ -0,0 +1,17 @@ +# DeltaMessageContent + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[models.ContentChunk]` + +```python +value: List[models.ContentChunk] = /* values here */ +``` + diff --git a/docs/models/deploymentdetailresponse.md b/docs/models/deploymentdetailresponse.md new file mode 100644 index 00000000..1f095899 --- /dev/null +++ b/docs/models/deploymentdetailresponse.md @@ -0,0 +1,14 @@ +# DeploymentDetailResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | Unique identifier of the deployment | +| `name` | *str* | :heavy_check_mark: | Deployment name | +| `is_active` | *bool* | :heavy_check_mark: | Whether at least one worker is currently live | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | When the deployment was first registered | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | When the deployment was last updated | +| `location` | [OptionalNullable[models.DeploymentLocation]](../models/deploymentlocation.md) | :heavy_minus_sign: | Where the deployment is running | +| `workers` | List[[models.DeploymentWorkerResponse](../models/deploymentworkerresponse.md)] | :heavy_check_mark: | Workers registered for the deployment | \ No newline at end of file diff --git a/docs/models/deploymentlistresponse.md b/docs/models/deploymentlistresponse.md new file mode 100644 index 00000000..22868512 --- /dev/null +++ b/docs/models/deploymentlistresponse.md @@ -0,0 +1,8 @@ +# DeploymentListResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `deployments` | List[[models.DeploymentResponse](../models/deploymentresponse.md)] | :heavy_check_mark: | List of deployments | \ No newline at end of file diff --git a/docs/models/deploymentlocation.md b/docs/models/deploymentlocation.md new file mode 100644 index 00000000..a0cbe6bc --- /dev/null +++ b/docs/models/deploymentlocation.md @@ -0,0 +1,10 @@ +# DeploymentLocation + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `location_type` | [models.LocationType](../models/locationtype.md) | :heavy_check_mark: | N/A | +| `k8s_cluster` | *OptionalNullable[str]* | :heavy_minus_sign: | K8s cluster name, if applicable | +| `k8s_namespace` | *OptionalNullable[str]* | :heavy_minus_sign: | K8s namespace, if applicable | \ No newline at end of file diff --git a/docs/models/deploymentresponse.md b/docs/models/deploymentresponse.md new file mode 100644 index 00000000..853ebbce --- /dev/null +++ b/docs/models/deploymentresponse.md @@ -0,0 +1,13 @@ +# DeploymentResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | Unique identifier of the deployment | +| `name` | *str* | :heavy_check_mark: | Deployment name | +| `is_active` | *bool* | :heavy_check_mark: | Whether at least one worker is currently live | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | When the deployment was first registered | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | When the deployment was last updated | +| `location` | [OptionalNullable[models.DeploymentLocation]](../models/deploymentlocation.md) | :heavy_minus_sign: | Where the deployment is running | \ No newline at end of file diff --git a/docs/models/deploymentworkerresponse.md b/docs/models/deploymentworkerresponse.md new file mode 100644 index 00000000..afdcca83 --- /dev/null +++ b/docs/models/deploymentworkerresponse.md @@ -0,0 +1,11 @@ +# DeploymentWorkerResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Worker name | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | When the worker first registered | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | When the worker last registered | +| `is_active` | *bool* | :heavy_check_mark: | Whether this worker's liveness key is currently alive | \ No newline at end of file diff --git a/docs/models/document.md b/docs/models/document.md index 509d43b7..42c639a6 100644 --- a/docs/models/document.md +++ b/docs/models/document.md @@ -1,25 +1,27 @@ # Document -Document to run OCR on - - -## Supported Types - -### `models.FileChunk` - -```python -value: models.FileChunk = /* values here */ -``` - -### `models.DocumentURLChunk` - -```python -value: models.DocumentURLChunk = /* values here */ -``` - -### `models.ImageURLChunk` - -```python -value: models.ImageURLChunk = /* values here */ -``` +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `hash` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `mime_type` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `extension` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `size` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `summary` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `last_processed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `number_of_pages` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `process_status` | [models.ProcessStatus](../models/processstatus.md) | :heavy_check_mark: | N/A | +| `uploaded_by_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `uploaded_by_type` | *str* | :heavy_check_mark: | N/A | +| `tokens_processing_main_content` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `tokens_processing_summary` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `attributes` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `processing_status` | *str* | :heavy_check_mark: | N/A | +| `tokens_processing_total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/documentlibrarytool.md b/docs/models/documentlibrarytool.md index 82315f32..95c3fa52 100644 --- a/docs/models/documentlibrarytool.md +++ b/docs/models/documentlibrarytool.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `type` | [Optional[models.DocumentLibraryToolType]](../models/documentlibrarytooltype.md) | :heavy_minus_sign: | N/A | -| `library_ids` | List[*str*] | :heavy_check_mark: | Ids of the library in which to search. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["document_library"]* | :heavy_check_mark: | N/A | +| `library_ids` | List[*str*] | :heavy_check_mark: | Ids of the library in which to search. | \ No newline at end of file diff --git a/docs/models/documentlibrarytooltype.md b/docs/models/documentlibrarytooltype.md deleted file mode 100644 index ebd420f6..00000000 --- a/docs/models/documentlibrarytooltype.md +++ /dev/null @@ -1,8 +0,0 @@ -# DocumentLibraryToolType - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `DOCUMENT_LIBRARY` | document_library | \ No newline at end of file diff --git a/docs/models/documentout.md b/docs/models/documentout.md deleted file mode 100644 index b9e7b212..00000000 --- a/docs/models/documentout.md +++ /dev/null @@ -1,24 +0,0 @@ -# DocumentOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `hash` | *str* | :heavy_check_mark: | N/A | -| `mime_type` | *str* | :heavy_check_mark: | N/A | -| `extension` | *str* | :heavy_check_mark: | N/A | -| `size` | *int* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `summary` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `last_processed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `number_of_pages` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `processing_status` | *str* | :heavy_check_mark: | N/A | -| `uploaded_by_id` | *str* | :heavy_check_mark: | N/A | -| `uploaded_by_type` | *str* | :heavy_check_mark: | N/A | -| `tokens_processing_main_content` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `tokens_processing_summary` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `tokens_processing_total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/documentunion.md b/docs/models/documentunion.md new file mode 100644 index 00000000..e573bd46 --- /dev/null +++ b/docs/models/documentunion.md @@ -0,0 +1,25 @@ +# DocumentUnion + +Document to run OCR on + + +## Supported Types + +### `models.FileChunk` + +```python +value: models.FileChunk = /* values here */ +``` + +### `models.DocumentURLChunk` + +```python +value: models.DocumentURLChunk = /* values here */ +``` + +### `models.ImageURLChunk` + +```python +value: models.ImageURLChunk = /* values here */ +``` + diff --git a/docs/models/documentupdatein.md b/docs/models/documentupdatein.md deleted file mode 100644 index 215ae95f..00000000 --- a/docs/models/documentupdatein.md +++ /dev/null @@ -1,8 +0,0 @@ -# DocumentUpdateIn - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/documentupload.md b/docs/models/documentupload.md new file mode 100644 index 00000000..4e58a475 --- /dev/null +++ b/docs/models/documentupload.md @@ -0,0 +1,8 @@ +# DocumentUpload + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file` | [models.File](../models/file.md) | :heavy_check_mark: | The File object (not file name) to be uploaded.
To upload a file and specify a custom file name you should format your request as such:
```bash
file=@path/to/your/file.jsonl;filename=custom_name.jsonl
```
Otherwise, you can just keep the original file name:
```bash
file=@path/to/your/file.jsonl
``` | \ No newline at end of file diff --git a/docs/models/documenturlchunk.md b/docs/models/documenturlchunk.md index 6c9a5b4d..9dbfbe50 100644 --- a/docs/models/documenturlchunk.md +++ b/docs/models/documenturlchunk.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `document_url` | *str* | :heavy_check_mark: | N/A | -| `document_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The filename of the document | -| `type` | [Optional[models.DocumentURLChunkType]](../models/documenturlchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `type` | *Optional[Literal["document_url"]]* | :heavy_minus_sign: | N/A | +| `document_url` | *str* | :heavy_check_mark: | N/A | +| `document_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The filename of the document | \ No newline at end of file diff --git a/docs/models/documenturlchunktype.md b/docs/models/documenturlchunktype.md deleted file mode 100644 index 32e1fa9e..00000000 --- a/docs/models/documenturlchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# DocumentURLChunkType - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `DOCUMENT_URL` | document_url | \ No newline at end of file diff --git a/docs/models/embeddedresource.md b/docs/models/embeddedresource.md new file mode 100644 index 00000000..102fca26 --- /dev/null +++ b/docs/models/embeddedresource.md @@ -0,0 +1,17 @@ +# EmbeddedResource + +The contents of a resource, embedded into a prompt or tool call result. + +It is up to the client how best to render embedded resources for the benefit +of the LLM and/or the user. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | *Literal["resource"]* | :heavy_check_mark: | N/A | +| `resource` | [models.Resource](../models/resource.md) | :heavy_check_mark: | N/A | +| `annotations` | [OptionalNullable[models.Annotations]](../models/annotations.md) | :heavy_minus_sign: | N/A | +| `meta` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/embeddingdtype.md b/docs/models/embeddingdtype.md index 01656b0a..301585b2 100644 --- a/docs/models/embeddingdtype.md +++ b/docs/models/embeddingdtype.md @@ -1,12 +1,17 @@ # EmbeddingDtype +## Example Usage + +```python +from mistralai.client.models import EmbeddingDtype +value: EmbeddingDtype = "float" +``` + ## Values -| Name | Value | -| --------- | --------- | -| `FLOAT` | float | -| `INT8` | int8 | -| `UINT8` | uint8 | -| `BINARY` | binary | -| `UBINARY` | ubinary | \ No newline at end of file +- `"float"` +- `"int8"` +- `"uint8"` +- `"binary"` +- `"ubinary"` diff --git a/docs/models/embeddingrequest.md b/docs/models/embeddingrequest.md index 2f48099f..71d139cd 100644 --- a/docs/models/embeddingrequest.md +++ b/docs/models/embeddingrequest.md @@ -3,10 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-embed | -| `inputs` | [models.EmbeddingRequestInputs](../models/embeddingrequestinputs.md) | :heavy_check_mark: | Text to embed. | [
"Embed this sentence.",
"As well as this one."
] | -| `output_dimension` | *OptionalNullable[int]* | :heavy_minus_sign: | The dimension of the output embeddings. | | -| `output_dtype` | [Optional[models.EmbeddingDtype]](../models/embeddingdtype.md) | :heavy_minus_sign: | N/A | | -| `encoding_format` | [Optional[models.EncodingFormat]](../models/encodingformat.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-embed | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `inputs` | [models.EmbeddingRequestInputs](../models/embeddingrequestinputs.md) | :heavy_check_mark: | Text to embed. | [
"Embed this sentence.",
"As well as this one."
] | +| `output_dimension` | *OptionalNullable[int]* | :heavy_minus_sign: | The dimension of the output embeddings when feature available. If not provided, a default output dimension will be used. | | +| `output_dtype` | [Optional[models.EmbeddingDtype]](../models/embeddingdtype.md) | :heavy_minus_sign: | N/A | | +| `encoding_format` | [Optional[models.EncodingFormat]](../models/encodingformat.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/encodedpayloadoptions.md b/docs/models/encodedpayloadoptions.md new file mode 100644 index 00000000..51fcfdc4 --- /dev/null +++ b/docs/models/encodedpayloadoptions.md @@ -0,0 +1,19 @@ +# EncodedPayloadOptions + +## Example Usage + +```python +from mistralai.client.models import EncodedPayloadOptions + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: EncodedPayloadOptions = "offloaded" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"offloaded"` +- `"encrypted"` +- `"encrypted-partial"` diff --git a/docs/models/encodingformat.md b/docs/models/encodingformat.md index 7d5941cf..8bc9e8c6 100644 --- a/docs/models/encodingformat.md +++ b/docs/models/encodingformat.md @@ -1,9 +1,14 @@ # EncodingFormat +## Example Usage + +```python +from mistralai.client.models import EncodingFormat +value: EncodingFormat = "float" +``` + ## Values -| Name | Value | -| -------- | -------- | -| `FLOAT` | float | -| `BASE64` | base64 | \ No newline at end of file +- `"float"` +- `"base64"` diff --git a/docs/models/entitytype.md b/docs/models/entitytype.md index 7c040b38..44fb9d6b 100644 --- a/docs/models/entitytype.md +++ b/docs/models/entitytype.md @@ -2,11 +2,20 @@ The type of entity, used to share a library. +## Example Usage + +```python +from mistralai.client.models import EntityType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: EntityType = "User" +``` + ## Values -| Name | Value | -| ----------- | ----------- | -| `USER` | User | -| `WORKSPACE` | Workspace | -| `ORG` | Org | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"User"` +- `"Workspace"` +- `"Org"` diff --git a/docs/models/entries.md b/docs/models/entries.md deleted file mode 100644 index 8e5a20d0..00000000 --- a/docs/models/entries.md +++ /dev/null @@ -1,41 +0,0 @@ -# Entries - - -## Supported Types - -### `models.MessageInputEntry` - -```python -value: models.MessageInputEntry = /* values here */ -``` - -### `models.MessageOutputEntry` - -```python -value: models.MessageOutputEntry = /* values here */ -``` - -### `models.FunctionResultEntry` - -```python -value: models.FunctionResultEntry = /* values here */ -``` - -### `models.FunctionCallEntry` - -```python -value: models.FunctionCallEntry = /* values here */ -``` - -### `models.ToolExecutionEntry` - -```python -value: models.ToolExecutionEntry = /* values here */ -``` - -### `models.AgentHandoffEntry` - -```python -value: models.AgentHandoffEntry = /* values here */ -``` - diff --git a/docs/models/entry.md b/docs/models/entry.md new file mode 100644 index 00000000..d934b677 --- /dev/null +++ b/docs/models/entry.md @@ -0,0 +1,41 @@ +# Entry + + +## Supported Types + +### `models.MessageInputEntry` + +```python +value: models.MessageInputEntry = /* values here */ +``` + +### `models.MessageOutputEntry` + +```python +value: models.MessageOutputEntry = /* values here */ +``` + +### `models.FunctionResultEntry` + +```python +value: models.FunctionResultEntry = /* values here */ +``` + +### `models.FunctionCallEntry` + +```python +value: models.FunctionCallEntry = /* values here */ +``` + +### `models.ToolExecutionEntry` + +```python +value: models.ToolExecutionEntry = /* values here */ +``` + +### `models.AgentHandoffEntry` + +```python +value: models.AgentHandoffEntry = /* values here */ +``` + diff --git a/docs/models/event.md b/docs/models/event.md new file mode 100644 index 00000000..3eebffca --- /dev/null +++ b/docs/models/event.md @@ -0,0 +1,10 @@ +# Event + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the event. | +| `data` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | \ No newline at end of file diff --git a/docs/models/eventout.md b/docs/models/eventout.md deleted file mode 100644 index d9202353..00000000 --- a/docs/models/eventout.md +++ /dev/null @@ -1,10 +0,0 @@ -# EventOut - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | The name of the event. | -| `data` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | -| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | \ No newline at end of file diff --git a/docs/models/eventprogressstatus.md b/docs/models/eventprogressstatus.md new file mode 100644 index 00000000..02033178 --- /dev/null +++ b/docs/models/eventprogressstatus.md @@ -0,0 +1,19 @@ +# EventProgressStatus + +## Example Usage + +```python +from mistralai.client.models import EventProgressStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: EventProgressStatus = "RUNNING" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"RUNNING"` +- `"COMPLETED"` +- `"FAILED"` diff --git a/docs/models/eventsource.md b/docs/models/eventsource.md new file mode 100644 index 00000000..6c2143d0 --- /dev/null +++ b/docs/models/eventsource.md @@ -0,0 +1,15 @@ +# EventSource + +## Example Usage + +```python +from mistralai.client.models import EventSource +value: EventSource = "DATABASE" +``` + + +## Values + +- `"DATABASE"` +- `"LIVE"` +- `"HYBRID"` diff --git a/docs/models/eventtype.md b/docs/models/eventtype.md new file mode 100644 index 00000000..6add793e --- /dev/null +++ b/docs/models/eventtype.md @@ -0,0 +1,18 @@ +# EventType + +## Example Usage + +```python +from mistralai.client.models import EventType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: EventType = "EVENT" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"EVENT"` +- `"EVENT_PROGRESS"` diff --git a/docs/models/executeworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepostrequest.md b/docs/models/executeworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepostrequest.md new file mode 100644 index 00000000..54de12a2 --- /dev/null +++ b/docs/models/executeworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepostrequest.md @@ -0,0 +1,9 @@ +# ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `workflow_registration_id` | *str* | :heavy_check_mark: | N/A | +| `workflow_execution_request` | [models.WorkflowExecutionRequest](../models/workflowexecutionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/executeworkflowv1workflowsworkflowidentifierexecutepostrequest.md b/docs/models/executeworkflowv1workflowsworkflowidentifierexecutepostrequest.md new file mode 100644 index 00000000..29c55a77 --- /dev/null +++ b/docs/models/executeworkflowv1workflowsworkflowidentifierexecutepostrequest.md @@ -0,0 +1,9 @@ +# ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | +| `workflow_execution_request` | [models.WorkflowExecutionRequest](../models/workflowexecutionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/executionconfig.md b/docs/models/executionconfig.md new file mode 100644 index 00000000..1033b7ea --- /dev/null +++ b/docs/models/executionconfig.md @@ -0,0 +1,13 @@ +# ExecutionConfig + +Not typed since mcp config can changed / not stable +we allow all extra fields and this is a dict +TODO: once mcp is stable, we need to type this + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `type` | *str* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/exportdatasetresponse.md b/docs/models/exportdatasetresponse.md new file mode 100644 index 00000000..7187ee5c --- /dev/null +++ b/docs/models/exportdatasetresponse.md @@ -0,0 +1,8 @@ +# ExportDatasetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `file_url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/exportdatasettojsonlv1observabilitydatasetsdatasetidexportstojsonlgetrequest.md b/docs/models/exportdatasettojsonlv1observabilitydatasetsdatasetidexportstojsonlgetrequest.md new file mode 100644 index 00000000..efe4bbb0 --- /dev/null +++ b/docs/models/exportdatasettojsonlv1observabilitydatasetsdatasetidexportstojsonlgetrequest.md @@ -0,0 +1,8 @@ +# ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/failure.md b/docs/models/failure.md new file mode 100644 index 00000000..259d7bcf --- /dev/null +++ b/docs/models/failure.md @@ -0,0 +1,10 @@ +# Failure + +Represents an error or exception that occurred during execution. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `message` | *str* | :heavy_check_mark: | A human-readable description of the failure. | \ No newline at end of file diff --git a/docs/models/feedresultchatcompletioneventpreview.md b/docs/models/feedresultchatcompletioneventpreview.md new file mode 100644 index 00000000..08a6e2f8 --- /dev/null +++ b/docs/models/feedresultchatcompletioneventpreview.md @@ -0,0 +1,10 @@ +# FeedResultChatCompletionEventPreview + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `results` | List[[models.ChatCompletionEventPreview](../models/chatcompletioneventpreview.md)] | :heavy_minus_sign: | N/A | +| `next` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/fetchcampaignstatusresponse.md b/docs/models/fetchcampaignstatusresponse.md new file mode 100644 index 00000000..7aac0f25 --- /dev/null +++ b/docs/models/fetchcampaignstatusresponse.md @@ -0,0 +1,8 @@ +# FetchCampaignStatusResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `status` | [models.BaseTaskStatus](../models/basetaskstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/fetchchatcompletionfieldoptionsresponse.md b/docs/models/fetchchatcompletionfieldoptionsresponse.md new file mode 100644 index 00000000..86beebc1 --- /dev/null +++ b/docs/models/fetchchatcompletionfieldoptionsresponse.md @@ -0,0 +1,8 @@ +# FetchChatCompletionFieldOptionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `options` | List[[Nullable[models.Option]](../models/option.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/fetchfieldoptioncountsrequest.md b/docs/models/fetchfieldoptioncountsrequest.md new file mode 100644 index 00000000..b13f6312 --- /dev/null +++ b/docs/models/fetchfieldoptioncountsrequest.md @@ -0,0 +1,8 @@ +# FetchFieldOptionCountsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `filter_params` | [OptionalNullable[models.FilterPayload]](../models/filterpayload.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/fetchfieldoptioncountsresponse.md b/docs/models/fetchfieldoptioncountsresponse.md new file mode 100644 index 00000000..dabf6b5e --- /dev/null +++ b/docs/models/fetchfieldoptioncountsresponse.md @@ -0,0 +1,8 @@ +# FetchFieldOptionCountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `counts` | List[[models.FieldOptionCountItem](../models/fieldoptioncountitem.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/fieldgroup.md b/docs/models/fieldgroup.md new file mode 100644 index 00000000..8fff281d --- /dev/null +++ b/docs/models/fieldgroup.md @@ -0,0 +1,9 @@ +# FieldGroup + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `label` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/fieldoptioncountitem.md b/docs/models/fieldoptioncountitem.md new file mode 100644 index 00000000..92bc971f --- /dev/null +++ b/docs/models/fieldoptioncountitem.md @@ -0,0 +1,9 @@ +# FieldOptionCountItem + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `value` | *str* | :heavy_check_mark: | N/A | +| `count` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filepurpose.md b/docs/models/filepurpose.md index 14cab13e..af6dc9fa 100644 --- a/docs/models/filepurpose.md +++ b/docs/models/filepurpose.md @@ -1,10 +1,19 @@ # FilePurpose +## Example Usage + +```python +from mistralai.client.models import FilePurpose + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: FilePurpose = "fine-tune" +``` + ## Values -| Name | Value | -| ----------- | ----------- | -| `FINE_TUNE` | fine-tune | -| `BATCH` | batch | -| `OCR` | ocr | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"fine-tune"` +- `"batch"` +- `"ocr"` diff --git a/docs/models/filesapiroutesgetsignedurlrequest.md b/docs/models/filesapiroutesgetsignedurlrequest.md index dbe3c801..794f25f7 100644 --- a/docs/models/filesapiroutesgetsignedurlrequest.md +++ b/docs/models/filesapiroutesgetsignedurlrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `file_id` | *str* | :heavy_check_mark: | N/A | -| `expiry` | *Optional[int]* | :heavy_minus_sign: | Number of hours before the url becomes invalid. Defaults to 24h | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `expiry` | *Optional[int]* | :heavy_minus_sign: | Number of hours before the URL becomes invalid. Defaults to 24h. Must be between 1h and 168h. | \ No newline at end of file diff --git a/docs/models/filesapirouteslistfilesrequest.md b/docs/models/filesapirouteslistfilesrequest.md index b28ab3fe..57d11722 100644 --- a/docs/models/filesapirouteslistfilesrequest.md +++ b/docs/models/filesapirouteslistfilesrequest.md @@ -7,7 +7,9 @@ | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | | `page` | *Optional[int]* | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `include_total` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `sample_type` | List[[models.SampleType](../models/sampletype.md)] | :heavy_minus_sign: | N/A | | `source` | List[[models.Source](../models/source.md)] | :heavy_minus_sign: | N/A | | `search` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `purpose` | [OptionalNullable[models.FilePurpose]](../models/filepurpose.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `purpose` | [OptionalNullable[models.FilePurpose]](../models/filepurpose.md) | :heavy_minus_sign: | N/A | +| `mimetypes` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/filesapiroutesuploadfilefilevisibility.md b/docs/models/filesapiroutesuploadfilefilevisibility.md new file mode 100644 index 00000000..c1f89309 --- /dev/null +++ b/docs/models/filesapiroutesuploadfilefilevisibility.md @@ -0,0 +1,14 @@ +# FilesAPIRoutesUploadFileFileVisibility + +## Example Usage + +```python +from mistralai.client.models import FilesAPIRoutesUploadFileFileVisibility +value: FilesAPIRoutesUploadFileFileVisibility = "workspace" +``` + + +## Values + +- `"workspace"` +- `"user"` diff --git a/docs/models/filesapiroutesuploadfilemultipartbodyparams.md b/docs/models/filesapiroutesuploadfilemultipartbodyparams.md deleted file mode 100644 index a5dd1174..00000000 --- a/docs/models/filesapiroutesuploadfilemultipartbodyparams.md +++ /dev/null @@ -1,9 +0,0 @@ -# FilesAPIRoutesUploadFileMultiPartBodyParams - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `purpose` | [Optional[models.FilePurpose]](../models/filepurpose.md) | :heavy_minus_sign: | N/A | -| `file` | [models.File](../models/file.md) | :heavy_check_mark: | The File object (not file name) to be uploaded.
To upload a file and specify a custom file name you should format your request as such:
```bash
file=@path/to/your/file.jsonl;filename=custom_name.jsonl
```
Otherwise, you can just keep the original file name:
```bash
file=@path/to/your/file.jsonl
``` | \ No newline at end of file diff --git a/docs/models/fileschema.md b/docs/models/fileschema.md index 4f3e72db..15454840 100644 --- a/docs/models/fileschema.md +++ b/docs/models/fileschema.md @@ -3,16 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The unique identifier of the file. | 497f6eca-6276-4993-bfeb-53cbbbba6f09 | -| `object` | *str* | :heavy_check_mark: | The object type, which is always "file". | file | -| `size_bytes` | *int* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | -| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | -| `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | -| `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | -| `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | -| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | -| `mimetype` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | -| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the file. | 497f6eca-6276-4993-bfeb-53cbbbba6f09 | +| `object` | *str* | :heavy_check_mark: | The object type, which is always "file". | file | +| `size_bytes` | *int* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | +| `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | +| `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | +| `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | +| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `mimetype` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | +| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `expires_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `visibility` | [OptionalNullable[models.FileVisibility]](../models/filevisibility.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/filesignedurl.md b/docs/models/filesignedurl.md deleted file mode 100644 index 52ce3f4f..00000000 --- a/docs/models/filesignedurl.md +++ /dev/null @@ -1,8 +0,0 @@ -# FileSignedURL - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filevisibility.md b/docs/models/filevisibility.md new file mode 100644 index 00000000..4e6c9ed9 --- /dev/null +++ b/docs/models/filevisibility.md @@ -0,0 +1,18 @@ +# FileVisibility + +## Example Usage + +```python +from mistralai.client.models import FileVisibility + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: FileVisibility = "workspace" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"workspace"` +- `"user"` diff --git a/docs/models/filtercondition.md b/docs/models/filtercondition.md new file mode 100644 index 00000000..ba2eea60 --- /dev/null +++ b/docs/models/filtercondition.md @@ -0,0 +1,10 @@ +# FilterCondition + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `field` | *str* | :heavy_check_mark: | N/A | +| `op` | [models.Op](../models/op.md) | :heavy_check_mark: | N/A | +| `value` | *Any* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filtergroup.md b/docs/models/filtergroup.md new file mode 100644 index 00000000..974c724c --- /dev/null +++ b/docs/models/filtergroup.md @@ -0,0 +1,9 @@ +# FilterGroup + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `and_` | List[[models.And](../models/and_.md)] | :heavy_minus_sign: | N/A | +| `or_` | List[[models.Or](../models/or_.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/filterpayload.md b/docs/models/filterpayload.md new file mode 100644 index 00000000..49f273c0 --- /dev/null +++ b/docs/models/filterpayload.md @@ -0,0 +1,8 @@ +# FilterPayload + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `filters` | [Nullable[models.Filters]](../models/filters.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filters.md b/docs/models/filters.md new file mode 100644 index 00000000..4595b82b --- /dev/null +++ b/docs/models/filters.md @@ -0,0 +1,17 @@ +# Filters + + +## Supported Types + +### `models.FilterGroup` + +```python +value: models.FilterGroup = /* values here */ +``` + +### `models.FilterCondition` + +```python +value: models.FilterCondition = /* values here */ +``` + diff --git a/docs/models/fimcompletionrequest.md b/docs/models/fimcompletionrequest.md index 7b785cf0..d25d45f6 100644 --- a/docs/models/fimcompletionrequest.md +++ b/docs/models/fimcompletionrequest.md @@ -5,13 +5,15 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | +| `model` | *str* | :heavy_check_mark: | ID of the model with FIM to use. | codestral-latest | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | | `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.FIMCompletionRequestStop]](../models/fimcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `stop` | [OptionalNullable[models.FIMCompletionRequestStop]](../models/fimcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | -| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | \ No newline at end of file +| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/fimcompletionstreamrequest.md b/docs/models/fimcompletionstreamrequest.md index d49a6301..15718c7c 100644 --- a/docs/models/fimcompletionstreamrequest.md +++ b/docs/models/fimcompletionstreamrequest.md @@ -5,13 +5,15 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | +| `model` | *str* | :heavy_check_mark: | ID of the model with FIM to use. | codestral-latest | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | | `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.FIMCompletionStreamRequestStop]](../models/fimcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `stop` | [OptionalNullable[models.FIMCompletionStreamRequestStop]](../models/fimcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | -| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | \ No newline at end of file +| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/finetuneablemodeltype.md b/docs/models/finetuneablemodeltype.md index 34b24bd4..9ec9634f 100644 --- a/docs/models/finetuneablemodeltype.md +++ b/docs/models/finetuneablemodeltype.md @@ -1,9 +1,14 @@ # FineTuneableModelType +## Example Usage + +```python +from mistralai.client.models import FineTuneableModelType +value: FineTuneableModelType = "completion" +``` + ## Values -| Name | Value | -| ------------ | ------------ | -| `COMPLETION` | completion | -| `CLASSIFIER` | classifier | \ No newline at end of file +- `"completion"` +- `"classifier"` diff --git a/docs/models/finetunedmodelcapabilities.md b/docs/models/finetunedmodelcapabilities.md new file mode 100644 index 00000000..d3203a2a --- /dev/null +++ b/docs/models/finetunedmodelcapabilities.md @@ -0,0 +1,12 @@ +# FineTunedModelCapabilities + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `completion_chat` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `completion_fim` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `function_calling` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `fine_tuning` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `classification` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/finishreason.md b/docs/models/finishreason.md deleted file mode 100644 index 2af53f6e..00000000 --- a/docs/models/finishreason.md +++ /dev/null @@ -1,12 +0,0 @@ -# FinishReason - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `STOP` | stop | -| `LENGTH` | length | -| `MODEL_LENGTH` | model_length | -| `ERROR` | error | -| `TOOL_CALLS` | tool_calls | \ No newline at end of file diff --git a/docs/models/format_.md b/docs/models/format_.md new file mode 100644 index 00000000..5bf1ed0c --- /dev/null +++ b/docs/models/format_.md @@ -0,0 +1,20 @@ +# Format + +Format of the table + +## Example Usage + +```python +from mistralai.client.models import Format + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Format = "markdown" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"markdown"` +- `"html"` diff --git a/docs/models/ftclassifierlossfunction.md b/docs/models/ftclassifierlossfunction.md index 919cdd38..36d3db18 100644 --- a/docs/models/ftclassifierlossfunction.md +++ b/docs/models/ftclassifierlossfunction.md @@ -1,9 +1,18 @@ # FTClassifierLossFunction +## Example Usage + +```python +from mistralai.client.models import FTClassifierLossFunction + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: FTClassifierLossFunction = "single_class" +``` + ## Values -| Name | Value | -| -------------- | -------------- | -| `SINGLE_CLASS` | single_class | -| `MULTI_CLASS` | multi_class | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"single_class"` +- `"multi_class"` diff --git a/docs/models/ftmodelcapabilitiesout.md b/docs/models/ftmodelcapabilitiesout.md deleted file mode 100644 index 19690476..00000000 --- a/docs/models/ftmodelcapabilitiesout.md +++ /dev/null @@ -1,12 +0,0 @@ -# FTModelCapabilitiesOut - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `completion_chat` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `completion_fim` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `function_calling` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `fine_tuning` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `classification` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/ftmodelcard.md b/docs/models/ftmodelcard.md index 35032775..f65ff6e8 100644 --- a/docs/models/ftmodelcard.md +++ b/docs/models/ftmodelcard.md @@ -5,21 +5,21 @@ Extra fields for fine-tuned models. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `object` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `created` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `owned_by` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `capabilities` | [models.ModelCapabilities](../models/modelcapabilities.md) | :heavy_check_mark: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `aliases` | List[*str*] | :heavy_minus_sign: | N/A | -| `deprecation` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `deprecation_replacement_model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `default_model_temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.FTModelCardType]](../models/ftmodelcardtype.md) | :heavy_minus_sign: | N/A | -| `job` | *str* | :heavy_check_mark: | N/A | -| `root` | *str* | :heavy_check_mark: | N/A | -| `archived` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `object` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `created` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `owned_by` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `capabilities` | [models.ModelCapabilities](../models/modelcapabilities.md) | :heavy_check_mark: | This is populated by Harmattan, but some fields have a name
that we don't want to expose in the API. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `max_context_length` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `aliases` | List[*str*] | :heavy_minus_sign: | N/A | +| `deprecation` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `deprecation_replacement_model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `default_model_temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `type` | *Literal["fine-tuned"]* | :heavy_check_mark: | N/A | +| `job` | *str* | :heavy_check_mark: | N/A | +| `root` | *str* | :heavy_check_mark: | N/A | +| `archived` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/ftmodelcardtype.md b/docs/models/ftmodelcardtype.md deleted file mode 100644 index 0b38470b..00000000 --- a/docs/models/ftmodelcardtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# FTModelCardType - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `FINE_TUNED` | fine-tuned | \ No newline at end of file diff --git a/docs/models/functioncallentry.md b/docs/models/functioncallentry.md index fd3aa5c5..2843db9d 100644 --- a/docs/models/functioncallentry.md +++ b/docs/models/functioncallentry.md @@ -3,13 +3,16 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `object` | [Optional[models.FunctionCallEntryObject]](../models/functioncallentryobject.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.FunctionCallEntryType]](../models/functioncallentrytype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `tool_call_id` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `arguments` | [models.FunctionCallEntryArguments](../models/functioncallentryarguments.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `object` | *Optional[Literal["entry"]]* | :heavy_minus_sign: | N/A | +| `type` | *Optional[Literal["function.call"]]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `tool_call_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `arguments` | [models.FunctionCallEntryArguments](../models/functioncallentryarguments.md) | :heavy_check_mark: | N/A | +| `confirmation_status` | [OptionalNullable[models.FunctionCallEntryConfirmationStatus]](../models/functioncallentryconfirmationstatus.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/functioncallentryconfirmationstatus.md b/docs/models/functioncallentryconfirmationstatus.md new file mode 100644 index 00000000..91231a0a --- /dev/null +++ b/docs/models/functioncallentryconfirmationstatus.md @@ -0,0 +1,19 @@ +# FunctionCallEntryConfirmationStatus + +## Example Usage + +```python +from mistralai.client.models import FunctionCallEntryConfirmationStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: FunctionCallEntryConfirmationStatus = "pending" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"pending"` +- `"allowed"` +- `"denied"` diff --git a/docs/models/functioncallentryobject.md b/docs/models/functioncallentryobject.md deleted file mode 100644 index 3cf2e427..00000000 --- a/docs/models/functioncallentryobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# FunctionCallEntryObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `ENTRY` | entry | \ No newline at end of file diff --git a/docs/models/functioncallentrytype.md b/docs/models/functioncallentrytype.md deleted file mode 100644 index 7ea34c52..00000000 --- a/docs/models/functioncallentrytype.md +++ /dev/null @@ -1,8 +0,0 @@ -# FunctionCallEntryType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `FUNCTION_CALL` | function.call | \ No newline at end of file diff --git a/docs/models/functioncallevent.md b/docs/models/functioncallevent.md index c25679a5..0e3a36d6 100644 --- a/docs/models/functioncallevent.md +++ b/docs/models/functioncallevent.md @@ -3,12 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `type` | [Optional[models.FunctionCallEventType]](../models/functioncalleventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `tool_call_id` | *str* | :heavy_check_mark: | N/A | -| `arguments` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `type` | *Literal["function.call.delta"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `tool_call_id` | *str* | :heavy_check_mark: | N/A | +| `arguments` | *str* | :heavy_check_mark: | N/A | +| `confirmation_status` | [OptionalNullable[models.FunctionCallEventConfirmationStatus]](../models/functioncalleventconfirmationstatus.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/functioncalleventconfirmationstatus.md b/docs/models/functioncalleventconfirmationstatus.md new file mode 100644 index 00000000..95bebe96 --- /dev/null +++ b/docs/models/functioncalleventconfirmationstatus.md @@ -0,0 +1,19 @@ +# FunctionCallEventConfirmationStatus + +## Example Usage + +```python +from mistralai.client.models import FunctionCallEventConfirmationStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: FunctionCallEventConfirmationStatus = "pending" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"pending"` +- `"allowed"` +- `"denied"` diff --git a/docs/models/functioncalleventtype.md b/docs/models/functioncalleventtype.md deleted file mode 100644 index 8cf3f038..00000000 --- a/docs/models/functioncalleventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# FunctionCallEventType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `FUNCTION_CALL_DELTA` | function.call.delta | \ No newline at end of file diff --git a/docs/models/functionresultentry.md b/docs/models/functionresultentry.md index 6df54d3d..6a77abfd 100644 --- a/docs/models/functionresultentry.md +++ b/docs/models/functionresultentry.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `object` | [Optional[models.FunctionResultEntryObject]](../models/functionresultentryobject.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.FunctionResultEntryType]](../models/functionresultentrytype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `tool_call_id` | *str* | :heavy_check_mark: | N/A | -| `result` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `object` | *Optional[Literal["entry"]]* | :heavy_minus_sign: | N/A | +| `type` | *Optional[Literal["function.result"]]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `tool_call_id` | *str* | :heavy_check_mark: | N/A | +| `result` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/functionresultentryobject.md b/docs/models/functionresultentryobject.md deleted file mode 100644 index fe52e0a5..00000000 --- a/docs/models/functionresultentryobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# FunctionResultEntryObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `ENTRY` | entry | \ No newline at end of file diff --git a/docs/models/functionresultentrytype.md b/docs/models/functionresultentrytype.md deleted file mode 100644 index 35c94d8e..00000000 --- a/docs/models/functionresultentrytype.md +++ /dev/null @@ -1,8 +0,0 @@ -# FunctionResultEntryType - - -## Values - -| Name | Value | -| ----------------- | ----------------- | -| `FUNCTION_RESULT` | function.result | \ No newline at end of file diff --git a/docs/models/functiontool.md b/docs/models/functiontool.md index 8c424593..0226b704 100644 --- a/docs/models/functiontool.md +++ b/docs/models/functiontool.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `type` | [Optional[models.FunctionToolType]](../models/functiontooltype.md) | :heavy_minus_sign: | N/A | -| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `type` | *Literal["function"]* | :heavy_check_mark: | N/A | +| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/functiontooltype.md b/docs/models/functiontooltype.md deleted file mode 100644 index 9c095625..00000000 --- a/docs/models/functiontooltype.md +++ /dev/null @@ -1,8 +0,0 @@ -# FunctionToolType - - -## Values - -| Name | Value | -| ---------- | ---------- | -| `FUNCTION` | function | \ No newline at end of file diff --git a/docs/models/getcampaignbyidv1observabilitycampaignscampaignidgetrequest.md b/docs/models/getcampaignbyidv1observabilitycampaignscampaignidgetrequest.md new file mode 100644 index 00000000..9e781961 --- /dev/null +++ b/docs/models/getcampaignbyidv1observabilitycampaignscampaignidgetrequest.md @@ -0,0 +1,8 @@ +# GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getcampaignselectedeventsv1observabilitycampaignscampaignidselectedeventsgetrequest.md b/docs/models/getcampaignselectedeventsv1observabilitycampaignscampaignidselectedeventsgetrequest.md new file mode 100644 index 00000000..18de3f10 --- /dev/null +++ b/docs/models/getcampaignselectedeventsv1observabilitycampaignscampaignidselectedeventsgetrequest.md @@ -0,0 +1,10 @@ +# GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getcampaignstatusbyidv1observabilitycampaignscampaignidstatusgetrequest.md b/docs/models/getcampaignstatusbyidv1observabilitycampaignscampaignidstatusgetrequest.md new file mode 100644 index 00000000..947c4d64 --- /dev/null +++ b/docs/models/getcampaignstatusbyidv1observabilitycampaignscampaignidstatusgetrequest.md @@ -0,0 +1,8 @@ +# GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getcampaignsv1observabilitycampaignsgetrequest.md b/docs/models/getcampaignsv1observabilitycampaignsgetrequest.md new file mode 100644 index 00000000..f83c3b64 --- /dev/null +++ b/docs/models/getcampaignsv1observabilitycampaignsgetrequest.md @@ -0,0 +1,10 @@ +# GetCampaignsV1ObservabilityCampaignsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `q` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getchatcompletioneventsv1observabilitychatcompletioneventssearchpostrequest.md b/docs/models/getchatcompletioneventsv1observabilitychatcompletioneventssearchpostrequest.md new file mode 100644 index 00000000..b7b92279 --- /dev/null +++ b/docs/models/getchatcompletioneventsv1observabilitychatcompletioneventssearchpostrequest.md @@ -0,0 +1,10 @@ +# GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `search_chat_completion_events_request` | [models.SearchChatCompletionEventsRequest](../models/searchchatcompletioneventsrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getchatcompletioneventv1observabilitychatcompletioneventseventidgetrequest.md b/docs/models/getchatcompletioneventv1observabilitychatcompletioneventseventidgetrequest.md new file mode 100644 index 00000000..8fe18c47 --- /dev/null +++ b/docs/models/getchatcompletioneventv1observabilitychatcompletioneventseventidgetrequest.md @@ -0,0 +1,8 @@ +# GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `event_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getchatcompletionfieldoptionscountsv1observabilitychatcompletionfieldsfieldnameoptionscountspostrequest.md b/docs/models/getchatcompletionfieldoptionscountsv1observabilitychatcompletionfieldsfieldnameoptionscountspostrequest.md new file mode 100644 index 00000000..339a1de8 --- /dev/null +++ b/docs/models/getchatcompletionfieldoptionscountsv1observabilitychatcompletionfieldsfieldnameoptionscountspostrequest.md @@ -0,0 +1,9 @@ +# GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `field_name` | *str* | :heavy_check_mark: | N/A | +| `fetch_field_option_counts_request` | [models.FetchFieldOptionCountsRequest](../models/fetchfieldoptioncountsrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getchatcompletionfieldoptionsv1observabilitychatcompletionfieldsfieldnameoptionsgetrequest.md b/docs/models/getchatcompletionfieldoptionsv1observabilitychatcompletionfieldsfieldnameoptionsgetrequest.md new file mode 100644 index 00000000..973a1a4b --- /dev/null +++ b/docs/models/getchatcompletionfieldoptionsv1observabilitychatcompletionfieldsfieldnameoptionsgetrequest.md @@ -0,0 +1,9 @@ +# GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `field_name` | *str* | :heavy_check_mark: | N/A | +| `operator` | [models.Operator](../models/operator.md) | :heavy_check_mark: | The operator to use for filtering options | \ No newline at end of file diff --git a/docs/models/getdatasetbyidv1observabilitydatasetsdatasetidgetrequest.md b/docs/models/getdatasetbyidv1observabilitydatasetsdatasetidgetrequest.md new file mode 100644 index 00000000..60f2d162 --- /dev/null +++ b/docs/models/getdatasetbyidv1observabilitydatasetsdatasetidgetrequest.md @@ -0,0 +1,8 @@ +# GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getdatasetimporttasksv1observabilitydatasetsdatasetidtasksgetrequest.md b/docs/models/getdatasetimporttasksv1observabilitydatasetsdatasetidtasksgetrequest.md new file mode 100644 index 00000000..d4226eca --- /dev/null +++ b/docs/models/getdatasetimporttasksv1observabilitydatasetsdatasetidtasksgetrequest.md @@ -0,0 +1,10 @@ +# GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getdatasetimporttaskv1observabilitydatasetsdatasetidtaskstaskidgetrequest.md b/docs/models/getdatasetimporttaskv1observabilitydatasetsdatasetidtaskstaskidgetrequest.md new file mode 100644 index 00000000..98ffc3c6 --- /dev/null +++ b/docs/models/getdatasetimporttaskv1observabilitydatasetsdatasetidtaskstaskidgetrequest.md @@ -0,0 +1,9 @@ +# GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `task_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getdatasetrecordsv1observabilitydatasetsdatasetidrecordsgetrequest.md b/docs/models/getdatasetrecordsv1observabilitydatasetsdatasetidrecordsgetrequest.md new file mode 100644 index 00000000..82453f0c --- /dev/null +++ b/docs/models/getdatasetrecordsv1observabilitydatasetsdatasetidrecordsgetrequest.md @@ -0,0 +1,10 @@ +# GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getdatasetrecordv1observabilitydatasetrecordsdatasetrecordidgetrequest.md b/docs/models/getdatasetrecordv1observabilitydatasetrecordsdatasetrecordidgetrequest.md new file mode 100644 index 00000000..6b9eb3bc --- /dev/null +++ b/docs/models/getdatasetrecordv1observabilitydatasetrecordsdatasetrecordidgetrequest.md @@ -0,0 +1,8 @@ +# GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getdatasetsv1observabilitydatasetsgetrequest.md b/docs/models/getdatasetsv1observabilitydatasetsgetrequest.md new file mode 100644 index 00000000..073ab769 --- /dev/null +++ b/docs/models/getdatasetsv1observabilitydatasetsgetrequest.md @@ -0,0 +1,10 @@ +# GetDatasetsV1ObservabilityDatasetsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `q` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getdeploymentv1workflowsdeploymentsnamegetrequest.md b/docs/models/getdeploymentv1workflowsdeploymentsnamegetrequest.md new file mode 100644 index 00000000..6af056b1 --- /dev/null +++ b/docs/models/getdeploymentv1workflowsdeploymentsnamegetrequest.md @@ -0,0 +1,8 @@ +# GetDeploymentV1WorkflowsDeploymentsNameGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getfileresponse.md b/docs/models/getfileresponse.md new file mode 100644 index 00000000..38ad4943 --- /dev/null +++ b/docs/models/getfileresponse.md @@ -0,0 +1,21 @@ +# GetFileResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the file. | 497f6eca-6276-4993-bfeb-53cbbbba6f09 | +| `object` | *str* | :heavy_check_mark: | The object type, which is always "file". | file | +| `size_bytes` | *int* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | +| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | +| `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | +| `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | +| `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | +| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `mimetype` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | +| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `expires_at` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `visibility` | [OptionalNullable[models.FileVisibility]](../models/filevisibility.md) | :heavy_minus_sign: | N/A | | +| `deleted` | *bool* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/getjudgebyidv1observabilityjudgesjudgeidgetrequest.md b/docs/models/getjudgebyidv1observabilityjudgesjudgeidgetrequest.md new file mode 100644 index 00000000..f9f1a248 --- /dev/null +++ b/docs/models/getjudgebyidv1observabilityjudgesjudgeidgetrequest.md @@ -0,0 +1,8 @@ +# GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `judge_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getjudgesv1observabilityjudgesgetrequest.md b/docs/models/getjudgesv1observabilityjudgesgetrequest.md new file mode 100644 index 00000000..154ece82 --- /dev/null +++ b/docs/models/getjudgesv1observabilityjudgesgetrequest.md @@ -0,0 +1,12 @@ +# GetJudgesV1ObservabilityJudgesGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `type_filter` | List[[models.JudgeOutputType](../models/judgeoutputtype.md)] | :heavy_minus_sign: | Filter by judge output types | +| `model_filter` | List[*str*] | :heavy_minus_sign: | Filter by model names | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `q` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getrunhistoryv1workflowsrunsrunidhistorygetrequest.md b/docs/models/getrunhistoryv1workflowsrunsrunidhistorygetrequest.md new file mode 100644 index 00000000..a2d1f1b4 --- /dev/null +++ b/docs/models/getrunhistoryv1workflowsrunsrunidhistorygetrequest.md @@ -0,0 +1,9 @@ +# GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `run_id` | *str* | :heavy_check_mark: | N/A | +| `decode_payloads` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getrunv1workflowsrunsrunidgetrequest.md b/docs/models/getrunv1workflowsrunsrunidgetrequest.md new file mode 100644 index 00000000..6b033690 --- /dev/null +++ b/docs/models/getrunv1workflowsrunsrunidgetrequest.md @@ -0,0 +1,8 @@ +# GetRunV1WorkflowsRunsRunIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `run_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getsignedurlresponse.md b/docs/models/getsignedurlresponse.md new file mode 100644 index 00000000..bde69323 --- /dev/null +++ b/docs/models/getsignedurlresponse.md @@ -0,0 +1,8 @@ +# GetSignedURLResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getsimilarchatcompletioneventsv1observabilitychatcompletioneventseventidsimilareventsgetrequest.md b/docs/models/getsimilarchatcompletioneventsv1observabilitychatcompletioneventseventidsimilareventsgetrequest.md new file mode 100644 index 00000000..cf276b5e --- /dev/null +++ b/docs/models/getsimilarchatcompletioneventsv1observabilitychatcompletioneventseventidsimilareventsgetrequest.md @@ -0,0 +1,8 @@ +# GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `event_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getstreameventsv1workflowseventsstreamgetrequest.md b/docs/models/getstreameventsv1workflowseventsstreamgetrequest.md new file mode 100644 index 00000000..9b5ae174 --- /dev/null +++ b/docs/models/getstreameventsv1workflowseventsstreamgetrequest.md @@ -0,0 +1,19 @@ +# GetStreamEventsV1WorkflowsEventsStreamGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `scope` | [Optional[models.Scope]](../models/scope.md) | :heavy_minus_sign: | N/A | +| `activity_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `activity_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `workflow_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `root_workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `parent_workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `stream` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `start_seq` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `metadata_filters` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `workflow_event_types` | List[[models.WorkflowEventType](../models/workfloweventtype.md)] | :heavy_minus_sign: | N/A | +| `last_event_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getstreameventsv1workflowseventsstreamgetresponsebody.md b/docs/models/getstreameventsv1workflowseventsstreamgetresponsebody.md new file mode 100644 index 00000000..18f9b639 --- /dev/null +++ b/docs/models/getstreameventsv1workflowseventsstreamgetresponsebody.md @@ -0,0 +1,13 @@ +# GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + +Stream of Server-Sent Events (SSE) + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `event` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `data` | [Optional[models.StreamEventSsePayload]](../models/streameventssepayload.md) | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `retry` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getvoicesampleaudiov1audiovoicesvoiceidsamplegetrequest.md b/docs/models/getvoicesampleaudiov1audiovoicesvoiceidsamplegetrequest.md new file mode 100644 index 00000000..618465e9 --- /dev/null +++ b/docs/models/getvoicesampleaudiov1audiovoicesvoiceidsamplegetrequest.md @@ -0,0 +1,8 @@ +# GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `voice_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getvoicev1audiovoicesvoiceidgetrequest.md b/docs/models/getvoicev1audiovoicesvoiceidgetrequest.md new file mode 100644 index 00000000..09caf65c --- /dev/null +++ b/docs/models/getvoicev1audiovoicesvoiceidgetrequest.md @@ -0,0 +1,8 @@ +# GetVoiceV1AudioVoicesVoiceIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `voice_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getworkfloweventsv1workflowseventslistgetrequest.md b/docs/models/getworkfloweventsv1workflowseventslistgetrequest.md new file mode 100644 index 00000000..5594402c --- /dev/null +++ b/docs/models/getworkfloweventsv1workflowseventslistgetrequest.md @@ -0,0 +1,12 @@ +# GetWorkflowEventsV1WorkflowsEventsListGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `root_workflow_exec_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Execution ID of the root workflow that initiated this execution chain. | +| `workflow_exec_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Run ID of the workflow that emitted this event. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of events to return. | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor for pagination. | \ No newline at end of file diff --git a/docs/models/getworkflowexecutionhistoryv1workflowsexecutionsexecutionidhistorygetrequest.md b/docs/models/getworkflowexecutionhistoryv1workflowsexecutionsexecutionidhistorygetrequest.md new file mode 100644 index 00000000..1934b7f9 --- /dev/null +++ b/docs/models/getworkflowexecutionhistoryv1workflowsexecutionsexecutionidhistorygetrequest.md @@ -0,0 +1,9 @@ +# GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `decode_payloads` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getworkflowexecutiontraceeventsrequest.md b/docs/models/getworkflowexecutiontraceeventsrequest.md new file mode 100644 index 00000000..4a1d8021 --- /dev/null +++ b/docs/models/getworkflowexecutiontraceeventsrequest.md @@ -0,0 +1,10 @@ +# GetWorkflowExecutionTraceEventsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `merge_same_id_events` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `include_internal_events` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getworkflowexecutiontraceotelrequest.md b/docs/models/getworkflowexecutiontraceotelrequest.md new file mode 100644 index 00000000..8c4f9be7 --- /dev/null +++ b/docs/models/getworkflowexecutiontraceotelrequest.md @@ -0,0 +1,8 @@ +# GetWorkflowExecutionTraceOtelRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `execution_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getworkflowexecutiontracesummaryrequest.md b/docs/models/getworkflowexecutiontracesummaryrequest.md new file mode 100644 index 00000000..a4524bbc --- /dev/null +++ b/docs/models/getworkflowexecutiontracesummaryrequest.md @@ -0,0 +1,8 @@ +# GetWorkflowExecutionTraceSummaryRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `execution_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getworkflowexecutionv1workflowsexecutionsexecutionidgetrequest.md b/docs/models/getworkflowexecutionv1workflowsexecutionsexecutionidgetrequest.md new file mode 100644 index 00000000..f9566f1c --- /dev/null +++ b/docs/models/getworkflowexecutionv1workflowsexecutionsexecutionidgetrequest.md @@ -0,0 +1,8 @@ +# GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `execution_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getworkflowmetricsv1workflowsworkflownamemetricsgetrequest.md b/docs/models/getworkflowmetricsv1workflowsworkflownamemetricsgetrequest.md new file mode 100644 index 00000000..a6e623dd --- /dev/null +++ b/docs/models/getworkflowmetricsv1workflowsworkflownamemetricsgetrequest.md @@ -0,0 +1,10 @@ +# GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `workflow_name` | *str* | :heavy_check_mark: | N/A | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter workflows started after this time (ISO 8601) | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter workflows started before this time (ISO 8601) | \ No newline at end of file diff --git a/docs/models/getworkflowregistrationsv1workflowsregistrationsgetrequest.md b/docs/models/getworkflowregistrationsv1workflowsregistrationsgetrequest.md new file mode 100644 index 00000000..ee53e5a2 --- /dev/null +++ b/docs/models/getworkflowregistrationsv1workflowsregistrationsgetrequest.md @@ -0,0 +1,17 @@ +# GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `workflow_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The workflow ID to filter by | +| `task_queue` | *OptionalNullable[str]* | :heavy_minus_sign: | The task queue to filter by | +| `active_only` | *Optional[bool]* | :heavy_minus_sign: | Whether to only return active workflows versions | +| `include_shared` | *Optional[bool]* | :heavy_minus_sign: | Whether to include shared workflow versions | +| `workflow_search` | *OptionalNullable[str]* | :heavy_minus_sign: | The workflow name to filter by | +| `archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by archived state. False=exclude archived, True=only archived, None=include all | +| `with_workflow` | *Optional[bool]* | :heavy_minus_sign: | Whether to include the workflow definition | +| `available_in_chat_assistant` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to only return workflows available in chat assistant | +| `limit` | *Optional[int]* | :heavy_minus_sign: | The maximum number of workflows versions to return | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor for pagination | \ No newline at end of file diff --git a/docs/models/getworkflowregistrationv1workflowsregistrationsworkflowregistrationidgetrequest.md b/docs/models/getworkflowregistrationv1workflowsregistrationsworkflowregistrationidgetrequest.md new file mode 100644 index 00000000..ec43ad56 --- /dev/null +++ b/docs/models/getworkflowregistrationv1workflowsregistrationsworkflowregistrationidgetrequest.md @@ -0,0 +1,10 @@ +# GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `workflow_registration_id` | *str* | :heavy_check_mark: | N/A | +| `with_workflow` | *Optional[bool]* | :heavy_minus_sign: | Whether to include the workflow definition | +| `include_shared` | *Optional[bool]* | :heavy_minus_sign: | Whether to include shared workflow versions | \ No newline at end of file diff --git a/docs/models/getworkflowsv1workflowsgetrequest.md b/docs/models/getworkflowsv1workflowsgetrequest.md new file mode 100644 index 00000000..c361f027 --- /dev/null +++ b/docs/models/getworkflowsv1workflowsgetrequest.md @@ -0,0 +1,13 @@ +# GetWorkflowsV1WorkflowsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `active_only` | *Optional[bool]* | :heavy_minus_sign: | Whether to only return active workflows | +| `include_shared` | *Optional[bool]* | :heavy_minus_sign: | Whether to include shared workflows | +| `available_in_chat_assistant` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to only return workflows available in chat assistant | +| `archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by archived state. False=exclude archived, True=only archived, None=include all | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor for pagination | +| `limit` | *Optional[int]* | :heavy_minus_sign: | The maximum number of workflows to return | \ No newline at end of file diff --git a/docs/models/getworkflowsv1workflowsgetresponse.md b/docs/models/getworkflowsv1workflowsgetresponse.md new file mode 100644 index 00000000..6ec4f4e7 --- /dev/null +++ b/docs/models/getworkflowsv1workflowsgetresponse.md @@ -0,0 +1,8 @@ +# GetWorkflowsV1WorkflowsGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `result` | [models.WorkflowListResponse](../models/workflowlistresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/getworkflowv1workflowsworkflowidentifiergetrequest.md b/docs/models/getworkflowv1workflowsworkflowidentifiergetrequest.md new file mode 100644 index 00000000..2f5c2b4d --- /dev/null +++ b/docs/models/getworkflowv1workflowsworkflowidentifiergetrequest.md @@ -0,0 +1,8 @@ +# GetWorkflowV1WorkflowsWorkflowIdentifierGetRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/githubrepository.md b/docs/models/githubrepository.md new file mode 100644 index 00000000..827b6f34 --- /dev/null +++ b/docs/models/githubrepository.md @@ -0,0 +1,13 @@ +# GithubRepository + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `type` | *Literal["github"]* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `owner` | *str* | :heavy_check_mark: | N/A | +| `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `commit_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/githubrepositoryin.md b/docs/models/githubrepositoryin.md deleted file mode 100644 index 1584152b..00000000 --- a/docs/models/githubrepositoryin.md +++ /dev/null @@ -1,13 +0,0 @@ -# GithubRepositoryIn - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `type` | [Optional[models.GithubRepositoryInType]](../models/githubrepositoryintype.md) | :heavy_minus_sign: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `owner` | *str* | :heavy_check_mark: | N/A | -| `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `token` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/githubrepositoryintype.md b/docs/models/githubrepositoryintype.md deleted file mode 100644 index 63da967c..00000000 --- a/docs/models/githubrepositoryintype.md +++ /dev/null @@ -1,8 +0,0 @@ -# GithubRepositoryInType - - -## Values - -| Name | Value | -| -------- | -------- | -| `GITHUB` | github | \ No newline at end of file diff --git a/docs/models/githubrepositoryout.md b/docs/models/githubrepositoryout.md deleted file mode 100644 index 03f0b266..00000000 --- a/docs/models/githubrepositoryout.md +++ /dev/null @@ -1,13 +0,0 @@ -# GithubRepositoryOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `type` | [Optional[models.GithubRepositoryOutType]](../models/githubrepositoryouttype.md) | :heavy_minus_sign: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `owner` | *str* | :heavy_check_mark: | N/A | -| `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `weight` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `commit_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/githubrepositoryouttype.md b/docs/models/githubrepositoryouttype.md deleted file mode 100644 index 46c3eefd..00000000 --- a/docs/models/githubrepositoryouttype.md +++ /dev/null @@ -1,8 +0,0 @@ -# GithubRepositoryOutType - - -## Values - -| Name | Value | -| -------- | -------- | -| `GITHUB` | github | \ No newline at end of file diff --git a/docs/models/guardrailconfig.md b/docs/models/guardrailconfig.md new file mode 100644 index 00000000..1276462c --- /dev/null +++ b/docs/models/guardrailconfig.md @@ -0,0 +1,10 @@ +# GuardrailConfig + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `block_on_error` | *Optional[bool]* | :heavy_minus_sign: | If true, return HTTP 403 and block request in the event of a server-side error | +| `moderation_llm_v1` | [OptionalNullable[models.ModerationLlmv1Config]](../models/moderationllmv1config.md) | :heavy_minus_sign: | N/A | +| `moderation_llm_v2` | [OptionalNullable[models.ModerationLlmv2Config]](../models/moderationllmv2config.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/handoffexecution.md b/docs/models/handoffexecution.md deleted file mode 100644 index 61e7dade..00000000 --- a/docs/models/handoffexecution.md +++ /dev/null @@ -1,9 +0,0 @@ -# HandoffExecution - - -## Values - -| Name | Value | -| -------- | -------- | -| `CLIENT` | client | -| `SERVER` | server | \ No newline at end of file diff --git a/docs/models/hyperparameters.md b/docs/models/hyperparameters.md index 46a6dd6b..b6c00c36 100644 --- a/docs/models/hyperparameters.md +++ b/docs/models/hyperparameters.md @@ -3,15 +3,15 @@ ## Supported Types -### `models.CompletionTrainingParametersIn` +### `models.CompletionTrainingParameters` ```python -value: models.CompletionTrainingParametersIn = /* values here */ +value: models.CompletionTrainingParameters = /* values here */ ``` -### `models.ClassifierTrainingParametersIn` +### `models.ClassifierTrainingParameters` ```python -value: models.ClassifierTrainingParametersIn = /* values here */ +value: models.ClassifierTrainingParameters = /* values here */ ``` diff --git a/docs/models/imagecontent.md b/docs/models/imagecontent.md new file mode 100644 index 00000000..5145469e --- /dev/null +++ b/docs/models/imagecontent.md @@ -0,0 +1,15 @@ +# ImageContent + +Image content for a message. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | *Literal["image"]* | :heavy_check_mark: | N/A | +| `data` | *str* | :heavy_check_mark: | N/A | +| `mime_type` | *str* | :heavy_check_mark: | N/A | +| `annotations` | [OptionalNullable[models.Annotations]](../models/annotations.md) | :heavy_minus_sign: | N/A | +| `meta` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/imagedetail.md b/docs/models/imagedetail.md new file mode 100644 index 00000000..bd7ea1fe --- /dev/null +++ b/docs/models/imagedetail.md @@ -0,0 +1,19 @@ +# ImageDetail + +## Example Usage + +```python +from mistralai.client.models import ImageDetail + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ImageDetail = "low" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"low"` +- `"auto"` +- `"high"` diff --git a/docs/models/imagegenerationtool.md b/docs/models/imagegenerationtool.md index b8fc9cf4..b476b6f2 100644 --- a/docs/models/imagegenerationtool.md +++ b/docs/models/imagegenerationtool.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `type` | [Optional[models.ImageGenerationToolType]](../models/imagegenerationtooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["image_generation"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/imagegenerationtooltype.md b/docs/models/imagegenerationtooltype.md deleted file mode 100644 index 29681b58..00000000 --- a/docs/models/imagegenerationtooltype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ImageGenerationToolType - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `IMAGE_GENERATION` | image_generation | \ No newline at end of file diff --git a/docs/models/imageurl.md b/docs/models/imageurl.md index 7c2bcbc3..6358e0ac 100644 --- a/docs/models/imageurl.md +++ b/docs/models/imageurl.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `url` | *str* | :heavy_check_mark: | N/A | -| `detail` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `url` | *str* | :heavy_check_mark: | N/A | +| `detail` | [OptionalNullable[models.ImageDetail]](../models/imagedetail.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/imageurlchunk.md b/docs/models/imageurlchunk.md index f1b926ef..6d238e25 100644 --- a/docs/models/imageurlchunk.md +++ b/docs/models/imageurlchunk.md @@ -1,11 +1,11 @@ # ImageURLChunk -{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 +{"type":"image_url","image_url":"data:image/png;base64,iVBORw0"} ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `image_url` | [models.ImageURLChunkImageURL](../models/imageurlchunkimageurl.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ImageURLChunkType]](../models/imageurlchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `type` | *Optional[Literal["image_url"]]* | :heavy_minus_sign: | N/A | +| `image_url` | [models.ImageURLUnion](../models/imageurlunion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/imageurlchunkimageurl.md b/docs/models/imageurlchunkimageurl.md deleted file mode 100644 index 76738908..00000000 --- a/docs/models/imageurlchunkimageurl.md +++ /dev/null @@ -1,17 +0,0 @@ -# ImageURLChunkImageURL - - -## Supported Types - -### `models.ImageURL` - -```python -value: models.ImageURL = /* values here */ -``` - -### `str` - -```python -value: str = /* values here */ -``` - diff --git a/docs/models/imageurlchunktype.md b/docs/models/imageurlchunktype.md deleted file mode 100644 index 2064a0b4..00000000 --- a/docs/models/imageurlchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ImageURLChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `IMAGE_URL` | image_url | \ No newline at end of file diff --git a/docs/models/imageurlunion.md b/docs/models/imageurlunion.md new file mode 100644 index 00000000..db97130f --- /dev/null +++ b/docs/models/imageurlunion.md @@ -0,0 +1,17 @@ +# ImageURLUnion + + +## Supported Types + +### `models.ImageURL` + +```python +value: models.ImageURL = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/importdatasetfromcampaignrequest.md b/docs/models/importdatasetfromcampaignrequest.md new file mode 100644 index 00000000..aa1ecc85 --- /dev/null +++ b/docs/models/importdatasetfromcampaignrequest.md @@ -0,0 +1,8 @@ +# ImportDatasetFromCampaignRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/importdatasetfromdatasetrequest.md b/docs/models/importdatasetfromdatasetrequest.md new file mode 100644 index 00000000..cf8d373f --- /dev/null +++ b/docs/models/importdatasetfromdatasetrequest.md @@ -0,0 +1,8 @@ +# ImportDatasetFromDatasetRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `dataset_record_ids` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/importdatasetfromexplorerrequest.md b/docs/models/importdatasetfromexplorerrequest.md new file mode 100644 index 00000000..668cdcbf --- /dev/null +++ b/docs/models/importdatasetfromexplorerrequest.md @@ -0,0 +1,8 @@ +# ImportDatasetFromExplorerRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `completion_event_ids` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/importdatasetfromfilerequest.md b/docs/models/importdatasetfromfilerequest.md new file mode 100644 index 00000000..a05e9725 --- /dev/null +++ b/docs/models/importdatasetfromfilerequest.md @@ -0,0 +1,8 @@ +# ImportDatasetFromFileRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `file_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/importdatasetfromplaygroundrequest.md b/docs/models/importdatasetfromplaygroundrequest.md new file mode 100644 index 00000000..72a586bc --- /dev/null +++ b/docs/models/importdatasetfromplaygroundrequest.md @@ -0,0 +1,8 @@ +# ImportDatasetFromPlaygroundRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `conversation_ids` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/ingestionpipelineconfiguration.md b/docs/models/ingestionpipelineconfiguration.md new file mode 100644 index 00000000..16fde9c6 --- /dev/null +++ b/docs/models/ingestionpipelineconfiguration.md @@ -0,0 +1,16 @@ +# IngestionPipelineConfiguration + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `author_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `modified_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `last_run_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `last_run_chunks_count` | *int* | :heavy_check_mark: | N/A | +| `total_chunks_count` | *int* | :heavy_check_mark: | N/A | +| `pipeline_composition` | Dict[str, *str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/inputs.md b/docs/models/inputs.md index 0f62a7ce..d5771207 100644 --- a/docs/models/inputs.md +++ b/docs/models/inputs.md @@ -5,10 +5,10 @@ Chat to classify ## Supported Types -### `models.InstructRequestInputs` +### `models.InstructRequest` ```python -value: models.InstructRequestInputs = /* values here */ +value: models.InstructRequest = /* values here */ ``` ### `List[models.InstructRequest]` diff --git a/docs/models/instructrequest.md b/docs/models/instructrequest.md index 9500cb58..5f0cdfff 100644 --- a/docs/models/instructrequest.md +++ b/docs/models/instructrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `messages` | List[[models.InstructRequestMessages](../models/instructrequestmessages.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `messages` | List[[models.InstructRequestMessage](../models/instructrequestmessage.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/instructrequestinputs.md b/docs/models/instructrequestinputs.md deleted file mode 100644 index 4caa028f..00000000 --- a/docs/models/instructrequestinputs.md +++ /dev/null @@ -1,8 +0,0 @@ -# InstructRequestInputs - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `messages` | List[[models.InstructRequestInputsMessages](../models/instructrequestinputsmessages.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/instructrequestinputsmessages.md b/docs/models/instructrequestinputsmessages.md deleted file mode 100644 index 237e131f..00000000 --- a/docs/models/instructrequestinputsmessages.md +++ /dev/null @@ -1,29 +0,0 @@ -# InstructRequestInputsMessages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/docs/models/instructrequestmessage.md b/docs/models/instructrequestmessage.md new file mode 100644 index 00000000..57ed27ab --- /dev/null +++ b/docs/models/instructrequestmessage.md @@ -0,0 +1,29 @@ +# InstructRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/docs/models/instructrequestmessages.md b/docs/models/instructrequestmessages.md deleted file mode 100644 index 9c866a7d..00000000 --- a/docs/models/instructrequestmessages.md +++ /dev/null @@ -1,29 +0,0 @@ -# InstructRequestMessages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/docs/models/integrations.md b/docs/models/integrations.md deleted file mode 100644 index 35214d63..00000000 --- a/docs/models/integrations.md +++ /dev/null @@ -1,11 +0,0 @@ -# Integrations - - -## Supported Types - -### `models.WandbIntegrationOut` - -```python -value: models.WandbIntegrationOut = /* values here */ -``` - diff --git a/docs/models/jobin.md b/docs/models/jobin.md deleted file mode 100644 index b9651770..00000000 --- a/docs/models/jobin.md +++ /dev/null @@ -1,18 +0,0 @@ -# JobIn - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | The name of the model to fine-tune. | -| `training_files` | List[[models.TrainingFile](../models/trainingfile.md)] | :heavy_minus_sign: | N/A | -| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` | -| `integrations` | List[[models.JobInIntegrations](../models/jobinintegrations.md)] | :heavy_minus_sign: | A list of integrations to enable for your fine-tuning job. | -| `auto_start` | *Optional[bool]* | :heavy_minus_sign: | This field will be required in a future release. | -| `invalid_sample_skip_percentage` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `job_type` | [OptionalNullable[models.FineTuneableModelType]](../models/finetuneablemodeltype.md) | :heavy_minus_sign: | N/A | -| `hyperparameters` | [models.Hyperparameters](../models/hyperparameters.md) | :heavy_check_mark: | N/A | -| `repositories` | List[[models.JobInRepositories](../models/jobinrepositories.md)] | :heavy_minus_sign: | N/A | -| `classifier_targets` | List[[models.ClassifierTargetIn](../models/classifiertargetin.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/jobinintegrations.md b/docs/models/jobinintegrations.md deleted file mode 100644 index 91c10242..00000000 --- a/docs/models/jobinintegrations.md +++ /dev/null @@ -1,11 +0,0 @@ -# JobInIntegrations - - -## Supported Types - -### `models.WandbIntegration` - -```python -value: models.WandbIntegration = /* values here */ -``` - diff --git a/docs/models/jobinrepositories.md b/docs/models/jobinrepositories.md deleted file mode 100644 index b94477af..00000000 --- a/docs/models/jobinrepositories.md +++ /dev/null @@ -1,11 +0,0 @@ -# JobInRepositories - - -## Supported Types - -### `models.GithubRepositoryIn` - -```python -value: models.GithubRepositoryIn = /* values here */ -``` - diff --git a/docs/models/jobmetadata.md b/docs/models/jobmetadata.md new file mode 100644 index 00000000..2c289a3b --- /dev/null +++ b/docs/models/jobmetadata.md @@ -0,0 +1,14 @@ +# JobMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `expected_duration_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | The approximated time (in seconds) for the fine-tuning process to complete. | 220 | +| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | The cost of the fine-tuning job. | 10 | +| `cost_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | The currency used for the fine-tuning job cost. | EUR | +| `train_tokens_per_step` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of tokens consumed by one training step. | 131072 | +| `train_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The total number of tokens used during the fine-tuning process. | 1310720 | +| `data_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The total number of tokens in the training dataset. | 305375 | +| `estimated_start_time` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/jobmetadataout.md b/docs/models/jobmetadataout.md deleted file mode 100644 index 6218a161..00000000 --- a/docs/models/jobmetadataout.md +++ /dev/null @@ -1,14 +0,0 @@ -# JobMetadataOut - - -## Fields - -| Field | Type | Required | Description | -| --------------------------- | --------------------------- | --------------------------- | --------------------------- | -| `expected_duration_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `cost_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `train_tokens_per_step` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `train_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `data_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `estimated_start_time` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/jobsapiroutesbatchdeletebatchjobrequest.md b/docs/models/jobsapiroutesbatchdeletebatchjobrequest.md new file mode 100644 index 00000000..02f1ec24 --- /dev/null +++ b/docs/models/jobsapiroutesbatchdeletebatchjobrequest.md @@ -0,0 +1,8 @@ +# JobsAPIRoutesBatchDeleteBatchJobRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `job_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/jobsapiroutesbatchgetbatchjobrequest.md b/docs/models/jobsapiroutesbatchgetbatchjobrequest.md index 3930aacd..8c259bea 100644 --- a/docs/models/jobsapiroutesbatchgetbatchjobrequest.md +++ b/docs/models/jobsapiroutesbatchgetbatchjobrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `job_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `job_id` | *str* | :heavy_check_mark: | N/A | +| `inline` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/jobsapiroutesbatchgetbatchjobsrequest.md b/docs/models/jobsapiroutesbatchgetbatchjobsrequest.md index b062b873..5ceb0b2c 100644 --- a/docs/models/jobsapiroutesbatchgetbatchjobsrequest.md +++ b/docs/models/jobsapiroutesbatchgetbatchjobsrequest.md @@ -12,4 +12,5 @@ | `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | `created_after` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | | `created_by_me` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `status` | List[[models.BatchJobStatus](../models/batchjobstatus.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status` | List[[models.BatchJobStatus](../models/batchjobstatus.md)] | :heavy_minus_sign: | N/A | +| `order_by` | [Optional[models.OrderBy]](../models/orderby.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md b/docs/models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md index 1b331662..fb62eb62 100644 --- a/docs/models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md +++ b/docs/models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md @@ -5,15 +5,15 @@ OK ## Supported Types -### `models.ClassifierDetailedJobOut` +### `models.ClassifierFineTuningJobDetails` ```python -value: models.ClassifierDetailedJobOut = /* values here */ +value: models.ClassifierFineTuningJobDetails = /* values here */ ``` -### `models.CompletionDetailedJobOut` +### `models.CompletionFineTuningJobDetails` ```python -value: models.CompletionDetailedJobOut = /* values here */ +value: models.CompletionFineTuningJobDetails = /* values here */ ``` diff --git a/docs/models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md b/docs/models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md index eeddc3cd..7b52e2ca 100644 --- a/docs/models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md +++ b/docs/models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md @@ -5,15 +5,15 @@ OK ## Supported Types -### `models.Response1` +### `models.Response` ```python -value: models.Response1 = /* values here */ +value: models.Response = /* values here */ ``` -### `models.LegacyJobMetadataOut` +### `models.LegacyJobMetadata` ```python -value: models.LegacyJobMetadataOut = /* values here */ +value: models.LegacyJobMetadata = /* values here */ ``` diff --git a/docs/models/jobsapiroutesfinetuninggetfinetuningjobresponse.md b/docs/models/jobsapiroutesfinetuninggetfinetuningjobresponse.md index e0d2e361..f7705327 100644 --- a/docs/models/jobsapiroutesfinetuninggetfinetuningjobresponse.md +++ b/docs/models/jobsapiroutesfinetuninggetfinetuningjobresponse.md @@ -5,15 +5,15 @@ OK ## Supported Types -### `models.ClassifierDetailedJobOut` +### `models.ClassifierFineTuningJobDetails` ```python -value: models.ClassifierDetailedJobOut = /* values here */ +value: models.ClassifierFineTuningJobDetails = /* values here */ ``` -### `models.CompletionDetailedJobOut` +### `models.CompletionFineTuningJobDetails` ```python -value: models.CompletionDetailedJobOut = /* values here */ +value: models.CompletionFineTuningJobDetails = /* values here */ ``` diff --git a/docs/models/jobsapiroutesfinetuninggetfinetuningjobsrequest.md b/docs/models/jobsapiroutesfinetuninggetfinetuningjobsrequest.md index 3dca3cd8..23c52c34 100644 --- a/docs/models/jobsapiroutesfinetuninggetfinetuningjobsrequest.md +++ b/docs/models/jobsapiroutesfinetuninggetfinetuningjobsrequest.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `page` | *Optional[int]* | :heavy_minus_sign: | The page number of the results to be returned. | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | The number of items to return per page. | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The model name used for fine-tuning to filter on. When set, the other results are not displayed. | -| `created_after` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date/time to filter on. When set, the results for previous creation times are not displayed. | -| `created_before` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `created_by_me` | *Optional[bool]* | :heavy_minus_sign: | When set, only return results for jobs created by the API caller. Other results are not displayed. | -| `status` | [OptionalNullable[models.QueryParamStatus]](../models/queryparamstatus.md) | :heavy_minus_sign: | The current job state to filter on. When set, the other results are not displayed. | -| `wandb_project` | *OptionalNullable[str]* | :heavy_minus_sign: | The Weights and Biases project to filter on. When set, the other results are not displayed. | -| `wandb_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The Weight and Biases run name to filter on. When set, the other results are not displayed. | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | The model suffix to filter on. When set, the other results are not displayed. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | The page number of the results to be returned. | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | The number of items to return per page. | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The model name used for fine-tuning to filter on. When set, the other results are not displayed. | +| `created_after` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date/time to filter on. When set, the results for previous creation times are not displayed. | +| `created_before` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `created_by_me` | *Optional[bool]* | :heavy_minus_sign: | When set, only return results for jobs created by the API caller. Other results are not displayed. | +| `status` | [OptionalNullable[models.JobsAPIRoutesFineTuningGetFineTuningJobsStatus]](../models/jobsapiroutesfinetuninggetfinetuningjobsstatus.md) | :heavy_minus_sign: | The current job state to filter on. When set, the other results are not displayed. | +| `wandb_project` | *OptionalNullable[str]* | :heavy_minus_sign: | The Weights and Biases project to filter on. When set, the other results are not displayed. | +| `wandb_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The Weight and Biases run name to filter on. When set, the other results are not displayed. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | The model suffix to filter on. When set, the other results are not displayed. | \ No newline at end of file diff --git a/docs/models/jobsapiroutesfinetuninggetfinetuningjobsstatus.md b/docs/models/jobsapiroutesfinetuninggetfinetuningjobsstatus.md new file mode 100644 index 00000000..1436f6ae --- /dev/null +++ b/docs/models/jobsapiroutesfinetuninggetfinetuningjobsstatus.md @@ -0,0 +1,24 @@ +# JobsAPIRoutesFineTuningGetFineTuningJobsStatus + +The current job state to filter on. When set, the other results are not displayed. + +## Example Usage + +```python +from mistralai.client.models import JobsAPIRoutesFineTuningGetFineTuningJobsStatus +value: JobsAPIRoutesFineTuningGetFineTuningJobsStatus = "QUEUED" +``` + + +## Values + +- `"QUEUED"` +- `"STARTED"` +- `"VALIDATING"` +- `"VALIDATED"` +- `"RUNNING"` +- `"FAILED_VALIDATION"` +- `"FAILED"` +- `"SUCCESS"` +- `"CANCELLED"` +- `"CANCELLATION_REQUESTED"` diff --git a/docs/models/jobsapiroutesfinetuningstartfinetuningjobresponse.md b/docs/models/jobsapiroutesfinetuningstartfinetuningjobresponse.md index 64f4cca6..1a7e71d4 100644 --- a/docs/models/jobsapiroutesfinetuningstartfinetuningjobresponse.md +++ b/docs/models/jobsapiroutesfinetuningstartfinetuningjobresponse.md @@ -5,15 +5,15 @@ OK ## Supported Types -### `models.ClassifierDetailedJobOut` +### `models.ClassifierFineTuningJobDetails` ```python -value: models.ClassifierDetailedJobOut = /* values here */ +value: models.ClassifierFineTuningJobDetails = /* values here */ ``` -### `models.CompletionDetailedJobOut` +### `models.CompletionFineTuningJobDetails` ```python -value: models.CompletionDetailedJobOut = /* values here */ +value: models.CompletionFineTuningJobDetails = /* values here */ ``` diff --git a/docs/models/jobsapiroutesfinetuningupdatefinetunedmodelrequest.md b/docs/models/jobsapiroutesfinetuningupdatefinetunedmodelrequest.md index 6d93832e..dbe49a86 100644 --- a/docs/models/jobsapiroutesfinetuningupdatefinetunedmodelrequest.md +++ b/docs/models/jobsapiroutesfinetuningupdatefinetunedmodelrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `model_id` | *str* | :heavy_check_mark: | The ID of the model to update. | ft:open-mistral-7b:587a6b29:20240514:7e773925 | -| `update_ft_model_in` | [models.UpdateFTModelIn](../models/updateftmodelin.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `model_id` | *str* | :heavy_check_mark: | The ID of the model to update. | ft:open-mistral-7b:587a6b29:20240514:7e773925 | +| `update_model_request` | [models.UpdateModelRequest](../models/updatemodelrequest.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/jobsapiroutesfinetuningupdatefinetunedmodelresponse.md b/docs/models/jobsapiroutesfinetuningupdatefinetunedmodelresponse.md index 54f4c398..f40350bf 100644 --- a/docs/models/jobsapiroutesfinetuningupdatefinetunedmodelresponse.md +++ b/docs/models/jobsapiroutesfinetuningupdatefinetunedmodelresponse.md @@ -5,15 +5,15 @@ OK ## Supported Types -### `models.ClassifierFTModelOut` +### `models.ClassifierFineTunedModel` ```python -value: models.ClassifierFTModelOut = /* values here */ +value: models.ClassifierFineTunedModel = /* values here */ ``` -### `models.CompletionFTModelOut` +### `models.CompletionFineTunedModel` ```python -value: models.CompletionFTModelOut = /* values here */ +value: models.CompletionFineTunedModel = /* values here */ ``` diff --git a/docs/models/jobsout.md b/docs/models/jobsout.md deleted file mode 100644 index 977013f7..00000000 --- a/docs/models/jobsout.md +++ /dev/null @@ -1,10 +0,0 @@ -# JobsOut - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `data` | List[[models.JobsOutData](../models/jobsoutdata.md)] | :heavy_minus_sign: | N/A | -| `object` | [Optional[models.JobsOutObject]](../models/jobsoutobject.md) | :heavy_minus_sign: | N/A | -| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/jobsoutdata.md b/docs/models/jobsoutdata.md deleted file mode 100644 index 28cec311..00000000 --- a/docs/models/jobsoutdata.md +++ /dev/null @@ -1,17 +0,0 @@ -# JobsOutData - - -## Supported Types - -### `models.ClassifierJobOut` - -```python -value: models.ClassifierJobOut = /* values here */ -``` - -### `models.CompletionJobOut` - -```python -value: models.CompletionJobOut = /* values here */ -``` - diff --git a/docs/models/jobsoutobject.md b/docs/models/jobsoutobject.md deleted file mode 100644 index f6c8a2c3..00000000 --- a/docs/models/jobsoutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# JobsOutObject - - -## Values - -| Name | Value | -| ------ | ------ | -| `LIST` | list | \ No newline at end of file diff --git a/docs/models/jobtype.md b/docs/models/jobtype.md deleted file mode 100644 index 847c6622..00000000 --- a/docs/models/jobtype.md +++ /dev/null @@ -1,10 +0,0 @@ -# JobType - -The type of job (`FT` for fine-tuning). - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `COMPLETION` | completion | \ No newline at end of file diff --git a/docs/models/jsonpatch.md b/docs/models/jsonpatch.md new file mode 100644 index 00000000..eb8d9347 --- /dev/null +++ b/docs/models/jsonpatch.md @@ -0,0 +1,29 @@ +# JSONPatch + + +## Supported Types + +### `models.JSONPatchAdd` + +```python +value: models.JSONPatchAdd = /* values here */ +``` + +### `models.JSONPatchAppend` + +```python +value: models.JSONPatchAppend = /* values here */ +``` + +### `models.JSONPatchRemove` + +```python +value: models.JSONPatchRemove = /* values here */ +``` + +### `models.JSONPatchReplace` + +```python +value: models.JSONPatchReplace = /* values here */ +``` + diff --git a/docs/models/jsonpatchadd.md b/docs/models/jsonpatchadd.md new file mode 100644 index 00000000..2a091c8a --- /dev/null +++ b/docs/models/jsonpatchadd.md @@ -0,0 +1,10 @@ +# JSONPatchAdd + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `path` | *str* | :heavy_check_mark: | A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations. | +| `value` | *Any* | :heavy_check_mark: | The value to use for the operation | +| `op` | *Literal["add"]* | :heavy_check_mark: | Add operation | \ No newline at end of file diff --git a/docs/models/jsonpatchappend.md b/docs/models/jsonpatchappend.md new file mode 100644 index 00000000..684cc896 --- /dev/null +++ b/docs/models/jsonpatchappend.md @@ -0,0 +1,10 @@ +# JSONPatchAppend + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `path` | *str* | :heavy_check_mark: | A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations. | +| `value` | *str* | :heavy_check_mark: | The value to use for the operation. A string to append to the existing value | +| `op` | *Literal["append"]* | :heavy_check_mark: | 'append' is an extension for efficient string concatenation in streaming scenarios. | \ No newline at end of file diff --git a/docs/models/jsonpatchpayloadresponse.md b/docs/models/jsonpatchpayloadresponse.md new file mode 100644 index 00000000..3436bee3 --- /dev/null +++ b/docs/models/jsonpatchpayloadresponse.md @@ -0,0 +1,16 @@ +# JSONPatchPayloadResponse + +A payload containing a list of JSON Patch operations. + +Used for streaming incremental updates to workflow state. +When encrypted, the value field contains base64-encoded encrypted data +and encoding_options indicates the type of encryption applied. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `type` | *Literal["json_patch"]* | :heavy_check_mark: | Discriminator indicating this is a JSON Patch payload. | +| `value` | [models.JSONPatchPayloadValueResponse](../models/jsonpatchpayloadvalueresponse.md) | :heavy_check_mark: | N/A | +| `encoding_options` | List[[models.EncodedPayloadOptions](../models/encodedpayloadoptions.md)] | :heavy_minus_sign: | Encoding options applied to the payload. | \ No newline at end of file diff --git a/docs/models/jsonpatchpayloadvalueresponse.md b/docs/models/jsonpatchpayloadvalueresponse.md new file mode 100644 index 00000000..f12623e5 --- /dev/null +++ b/docs/models/jsonpatchpayloadvalueresponse.md @@ -0,0 +1,17 @@ +# JSONPatchPayloadValueResponse + + +## Supported Types + +### `List[models.JSONPatch]` + +```python +value: List[models.JSONPatch] = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/jsonpatchremove.md b/docs/models/jsonpatchremove.md new file mode 100644 index 00000000..735305cf --- /dev/null +++ b/docs/models/jsonpatchremove.md @@ -0,0 +1,10 @@ +# JSONPatchRemove + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `path` | *str* | :heavy_check_mark: | A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations. | +| `value` | *Any* | :heavy_check_mark: | The value to use for the operation | +| `op` | *Literal["remove"]* | :heavy_check_mark: | Remove operation | \ No newline at end of file diff --git a/docs/models/jsonpatchreplace.md b/docs/models/jsonpatchreplace.md new file mode 100644 index 00000000..382b7d93 --- /dev/null +++ b/docs/models/jsonpatchreplace.md @@ -0,0 +1,10 @@ +# JSONPatchReplace + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `path` | *str* | :heavy_check_mark: | A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations. | +| `value` | *Any* | :heavy_check_mark: | The value to use for the operation | +| `op` | *Literal["replace"]* | :heavy_check_mark: | Replace operation | \ No newline at end of file diff --git a/docs/models/jsonpayloadresponse.md b/docs/models/jsonpayloadresponse.md new file mode 100644 index 00000000..2976dea5 --- /dev/null +++ b/docs/models/jsonpayloadresponse.md @@ -0,0 +1,16 @@ +# JSONPayloadResponse + +A payload containing arbitrary JSON data. + +Used for complete state snapshots or final results. +When encrypted, the value field contains base64-encoded encrypted data +and encoding_options indicates the type of encryption applied. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `type` | *Optional[Literal["json"]]* | :heavy_minus_sign: | Discriminator indicating this is a raw JSON payload. | +| `value` | *Any* | :heavy_check_mark: | The JSON-serializable payload value. When encrypted, contains base64-encoded data. | +| `encoding_options` | List[[models.EncodedPayloadOptions](../models/encodedpayloadoptions.md)] | :heavy_minus_sign: | Encoding options applied to the payload. | \ No newline at end of file diff --git a/docs/models/judge.md b/docs/models/judge.md new file mode 100644 index 00000000..34bcce9b --- /dev/null +++ b/docs/models/judge.md @@ -0,0 +1,22 @@ +# Judge + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `deleted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `owner_id` | *str* | :heavy_check_mark: | N/A | +| `workspace_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `model_name` | *str* | :heavy_check_mark: | N/A | +| `output` | [models.JudgeOutputUnion](../models/judgeoutputunion.md) | :heavy_check_mark: | N/A | +| `instructions` | *str* | :heavy_check_mark: | N/A | +| `tools` | List[*str*] | :heavy_check_mark: | N/A | +| `up_revision` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `down_revision` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `base_revision` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/judgechatcompletioneventrequest.md b/docs/models/judgechatcompletioneventrequest.md new file mode 100644 index 00000000..b91a6492 --- /dev/null +++ b/docs/models/judgechatcompletioneventrequest.md @@ -0,0 +1,8 @@ +# JudgeChatCompletionEventRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `judge_definition` | [models.CreateJudgeRequest](../models/createjudgerequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/judgechatcompletioneventv1observabilitychatcompletioneventseventidlivejudgingpostrequest.md b/docs/models/judgechatcompletioneventv1observabilitychatcompletioneventseventidlivejudgingpostrequest.md new file mode 100644 index 00000000..6a9d93c9 --- /dev/null +++ b/docs/models/judgechatcompletioneventv1observabilitychatcompletioneventseventidlivejudgingpostrequest.md @@ -0,0 +1,9 @@ +# JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | N/A | +| `judge_chat_completion_event_request` | [models.JudgeChatCompletionEventRequest](../models/judgechatcompletioneventrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/judgeclassificationoutput.md b/docs/models/judgeclassificationoutput.md new file mode 100644 index 00000000..44d8462e --- /dev/null +++ b/docs/models/judgeclassificationoutput.md @@ -0,0 +1,9 @@ +# JudgeClassificationOutput + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `type` | *Literal["CLASSIFICATION"]* | :heavy_check_mark: | N/A | +| `options` | List[[models.JudgeClassificationOutputOption](../models/judgeclassificationoutputoption.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/judgeclassificationoutputoption.md b/docs/models/judgeclassificationoutputoption.md new file mode 100644 index 00000000..67e08ed2 --- /dev/null +++ b/docs/models/judgeclassificationoutputoption.md @@ -0,0 +1,9 @@ +# JudgeClassificationOutputOption + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `value` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/judgeconversationrequest.md b/docs/models/judgeconversationrequest.md new file mode 100644 index 00000000..491c3b34 --- /dev/null +++ b/docs/models/judgeconversationrequest.md @@ -0,0 +1,9 @@ +# JudgeConversationRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `messages` | List[Dict[str, *Any*]] | :heavy_check_mark: | N/A | +| `properties` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/judgeconversationv1observabilityjudgesjudgeidlivejudgingpostrequest.md b/docs/models/judgeconversationv1observabilityjudgesjudgeidlivejudgingpostrequest.md new file mode 100644 index 00000000..4d362423 --- /dev/null +++ b/docs/models/judgeconversationv1observabilityjudgesjudgeidlivejudgingpostrequest.md @@ -0,0 +1,9 @@ +# JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `judge_id` | *str* | :heavy_check_mark: | N/A | +| `judge_conversation_request` | [models.JudgeConversationRequest](../models/judgeconversationrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/judgedatasetrecordrequest.md b/docs/models/judgedatasetrecordrequest.md new file mode 100644 index 00000000..d82aabd9 --- /dev/null +++ b/docs/models/judgedatasetrecordrequest.md @@ -0,0 +1,8 @@ +# JudgeDatasetRecordRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `judge_definition` | [models.CreateJudgeRequest](../models/createjudgerequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/judgedatasetrecordv1observabilitydatasetrecordsdatasetrecordidlivejudgingpostrequest.md b/docs/models/judgedatasetrecordv1observabilitydatasetrecordsdatasetrecordidlivejudgingpostrequest.md new file mode 100644 index 00000000..9ce4f011 --- /dev/null +++ b/docs/models/judgedatasetrecordv1observabilitydatasetrecordsdatasetrecordidlivejudgingpostrequest.md @@ -0,0 +1,9 @@ +# JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | +| `judge_dataset_record_request` | [models.JudgeDatasetRecordRequest](../models/judgedatasetrecordrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/judgeoutput.md b/docs/models/judgeoutput.md new file mode 100644 index 00000000..4abeffa5 --- /dev/null +++ b/docs/models/judgeoutput.md @@ -0,0 +1,9 @@ +# JudgeOutput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `analysis` | *str* | :heavy_check_mark: | N/A | +| `answer` | [models.Answer](../models/answer.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/judgeoutputtype.md b/docs/models/judgeoutputtype.md new file mode 100644 index 00000000..35a1a837 --- /dev/null +++ b/docs/models/judgeoutputtype.md @@ -0,0 +1,14 @@ +# JudgeOutputType + +## Example Usage + +```python +from mistralai.client.models import JudgeOutputType +value: JudgeOutputType = "REGRESSION" +``` + + +## Values + +- `"REGRESSION"` +- `"CLASSIFICATION"` diff --git a/docs/models/judgeoutputunion.md b/docs/models/judgeoutputunion.md new file mode 100644 index 00000000..61829564 --- /dev/null +++ b/docs/models/judgeoutputunion.md @@ -0,0 +1,17 @@ +# JudgeOutputUnion + + +## Supported Types + +### `models.JudgeClassificationOutput` + +```python +value: models.JudgeClassificationOutput = /* values here */ +``` + +### `models.JudgeRegressionOutput` + +```python +value: models.JudgeRegressionOutput = /* values here */ +``` + diff --git a/docs/models/judgeregressionoutput.md b/docs/models/judgeregressionoutput.md new file mode 100644 index 00000000..8f020dfb --- /dev/null +++ b/docs/models/judgeregressionoutput.md @@ -0,0 +1,12 @@ +# JudgeRegressionOutput + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `type` | *Literal["REGRESSION"]* | :heavy_check_mark: | N/A | +| `min` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `min_description` | *str* | :heavy_check_mark: | N/A | +| `max` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `max_description` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/legacyjobmetadata.md b/docs/models/legacyjobmetadata.md new file mode 100644 index 00000000..4705ab4f --- /dev/null +++ b/docs/models/legacyjobmetadata.md @@ -0,0 +1,19 @@ +# LegacyJobMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `expected_duration_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | The approximated time (in seconds) for the fine-tuning process to complete. | 220 | +| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | The cost of the fine-tuning job. | 10 | +| `cost_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | The currency used for the fine-tuning job cost. | EUR | +| `train_tokens_per_step` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of tokens consumed by one training step. | 131072 | +| `train_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The total number of tokens used during the fine-tuning process. | 1310720 | +| `data_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The total number of tokens in the training dataset. | 305375 | +| `estimated_start_time` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | +| `deprecated` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `details` | *str* | :heavy_check_mark: | N/A | | +| `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | The number of complete passes through the entire training dataset. | 4.2922 | +| `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | 10 | +| `object` | *Optional[Literal["job.metadata"]]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/legacyjobmetadataout.md b/docs/models/legacyjobmetadataout.md deleted file mode 100644 index 53a45485..00000000 --- a/docs/models/legacyjobmetadataout.md +++ /dev/null @@ -1,19 +0,0 @@ -# LegacyJobMetadataOut - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `expected_duration_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | The approximated time (in seconds) for the fine-tuning process to complete. | 220 | -| `cost` | *OptionalNullable[float]* | :heavy_minus_sign: | The cost of the fine-tuning job. | 10 | -| `cost_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | The currency used for the fine-tuning job cost. | EUR | -| `train_tokens_per_step` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of tokens consumed by one training step. | 131072 | -| `train_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The total number of tokens used during the fine-tuning process. | 1310720 | -| `data_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The total number of tokens in the training dataset. | 305375 | -| `estimated_start_time` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | -| `deprecated` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `details` | *str* | :heavy_check_mark: | N/A | | -| `epochs` | *OptionalNullable[float]* | :heavy_minus_sign: | The number of complete passes through the entire training dataset. | 4.2922 | -| `training_steps` | *OptionalNullable[int]* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | 10 | -| `object` | [Optional[models.LegacyJobMetadataOutObject]](../models/legacyjobmetadataoutobject.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/legacyjobmetadataoutobject.md b/docs/models/legacyjobmetadataoutobject.md deleted file mode 100644 index 9873ada8..00000000 --- a/docs/models/legacyjobmetadataoutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# LegacyJobMetadataOutObject - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `JOB_METADATA` | job.metadata | \ No newline at end of file diff --git a/docs/models/librariesdocumentsgettextcontentv1request.md b/docs/models/librariesdocumentsgettextcontentv1request.md index 2f58a446..6413e51c 100644 --- a/docs/models/librariesdocumentsgettextcontentv1request.md +++ b/docs/models/librariesdocumentsgettextcontentv1request.md @@ -3,7 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `document_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `document_id` | *str* | :heavy_check_mark: | N/A | +| `page_start` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `page_end` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/librariesdocumentslistv1request.md b/docs/models/librariesdocumentslistv1request.md index 1b4eb24d..44f63001 100644 --- a/docs/models/librariesdocumentslistv1request.md +++ b/docs/models/librariesdocumentslistv1request.md @@ -9,5 +9,6 @@ | `search` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `filters_attributes` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `sort_by` | *Optional[str]* | :heavy_minus_sign: | N/A | | `sort_order` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/librariesdocumentsupdatev1request.md b/docs/models/librariesdocumentsupdatev1request.md index 2f18b014..d4630850 100644 --- a/docs/models/librariesdocumentsupdatev1request.md +++ b/docs/models/librariesdocumentsupdatev1request.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `document_id` | *str* | :heavy_check_mark: | N/A | -| `document_update_in` | [models.DocumentUpdateIn](../models/documentupdatein.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `document_id` | *str* | :heavy_check_mark: | N/A | +| `update_document_request` | [models.UpdateDocumentRequest](../models/updatedocumentrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/librariesdocumentsuploadv1documentupload.md b/docs/models/librariesdocumentsuploadv1documentupload.md deleted file mode 100644 index a0ba95da..00000000 --- a/docs/models/librariesdocumentsuploadv1documentupload.md +++ /dev/null @@ -1,8 +0,0 @@ -# LibrariesDocumentsUploadV1DocumentUpload - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` | [models.File](../models/file.md) | :heavy_check_mark: | The File object (not file name) to be uploaded.
To upload a file and specify a custom file name you should format your request as such:
```bash
file=@path/to/your/file.jsonl;filename=custom_name.jsonl
```
Otherwise, you can just keep the original file name:
```bash
file=@path/to/your/file.jsonl
``` | \ No newline at end of file diff --git a/docs/models/librariesdocumentsuploadv1request.md b/docs/models/librariesdocumentsuploadv1request.md index 7c91ca9b..172a6183 100644 --- a/docs/models/librariesdocumentsuploadv1request.md +++ b/docs/models/librariesdocumentsuploadv1request.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `request_body` | [models.LibrariesDocumentsUploadV1DocumentUpload](../models/librariesdocumentsuploadv1documentupload.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `request_body` | [models.DocumentUpload](../models/documentupload.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/librarieslistv1request.md b/docs/models/librarieslistv1request.md new file mode 100644 index 00000000..37352ee1 --- /dev/null +++ b/docs/models/librarieslistv1request.md @@ -0,0 +1,11 @@ +# LibrariesListV1Request + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `search` | *OptionalNullable[str]* | :heavy_minus_sign: | Case-insensitive search on the library name. | +| `filter_owned_by_me` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter libraries by whether they were created by the current authenticated identity. Set to true for created by me, false for only libraries shared with me, or None to disable this filter. | \ No newline at end of file diff --git a/docs/models/librariessharecreatev1request.md b/docs/models/librariessharecreatev1request.md index 4c05241d..8af7cc9d 100644 --- a/docs/models/librariessharecreatev1request.md +++ b/docs/models/librariessharecreatev1request.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `sharing_in` | [models.SharingIn](../models/sharingin.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `sharing_request` | [models.SharingRequest](../models/sharingrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/librariesupdatev1request.md b/docs/models/librariesupdatev1request.md index a68ef7a8..c5c142db 100644 --- a/docs/models/librariesupdatev1request.md +++ b/docs/models/librariesupdatev1request.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `library_in_update` | [models.LibraryInUpdate](../models/libraryinupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `update_library_request` | [models.UpdateLibraryRequest](../models/updatelibraryrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/library.md b/docs/models/library.md new file mode 100644 index 00000000..a07d3afa --- /dev/null +++ b/docs/models/library.md @@ -0,0 +1,23 @@ +# Library + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `owner_id` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `owner_type` | *str* | :heavy_check_mark: | N/A | +| `total_size` | *int* | :heavy_check_mark: | N/A | +| `nb_documents` | *int* | :heavy_check_mark: | N/A | +| `chunk_size` | *Nullable[int]* | :heavy_check_mark: | N/A | +| `emoji` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `generated_description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `explicit_user_members_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `explicit_workspace_members_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| ~~`org_sharing_role`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | +| `generated_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Generated Name | \ No newline at end of file diff --git a/docs/models/libraryin.md b/docs/models/libraryin.md deleted file mode 100644 index d6b11914..00000000 --- a/docs/models/libraryin.md +++ /dev/null @@ -1,10 +0,0 @@ -# LibraryIn - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `name` | *str* | :heavy_check_mark: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `chunk_size` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/libraryinupdate.md b/docs/models/libraryinupdate.md deleted file mode 100644 index 4aa169c7..00000000 --- a/docs/models/libraryinupdate.md +++ /dev/null @@ -1,9 +0,0 @@ -# LibraryInUpdate - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/libraryout.md b/docs/models/libraryout.md deleted file mode 100644 index cf4de41b..00000000 --- a/docs/models/libraryout.md +++ /dev/null @@ -1,23 +0,0 @@ -# LibraryOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `owner_id` | *str* | :heavy_check_mark: | N/A | -| `owner_type` | *str* | :heavy_check_mark: | N/A | -| `total_size` | *int* | :heavy_check_mark: | N/A | -| `nb_documents` | *int* | :heavy_check_mark: | N/A | -| `chunk_size` | *Nullable[int]* | :heavy_check_mark: | N/A | -| `emoji` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `generated_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `generated_description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `explicit_user_members_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `explicit_workspace_members_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `org_sharing_role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/listbatchjobsresponse.md b/docs/models/listbatchjobsresponse.md new file mode 100644 index 00000000..c23e3220 --- /dev/null +++ b/docs/models/listbatchjobsresponse.md @@ -0,0 +1,10 @@ +# ListBatchJobsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `data` | List[[models.BatchJob](../models/batchjob.md)] | :heavy_minus_sign: | N/A | +| `object` | *Optional[Literal["list"]]* | :heavy_minus_sign: | N/A | +| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listcampaignselectedeventsresponse.md b/docs/models/listcampaignselectedeventsresponse.md new file mode 100644 index 00000000..eb6ea27f --- /dev/null +++ b/docs/models/listcampaignselectedeventsresponse.md @@ -0,0 +1,8 @@ +# ListCampaignSelectedEventsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `completion_events` | [models.PaginatedResultChatCompletionEventPreview](../models/paginatedresultchatcompletioneventpreview.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listcampaignsresponse.md b/docs/models/listcampaignsresponse.md new file mode 100644 index 00000000..2fcc7d19 --- /dev/null +++ b/docs/models/listcampaignsresponse.md @@ -0,0 +1,8 @@ +# ListCampaignsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `campaigns` | [models.PaginatedResultCampaignPreview](../models/paginatedresultcampaignpreview.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listchatcompletionfieldsresponse.md b/docs/models/listchatcompletionfieldsresponse.md new file mode 100644 index 00000000..c552805e --- /dev/null +++ b/docs/models/listchatcompletionfieldsresponse.md @@ -0,0 +1,9 @@ +# ListChatCompletionFieldsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `field_definitions` | List[[models.BaseFieldDefinition](../models/basefielddefinition.md)] | :heavy_check_mark: | N/A | +| `field_groups` | List[[models.FieldGroup](../models/fieldgroup.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listdatasetimporttasksresponse.md b/docs/models/listdatasetimporttasksresponse.md new file mode 100644 index 00000000..ce2e9057 --- /dev/null +++ b/docs/models/listdatasetimporttasksresponse.md @@ -0,0 +1,8 @@ +# ListDatasetImportTasksResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `tasks` | [models.PaginatedResultDatasetImportTask](../models/paginatedresultdatasetimporttask.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listdatasetrecordsresponse.md b/docs/models/listdatasetrecordsresponse.md new file mode 100644 index 00000000..25d2618a --- /dev/null +++ b/docs/models/listdatasetrecordsresponse.md @@ -0,0 +1,8 @@ +# ListDatasetRecordsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `records` | [models.PaginatedResultDatasetRecord](../models/paginatedresultdatasetrecord.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listdatasetsresponse.md b/docs/models/listdatasetsresponse.md new file mode 100644 index 00000000..af046696 --- /dev/null +++ b/docs/models/listdatasetsresponse.md @@ -0,0 +1,8 @@ +# ListDatasetsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `datasets` | [models.PaginatedResultDatasetPreview](../models/paginatedresultdatasetpreview.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listdeploymentsv1workflowsdeploymentsgetrequest.md b/docs/models/listdeploymentsv1workflowsdeploymentsgetrequest.md new file mode 100644 index 00000000..c93c0dbb --- /dev/null +++ b/docs/models/listdeploymentsv1workflowsdeploymentsgetrequest.md @@ -0,0 +1,9 @@ +# ListDeploymentsV1WorkflowsDeploymentsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `active_only` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `workflow_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/listdocumentout.md b/docs/models/listdocumentout.md deleted file mode 100644 index f14157b8..00000000 --- a/docs/models/listdocumentout.md +++ /dev/null @@ -1,9 +0,0 @@ -# ListDocumentOut - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `pagination` | [models.PaginationInfo](../models/paginationinfo.md) | :heavy_check_mark: | N/A | -| `data` | List[[models.DocumentOut](../models/documentout.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listdocumentsresponse.md b/docs/models/listdocumentsresponse.md new file mode 100644 index 00000000..47b9d3b7 --- /dev/null +++ b/docs/models/listdocumentsresponse.md @@ -0,0 +1,9 @@ +# ListDocumentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `pagination` | [models.PaginationInfo](../models/paginationinfo.md) | :heavy_check_mark: | N/A | +| `data` | List[[models.Document](../models/document.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listfilesout.md b/docs/models/listfilesout.md deleted file mode 100644 index ee544c1b..00000000 --- a/docs/models/listfilesout.md +++ /dev/null @@ -1,10 +0,0 @@ -# ListFilesOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `data` | List[[models.FileSchema](../models/fileschema.md)] | :heavy_check_mark: | N/A | -| `object` | *str* | :heavy_check_mark: | N/A | -| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listfilesresponse.md b/docs/models/listfilesresponse.md new file mode 100644 index 00000000..802f685f --- /dev/null +++ b/docs/models/listfilesresponse.md @@ -0,0 +1,10 @@ +# ListFilesResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `data` | List[[models.FileSchema](../models/fileschema.md)] | :heavy_check_mark: | N/A | +| `object` | *str* | :heavy_check_mark: | N/A | +| `total` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/listfinetuningjobsresponse.md b/docs/models/listfinetuningjobsresponse.md new file mode 100644 index 00000000..00251242 --- /dev/null +++ b/docs/models/listfinetuningjobsresponse.md @@ -0,0 +1,10 @@ +# ListFineTuningJobsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `data` | List[[models.ListFineTuningJobsResponseData](../models/listfinetuningjobsresponsedata.md)] | :heavy_minus_sign: | N/A | +| `object` | *Optional[Literal["list"]]* | :heavy_minus_sign: | N/A | +| `total` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listfinetuningjobsresponsedata.md b/docs/models/listfinetuningjobsresponsedata.md new file mode 100644 index 00000000..adb06444 --- /dev/null +++ b/docs/models/listfinetuningjobsresponsedata.md @@ -0,0 +1,17 @@ +# ListFineTuningJobsResponseData + + +## Supported Types + +### `models.ClassifierFineTuningJob` + +```python +value: models.ClassifierFineTuningJob = /* values here */ +``` + +### `models.CompletionFineTuningJob` + +```python +value: models.CompletionFineTuningJob = /* values here */ +``` + diff --git a/docs/models/listjudgesresponse.md b/docs/models/listjudgesresponse.md new file mode 100644 index 00000000..66883d64 --- /dev/null +++ b/docs/models/listjudgesresponse.md @@ -0,0 +1,8 @@ +# ListJudgesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `judges` | [models.PaginatedResultJudgePreview](../models/paginatedresultjudgepreview.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listlibrariesresponse.md b/docs/models/listlibrariesresponse.md new file mode 100644 index 00000000..18cb63c1 --- /dev/null +++ b/docs/models/listlibrariesresponse.md @@ -0,0 +1,9 @@ +# ListLibrariesResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `pagination` | [models.PaginationInfo](../models/paginationinfo.md) | :heavy_check_mark: | N/A | +| `data` | List[[models.Library](../models/library.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listlibraryout.md b/docs/models/listlibraryout.md deleted file mode 100644 index db76ffa1..00000000 --- a/docs/models/listlibraryout.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListLibraryOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `data` | List[[models.LibraryOut](../models/libraryout.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listmodelsv1modelsgetrequest.md b/docs/models/listmodelsv1modelsgetrequest.md new file mode 100644 index 00000000..537269f7 --- /dev/null +++ b/docs/models/listmodelsv1modelsgetrequest.md @@ -0,0 +1,9 @@ +# ListModelsV1ModelsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `provider` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/listrunsv1workflowsrunsgetrequest.md b/docs/models/listrunsv1workflowsrunsgetrequest.md new file mode 100644 index 00000000..319d9ed5 --- /dev/null +++ b/docs/models/listrunsv1workflowsrunsgetrequest.md @@ -0,0 +1,13 @@ +# ListRunsV1WorkflowsRunsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `workflow_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by workflow name or id | +| `search` | *OptionalNullable[str]* | :heavy_minus_sign: | Search by workflow name, display name or id | +| `status` | [OptionalNullable[models.ListRunsV1WorkflowsRunsGetStatus]](../models/listrunsv1workflowsrunsgetstatus.md) | :heavy_minus_sign: | Filter by workflow status | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by user id. Use 'current' to filter by the authenticated user | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of items per page | +| `next_page_token` | *OptionalNullable[str]* | :heavy_minus_sign: | Token for the next page of results | \ No newline at end of file diff --git a/docs/models/listrunsv1workflowsrunsgetresponse.md b/docs/models/listrunsv1workflowsrunsgetresponse.md new file mode 100644 index 00000000..405119b0 --- /dev/null +++ b/docs/models/listrunsv1workflowsrunsgetresponse.md @@ -0,0 +1,8 @@ +# ListRunsV1WorkflowsRunsGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `result` | [models.WorkflowExecutionListResponse](../models/workflowexecutionlistresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listrunsv1workflowsrunsgetstatus.md b/docs/models/listrunsv1workflowsrunsgetstatus.md new file mode 100644 index 00000000..e6f0d606 --- /dev/null +++ b/docs/models/listrunsv1workflowsrunsgetstatus.md @@ -0,0 +1,19 @@ +# ListRunsV1WorkflowsRunsGetStatus + +Filter by workflow status + + +## Supported Types + +### `models.WorkflowExecutionStatus` + +```python +value: models.WorkflowExecutionStatus = /* values here */ +``` + +### `List[models.WorkflowExecutionStatus]` + +```python +value: List[models.WorkflowExecutionStatus] = /* values here */ +``` + diff --git a/docs/models/listsharingout.md b/docs/models/listsharingout.md deleted file mode 100644 index bcac4834..00000000 --- a/docs/models/listsharingout.md +++ /dev/null @@ -1,8 +0,0 @@ -# ListSharingOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `data` | List[[models.SharingOut](../models/sharingout.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listsharingresponse.md b/docs/models/listsharingresponse.md new file mode 100644 index 00000000..4c29d4d4 --- /dev/null +++ b/docs/models/listsharingresponse.md @@ -0,0 +1,8 @@ +# ListSharingResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `data` | List[[models.Sharing](../models/sharing.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/listvoicesv1audiovoicesgetrequest.md b/docs/models/listvoicesv1audiovoicesgetrequest.md new file mode 100644 index 00000000..67c04d7c --- /dev/null +++ b/docs/models/listvoicesv1audiovoicesgetrequest.md @@ -0,0 +1,10 @@ +# ListVoicesV1AudioVoicesGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of voices to return | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Offset for pagination | +| `type` | [Optional[models.ListVoicesV1AudioVoicesGetType]](../models/listvoicesv1audiovoicesgettype.md) | :heavy_minus_sign: | Filter the voices between customs and presets | \ No newline at end of file diff --git a/docs/models/listvoicesv1audiovoicesgettype.md b/docs/models/listvoicesv1audiovoicesgettype.md new file mode 100644 index 00000000..a44f95b3 --- /dev/null +++ b/docs/models/listvoicesv1audiovoicesgettype.md @@ -0,0 +1,17 @@ +# ListVoicesV1AudioVoicesGetType + +Filter the voices between customs and presets + +## Example Usage + +```python +from mistralai.client.models import ListVoicesV1AudioVoicesGetType +value: ListVoicesV1AudioVoicesGetType = "all" +``` + + +## Values + +- `"all"` +- `"custom"` +- `"preset"` diff --git a/docs/models/listworkfloweventresponse.md b/docs/models/listworkfloweventresponse.md new file mode 100644 index 00000000..72c51a16 --- /dev/null +++ b/docs/models/listworkfloweventresponse.md @@ -0,0 +1,9 @@ +# ListWorkflowEventResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `events` | List[[models.ListWorkflowEventResponseEvent](../models/listworkfloweventresponseevent.md)] | :heavy_check_mark: | List of workflow events. | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor for pagination. | \ No newline at end of file diff --git a/docs/models/listworkfloweventresponseevent.md b/docs/models/listworkfloweventresponseevent.md new file mode 100644 index 00000000..2b8cb1e4 --- /dev/null +++ b/docs/models/listworkfloweventresponseevent.md @@ -0,0 +1,107 @@ +# ListWorkflowEventResponseEvent + + +## Supported Types + +### `models.WorkflowExecutionStartedResponse` + +```python +value: models.WorkflowExecutionStartedResponse = /* values here */ +``` + +### `models.WorkflowExecutionCompletedResponse` + +```python +value: models.WorkflowExecutionCompletedResponse = /* values here */ +``` + +### `models.WorkflowExecutionFailedResponse` + +```python +value: models.WorkflowExecutionFailedResponse = /* values here */ +``` + +### `models.WorkflowExecutionCanceledResponse` + +```python +value: models.WorkflowExecutionCanceledResponse = /* values here */ +``` + +### `models.WorkflowExecutionContinuedAsNewResponse` + +```python +value: models.WorkflowExecutionContinuedAsNewResponse = /* values here */ +``` + +### `models.WorkflowTaskTimedOutResponse` + +```python +value: models.WorkflowTaskTimedOutResponse = /* values here */ +``` + +### `models.WorkflowTaskFailedResponse` + +```python +value: models.WorkflowTaskFailedResponse = /* values here */ +``` + +### `models.CustomTaskStartedResponse` + +```python +value: models.CustomTaskStartedResponse = /* values here */ +``` + +### `models.CustomTaskInProgressResponse` + +```python +value: models.CustomTaskInProgressResponse = /* values here */ +``` + +### `models.CustomTaskCompletedResponse` + +```python +value: models.CustomTaskCompletedResponse = /* values here */ +``` + +### `models.CustomTaskFailedResponse` + +```python +value: models.CustomTaskFailedResponse = /* values here */ +``` + +### `models.CustomTaskTimedOutResponse` + +```python +value: models.CustomTaskTimedOutResponse = /* values here */ +``` + +### `models.CustomTaskCanceledResponse` + +```python +value: models.CustomTaskCanceledResponse = /* values here */ +``` + +### `models.ActivityTaskStartedResponse` + +```python +value: models.ActivityTaskStartedResponse = /* values here */ +``` + +### `models.ActivityTaskCompletedResponse` + +```python +value: models.ActivityTaskCompletedResponse = /* values here */ +``` + +### `models.ActivityTaskRetryingResponse` + +```python +value: models.ActivityTaskRetryingResponse = /* values here */ +``` + +### `models.ActivityTaskFailedResponse` + +```python +value: models.ActivityTaskFailedResponse = /* values here */ +``` + diff --git a/docs/models/locationtype.md b/docs/models/locationtype.md new file mode 100644 index 00000000..6daecdd1 --- /dev/null +++ b/docs/models/locationtype.md @@ -0,0 +1,18 @@ +# LocationType + +## Example Usage + +```python +from mistralai.client.models import LocationType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: LocationType = "local" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"local"` +- `"k8s"` diff --git a/docs/models/mcpservericon.md b/docs/models/mcpservericon.md new file mode 100644 index 00000000..b0ae7da0 --- /dev/null +++ b/docs/models/mcpservericon.md @@ -0,0 +1,13 @@ +# MCPServerIcon + +An icon for display in user interfaces. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `src` | *str* | :heavy_check_mark: | N/A | +| `mime_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `sizes` | List[*str*] | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mcptool.md b/docs/models/mcptool.md new file mode 100644 index 00000000..006802b4 --- /dev/null +++ b/docs/models/mcptool.md @@ -0,0 +1,17 @@ +# MCPTool + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `input_schema` | Dict[str, *Any*] | :heavy_check_mark: | N/A | +| `output_schema` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `icons` | List[[models.MCPServerIcon](../models/mcpservericon.md)] | :heavy_minus_sign: | N/A | +| `annotations` | [OptionalNullable[models.ToolAnnotations]](../models/toolannotations.md) | :heavy_minus_sign: | N/A | +| `meta` | [OptionalNullable[models.MCPToolMeta]](../models/mcptoolmeta.md) | :heavy_minus_sign: | N/A | +| `execution` | [OptionalNullable[models.ToolExecution]](../models/toolexecution.md) | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mcptoolmeta.md b/docs/models/mcptoolmeta.md new file mode 100644 index 00000000..23e8b64c --- /dev/null +++ b/docs/models/mcptoolmeta.md @@ -0,0 +1,14 @@ +# MCPToolMeta + +Typed _meta for MCP tools. + +Only the 'ui' field is typed. Other fields are allowed via extra="allow". + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ui` | [OptionalNullable[models.MCPUIToolMeta]](../models/mcpuitoolmeta.md) | :heavy_minus_sign: | N/A | +| `ai_mistral_turbine` | [OptionalNullable[models.TurbineToolMeta]](../models/turbinetoolmeta.md) | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mcpuitoolmeta.md b/docs/models/mcpuitoolmeta.md new file mode 100644 index 00000000..c09b29ad --- /dev/null +++ b/docs/models/mcpuitoolmeta.md @@ -0,0 +1,12 @@ +# MCPUIToolMeta + +UI metadata for tools that reference UI resources. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `resource_uri` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `visibility` | List[[models.Visibility](../models/visibility.md)] | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/messageinputentry.md b/docs/models/messageinputentry.md index d55eb876..f8514fb3 100644 --- a/docs/models/messageinputentry.md +++ b/docs/models/messageinputentry.md @@ -5,13 +5,13 @@ Representation of an input message inside the conversation. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `object` | [Optional[models.Object]](../models/object.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.MessageInputEntryType]](../models/messageinputentrytype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `role` | [models.MessageInputEntryRole](../models/messageinputentryrole.md) | :heavy_check_mark: | N/A | -| `content` | [models.MessageInputEntryContent](../models/messageinputentrycontent.md) | :heavy_check_mark: | N/A | -| `prefix` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `object` | *Optional[Literal["entry"]]* | :heavy_minus_sign: | N/A | +| `type` | *Optional[Literal["message.input"]]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `role` | [models.Role](../models/role.md) | :heavy_check_mark: | N/A | +| `content` | [models.MessageInputEntryContent](../models/messageinputentrycontent.md) | :heavy_check_mark: | N/A | +| `prefix` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/messageinputentryrole.md b/docs/models/messageinputentryrole.md deleted file mode 100644 index f2fdc71d..00000000 --- a/docs/models/messageinputentryrole.md +++ /dev/null @@ -1,9 +0,0 @@ -# MessageInputEntryRole - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ASSISTANT` | assistant | -| `USER` | user | \ No newline at end of file diff --git a/docs/models/messageinputentrytype.md b/docs/models/messageinputentrytype.md deleted file mode 100644 index d3378124..00000000 --- a/docs/models/messageinputentrytype.md +++ /dev/null @@ -1,8 +0,0 @@ -# MessageInputEntryType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `MESSAGE_INPUT` | message.input | \ No newline at end of file diff --git a/docs/models/messageoutputentry.md b/docs/models/messageoutputentry.md index 5b42e20d..73a1c666 100644 --- a/docs/models/messageoutputentry.md +++ b/docs/models/messageoutputentry.md @@ -3,14 +3,14 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `object` | [Optional[models.MessageOutputEntryObject]](../models/messageoutputentryobject.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.MessageOutputEntryType]](../models/messageoutputentrytype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.MessageOutputEntryRole]](../models/messageoutputentryrole.md) | :heavy_minus_sign: | N/A | -| `content` | [models.MessageOutputEntryContent](../models/messageoutputentrycontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `object` | *Optional[Literal["entry"]]* | :heavy_minus_sign: | N/A | +| `type` | *Optional[Literal["message.output"]]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `role` | *Optional[Literal["assistant"]]* | :heavy_minus_sign: | N/A | +| `content` | [models.MessageOutputEntryContent](../models/messageoutputentrycontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/messageoutputentryobject.md b/docs/models/messageoutputentryobject.md deleted file mode 100644 index bb254c82..00000000 --- a/docs/models/messageoutputentryobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# MessageOutputEntryObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `ENTRY` | entry | \ No newline at end of file diff --git a/docs/models/messageoutputentryrole.md b/docs/models/messageoutputentryrole.md deleted file mode 100644 index 783ee0aa..00000000 --- a/docs/models/messageoutputentryrole.md +++ /dev/null @@ -1,8 +0,0 @@ -# MessageOutputEntryRole - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ASSISTANT` | assistant | \ No newline at end of file diff --git a/docs/models/messageoutputentrytype.md b/docs/models/messageoutputentrytype.md deleted file mode 100644 index cb4a7a1b..00000000 --- a/docs/models/messageoutputentrytype.md +++ /dev/null @@ -1,8 +0,0 @@ -# MessageOutputEntryType - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `MESSAGE_OUTPUT` | message.output | \ No newline at end of file diff --git a/docs/models/messageoutputevent.md b/docs/models/messageoutputevent.md index 92c1c615..e09a965f 100644 --- a/docs/models/messageoutputevent.md +++ b/docs/models/messageoutputevent.md @@ -3,14 +3,14 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `type` | [Optional[models.MessageOutputEventType]](../models/messageoutputeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `content_index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.MessageOutputEventRole]](../models/messageoutputeventrole.md) | :heavy_minus_sign: | N/A | -| `content` | [models.MessageOutputEventContent](../models/messageoutputeventcontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `type` | *Literal["message.output.delta"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `content_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `role` | *Optional[Literal["assistant"]]* | :heavy_minus_sign: | N/A | +| `content` | [models.MessageOutputEventContent](../models/messageoutputeventcontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/messageoutputeventrole.md b/docs/models/messageoutputeventrole.md deleted file mode 100644 index e38c6472..00000000 --- a/docs/models/messageoutputeventrole.md +++ /dev/null @@ -1,8 +0,0 @@ -# MessageOutputEventRole - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ASSISTANT` | assistant | \ No newline at end of file diff --git a/docs/models/messageoutputeventtype.md b/docs/models/messageoutputeventtype.md deleted file mode 100644 index 1f43fdcc..00000000 --- a/docs/models/messageoutputeventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# MessageOutputEventType - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `MESSAGE_OUTPUT_DELTA` | message.output.delta | \ No newline at end of file diff --git a/docs/models/messageresponse.md b/docs/models/messageresponse.md new file mode 100644 index 00000000..504aa9de --- /dev/null +++ b/docs/models/messageresponse.md @@ -0,0 +1,8 @@ +# MessageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `message` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/messages.md b/docs/models/messages.md deleted file mode 100644 index 1d394500..00000000 --- a/docs/models/messages.md +++ /dev/null @@ -1,29 +0,0 @@ -# Messages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/docs/models/messagetokens.md b/docs/models/messagetokens.md new file mode 100644 index 00000000..427e09b5 --- /dev/null +++ b/docs/models/messagetokens.md @@ -0,0 +1,13 @@ +# MessageTokens + +Information on a single message included in a tokenized prompt as part of an InstructRequest. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `role` | [models.Roles](../models/roles.md) | :heavy_check_mark: | N/A | +| `total_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `truncated` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `usage_count` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/metric.md b/docs/models/metric.md new file mode 100644 index 00000000..7f863036 --- /dev/null +++ b/docs/models/metric.md @@ -0,0 +1,12 @@ +# Metric + +Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase). + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `train_loss` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `valid_loss` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `valid_mean_token_accuracy` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/metricout.md b/docs/models/metricout.md deleted file mode 100644 index 3c552bac..00000000 --- a/docs/models/metricout.md +++ /dev/null @@ -1,12 +0,0 @@ -# MetricOut - -Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase). - - -## Fields - -| Field | Type | Required | Description | -| --------------------------- | --------------------------- | --------------------------- | --------------------------- | -| `train_loss` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `valid_loss` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `valid_mean_token_accuracy` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mistralpromptmode.md b/docs/models/mistralpromptmode.md index 7416e203..9b234e3e 100644 --- a/docs/models/mistralpromptmode.md +++ b/docs/models/mistralpromptmode.md @@ -1,8 +1,21 @@ # MistralPromptMode +Available options to the prompt_mode argument on the chat completion endpoint. +Values represent high-level intent. Assignment to actual SPs is handled internally. +System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc. + +## Example Usage + +```python +from mistralai.client.models import MistralPromptMode + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: MistralPromptMode = "reasoning" +``` + ## Values -| Name | Value | -| ----------- | ----------- | -| `REASONING` | reasoning | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"reasoning"` diff --git a/docs/models/modelcapabilities.md b/docs/models/modelcapabilities.md index 36b27938..7c125e64 100644 --- a/docs/models/modelcapabilities.md +++ b/docs/models/modelcapabilities.md @@ -1,13 +1,23 @@ # ModelCapabilities +This is populated by Harmattan, but some fields have a name +that we don't want to expose in the API. + ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `completion_chat` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `completion_fim` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `function_calling` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `fine_tuning` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `vision` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `classification` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `completion_chat` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `function_calling` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `reasoning` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `completion_fim` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `fine_tuning` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `vision` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `ocr` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `classification` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `moderation` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `audio` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `audio_transcription` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `audio_transcription_realtime` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `audio_speech` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/modelconversation.md b/docs/models/modelconversation.md index f7f61a79..190a6f6e 100644 --- a/docs/models/modelconversation.md +++ b/docs/models/modelconversation.md @@ -3,15 +3,17 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | -| `tools` | List[[models.ModelConversationTools](../models/modelconversationtools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | -| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. | -| `object` | [Optional[models.ModelConversationObject]](../models/modelconversationobject.md) | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | +| `tools` | List[[models.ModelConversationTool](../models/modelconversationtool.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | +| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name given to the conversation. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the what the conversation is about. | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Custom metadata for the conversation. | +| `object` | *Optional[Literal["conversation"]]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/modelconversationobject.md b/docs/models/modelconversationobject.md deleted file mode 100644 index ead1fa26..00000000 --- a/docs/models/modelconversationobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# ModelConversationObject - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `CONVERSATION` | conversation | \ No newline at end of file diff --git a/docs/models/modelconversationtool.md b/docs/models/modelconversationtool.md new file mode 100644 index 00000000..0b6a45f7 --- /dev/null +++ b/docs/models/modelconversationtool.md @@ -0,0 +1,47 @@ +# ModelConversationTool + + +## Supported Types + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.FunctionTool` + +```python +value: models.FunctionTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + diff --git a/docs/models/modelconversationtools.md b/docs/models/modelconversationtools.md deleted file mode 100644 index 5cc97437..00000000 --- a/docs/models/modelconversationtools.md +++ /dev/null @@ -1,41 +0,0 @@ -# ModelConversationTools - - -## Supported Types - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.FunctionTool` - -```python -value: models.FunctionTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - diff --git a/docs/models/modellist.md b/docs/models/modellist.md index 760882c6..85b20be7 100644 --- a/docs/models/modellist.md +++ b/docs/models/modellist.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| `object` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `data` | List[[models.Data](../models/data.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `object` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `data` | List[[models.ModelListData](../models/modellistdata.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/modellistdata.md b/docs/models/modellistdata.md new file mode 100644 index 00000000..b44e84a0 --- /dev/null +++ b/docs/models/modellistdata.md @@ -0,0 +1,17 @@ +# ModelListData + + +## Supported Types + +### `models.BaseModelCard` + +```python +value: models.BaseModelCard = /* values here */ +``` + +### `models.FTModelCard` + +```python +value: models.FTModelCard = /* values here */ +``` + diff --git a/docs/models/modeltype.md b/docs/models/modeltype.md deleted file mode 100644 index a31c3ca0..00000000 --- a/docs/models/modeltype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ModelType - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `COMPLETION` | completion | \ No newline at end of file diff --git a/docs/models/moderationllmaction.md b/docs/models/moderationllmaction.md new file mode 100644 index 00000000..e46a30b4 --- /dev/null +++ b/docs/models/moderationllmaction.md @@ -0,0 +1,18 @@ +# ModerationLLMAction + +## Example Usage + +```python +from mistralai.client.models import ModerationLLMAction + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ModerationLLMAction = "none" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"none"` +- `"block"` diff --git a/docs/models/moderationllmv1categorythresholds.md b/docs/models/moderationllmv1categorythresholds.md new file mode 100644 index 00000000..90ae213f --- /dev/null +++ b/docs/models/moderationllmv1categorythresholds.md @@ -0,0 +1,16 @@ +# ModerationLlmv1CategoryThresholds + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `sexual` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `hate_and_discrimination` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `violence_and_threats` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `dangerous_and_criminal_content` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `selfharm` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `health` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `financial` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `law` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `pii` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/moderationllmv1config.md b/docs/models/moderationllmv1config.md new file mode 100644 index 00000000..bdb5812b --- /dev/null +++ b/docs/models/moderationllmv1config.md @@ -0,0 +1,11 @@ +# ModerationLlmv1Config + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `model_name` | *Optional[str]* | :heavy_minus_sign: | Override model name. Should be omitted in general. | +| `custom_category_thresholds` | [OptionalNullable[models.ModerationLlmv1CategoryThresholds]](../models/moderationllmv1categorythresholds.md) | :heavy_minus_sign: | N/A | +| `ignore_other_categories` | *Optional[bool]* | :heavy_minus_sign: | If true, only evaluate categories in custom_category_thresholds; others are ignored. | +| `action` | [Optional[models.ModerationLLMAction]](../models/moderationllmaction.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/moderationllmv2categorythresholds.md b/docs/models/moderationllmv2categorythresholds.md new file mode 100644 index 00000000..e95b81b0 --- /dev/null +++ b/docs/models/moderationllmv2categorythresholds.md @@ -0,0 +1,18 @@ +# ModerationLlmv2CategoryThresholds + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `sexual` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `hate_and_discrimination` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `violence_and_threats` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `dangerous` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `criminal` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `selfharm` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `health` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `financial` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `law` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `pii` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `jailbreaking` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/moderationllmv2config.md b/docs/models/moderationllmv2config.md new file mode 100644 index 00000000..e928506c --- /dev/null +++ b/docs/models/moderationllmv2config.md @@ -0,0 +1,11 @@ +# ModerationLlmv2Config + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `model_name` | *Optional[str]* | :heavy_minus_sign: | Override model name. Should be omitted in general. | +| `custom_category_thresholds` | [OptionalNullable[models.ModerationLlmv2CategoryThresholds]](../models/moderationllmv2categorythresholds.md) | :heavy_minus_sign: | N/A | +| `ignore_other_categories` | *Optional[bool]* | :heavy_minus_sign: | If true, only evaluate categories in custom_category_thresholds; others are ignored. | +| `action` | [Optional[models.ModerationLLMAction]](../models/moderationllmaction.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/multipartbodyparams.md b/docs/models/multipartbodyparams.md new file mode 100644 index 00000000..9d7a00c4 --- /dev/null +++ b/docs/models/multipartbodyparams.md @@ -0,0 +1,11 @@ +# MultiPartBodyParams + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `expiry` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `visibility` | [Optional[models.FilesAPIRoutesUploadFileFileVisibility]](../models/filesapiroutesuploadfilefilevisibility.md) | :heavy_minus_sign: | N/A | +| `purpose` | [Optional[models.FilePurpose]](../models/filepurpose.md) | :heavy_minus_sign: | N/A | +| `file` | [models.File](../models/file.md) | :heavy_check_mark: | The File object (not file name) to be uploaded.
To upload a file and specify a custom file name you should format your request as such:
```bash
file=@path/to/your/file.jsonl;filename=custom_name.jsonl
```
Otherwise, you can just keep the original file name:
```bash
file=@path/to/your/file.jsonl
``` | \ No newline at end of file diff --git a/docs/models/networkencodedinput.md b/docs/models/networkencodedinput.md new file mode 100644 index 00000000..71e38615 --- /dev/null +++ b/docs/models/networkencodedinput.md @@ -0,0 +1,10 @@ +# NetworkEncodedInput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `b64payload` | *str* | :heavy_check_mark: | The encoded payload | +| `encoding_options` | List[[models.EncodedPayloadOptions](../models/encodedpayloadoptions.md)] | :heavy_minus_sign: | The encoding of the payload | +| `empty` | *Optional[bool]* | :heavy_minus_sign: | Whether the payload is empty | \ No newline at end of file diff --git a/docs/models/oauth2token.md b/docs/models/oauth2token.md new file mode 100644 index 00000000..59716ed6 --- /dev/null +++ b/docs/models/oauth2token.md @@ -0,0 +1,13 @@ +# OAuth2Token + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `access_token` | *str* | :heavy_check_mark: | N/A | +| `token_type` | *Optional[Literal["Bearer"]]* | :heavy_minus_sign: | N/A | +| `expires_in` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `scope` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `refresh_token` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/oauth2tokenauth.md b/docs/models/oauth2tokenauth.md new file mode 100644 index 00000000..89f80436 --- /dev/null +++ b/docs/models/oauth2tokenauth.md @@ -0,0 +1,9 @@ +# OAuth2TokenAuth + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `type` | *Literal["oauth2-token"]* | :heavy_check_mark: | N/A | +| `value` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/object.md b/docs/models/object.md deleted file mode 100644 index 0122c0db..00000000 --- a/docs/models/object.md +++ /dev/null @@ -1,8 +0,0 @@ -# Object - - -## Values - -| Name | Value | -| ------- | ------- | -| `ENTRY` | entry | \ No newline at end of file diff --git a/docs/models/observabilityerrorcode.md b/docs/models/observabilityerrorcode.md new file mode 100644 index 00000000..d8532e86 --- /dev/null +++ b/docs/models/observabilityerrorcode.md @@ -0,0 +1,65 @@ +# ObservabilityErrorCode + +## Example Usage + +```python +from mistralai.client.models import ObservabilityErrorCode + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ObservabilityErrorCode = "UNKNOWN_ERROR" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"UNKNOWN_ERROR"` +- `"VALIDATION_ERROR"` +- `"AUTH_FORBIDDEN"` +- `"AUTH_FORBIDDEN_NOT_WORKSPACE_ADMIN"` +- `"AUTH_FORBIDDEN_WORKSPACE_NOT_FOUND"` +- `"AUTH_FORBIDDEN_ROLE_NOT_FOUND"` +- `"AUTH_FORBIDDEN_ORG_NOT_WHITELISTED"` +- `"AUTH_UNAUTHORIZED"` +- `"FEATURE_NOT_SUPPORTED"` +- `"FIELDS_BAD_REQUEST"` +- `"FIELDS_NOT_FOUND"` +- `"SEARCH_NOT_FOUND"` +- `"SEARCH_BAD_REQUEST"` +- `"SEARCH_SERVICE_UNAVAILABLE"` +- `"DATABASE_ERROR"` +- `"DATABASE_TIMEOUT"` +- `"DATABASE_UNAVAILABLE"` +- `"DATABASE_QUERY_ERROR"` +- `"SEARCH_FILTER_TO_SQL_CONVERSION_ERROR"` +- `"JUDGE_CONVERSATION_FORMAT_ERROR"` +- `"JUDGE_MISTRAL_API_ERROR"` +- `"JUDGE_MISTRAL_API_TIMEOUT"` +- `"JUDGE_NAME_ALREADY_EXISTS"` +- `"JUDGE_NOT_FOUND"` +- `"JUDGE_ALREADY_HAS_NEW_VERSION"` +- `"JUDGE_USED_IN_CAMPAIGN_CANNOT_BE_UPDATED"` +- `"JUDGE_DID_NOT_CHANGE"` +- `"CAMPAIGN_NOT_FOUND"` +- `"CAMPAIGN_NO_MATCHING_EVENTS"` +- `"DATASET_NOT_FOUND"` +- `"DATASET_TASK_NOT_FOUND"` +- `"DATASET_RECORD_NOT_FOUND"` +- `"DATASET_RECORD_FORMAT_ERROR"` +- `"AGENT_NOT_FOUND"` +- `"AGENT_MISTRAL_API_ERROR"` +- `"EVALUATION_NOT_FOUND"` +- `"EVALUATION_CURRENTLY_RUNNING"` +- `"EVALUATION_RECORD_NOT_FOUND"` +- `"EVALUATION_RUN_NOT_FOUND"` +- `"EVALUATION_RUN_TRANSITION_IS_INVALID"` +- `"EVALUATION_RUN_TRANSITION_IS_RUNNING_ALREADY"` +- `"EVALUATION_RUN_TRANSITION_ERROR"` +- `"TEMPLATE_ERROR"` +- `"TEMPLATE_SYNTAX_ERROR"` +- `"PROJECT_NAME_ALREADY_EXISTS"` +- `"EVALUATION_NAME_ALREADY_EXISTS"` +- `"TRACES_FILTER_QUERY_PARSE_ERROR"` +- `"TRACE_NOT_FOUND"` +- `"SPAN_NOT_FOUND"` diff --git a/docs/models/observabilityerrordetail.md b/docs/models/observabilityerrordetail.md new file mode 100644 index 00000000..a95e25c9 --- /dev/null +++ b/docs/models/observabilityerrordetail.md @@ -0,0 +1,9 @@ +# ObservabilityErrorDetail + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `message` | *str* | :heavy_check_mark: | N/A | +| `error_code` | [Nullable[models.ObservabilityErrorCode]](../models/observabilityerrorcode.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/ocrconfidencescore.md b/docs/models/ocrconfidencescore.md new file mode 100644 index 00000000..73fdcb28 --- /dev/null +++ b/docs/models/ocrconfidencescore.md @@ -0,0 +1,12 @@ +# OCRConfidenceScore + +Confidence score for a token or word in OCR output. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `text` | *str* | :heavy_check_mark: | The word or text segment | +| `confidence` | *float* | :heavy_check_mark: | Confidence score (0-1) | +| `start_index` | *int* | :heavy_check_mark: | Start index of the text in the page markdown string | \ No newline at end of file diff --git a/docs/models/ocrpageconfidencescores.md b/docs/models/ocrpageconfidencescores.md new file mode 100644 index 00000000..bffb2148 --- /dev/null +++ b/docs/models/ocrpageconfidencescores.md @@ -0,0 +1,18 @@ +# OCRPageConfidenceScores + +Confidence scores for an OCR page at various granularities. + +Note on page-level stats: +- For 'page' granularity: average/minimum are computed from per-token exp(logprob). +- For 'word' granularity: average/minimum are computed from per-word confidence, + where each word's confidence is exp(mean(token_logprobs)) — a geometric mean + over the word's subword tokens. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `word_confidence_scores` | List[[models.OCRConfidenceScore](../models/ocrconfidencescore.md)] | :heavy_minus_sign: | Word-level confidence scores (populated only for 'word' granularity) | +| `average_page_confidence_score` | *float* | :heavy_check_mark: | Average confidence score for the page | +| `minimum_page_confidence_score` | *float* | :heavy_check_mark: | Minimum confidence score for the page | \ No newline at end of file diff --git a/docs/models/ocrpageobject.md b/docs/models/ocrpageobject.md index 9db3bb77..0fc55052 100644 --- a/docs/models/ocrpageobject.md +++ b/docs/models/ocrpageobject.md @@ -3,9 +3,14 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `index` | *int* | :heavy_check_mark: | The page index in a pdf document starting from 0 | -| `markdown` | *str* | :heavy_check_mark: | The markdown string response of the page | -| `images` | List[[models.OCRImageObject](../models/ocrimageobject.md)] | :heavy_check_mark: | List of all extracted images in the page | -| `dimensions` | [Nullable[models.OCRPageDimensions]](../models/ocrpagedimensions.md) | :heavy_check_mark: | The dimensions of the PDF Page's screenshot image | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `index` | *int* | :heavy_check_mark: | The page index in a pdf document starting from 0 | +| `markdown` | *str* | :heavy_check_mark: | The markdown string response of the page | +| `images` | List[[models.OCRImageObject](../models/ocrimageobject.md)] | :heavy_check_mark: | List of all extracted images in the page | +| `tables` | List[[models.OCRTableObject](../models/ocrtableobject.md)] | :heavy_minus_sign: | List of all extracted tables in the page | +| `hyperlinks` | List[*str*] | :heavy_minus_sign: | List of all hyperlinks in the page | +| `header` | *OptionalNullable[str]* | :heavy_minus_sign: | Header of the page | +| `footer` | *OptionalNullable[str]* | :heavy_minus_sign: | Footer of the page | +| `dimensions` | [Nullable[models.OCRPageDimensions]](../models/ocrpagedimensions.md) | :heavy_check_mark: | The dimensions of the PDF Page's screenshot image | +| `confidence_scores` | [OptionalNullable[models.OCRPageConfidenceScores]](../models/ocrpageconfidencescores.md) | :heavy_minus_sign: | Confidence scores for the OCR page (populated when confidence_scores_granularity is set) | \ No newline at end of file diff --git a/docs/models/ocrrequest.md b/docs/models/ocrrequest.md index 6a9c77ab..54cea7c1 100644 --- a/docs/models/ocrrequest.md +++ b/docs/models/ocrrequest.md @@ -3,14 +3,18 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *Nullable[str]* | :heavy_check_mark: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `document` | [models.Document](../models/document.md) | :heavy_check_mark: | Document to run OCR on | -| `pages` | List[*int*] | :heavy_minus_sign: | Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 | -| `include_image_base64` | *OptionalNullable[bool]* | :heavy_minus_sign: | Include image URLs in response | -| `image_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | Max images to extract | -| `image_min_size` | *OptionalNullable[int]* | :heavy_minus_sign: | Minimum height and width of image to extract | -| `bbox_annotation_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field | -| `document_annotation_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `document` | [models.DocumentUnion](../models/documentunion.md) | :heavy_check_mark: | Document to run OCR on | | +| `pages` | [OptionalNullable[models.Pages]](../models/pages.md) | :heavy_minus_sign: | Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0. | | +| `include_image_base64` | *OptionalNullable[bool]* | :heavy_minus_sign: | Include image URLs in response | | +| `image_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | Max images to extract | | +| `image_min_size` | *OptionalNullable[int]* | :heavy_minus_sign: | Minimum height and width of image to extract | | +| `bbox_annotation_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `document_annotation_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `document_annotation_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided. | | +| `table_format` | [OptionalNullable[models.TableFormat]](../models/tableformat.md) | :heavy_minus_sign: | N/A | | +| `extract_header` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `extract_footer` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `confidence_scores_granularity` | [OptionalNullable[models.ConfidenceScoresGranularity]](../models/confidencescoresgranularity.md) | :heavy_minus_sign: | Granularity for confidence scores: 'word' (per-word scores) or 'page' (aggregate only). Defaults to None (no confidence scores) to keep response payload small. | | \ No newline at end of file diff --git a/docs/models/ocrtableobject.md b/docs/models/ocrtableobject.md new file mode 100644 index 00000000..2da8f610 --- /dev/null +++ b/docs/models/ocrtableobject.md @@ -0,0 +1,11 @@ +# OCRTableObject + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Table ID for extracted table in a page | +| `content` | *str* | :heavy_check_mark: | Content of the table in the given format | +| `format_` | [models.Format](../models/format_.md) | :heavy_check_mark: | Format of the table | +| `word_confidence_scores` | List[[models.OCRConfidenceScore](../models/ocrconfidencescore.md)] | :heavy_minus_sign: | Per-word confidence scores for the table content. Returned when confidence_scores_granularity is set to 'word'. | \ No newline at end of file diff --git a/docs/models/one.md b/docs/models/one.md deleted file mode 100644 index 3de496a6..00000000 --- a/docs/models/one.md +++ /dev/null @@ -1,29 +0,0 @@ -# One - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/docs/models/op.md b/docs/models/op.md new file mode 100644 index 00000000..da9031db --- /dev/null +++ b/docs/models/op.md @@ -0,0 +1,35 @@ +# Op + +## Example Usage + +```python +from mistralai.client.models import Op + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Op = "lt" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"lt"` +- `"lte"` +- `"gt"` +- `"gte"` +- `"startswith"` +- `"istartswith"` +- `"endswith"` +- `"iendswith"` +- `"contains"` +- `"icontains"` +- `"matches"` +- `"notcontains"` +- `"inotcontains"` +- `"eq"` +- `"neq"` +- `"isnull"` +- `"includes"` +- `"excludes"` +- `"len_eq"` diff --git a/docs/models/operator.md b/docs/models/operator.md new file mode 100644 index 00000000..2790c574 --- /dev/null +++ b/docs/models/operator.md @@ -0,0 +1,33 @@ +# Operator + +The operator to use for filtering options + +## Example Usage + +```python +from mistralai.client.models import Operator +value: Operator = "lt" +``` + + +## Values + +- `"lt"` +- `"lte"` +- `"gt"` +- `"gte"` +- `"startswith"` +- `"istartswith"` +- `"endswith"` +- `"iendswith"` +- `"contains"` +- `"icontains"` +- `"matches"` +- `"notcontains"` +- `"inotcontains"` +- `"eq"` +- `"neq"` +- `"isnull"` +- `"includes"` +- `"excludes"` +- `"len_eq"` diff --git a/docs/models/option.md b/docs/models/option.md new file mode 100644 index 00000000..0f600be4 --- /dev/null +++ b/docs/models/option.md @@ -0,0 +1,17 @@ +# Option + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/docs/models/or_.md b/docs/models/or_.md new file mode 100644 index 00000000..2a217269 --- /dev/null +++ b/docs/models/or_.md @@ -0,0 +1,17 @@ +# Or + + +## Supported Types + +### `models.FilterGroup` + +```python +value: models.FilterGroup = /* values here */ +``` + +### `models.FilterCondition` + +```python +value: models.FilterCondition = /* values here */ +``` + diff --git a/docs/models/orderby.md b/docs/models/orderby.md new file mode 100644 index 00000000..d778621f --- /dev/null +++ b/docs/models/orderby.md @@ -0,0 +1,14 @@ +# OrderBy + +## Example Usage + +```python +from mistralai.client.models import OrderBy +value: OrderBy = "created" +``` + + +## Values + +- `"created"` +- `"-created"` diff --git a/docs/models/outboundauthenticationtype.md b/docs/models/outboundauthenticationtype.md new file mode 100644 index 00000000..a8ddd624 --- /dev/null +++ b/docs/models/outboundauthenticationtype.md @@ -0,0 +1,19 @@ +# OutboundAuthenticationType + +## Example Usage + +```python +from mistralai.client.models import OutboundAuthenticationType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: OutboundAuthenticationType = "oauth2" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"oauth2"` +- `"bearer"` +- `"none"` diff --git a/docs/models/outputs.md b/docs/models/outputs.md deleted file mode 100644 index 7756c627..00000000 --- a/docs/models/outputs.md +++ /dev/null @@ -1,29 +0,0 @@ -# Outputs - - -## Supported Types - -### `models.MessageOutputEntry` - -```python -value: models.MessageOutputEntry = /* values here */ -``` - -### `models.ToolExecutionEntry` - -```python -value: models.ToolExecutionEntry = /* values here */ -``` - -### `models.FunctionCallEntry` - -```python -value: models.FunctionCallEntry = /* values here */ -``` - -### `models.AgentHandoffEntry` - -```python -value: models.AgentHandoffEntry = /* values here */ -``` - diff --git a/docs/models/ownertype.md b/docs/models/ownertype.md new file mode 100644 index 00000000..288d5833 --- /dev/null +++ b/docs/models/ownertype.md @@ -0,0 +1,14 @@ +# OwnerType + +## Example Usage + +```python +from mistralai.client.models import OwnerType +value: OwnerType = "User" +``` + + +## Values + +- `"User"` +- `"Workspace"` diff --git a/docs/models/pages.md b/docs/models/pages.md new file mode 100644 index 00000000..a3631692 --- /dev/null +++ b/docs/models/pages.md @@ -0,0 +1,19 @@ +# Pages + +Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[int]` + +```python +value: List[int] = /* values here */ +``` + diff --git a/docs/models/paginatedconnectors.md b/docs/models/paginatedconnectors.md new file mode 100644 index 00000000..3fff5b95 --- /dev/null +++ b/docs/models/paginatedconnectors.md @@ -0,0 +1,9 @@ +# PaginatedConnectors + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `items` | List[[models.Connector](../models/connector.md)] | :heavy_check_mark: | N/A | +| `pagination` | [models.PaginationResponse](../models/paginationresponse.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/paginatedresultcampaignpreview.md b/docs/models/paginatedresultcampaignpreview.md new file mode 100644 index 00000000..7e8e5715 --- /dev/null +++ b/docs/models/paginatedresultcampaignpreview.md @@ -0,0 +1,11 @@ +# PaginatedResultCampaignPreview + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `results` | List[[models.Campaign](../models/campaign.md)] | :heavy_minus_sign: | N/A | +| `count` | *int* | :heavy_check_mark: | N/A | +| `next` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `previous` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/paginatedresultchatcompletioneventpreview.md b/docs/models/paginatedresultchatcompletioneventpreview.md new file mode 100644 index 00000000..96b4b7ae --- /dev/null +++ b/docs/models/paginatedresultchatcompletioneventpreview.md @@ -0,0 +1,11 @@ +# PaginatedResultChatCompletionEventPreview + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `results` | List[[models.ChatCompletionEventPreview](../models/chatcompletioneventpreview.md)] | :heavy_minus_sign: | N/A | +| `count` | *int* | :heavy_check_mark: | N/A | +| `next` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `previous` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/paginatedresultdatasetimporttask.md b/docs/models/paginatedresultdatasetimporttask.md new file mode 100644 index 00000000..ce067d52 --- /dev/null +++ b/docs/models/paginatedresultdatasetimporttask.md @@ -0,0 +1,11 @@ +# PaginatedResultDatasetImportTask + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `results` | List[[models.DatasetImportTask](../models/datasetimporttask.md)] | :heavy_minus_sign: | N/A | +| `count` | *int* | :heavy_check_mark: | N/A | +| `next` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `previous` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/paginatedresultdatasetpreview.md b/docs/models/paginatedresultdatasetpreview.md new file mode 100644 index 00000000..f6ca9037 --- /dev/null +++ b/docs/models/paginatedresultdatasetpreview.md @@ -0,0 +1,11 @@ +# PaginatedResultDatasetPreview + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `results` | List[[models.DatasetPreview](../models/datasetpreview.md)] | :heavy_minus_sign: | N/A | +| `count` | *int* | :heavy_check_mark: | N/A | +| `next` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `previous` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/paginatedresultdatasetrecord.md b/docs/models/paginatedresultdatasetrecord.md new file mode 100644 index 00000000..31b086eb --- /dev/null +++ b/docs/models/paginatedresultdatasetrecord.md @@ -0,0 +1,11 @@ +# PaginatedResultDatasetRecord + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `results` | List[[models.DatasetRecord](../models/datasetrecord.md)] | :heavy_minus_sign: | N/A | +| `count` | *int* | :heavy_check_mark: | N/A | +| `next` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `previous` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/paginatedresultjudgepreview.md b/docs/models/paginatedresultjudgepreview.md new file mode 100644 index 00000000..91bf0c35 --- /dev/null +++ b/docs/models/paginatedresultjudgepreview.md @@ -0,0 +1,11 @@ +# PaginatedResultJudgePreview + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `results` | List[[models.Judge](../models/judge.md)] | :heavy_minus_sign: | N/A | +| `count` | *int* | :heavy_check_mark: | N/A | +| `next` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `previous` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/paginationresponse.md b/docs/models/paginationresponse.md new file mode 100644 index 00000000..7ed17a69 --- /dev/null +++ b/docs/models/paginationresponse.md @@ -0,0 +1,9 @@ +# PaginationResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `next_cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/pauseschedulev1workflowsschedulesscheduleidpausepostrequest.md b/docs/models/pauseschedulev1workflowsschedulesscheduleidpausepostrequest.md new file mode 100644 index 00000000..dc69416c --- /dev/null +++ b/docs/models/pauseschedulev1workflowsschedulesscheduleidpausepostrequest.md @@ -0,0 +1,9 @@ +# PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | +| `workflow_schedule_pause_request` | [OptionalNullable[models.WorkflowSchedulePauseRequest]](../models/workflowschedulepauserequest.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/payload.md b/docs/models/payload.md new file mode 100644 index 00000000..22b47fa5 --- /dev/null +++ b/docs/models/payload.md @@ -0,0 +1,19 @@ +# Payload + +The current state or incremental update for the task. + + +## Supported Types + +### `models.JSONPayloadResponse` + +```python +value: models.JSONPayloadResponse = /* values here */ +``` + +### `models.JSONPatchPayloadResponse` + +```python +value: models.JSONPatchPayloadResponse = /* values here */ +``` + diff --git a/docs/models/postdatasetrecordsfromcampaignv1observabilitydatasetsdatasetidimportsfromcampaignpostrequest.md b/docs/models/postdatasetrecordsfromcampaignv1observabilitydatasetsdatasetidimportsfromcampaignpostrequest.md new file mode 100644 index 00000000..b3bf2a61 --- /dev/null +++ b/docs/models/postdatasetrecordsfromcampaignv1observabilitydatasetsdatasetidimportsfromcampaignpostrequest.md @@ -0,0 +1,9 @@ +# PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `import_dataset_from_campaign_request` | [models.ImportDatasetFromCampaignRequest](../models/importdatasetfromcampaignrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/postdatasetrecordsfromdatasetv1observabilitydatasetsdatasetidimportsfromdatasetpostrequest.md b/docs/models/postdatasetrecordsfromdatasetv1observabilitydatasetsdatasetidimportsfromdatasetpostrequest.md new file mode 100644 index 00000000..33dafda2 --- /dev/null +++ b/docs/models/postdatasetrecordsfromdatasetv1observabilitydatasetsdatasetidimportsfromdatasetpostrequest.md @@ -0,0 +1,9 @@ +# PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `import_dataset_from_dataset_request` | [models.ImportDatasetFromDatasetRequest](../models/importdatasetfromdatasetrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/postdatasetrecordsfromexplorerv1observabilitydatasetsdatasetidimportsfromexplorerpostrequest.md b/docs/models/postdatasetrecordsfromexplorerv1observabilitydatasetsdatasetidimportsfromexplorerpostrequest.md new file mode 100644 index 00000000..ba25323e --- /dev/null +++ b/docs/models/postdatasetrecordsfromexplorerv1observabilitydatasetsdatasetidimportsfromexplorerpostrequest.md @@ -0,0 +1,9 @@ +# PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `import_dataset_from_explorer_request` | [models.ImportDatasetFromExplorerRequest](../models/importdatasetfromexplorerrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/postdatasetrecordsfromfilev1observabilitydatasetsdatasetidimportsfromfilepostrequest.md b/docs/models/postdatasetrecordsfromfilev1observabilitydatasetsdatasetidimportsfromfilepostrequest.md new file mode 100644 index 00000000..0bff196b --- /dev/null +++ b/docs/models/postdatasetrecordsfromfilev1observabilitydatasetsdatasetidimportsfromfilepostrequest.md @@ -0,0 +1,9 @@ +# PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `import_dataset_from_file_request` | [models.ImportDatasetFromFileRequest](../models/importdatasetfromfilerequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/postdatasetrecordsfromplaygroundv1observabilitydatasetsdatasetidimportsfromplaygroundpostrequest.md b/docs/models/postdatasetrecordsfromplaygroundv1observabilitydatasetsdatasetidimportsfromplaygroundpostrequest.md new file mode 100644 index 00000000..86ab87b8 --- /dev/null +++ b/docs/models/postdatasetrecordsfromplaygroundv1observabilitydatasetsdatasetidimportsfromplaygroundpostrequest.md @@ -0,0 +1,9 @@ +# PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `import_dataset_from_playground_request` | [models.ImportDatasetFromPlaygroundRequest](../models/importdatasetfromplaygroundrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/prediction.md b/docs/models/prediction.md index 86e9c396..fae3c1ca 100644 --- a/docs/models/prediction.md +++ b/docs/models/prediction.md @@ -1,5 +1,7 @@ # Prediction +Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + ## Fields diff --git a/docs/models/processingstatus.md b/docs/models/processingstatus.md new file mode 100644 index 00000000..514caa50 --- /dev/null +++ b/docs/models/processingstatus.md @@ -0,0 +1,10 @@ +# ProcessingStatus + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `document_id` | *str* | :heavy_check_mark: | N/A | +| `process_status` | [models.ProcessStatus](../models/processstatus.md) | :heavy_check_mark: | N/A | +| `processing_status` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/processingstatusout.md b/docs/models/processingstatusout.md deleted file mode 100644 index 7b67583f..00000000 --- a/docs/models/processingstatusout.md +++ /dev/null @@ -1,9 +0,0 @@ -# ProcessingStatusOut - - -## Fields - -| Field | Type | Required | Description | -| ------------------- | ------------------- | ------------------- | ------------------- | -| `document_id` | *str* | :heavy_check_mark: | N/A | -| `processing_status` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/processstatus.md b/docs/models/processstatus.md new file mode 100644 index 00000000..68313743 --- /dev/null +++ b/docs/models/processstatus.md @@ -0,0 +1,24 @@ +# ProcessStatus + +## Example Usage + +```python +from mistralai.client.models import ProcessStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ProcessStatus = "self_managed" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"self_managed"` +- `"missing_content"` +- `"noop"` +- `"done"` +- `"todo"` +- `"in_progress"` +- `"error"` +- `"waiting_for_capacity"` diff --git a/docs/models/prompttokensdetails.md b/docs/models/prompttokensdetails.md new file mode 100644 index 00000000..36b58e9a --- /dev/null +++ b/docs/models/prompttokensdetails.md @@ -0,0 +1,11 @@ +# PromptTokensDetails + +Token usage details for the prompt. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `messages` | List[[models.MessageTokens](../models/messagetokens.md)] | :heavy_minus_sign: | N/A | +| `cached_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/publicauthenticationmethod.md b/docs/models/publicauthenticationmethod.md new file mode 100644 index 00000000..59de7076 --- /dev/null +++ b/docs/models/publicauthenticationmethod.md @@ -0,0 +1,12 @@ +# PublicAuthenticationMethod + +Public view of an authentication method, without secrets. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `method_type` | [models.OutboundAuthenticationType](../models/outboundauthenticationtype.md) | :heavy_check_mark: | N/A | +| `headers` | List[[models.ConnectorAuthenticationHeader](../models/connectorauthenticationheader.md)] | :heavy_minus_sign: | N/A | +| `has_default_credentials` | *bool* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/querydefinition.md b/docs/models/querydefinition.md new file mode 100644 index 00000000..9d094fda --- /dev/null +++ b/docs/models/querydefinition.md @@ -0,0 +1,11 @@ +# QueryDefinition + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name of the query | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the query | +| `input_schema` | Dict[str, *Any*] | :heavy_check_mark: | Input JSON schema of the query's model | +| `output_schema` | Dict[str, *Any*] | :heavy_minus_sign: | Output JSON schema of the query's model | \ No newline at end of file diff --git a/docs/models/queryinvocationbody.md b/docs/models/queryinvocationbody.md new file mode 100644 index 00000000..3d4e5441 --- /dev/null +++ b/docs/models/queryinvocationbody.md @@ -0,0 +1,9 @@ +# QueryInvocationBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | The name of the query to request | +| `input` | [OptionalNullable[models.QueryInvocationBodyInput]](../models/queryinvocationbodyinput.md) | :heavy_minus_sign: | Input data for the query, matching its schema | \ No newline at end of file diff --git a/docs/models/queryinvocationbodyinput.md b/docs/models/queryinvocationbodyinput.md new file mode 100644 index 00000000..deb0db27 --- /dev/null +++ b/docs/models/queryinvocationbodyinput.md @@ -0,0 +1,19 @@ +# QueryInvocationBodyInput + +Input data for the query, matching its schema + + +## Supported Types + +### `models.NetworkEncodedInput` + +```python +value: models.NetworkEncodedInput = /* values here */ +``` + +### `Dict[str, Any]` + +```python +value: Dict[str, Any] = /* values here */ +``` + diff --git a/docs/models/queryparamstatus.md b/docs/models/queryparamstatus.md deleted file mode 100644 index dcd20908..00000000 --- a/docs/models/queryparamstatus.md +++ /dev/null @@ -1,19 +0,0 @@ -# QueryParamStatus - -The current job state to filter on. When set, the other results are not displayed. - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `QUEUED` | QUEUED | -| `STARTED` | STARTED | -| `VALIDATING` | VALIDATING | -| `VALIDATED` | VALIDATED | -| `RUNNING` | RUNNING | -| `FAILED_VALIDATION` | FAILED_VALIDATION | -| `FAILED` | FAILED | -| `SUCCESS` | SUCCESS | -| `CANCELLED` | CANCELLED | -| `CANCELLATION_REQUESTED` | CANCELLATION_REQUESTED | \ No newline at end of file diff --git a/docs/models/queryworkflowexecutionv1workflowsexecutionsexecutionidqueriespostrequest.md b/docs/models/queryworkflowexecutionv1workflowsexecutionsexecutionidqueriespostrequest.md new file mode 100644 index 00000000..0e0d378d --- /dev/null +++ b/docs/models/queryworkflowexecutionv1workflowsexecutionsexecutionidqueriespostrequest.md @@ -0,0 +1,9 @@ +# QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `query_invocation_body` | [models.QueryInvocationBody](../models/queryinvocationbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/queryworkflowresponse.md b/docs/models/queryworkflowresponse.md new file mode 100644 index 00000000..cc5b0866 --- /dev/null +++ b/docs/models/queryworkflowresponse.md @@ -0,0 +1,9 @@ +# QueryWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `query_name` | *str* | :heavy_check_mark: | N/A | +| `result` | *Any* | :heavy_check_mark: | The result of the Query workflow call | \ No newline at end of file diff --git a/docs/models/realtimetranscriptionerror.md b/docs/models/realtimetranscriptionerror.md new file mode 100644 index 00000000..e01f2126 --- /dev/null +++ b/docs/models/realtimetranscriptionerror.md @@ -0,0 +1,9 @@ +# RealtimeTranscriptionError + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `type` | *Optional[Literal["error"]]* | :heavy_minus_sign: | N/A | +| `error` | [models.RealtimeTranscriptionErrorDetail](../models/realtimetranscriptionerrordetail.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/realtimetranscriptionerrordetail.md b/docs/models/realtimetranscriptionerrordetail.md new file mode 100644 index 00000000..5b34755d --- /dev/null +++ b/docs/models/realtimetranscriptionerrordetail.md @@ -0,0 +1,9 @@ +# RealtimeTranscriptionErrorDetail + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `message` | [models.RealtimeTranscriptionErrorDetailMessage](../models/realtimetranscriptionerrordetailmessage.md) | :heavy_check_mark: | Human-readable error message. | +| `code` | *int* | :heavy_check_mark: | Internal error code for debugging. | \ No newline at end of file diff --git a/docs/models/realtimetranscriptionerrordetailmessage.md b/docs/models/realtimetranscriptionerrordetailmessage.md new file mode 100644 index 00000000..da3764ef --- /dev/null +++ b/docs/models/realtimetranscriptionerrordetailmessage.md @@ -0,0 +1,19 @@ +# RealtimeTranscriptionErrorDetailMessage + +Human-readable error message. + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `Dict[str, Any]` + +```python +value: Dict[str, Any] = /* values here */ +``` + diff --git a/docs/models/realtimetranscriptioninputaudioappend.md b/docs/models/realtimetranscriptioninputaudioappend.md new file mode 100644 index 00000000..5ee365eb --- /dev/null +++ b/docs/models/realtimetranscriptioninputaudioappend.md @@ -0,0 +1,9 @@ +# RealtimeTranscriptionInputAudioAppend + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `type` | *Optional[Literal["input_audio.append"]]* | :heavy_minus_sign: | N/A | +| `audio` | *str* | :heavy_check_mark: | Base64-encoded raw PCM bytes matching the current audio_format. Max decoded size: 262144 bytes. | \ No newline at end of file diff --git a/docs/models/realtimetranscriptioninputaudioend.md b/docs/models/realtimetranscriptioninputaudioend.md new file mode 100644 index 00000000..393d208c --- /dev/null +++ b/docs/models/realtimetranscriptioninputaudioend.md @@ -0,0 +1,8 @@ +# RealtimeTranscriptionInputAudioEnd + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `type` | *Optional[Literal["input_audio.end"]]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/realtimetranscriptioninputaudioflush.md b/docs/models/realtimetranscriptioninputaudioflush.md new file mode 100644 index 00000000..367725ba --- /dev/null +++ b/docs/models/realtimetranscriptioninputaudioflush.md @@ -0,0 +1,8 @@ +# RealtimeTranscriptionInputAudioFlush + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `type` | *Optional[Literal["input_audio.flush"]]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/realtimetranscriptionsession.md b/docs/models/realtimetranscriptionsession.md new file mode 100644 index 00000000..750bd7f7 --- /dev/null +++ b/docs/models/realtimetranscriptionsession.md @@ -0,0 +1,11 @@ +# RealtimeTranscriptionSession + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `request_id` | *str* | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `audio_format` | [models.AudioFormat](../models/audioformat.md) | :heavy_check_mark: | N/A | +| `target_streaming_delay_ms` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/realtimetranscriptionsessioncreated.md b/docs/models/realtimetranscriptionsessioncreated.md new file mode 100644 index 00000000..34e603fd --- /dev/null +++ b/docs/models/realtimetranscriptionsessioncreated.md @@ -0,0 +1,9 @@ +# RealtimeTranscriptionSessionCreated + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `type` | *Optional[Literal["session.created"]]* | :heavy_minus_sign: | N/A | +| `session` | [models.RealtimeTranscriptionSession](../models/realtimetranscriptionsession.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/realtimetranscriptionsessionupdated.md b/docs/models/realtimetranscriptionsessionupdated.md new file mode 100644 index 00000000..7e271995 --- /dev/null +++ b/docs/models/realtimetranscriptionsessionupdated.md @@ -0,0 +1,9 @@ +# RealtimeTranscriptionSessionUpdated + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `type` | *Optional[Literal["session.updated"]]* | :heavy_minus_sign: | N/A | +| `session` | [models.RealtimeTranscriptionSession](../models/realtimetranscriptionsession.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/realtimetranscriptionsessionupdatemessage.md b/docs/models/realtimetranscriptionsessionupdatemessage.md new file mode 100644 index 00000000..2a50ca92 --- /dev/null +++ b/docs/models/realtimetranscriptionsessionupdatemessage.md @@ -0,0 +1,9 @@ +# RealtimeTranscriptionSessionUpdateMessage + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `type` | *Optional[Literal["session.update"]]* | :heavy_minus_sign: | N/A | +| `session` | [models.RealtimeTranscriptionSessionUpdatePayload](../models/realtimetranscriptionsessionupdatepayload.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/realtimetranscriptionsessionupdatepayload.md b/docs/models/realtimetranscriptionsessionupdatepayload.md new file mode 100644 index 00000000..d6c6547d --- /dev/null +++ b/docs/models/realtimetranscriptionsessionupdatepayload.md @@ -0,0 +1,9 @@ +# RealtimeTranscriptionSessionUpdatePayload + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `audio_format` | [OptionalNullable[models.AudioFormat]](../models/audioformat.md) | :heavy_minus_sign: | Set before sending audio. Audio format updates are rejected after audio starts. | +| `target_streaming_delay_ms` | *OptionalNullable[int]* | :heavy_minus_sign: | Set before sending audio. Streaming delay updates are rejected after audio starts. | \ No newline at end of file diff --git a/docs/models/reasoningeffort.md b/docs/models/reasoningeffort.md new file mode 100644 index 00000000..9b418bc3 --- /dev/null +++ b/docs/models/reasoningeffort.md @@ -0,0 +1,18 @@ +# ReasoningEffort + +## Example Usage + +```python +from mistralai.client.models import ReasoningEffort + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ReasoningEffort = "none" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"none"` +- `"high"` diff --git a/docs/models/referencechunk.md b/docs/models/referencechunk.md index a132ca2f..0186d3c3 100644 --- a/docs/models/referencechunk.md +++ b/docs/models/referencechunk.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ReferenceChunkType]](../models/referencechunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `type` | *Optional[Literal["reference"]]* | :heavy_minus_sign: | N/A | +| `reference_ids` | List[[models.ReferenceID](../models/referenceid.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/referencechunktype.md b/docs/models/referencechunktype.md deleted file mode 100644 index 1e0e2fe6..00000000 --- a/docs/models/referencechunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReferenceChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `REFERENCE` | reference | \ No newline at end of file diff --git a/docs/models/referenceid.md b/docs/models/referenceid.md new file mode 100644 index 00000000..1d29397f --- /dev/null +++ b/docs/models/referenceid.md @@ -0,0 +1,17 @@ +# ReferenceID + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/repositories.md b/docs/models/repositories.md deleted file mode 100644 index 02274e3d..00000000 --- a/docs/models/repositories.md +++ /dev/null @@ -1,11 +0,0 @@ -# Repositories - - -## Supported Types - -### `models.GithubRepositoryOut` - -```python -value: models.GithubRepositoryOut = /* values here */ -``` - diff --git a/docs/models/requestsource.md b/docs/models/requestsource.md new file mode 100644 index 00000000..b710cc1f --- /dev/null +++ b/docs/models/requestsource.md @@ -0,0 +1,15 @@ +# RequestSource + +## Example Usage + +```python +from mistralai.client.models import RequestSource +value: RequestSource = "api" +``` + + +## Values + +- `"api"` +- `"playground"` +- `"agent_builder_v1"` diff --git a/docs/models/resetinvocationbody.md b/docs/models/resetinvocationbody.md new file mode 100644 index 00000000..9f306e2d --- /dev/null +++ b/docs/models/resetinvocationbody.md @@ -0,0 +1,11 @@ +# ResetInvocationBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `event_id` | *int* | :heavy_check_mark: | The event ID to reset the workflow execution to | +| `reason` | *OptionalNullable[str]* | :heavy_minus_sign: | Reason for resetting the workflow execution | +| `exclude_signals` | *Optional[bool]* | :heavy_minus_sign: | Whether to exclude signals that happened after the reset point | +| `exclude_updates` | *Optional[bool]* | :heavy_minus_sign: | Whether to exclude updates that happened after the reset point | \ No newline at end of file diff --git a/docs/models/resetworkflowv1workflowsexecutionsexecutionidresetpostrequest.md b/docs/models/resetworkflowv1workflowsexecutionsexecutionidresetpostrequest.md new file mode 100644 index 00000000..418c6c5a --- /dev/null +++ b/docs/models/resetworkflowv1workflowsexecutionsexecutionidresetpostrequest.md @@ -0,0 +1,9 @@ +# ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `reset_invocation_body` | [models.ResetInvocationBody](../models/resetinvocationbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/resource.md b/docs/models/resource.md new file mode 100644 index 00000000..30d74c40 --- /dev/null +++ b/docs/models/resource.md @@ -0,0 +1,17 @@ +# Resource + + +## Supported Types + +### `models.TextResourceContents` + +```python +value: models.TextResourceContents = /* values here */ +``` + +### `models.BlobResourceContents` + +```python +value: models.BlobResourceContents = /* values here */ +``` + diff --git a/docs/models/resourcelink.md b/docs/models/resourcelink.md new file mode 100644 index 00000000..074c573e --- /dev/null +++ b/docs/models/resourcelink.md @@ -0,0 +1,22 @@ +# ResourceLink + +A resource that the server is capable of reading, included in a prompt or tool call result. + +Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `uri` | *str* | :heavy_check_mark: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `mime_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `size` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `icons` | List[[models.MCPServerIcon](../models/mcpservericon.md)] | :heavy_minus_sign: | N/A | +| `annotations` | [OptionalNullable[models.Annotations]](../models/annotations.md) | :heavy_minus_sign: | N/A | +| `meta` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `type` | *Literal["resource_link"]* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/resourcevisibility.md b/docs/models/resourcevisibility.md new file mode 100644 index 00000000..970211bb --- /dev/null +++ b/docs/models/resourcevisibility.md @@ -0,0 +1,20 @@ +# ResourceVisibility + +## Example Usage + +```python +from mistralai.client.models import ResourceVisibility + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ResourceVisibility = "shared_global" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"shared_global"` +- `"shared_org"` +- `"shared_workspace"` +- `"private"` diff --git a/docs/models/response.md b/docs/models/response.md new file mode 100644 index 00000000..ff679257 --- /dev/null +++ b/docs/models/response.md @@ -0,0 +1,17 @@ +# Response + + +## Supported Types + +### `models.ClassifierFineTuningJob` + +```python +value: models.ClassifierFineTuningJob = /* values here */ +``` + +### `models.CompletionFineTuningJob` + +```python +value: models.CompletionFineTuningJob = /* values here */ +``` + diff --git a/docs/models/response1.md b/docs/models/response1.md deleted file mode 100644 index 2e73fdbb..00000000 --- a/docs/models/response1.md +++ /dev/null @@ -1,17 +0,0 @@ -# Response1 - - -## Supported Types - -### `models.ClassifierJobOut` - -```python -value: models.ClassifierJobOut = /* values here */ -``` - -### `models.CompletionJobOut` - -```python -value: models.CompletionJobOut = /* values here */ -``` - diff --git a/docs/models/responsebody.md b/docs/models/responsebody.md deleted file mode 100644 index 8a218517..00000000 --- a/docs/models/responsebody.md +++ /dev/null @@ -1,17 +0,0 @@ -# ResponseBody - - -## Supported Types - -### `models.ModelConversation` - -```python -value: models.ModelConversation = /* values here */ -``` - -### `models.AgentConversation` - -```python -value: models.AgentConversation = /* values here */ -``` - diff --git a/docs/models/responseconnectorlisttoolsv1.md b/docs/models/responseconnectorlisttoolsv1.md new file mode 100644 index 00000000..18a31c56 --- /dev/null +++ b/docs/models/responseconnectorlisttoolsv1.md @@ -0,0 +1,25 @@ +# ResponseConnectorListToolsV1 + +Successful Response + + +## Supported Types + +### `List[models.ConnectorTool]` + +```python +value: List[models.ConnectorTool] = /* values here */ +``` + +### `List[models.MCPTool]` + +```python +value: List[models.MCPTool] = /* values here */ +``` + +### `List[Dict[str, Any]]` + +```python +value: List[Dict[str, Any]] = /* values here */ +``` + diff --git a/docs/models/responsedoneevent.md b/docs/models/responsedoneevent.md index ec25bd6d..63d4cc06 100644 --- a/docs/models/responsedoneevent.md +++ b/docs/models/responsedoneevent.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `type` | [Optional[models.ResponseDoneEventType]](../models/responsedoneeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `usage` | [models.ConversationUsageInfo](../models/conversationusageinfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *Literal["conversation.response.done"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `usage` | [models.ConversationUsageInfo](../models/conversationusageinfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/responsedoneeventtype.md b/docs/models/responsedoneeventtype.md deleted file mode 100644 index 58f7f44d..00000000 --- a/docs/models/responsedoneeventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ResponseDoneEventType - - -## Values - -| Name | Value | -| ---------------------------- | ---------------------------- | -| `CONVERSATION_RESPONSE_DONE` | conversation.response.done | \ No newline at end of file diff --git a/docs/models/responseerrorevent.md b/docs/models/responseerrorevent.md index 2ea6a2e0..4309bdad 100644 --- a/docs/models/responseerrorevent.md +++ b/docs/models/responseerrorevent.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `type` | [Optional[models.ResponseErrorEventType]](../models/responseerroreventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `message` | *str* | :heavy_check_mark: | N/A | -| `code` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *Literal["conversation.response.error"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `message` | *str* | :heavy_check_mark: | N/A | +| `code` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/responseerroreventtype.md b/docs/models/responseerroreventtype.md deleted file mode 100644 index 3b3fc303..00000000 --- a/docs/models/responseerroreventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ResponseErrorEventType - - -## Values - -| Name | Value | -| ----------------------------- | ----------------------------- | -| `CONVERSATION_RESPONSE_ERROR` | conversation.response.error | \ No newline at end of file diff --git a/docs/models/responseexecuteworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepost.md b/docs/models/responseexecuteworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepost.md new file mode 100644 index 00000000..381987b6 --- /dev/null +++ b/docs/models/responseexecuteworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepost.md @@ -0,0 +1,19 @@ +# ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost + +Successful Response + + +## Supported Types + +### `models.WorkflowExecutionResponse` + +```python +value: models.WorkflowExecutionResponse = /* values here */ +``` + +### `models.WorkflowExecutionSyncResponse` + +```python +value: models.WorkflowExecutionSyncResponse = /* values here */ +``` + diff --git a/docs/models/responseexecuteworkflowv1workflowsworkflowidentifierexecutepost.md b/docs/models/responseexecuteworkflowv1workflowsworkflowidentifierexecutepost.md new file mode 100644 index 00000000..368f2318 --- /dev/null +++ b/docs/models/responseexecuteworkflowv1workflowsworkflowidentifierexecutepost.md @@ -0,0 +1,19 @@ +# ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost + +Successful Response + + +## Supported Types + +### `models.WorkflowExecutionResponse` + +```python +value: models.WorkflowExecutionResponse = /* values here */ +``` + +### `models.WorkflowExecutionSyncResponse` + +```python +value: models.WorkflowExecutionSyncResponse = /* values here */ +``` + diff --git a/docs/models/responseformat.md b/docs/models/responseformat.md index 23a1641b..5cab22f2 100644 --- a/docs/models/responseformat.md +++ b/docs/models/responseformat.md @@ -1,9 +1,11 @@ # ResponseFormat +Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Optional[models.ResponseFormats]](../models/responseformats.md) | :heavy_minus_sign: | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. | -| `json_schema` | [OptionalNullable[models.JSONSchema]](../models/jsonschema.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | [Optional[models.ResponseFormats]](../models/responseformats.md) | :heavy_minus_sign: | N/A | +| `json_schema` | [OptionalNullable[models.JSONSchema]](../models/jsonschema.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/responseformats.md b/docs/models/responseformats.md index 06886afe..12e5edd7 100644 --- a/docs/models/responseformats.md +++ b/docs/models/responseformats.md @@ -1,12 +1,19 @@ # ResponseFormats -An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. +## Example Usage + +```python +from mistralai.client.models import ResponseFormats + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ResponseFormats = "text" +``` ## Values -| Name | Value | -| ------------- | ------------- | -| `TEXT` | text | -| `JSON_OBJECT` | json_object | -| `JSON_SCHEMA` | json_schema | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"text"` +- `"json_object"` +- `"json_schema"` diff --git a/docs/models/responseretrievemodelv1modelsmodelidget.md b/docs/models/responseretrievemodelv1modelsmodelidget.md new file mode 100644 index 00000000..ffbc1473 --- /dev/null +++ b/docs/models/responseretrievemodelv1modelsmodelidget.md @@ -0,0 +1,19 @@ +# ResponseRetrieveModelV1ModelsModelIDGet + +Successful Response + + +## Supported Types + +### `models.BaseModelCard` + +```python +value: models.BaseModelCard = /* values here */ +``` + +### `models.FTModelCard` + +```python +value: models.FTModelCard = /* values here */ +``` + diff --git a/docs/models/responsestartedevent.md b/docs/models/responsestartedevent.md index 481bd5bb..e2f421af 100644 --- a/docs/models/responsestartedevent.md +++ b/docs/models/responsestartedevent.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `type` | [Optional[models.ResponseStartedEventType]](../models/responsestartedeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `conversation_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *Literal["conversation.response.started"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `conversation_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/responsestartedeventtype.md b/docs/models/responsestartedeventtype.md deleted file mode 100644 index 2d9273bd..00000000 --- a/docs/models/responsestartedeventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ResponseStartedEventType - - -## Values - -| Name | Value | -| ------------------------------- | ------------------------------- | -| `CONVERSATION_RESPONSE_STARTED` | conversation.response.started | \ No newline at end of file diff --git a/docs/models/responsev1conversationsget.md b/docs/models/responsev1conversationsget.md new file mode 100644 index 00000000..844c5d61 --- /dev/null +++ b/docs/models/responsev1conversationsget.md @@ -0,0 +1,19 @@ +# ResponseV1ConversationsGet + +Successful Response + + +## Supported Types + +### `models.ModelConversation` + +```python +value: models.ModelConversation = /* values here */ +``` + +### `models.AgentConversation` + +```python +value: models.AgentConversation = /* values here */ +``` + diff --git a/docs/models/resumeschedulev1workflowsschedulesscheduleidresumepostrequest.md b/docs/models/resumeschedulev1workflowsschedulesscheduleidresumepostrequest.md new file mode 100644 index 00000000..e50fe6cd --- /dev/null +++ b/docs/models/resumeschedulev1workflowsschedulesscheduleidresumepostrequest.md @@ -0,0 +1,9 @@ +# ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | +| `workflow_schedule_pause_request` | [OptionalNullable[models.WorkflowSchedulePauseRequest]](../models/workflowschedulepauserequest.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/retrievefileout.md b/docs/models/retrievefileout.md deleted file mode 100644 index 28f97dd2..00000000 --- a/docs/models/retrievefileout.md +++ /dev/null @@ -1,19 +0,0 @@ -# RetrieveFileOut - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The unique identifier of the file. | 497f6eca-6276-4993-bfeb-53cbbbba6f09 | -| `object` | *str* | :heavy_check_mark: | The object type, which is always "file". | file | -| `size_bytes` | *int* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | -| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | -| `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | -| `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | -| `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | -| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | -| `mimetype` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | -| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `deleted` | *bool* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md b/docs/models/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md deleted file mode 100644 index 3ac96521..00000000 --- a/docs/models/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md +++ /dev/null @@ -1,19 +0,0 @@ -# RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet - -Successful Response - - -## Supported Types - -### `models.BaseModelCard` - -```python -value: models.BaseModelCard = /* values here */ -``` - -### `models.FTModelCard` - -```python -value: models.FTModelCard = /* values here */ -``` - diff --git a/docs/models/role.md b/docs/models/role.md index affca78d..b16f5c3b 100644 --- a/docs/models/role.md +++ b/docs/models/role.md @@ -1,8 +1,18 @@ # Role +## Example Usage + +```python +from mistralai.client.models import Role + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Role = "assistant" +``` + ## Values -| Name | Value | -| -------- | -------- | -| `SYSTEM` | system | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"assistant"` +- `"user"` diff --git a/docs/models/roles.md b/docs/models/roles.md new file mode 100644 index 00000000..d722e765 --- /dev/null +++ b/docs/models/roles.md @@ -0,0 +1,20 @@ +# Roles + +## Example Usage + +```python +from mistralai.client.models import Roles + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Roles = "system" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"system"` +- `"user"` +- `"assistant"` +- `"tool"` diff --git a/docs/models/sampletype.md b/docs/models/sampletype.md index 34a6a012..31f26c3c 100644 --- a/docs/models/sampletype.md +++ b/docs/models/sampletype.md @@ -1,12 +1,21 @@ # SampleType +## Example Usage + +```python +from mistralai.client.models import SampleType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: SampleType = "pretrain" +``` + ## Values -| Name | Value | -| --------------- | --------------- | -| `PRETRAIN` | pretrain | -| `INSTRUCT` | instruct | -| `BATCH_REQUEST` | batch_request | -| `BATCH_RESULT` | batch_result | -| `BATCH_ERROR` | batch_error | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"pretrain"` +- `"instruct"` +- `"batch_request"` +- `"batch_result"` +- `"batch_error"` diff --git a/docs/models/scalarmetric.md b/docs/models/scalarmetric.md new file mode 100644 index 00000000..96b93231 --- /dev/null +++ b/docs/models/scalarmetric.md @@ -0,0 +1,10 @@ +# ScalarMetric + +Scalar metric with a single value. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `value` | [models.ScalarMetricValue](../models/scalarmetricvalue.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/scalarmetricvalue.md b/docs/models/scalarmetricvalue.md new file mode 100644 index 00000000..6723310e --- /dev/null +++ b/docs/models/scalarmetricvalue.md @@ -0,0 +1,17 @@ +# ScalarMetricValue + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/schedulecalendar.md b/docs/models/schedulecalendar.md new file mode 100644 index 00000000..4166bef5 --- /dev/null +++ b/docs/models/schedulecalendar.md @@ -0,0 +1,15 @@ +# ScheduleCalendar + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `second` | List[[models.ScheduleRange](../models/schedulerange.md)] | :heavy_minus_sign: | N/A | +| `minute` | List[[models.ScheduleRange](../models/schedulerange.md)] | :heavy_minus_sign: | N/A | +| `hour` | List[[models.ScheduleRange](../models/schedulerange.md)] | :heavy_minus_sign: | N/A | +| `day_of_month` | List[[models.ScheduleRange](../models/schedulerange.md)] | :heavy_minus_sign: | N/A | +| `month` | List[[models.ScheduleRange](../models/schedulerange.md)] | :heavy_minus_sign: | N/A | +| `year` | List[[models.ScheduleRange](../models/schedulerange.md)] | :heavy_minus_sign: | N/A | +| `day_of_week` | List[[models.ScheduleRange](../models/schedulerange.md)] | :heavy_minus_sign: | N/A | +| `comment` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/scheduledefinition.md b/docs/models/scheduledefinition.md new file mode 100644 index 00000000..7d0509f6 --- /dev/null +++ b/docs/models/scheduledefinition.md @@ -0,0 +1,26 @@ +# ScheduleDefinition + +Specification of the times scheduled actions may occur. + +The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and +:py:attr:`cron_expressions` excluding anything in :py:attr:`skip`. + +Used for input where schedule_id is optional (can be provided or auto-generated). + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | *Any* | :heavy_check_mark: | Input to provide to the workflow when starting it. | +| `calendars` | List[[models.ScheduleCalendar](../models/schedulecalendar.md)] | :heavy_minus_sign: | Calendar-based specification of times. | +| `intervals` | List[[models.ScheduleInterval](../models/scheduleinterval.md)] | :heavy_minus_sign: | Interval-based specification of times. | +| `cron_expressions` | List[*str*] | :heavy_minus_sign: | Cron-based specification of times. | +| `skip` | List[[models.ScheduleCalendar](../models/schedulecalendar.md)] | :heavy_minus_sign: | Set of calendar times to skip. | +| `start_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Time after which the first action may be run. | +| `end_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Time after which no more actions will be run. | +| `jitter` | *OptionalNullable[str]* | :heavy_minus_sign: | Jitter to apply each action.

An action's scheduled time will be incremented by a random value between 0
and this value if present (but not past the next schedule).
| +| `time_zone_name` | *OptionalNullable[str]* | :heavy_minus_sign: | IANA time zone name, for example ``US/Central``. | +| `policy` | [Optional[models.SchedulePolicy]](../models/schedulepolicy.md) | :heavy_minus_sign: | N/A | +| `schedule_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the schedule. | +| `max_executions` | *OptionalNullable[int]* | :heavy_minus_sign: | Maximum number of times this schedule will trigger a workflow execution. Once this limit is reached, no further executions are triggered automatically. null means unlimited. | \ No newline at end of file diff --git a/docs/models/scheduledefinitionoutput.md b/docs/models/scheduledefinitionoutput.md new file mode 100644 index 00000000..64b7b525 --- /dev/null +++ b/docs/models/scheduledefinitionoutput.md @@ -0,0 +1,28 @@ +# ScheduleDefinitionOutput + +Output representation of a schedule with required schedule_id. + +Used when returning schedules from the API where schedule_id is always present. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | *Any* | :heavy_check_mark: | Input to provide to the workflow when starting it. | +| `calendars` | List[[models.ScheduleCalendar](../models/schedulecalendar.md)] | :heavy_minus_sign: | Calendar-based specification of times. | +| `intervals` | List[[models.ScheduleInterval](../models/scheduleinterval.md)] | :heavy_minus_sign: | Interval-based specification of times. | +| `cron_expressions` | List[*str*] | :heavy_minus_sign: | Cron-based specification of times. | +| `skip` | List[[models.ScheduleCalendar](../models/schedulecalendar.md)] | :heavy_minus_sign: | Set of calendar times to skip. | +| `start_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Time after which the first action may be run. | +| `end_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Time after which no more actions will be run. | +| `jitter` | *OptionalNullable[str]* | :heavy_minus_sign: | Jitter to apply each action.

An action's scheduled time will be incremented by a random value between 0
and this value if present (but not past the next schedule).
| +| `time_zone_name` | *OptionalNullable[str]* | :heavy_minus_sign: | IANA time zone name, for example ``US/Central``. | +| `policy` | [Optional[models.SchedulePolicy]](../models/schedulepolicy.md) | :heavy_minus_sign: | N/A | +| `schedule_id` | *str* | :heavy_check_mark: | Unique identifier for the schedule. | +| `remaining_executions` | *OptionalNullable[int]* | :heavy_minus_sign: | Remaining workflow executions before this schedule stops triggering automatically. null means unlimited; 0 means the limit has been reached and the schedule is exhausted. | +| `workflow_name` | *str* | :heavy_check_mark: | Name of the workflow this schedule triggers. | +| `paused` | *bool* | :heavy_check_mark: | Whether the schedule is currently paused. | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Human-readable note associated with the current pause or resume state. | +| `future_executions` | List[[models.ScheduleFutureExecution](../models/schedulefutureexecution.md)] | :heavy_minus_sign: | Upcoming scheduled executions (10 next executions, earliest first). | +| `recent_executions` | List[[models.ScheduleRecentExecution](../models/schedulerecentexecution.md)] | :heavy_minus_sign: | Most recent scheduled executions (10 most recent, newest last). | \ No newline at end of file diff --git a/docs/models/schedulefutureexecution.md b/docs/models/schedulefutureexecution.md new file mode 100644 index 00000000..7dfa16af --- /dev/null +++ b/docs/models/schedulefutureexecution.md @@ -0,0 +1,8 @@ +# ScheduleFutureExecution + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `scheduled_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Time the execution is scheduled to run. | \ No newline at end of file diff --git a/docs/models/scheduleinterval.md b/docs/models/scheduleinterval.md new file mode 100644 index 00000000..e99d552f --- /dev/null +++ b/docs/models/scheduleinterval.md @@ -0,0 +1,9 @@ +# ScheduleInterval + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `every` | *str* | :heavy_check_mark: | N/A | +| `offset` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/scheduleoverlappolicy.md b/docs/models/scheduleoverlappolicy.md new file mode 100644 index 00000000..1df8c0ea --- /dev/null +++ b/docs/models/scheduleoverlappolicy.md @@ -0,0 +1,25 @@ +# ScheduleOverlapPolicy + +Controls what happens when a workflow would be started by a schedule but +one is already running. + +## Example Usage + +```python +from mistralai.client.models import ScheduleOverlapPolicy + +# Open enum: unrecognized values are captured as UnrecognizedInt +value: ScheduleOverlapPolicy = 1 +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `1` +- `2` +- `3` +- `4` +- `5` +- `6` diff --git a/docs/models/schedulepolicy.md b/docs/models/schedulepolicy.md new file mode 100644 index 00000000..5f079049 --- /dev/null +++ b/docs/models/schedulepolicy.md @@ -0,0 +1,10 @@ +# SchedulePolicy + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `catchup_window_seconds` | *Optional[int]* | :heavy_minus_sign: | After a Temporal server is unavailable, amount of time in seconds in the past to execute missed actions. | +| `overlap` | [Optional[models.ScheduleOverlapPolicy]](../models/scheduleoverlappolicy.md) | :heavy_minus_sign: | Controls what happens when a workflow would be started by a schedule but
one is already running. | +| `pause_on_failure` | *Optional[bool]* | :heavy_minus_sign: | Whether to pause the schedule after a workflow failure. | \ No newline at end of file diff --git a/docs/models/schedulerange.md b/docs/models/schedulerange.md new file mode 100644 index 00000000..d6cb0975 --- /dev/null +++ b/docs/models/schedulerange.md @@ -0,0 +1,10 @@ +# ScheduleRange + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `start` | *int* | :heavy_check_mark: | N/A | +| `end` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `step` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/schedulerecentexecution.md b/docs/models/schedulerecentexecution.md new file mode 100644 index 00000000..f849e1ae --- /dev/null +++ b/docs/models/schedulerecentexecution.md @@ -0,0 +1,10 @@ +# ScheduleRecentExecution + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `scheduled_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Time the execution was scheduled to run. | +| `started_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Actual time the execution started. | +| `execution_id` | *str* | :heavy_check_mark: | ID of the workflow execution that was started. | \ No newline at end of file diff --git a/docs/models/scope.md b/docs/models/scope.md new file mode 100644 index 00000000..0dc29aa5 --- /dev/null +++ b/docs/models/scope.md @@ -0,0 +1,15 @@ +# Scope + +## Example Usage + +```python +from mistralai.client.models import Scope +value: Scope = "activity" +``` + + +## Values + +- `"activity"` +- `"workflow"` +- `"*"` diff --git a/docs/models/searchchatcompletioneventidsrequest.md b/docs/models/searchchatcompletioneventidsrequest.md new file mode 100644 index 00000000..7d0c4a50 --- /dev/null +++ b/docs/models/searchchatcompletioneventidsrequest.md @@ -0,0 +1,9 @@ +# SearchChatCompletionEventIdsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `search_params` | [models.FilterPayload](../models/filterpayload.md) | :heavy_check_mark: | N/A | +| `extra_fields` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/searchchatcompletioneventidsresponse.md b/docs/models/searchchatcompletioneventidsresponse.md new file mode 100644 index 00000000..6e429684 --- /dev/null +++ b/docs/models/searchchatcompletioneventidsresponse.md @@ -0,0 +1,8 @@ +# SearchChatCompletionEventIdsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `completion_event_ids` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/searchchatcompletioneventsrequest.md b/docs/models/searchchatcompletioneventsrequest.md new file mode 100644 index 00000000..11bc3ab9 --- /dev/null +++ b/docs/models/searchchatcompletioneventsrequest.md @@ -0,0 +1,9 @@ +# SearchChatCompletionEventsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `search_params` | [models.FilterPayload](../models/filterpayload.md) | :heavy_check_mark: | N/A | +| `extra_fields` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/searchchatcompletioneventsresponse.md b/docs/models/searchchatcompletioneventsresponse.md new file mode 100644 index 00000000..9474c110 --- /dev/null +++ b/docs/models/searchchatcompletioneventsresponse.md @@ -0,0 +1,8 @@ +# SearchChatCompletionEventsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `completion_events` | [models.FeedResultChatCompletionEventPreview](../models/feedresultchatcompletioneventpreview.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shareenum.md b/docs/models/shareenum.md index dc5d2b68..d471b7c3 100644 --- a/docs/models/shareenum.md +++ b/docs/models/shareenum.md @@ -1,9 +1,18 @@ # ShareEnum +## Example Usage + +```python +from mistralai.client.models import ShareEnum + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ShareEnum = "Viewer" +``` + ## Values -| Name | Value | -| -------- | -------- | -| `VIEWER` | Viewer | -| `EDITOR` | Editor | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"Viewer"` +- `"Editor"` diff --git a/docs/models/sharing.md b/docs/models/sharing.md new file mode 100644 index 00000000..fc718632 --- /dev/null +++ b/docs/models/sharing.md @@ -0,0 +1,13 @@ +# Sharing + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `library_id` | *str* | :heavy_check_mark: | N/A | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `org_id` | *str* | :heavy_check_mark: | N/A | +| `role` | *str* | :heavy_check_mark: | N/A | +| `share_with_type` | *str* | :heavy_check_mark: | N/A | +| `share_with_uuid` | *Nullable[str]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/sharingdelete.md b/docs/models/sharingdelete.md index 71cacab6..1dcec095 100644 --- a/docs/models/sharingdelete.md +++ b/docs/models/sharingdelete.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `org_id` | *str* | :heavy_check_mark: | N/A | +| `org_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `share_with_uuid` | *str* | :heavy_check_mark: | The id of the entity (user, workspace or organization) to share with | | `share_with_type` | [models.EntityType](../models/entitytype.md) | :heavy_check_mark: | The type of entity, used to share a library. | \ No newline at end of file diff --git a/docs/models/sharingin.md b/docs/models/sharingin.md deleted file mode 100644 index 537ede03..00000000 --- a/docs/models/sharingin.md +++ /dev/null @@ -1,11 +0,0 @@ -# SharingIn - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `org_id` | *str* | :heavy_check_mark: | N/A | -| `level` | [models.ShareEnum](../models/shareenum.md) | :heavy_check_mark: | N/A | -| `share_with_uuid` | *str* | :heavy_check_mark: | The id of the entity (user, workspace or organization) to share with | -| `share_with_type` | [models.EntityType](../models/entitytype.md) | :heavy_check_mark: | The type of entity, used to share a library. | \ No newline at end of file diff --git a/docs/models/sharingout.md b/docs/models/sharingout.md deleted file mode 100644 index 5844fe64..00000000 --- a/docs/models/sharingout.md +++ /dev/null @@ -1,13 +0,0 @@ -# SharingOut - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `library_id` | *str* | :heavy_check_mark: | N/A | -| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `org_id` | *str* | :heavy_check_mark: | N/A | -| `role` | *str* | :heavy_check_mark: | N/A | -| `share_with_type` | *str* | :heavy_check_mark: | N/A | -| `share_with_uuid` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/sharingrequest.md b/docs/models/sharingrequest.md new file mode 100644 index 00000000..21b8ec1f --- /dev/null +++ b/docs/models/sharingrequest.md @@ -0,0 +1,11 @@ +# SharingRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `org_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `level` | [models.ShareEnum](../models/shareenum.md) | :heavy_check_mark: | N/A | +| `share_with_uuid` | *str* | :heavy_check_mark: | The id of the entity (user, workspace or organization) to share with | +| `share_with_type` | [models.EntityType](../models/entitytype.md) | :heavy_check_mark: | The type of entity, used to share a library. | \ No newline at end of file diff --git a/docs/models/signaldefinition.md b/docs/models/signaldefinition.md new file mode 100644 index 00000000..c1974f70 --- /dev/null +++ b/docs/models/signaldefinition.md @@ -0,0 +1,10 @@ +# SignalDefinition + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name of the signal | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the signal | +| `input_schema` | Dict[str, *Any*] | :heavy_check_mark: | Input JSON schema of the signal's model | \ No newline at end of file diff --git a/docs/models/signalinvocationbody.md b/docs/models/signalinvocationbody.md new file mode 100644 index 00000000..14dc23e0 --- /dev/null +++ b/docs/models/signalinvocationbody.md @@ -0,0 +1,9 @@ +# SignalInvocationBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the signal to send | +| `input` | [OptionalNullable[models.SignalInvocationBodyInput]](../models/signalinvocationbodyinput.md) | :heavy_minus_sign: | Input data for the signal, matching its schema | \ No newline at end of file diff --git a/docs/models/signalinvocationbodyinput.md b/docs/models/signalinvocationbodyinput.md new file mode 100644 index 00000000..e9308bcb --- /dev/null +++ b/docs/models/signalinvocationbodyinput.md @@ -0,0 +1,19 @@ +# SignalInvocationBodyInput + +Input data for the signal, matching its schema + + +## Supported Types + +### `models.SignalInvocationBodyNetworkEncodedInput` + +```python +value: models.SignalInvocationBodyNetworkEncodedInput = /* values here */ +``` + +### `Dict[str, Any]` + +```python +value: Dict[str, Any] = /* values here */ +``` + diff --git a/docs/models/signalinvocationbodynetworkencodedinput.md b/docs/models/signalinvocationbodynetworkencodedinput.md new file mode 100644 index 00000000..09368656 --- /dev/null +++ b/docs/models/signalinvocationbodynetworkencodedinput.md @@ -0,0 +1,11 @@ +# SignalInvocationBodyNetworkEncodedInput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `b64payload` | *str* | :heavy_check_mark: | The encoded payload | +| `encoding_options` | List[[models.EncodedPayloadOptions](../models/encodedpayloadoptions.md)] | :heavy_minus_sign: | The encoding of the payload | +| `empty` | *Optional[bool]* | :heavy_minus_sign: | Whether the payload is empty | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/signalworkflowexecutionv1workflowsexecutionsexecutionidsignalspostrequest.md b/docs/models/signalworkflowexecutionv1workflowsexecutionsexecutionidsignalspostrequest.md new file mode 100644 index 00000000..2ca356d8 --- /dev/null +++ b/docs/models/signalworkflowexecutionv1workflowsexecutionsexecutionidsignalspostrequest.md @@ -0,0 +1,9 @@ +# SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `signal_invocation_body` | [models.SignalInvocationBody](../models/signalinvocationbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/signalworkflowresponse.md b/docs/models/signalworkflowresponse.md new file mode 100644 index 00000000..f65d7924 --- /dev/null +++ b/docs/models/signalworkflowresponse.md @@ -0,0 +1,8 @@ +# SignalWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `message` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/source.md b/docs/models/source.md index bb1ed612..37ca338b 100644 --- a/docs/models/source.md +++ b/docs/models/source.md @@ -1,10 +1,19 @@ # Source +## Example Usage + +```python +from mistralai.client.models import Source + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Source = "upload" +``` + ## Values -| Name | Value | -| ------------ | ------------ | -| `UPLOAD` | upload | -| `REPOSITORY` | repository | -| `MISTRAL` | mistral | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"upload"` +- `"repository"` +- `"mistral"` diff --git a/docs/models/speechoutputformat.md b/docs/models/speechoutputformat.md new file mode 100644 index 00000000..9b06e464 --- /dev/null +++ b/docs/models/speechoutputformat.md @@ -0,0 +1,17 @@ +# SpeechOutputFormat + +## Example Usage + +```python +from mistralai.client.models import SpeechOutputFormat +value: SpeechOutputFormat = "pcm" +``` + + +## Values + +- `"pcm"` +- `"wav"` +- `"mp3"` +- `"flac"` +- `"opus"` diff --git a/docs/models/speechrequest.md b/docs/models/speechrequest.md new file mode 100644 index 00000000..3a22e80a --- /dev/null +++ b/docs/models/speechrequest.md @@ -0,0 +1,15 @@ +# SpeechRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `voice_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The preset or custom voice to use for generating the speech. | +| `ref_audio` | *OptionalNullable[str]* | :heavy_minus_sign: | The audio reference for generating the speech. | +| `input` | *str* | :heavy_check_mark: | Text to generate a speech from | +| `response_format` | [Optional[models.SpeechOutputFormat]](../models/speechoutputformat.md) | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/speechresponse.md b/docs/models/speechresponse.md new file mode 100644 index 00000000..c44ecd83 --- /dev/null +++ b/docs/models/speechresponse.md @@ -0,0 +1,10 @@ +# SpeechResponse + +Speech audio data. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `audio_data` | *str* | :heavy_check_mark: | Base64 encoded audio data | \ No newline at end of file diff --git a/docs/models/speechstreamaudiodelta.md b/docs/models/speechstreamaudiodelta.md new file mode 100644 index 00000000..3a172552 --- /dev/null +++ b/docs/models/speechstreamaudiodelta.md @@ -0,0 +1,9 @@ +# SpeechStreamAudioDelta + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `type` | *Literal["speech.audio.delta"]* | :heavy_check_mark: | N/A | +| `audio_data` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/speechstreamdone.md b/docs/models/speechstreamdone.md new file mode 100644 index 00000000..d9b5e0c0 --- /dev/null +++ b/docs/models/speechstreamdone.md @@ -0,0 +1,9 @@ +# SpeechStreamDone + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `type` | *Literal["speech.audio.done"]* | :heavy_check_mark: | N/A | +| `usage` | [models.UsageInfoDollarDefs](../models/usageinfodollardefs.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/speechstreamevents.md b/docs/models/speechstreamevents.md new file mode 100644 index 00000000..f624f85f --- /dev/null +++ b/docs/models/speechstreamevents.md @@ -0,0 +1,11 @@ +# SpeechStreamEvents + +Speech audio data. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `event` | [models.SpeechStreamEventTypes](../models/speechstreameventtypes.md) | :heavy_check_mark: | N/A | +| `data` | [models.SpeechV1AudioSpeechPostData](../models/speechv1audiospeechpostdata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/speechstreameventtypes.md b/docs/models/speechstreameventtypes.md new file mode 100644 index 00000000..8c688c27 --- /dev/null +++ b/docs/models/speechstreameventtypes.md @@ -0,0 +1,18 @@ +# SpeechStreamEventTypes + +## Example Usage + +```python +from mistralai.client.models import SpeechStreamEventTypes + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: SpeechStreamEventTypes = "speech.audio.delta" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"speech.audio.delta"` +- `"speech.audio.done"` diff --git a/docs/models/speechv1audiospeechpostdata.md b/docs/models/speechv1audiospeechpostdata.md new file mode 100644 index 00000000..52735e25 --- /dev/null +++ b/docs/models/speechv1audiospeechpostdata.md @@ -0,0 +1,17 @@ +# SpeechV1AudioSpeechPostData + + +## Supported Types + +### `models.SpeechStreamAudioDelta` + +```python +value: models.SpeechStreamAudioDelta = /* values here */ +``` + +### `models.SpeechStreamDone` + +```python +value: models.SpeechStreamDone = /* values here */ +``` + diff --git a/docs/models/speechv1audiospeechpostresponse.md b/docs/models/speechv1audiospeechpostresponse.md new file mode 100644 index 00000000..040f3351 --- /dev/null +++ b/docs/models/speechv1audiospeechpostresponse.md @@ -0,0 +1,17 @@ +# SpeechV1AudioSpeechPostResponse + + +## Supported Types + +### `models.SpeechResponse` + +```python +value: models.SpeechResponse = /* values here */ +``` + +### `Union[eventstreaming.EventStream[models.SpeechStreamEvents], eventstreaming.EventStreamAsync[models.SpeechStreamEvents]]` + +```python +value: Union[eventstreaming.EventStream[models.SpeechStreamEvents], eventstreaming.EventStreamAsync[models.SpeechStreamEvents]] = /* values here */ +``` + diff --git a/docs/models/ssetypes.md b/docs/models/ssetypes.md index ae06b5e8..372eafee 100644 --- a/docs/models/ssetypes.md +++ b/docs/models/ssetypes.md @@ -2,18 +2,27 @@ Server side events sent when streaming a conversation response. +## Example Usage + +```python +from mistralai.client.models import SSETypes + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: SSETypes = "conversation.response.started" +``` + ## Values -| Name | Value | -| ------------------------------- | ------------------------------- | -| `CONVERSATION_RESPONSE_STARTED` | conversation.response.started | -| `CONVERSATION_RESPONSE_DONE` | conversation.response.done | -| `CONVERSATION_RESPONSE_ERROR` | conversation.response.error | -| `MESSAGE_OUTPUT_DELTA` | message.output.delta | -| `TOOL_EXECUTION_STARTED` | tool.execution.started | -| `TOOL_EXECUTION_DELTA` | tool.execution.delta | -| `TOOL_EXECUTION_DONE` | tool.execution.done | -| `AGENT_HANDOFF_STARTED` | agent.handoff.started | -| `AGENT_HANDOFF_DONE` | agent.handoff.done | -| `FUNCTION_CALL_DELTA` | function.call.delta | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"conversation.response.started"` +- `"conversation.response.done"` +- `"conversation.response.error"` +- `"message.output.delta"` +- `"tool.execution.started"` +- `"tool.execution.delta"` +- `"tool.execution.done"` +- `"agent.handoff.started"` +- `"agent.handoff.done"` +- `"function.call.delta"` diff --git a/docs/models/status.md b/docs/models/status.md deleted file mode 100644 index 5e22eb73..00000000 --- a/docs/models/status.md +++ /dev/null @@ -1,19 +0,0 @@ -# Status - -The current status of the fine-tuning job. - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `QUEUED` | QUEUED | -| `STARTED` | STARTED | -| `VALIDATING` | VALIDATING | -| `VALIDATED` | VALIDATED | -| `RUNNING` | RUNNING | -| `FAILED_VALIDATION` | FAILED_VALIDATION | -| `FAILED` | FAILED | -| `SUCCESS` | SUCCESS | -| `CANCELLED` | CANCELLED | -| `CANCELLATION_REQUESTED` | CANCELLATION_REQUESTED | \ No newline at end of file diff --git a/docs/models/stop.md b/docs/models/stop.md deleted file mode 100644 index ba40ca83..00000000 --- a/docs/models/stop.md +++ /dev/null @@ -1,19 +0,0 @@ -# Stop - -Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[str]` - -```python -value: List[str] = /* values here */ -``` - diff --git a/docs/models/streameventssepayload.md b/docs/models/streameventssepayload.md new file mode 100644 index 00000000..6ec6726a --- /dev/null +++ b/docs/models/streameventssepayload.md @@ -0,0 +1,13 @@ +# StreamEventSsePayload + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `stream` | *str* | :heavy_check_mark: | N/A | +| `timestamp` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `data` | [models.StreamEventSsePayloadData](../models/streameventssepayloaddata.md) | :heavy_check_mark: | N/A | +| `workflow_context` | [models.StreamEventWorkflowContext](../models/streameventworkflowcontext.md) | :heavy_check_mark: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `broker_sequence` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/streameventssepayloaddata.md b/docs/models/streameventssepayloaddata.md new file mode 100644 index 00000000..61e65562 --- /dev/null +++ b/docs/models/streameventssepayloaddata.md @@ -0,0 +1,107 @@ +# StreamEventSsePayloadData + + +## Supported Types + +### `models.WorkflowExecutionStartedResponse` + +```python +value: models.WorkflowExecutionStartedResponse = /* values here */ +``` + +### `models.WorkflowExecutionCompletedResponse` + +```python +value: models.WorkflowExecutionCompletedResponse = /* values here */ +``` + +### `models.WorkflowExecutionFailedResponse` + +```python +value: models.WorkflowExecutionFailedResponse = /* values here */ +``` + +### `models.WorkflowExecutionCanceledResponse` + +```python +value: models.WorkflowExecutionCanceledResponse = /* values here */ +``` + +### `models.WorkflowExecutionContinuedAsNewResponse` + +```python +value: models.WorkflowExecutionContinuedAsNewResponse = /* values here */ +``` + +### `models.WorkflowTaskTimedOutResponse` + +```python +value: models.WorkflowTaskTimedOutResponse = /* values here */ +``` + +### `models.WorkflowTaskFailedResponse` + +```python +value: models.WorkflowTaskFailedResponse = /* values here */ +``` + +### `models.CustomTaskStartedResponse` + +```python +value: models.CustomTaskStartedResponse = /* values here */ +``` + +### `models.CustomTaskInProgressResponse` + +```python +value: models.CustomTaskInProgressResponse = /* values here */ +``` + +### `models.CustomTaskCompletedResponse` + +```python +value: models.CustomTaskCompletedResponse = /* values here */ +``` + +### `models.CustomTaskFailedResponse` + +```python +value: models.CustomTaskFailedResponse = /* values here */ +``` + +### `models.CustomTaskTimedOutResponse` + +```python +value: models.CustomTaskTimedOutResponse = /* values here */ +``` + +### `models.CustomTaskCanceledResponse` + +```python +value: models.CustomTaskCanceledResponse = /* values here */ +``` + +### `models.ActivityTaskStartedResponse` + +```python +value: models.ActivityTaskStartedResponse = /* values here */ +``` + +### `models.ActivityTaskCompletedResponse` + +```python +value: models.ActivityTaskCompletedResponse = /* values here */ +``` + +### `models.ActivityTaskRetryingResponse` + +```python +value: models.ActivityTaskRetryingResponse = /* values here */ +``` + +### `models.ActivityTaskFailedResponse` + +```python +value: models.ActivityTaskFailedResponse = /* values here */ +``` + diff --git a/docs/models/streameventworkflowcontext.md b/docs/models/streameventworkflowcontext.md new file mode 100644 index 00000000..098f48fd --- /dev/null +++ b/docs/models/streameventworkflowcontext.md @@ -0,0 +1,12 @@ +# StreamEventWorkflowContext + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `namespace` | *str* | :heavy_check_mark: | N/A | +| `workflow_name` | *str* | :heavy_check_mark: | N/A | +| `workflow_exec_id` | *str* | :heavy_check_mark: | N/A | +| `parent_workflow_exec_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `root_workflow_exec_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/streamv1workflowsexecutionsexecutionidstreamgetrequest.md b/docs/models/streamv1workflowsexecutionsexecutionidstreamgetrequest.md new file mode 100644 index 00000000..19d02a40 --- /dev/null +++ b/docs/models/streamv1workflowsexecutionsexecutionidstreamgetrequest.md @@ -0,0 +1,10 @@ +# StreamV1WorkflowsExecutionsExecutionIDStreamGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `event_source` | [OptionalNullable[models.EventSource]](../models/eventsource.md) | :heavy_minus_sign: | N/A | +| `last_event_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/streamv1workflowsexecutionsexecutionidstreamgetresponsebody.md b/docs/models/streamv1workflowsexecutionsexecutionidstreamgetresponsebody.md new file mode 100644 index 00000000..e12bb938 --- /dev/null +++ b/docs/models/streamv1workflowsexecutionsexecutionidstreamgetresponsebody.md @@ -0,0 +1,13 @@ +# StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody + +Stream of Server-Sent Events (SSE) + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `event` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `data` | [Optional[models.StreamEventSsePayload]](../models/streameventssepayload.md) | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `retry` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/supportedoperator.md b/docs/models/supportedoperator.md new file mode 100644 index 00000000..97dbd4b1 --- /dev/null +++ b/docs/models/supportedoperator.md @@ -0,0 +1,35 @@ +# SupportedOperator + +## Example Usage + +```python +from mistralai.client.models import SupportedOperator + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: SupportedOperator = "lt" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"lt"` +- `"lte"` +- `"gt"` +- `"gte"` +- `"startswith"` +- `"istartswith"` +- `"endswith"` +- `"iendswith"` +- `"contains"` +- `"icontains"` +- `"matches"` +- `"notcontains"` +- `"inotcontains"` +- `"eq"` +- `"neq"` +- `"isnull"` +- `"includes"` +- `"excludes"` +- `"len_eq"` diff --git a/docs/models/systemmessage.md b/docs/models/systemmessage.md index 0dba71c0..10bda10f 100644 --- a/docs/models/systemmessage.md +++ b/docs/models/systemmessage.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.Role]](../models/role.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `role` | *Literal["system"]* | :heavy_check_mark: | N/A | +| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/tableformat.md b/docs/models/tableformat.md new file mode 100644 index 00000000..8321a309 --- /dev/null +++ b/docs/models/tableformat.md @@ -0,0 +1,14 @@ +# TableFormat + +## Example Usage + +```python +from mistralai.client.models import TableFormat +value: TableFormat = "markdown" +``` + + +## Values + +- `"markdown"` +- `"html"` diff --git a/docs/models/tasksupport.md b/docs/models/tasksupport.md new file mode 100644 index 00000000..2d16da9d --- /dev/null +++ b/docs/models/tasksupport.md @@ -0,0 +1,19 @@ +# TaskSupport + +## Example Usage + +```python +from mistralai.client.models import TaskSupport + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: TaskSupport = "forbidden" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"forbidden"` +- `"optional"` +- `"required"` diff --git a/docs/models/tempogettraceresponse.md b/docs/models/tempogettraceresponse.md new file mode 100644 index 00000000..cc4a4e93 --- /dev/null +++ b/docs/models/tempogettraceresponse.md @@ -0,0 +1,14 @@ +# TempoGetTraceResponse + +Trace response in OpenTelemetry format. + +This is the unified trace format used across all trace providers (Tempo, ClickHouse, etc.). +Regardless of the underlying backend, all trace data is normalized to this Tempo-compatible +OpenTelemetry format to ensure consistency in the API response structure. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `batches` | List[[models.TempoTraceBatch](../models/tempotracebatch.md)] | :heavy_minus_sign: | The batches of the trace | \ No newline at end of file diff --git a/docs/models/tempotraceattribute.md b/docs/models/tempotraceattribute.md new file mode 100644 index 00000000..6061df86 --- /dev/null +++ b/docs/models/tempotraceattribute.md @@ -0,0 +1,9 @@ +# TempoTraceAttribute + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `key` | *str* | :heavy_check_mark: | The key of the attribute | +| `value` | [models.TempoTraceAttributeValue](../models/tempotraceattributevalue.md) | :heavy_check_mark: | The value of the attribute | \ No newline at end of file diff --git a/docs/models/tempotraceattributearraycontainer.md b/docs/models/tempotraceattributearraycontainer.md new file mode 100644 index 00000000..049dce7d --- /dev/null +++ b/docs/models/tempotraceattributearraycontainer.md @@ -0,0 +1,8 @@ +# TempoTraceAttributeArrayContainer + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `values` | List[[models.TempoTraceAttributeArrayElement](../models/tempotraceattributearrayelement.md)] | :heavy_minus_sign: | The values of the array | \ No newline at end of file diff --git a/docs/models/tempotraceattributearrayelement.md b/docs/models/tempotraceattributearrayelement.md new file mode 100644 index 00000000..a4b82080 --- /dev/null +++ b/docs/models/tempotraceattributearrayelement.md @@ -0,0 +1,10 @@ +# TempoTraceAttributeArrayElement + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `string_value` | *OptionalNullable[str]* | :heavy_minus_sign: | A string element in the array | +| `int_value` | *OptionalNullable[str]* | :heavy_minus_sign: | An integer element in the array | +| `bool_value` | *OptionalNullable[bool]* | :heavy_minus_sign: | A boolean element in the array | \ No newline at end of file diff --git a/docs/models/tempotraceattributearrayvalue.md b/docs/models/tempotraceattributearrayvalue.md new file mode 100644 index 00000000..b763756f --- /dev/null +++ b/docs/models/tempotraceattributearrayvalue.md @@ -0,0 +1,8 @@ +# TempoTraceAttributeArrayValue + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `array_value` | [models.TempoTraceAttributeArrayContainer](../models/tempotraceattributearraycontainer.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/tempotraceattributeboolvalue.md b/docs/models/tempotraceattributeboolvalue.md new file mode 100644 index 00000000..07b77e43 --- /dev/null +++ b/docs/models/tempotraceattributeboolvalue.md @@ -0,0 +1,8 @@ +# TempoTraceAttributeBoolValue + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `bool_value` | *bool* | :heavy_check_mark: | The boolean value of the attribute | \ No newline at end of file diff --git a/docs/models/tempotraceattributeintvalue.md b/docs/models/tempotraceattributeintvalue.md new file mode 100644 index 00000000..5c47f1eb --- /dev/null +++ b/docs/models/tempotraceattributeintvalue.md @@ -0,0 +1,8 @@ +# TempoTraceAttributeIntValue + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `int_value` | *str* | :heavy_check_mark: | The integer value of the attribute | \ No newline at end of file diff --git a/docs/models/tempotraceattributestringvalue.md b/docs/models/tempotraceattributestringvalue.md new file mode 100644 index 00000000..61e7eb8a --- /dev/null +++ b/docs/models/tempotraceattributestringvalue.md @@ -0,0 +1,8 @@ +# TempoTraceAttributeStringValue + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `string_value` | *str* | :heavy_check_mark: | The string value of the attribute | \ No newline at end of file diff --git a/docs/models/tempotraceattributevalue.md b/docs/models/tempotraceattributevalue.md new file mode 100644 index 00000000..3b0a1869 --- /dev/null +++ b/docs/models/tempotraceattributevalue.md @@ -0,0 +1,31 @@ +# TempoTraceAttributeValue + +The value of the attribute + + +## Supported Types + +### `models.TempoTraceAttributeStringValue` + +```python +value: models.TempoTraceAttributeStringValue = /* values here */ +``` + +### `models.TempoTraceAttributeIntValue` + +```python +value: models.TempoTraceAttributeIntValue = /* values here */ +``` + +### `models.TempoTraceAttributeBoolValue` + +```python +value: models.TempoTraceAttributeBoolValue = /* values here */ +``` + +### `models.TempoTraceAttributeArrayValue` + +```python +value: models.TempoTraceAttributeArrayValue = /* values here */ +``` + diff --git a/docs/models/tempotracebatch.md b/docs/models/tempotracebatch.md new file mode 100644 index 00000000..1e7779a2 --- /dev/null +++ b/docs/models/tempotracebatch.md @@ -0,0 +1,9 @@ +# TempoTraceBatch + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `resource` | [models.TempoTraceResource](../models/tempotraceresource.md) | :heavy_check_mark: | N/A | +| `scope_spans` | List[[models.TempoTraceScopeSpan](../models/tempotracescopespan.md)] | :heavy_minus_sign: | The spans of the scope | \ No newline at end of file diff --git a/docs/models/tempotraceevent.md b/docs/models/tempotraceevent.md new file mode 100644 index 00000000..e456fa7c --- /dev/null +++ b/docs/models/tempotraceevent.md @@ -0,0 +1,10 @@ +# TempoTraceEvent + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the event | +| `time_unix_nano` | *str* | :heavy_check_mark: | The time of the event in Unix nano | +| `attributes` | List[[models.TempoTraceAttribute](../models/tempotraceattribute.md)] | :heavy_minus_sign: | The attributes of the event | \ No newline at end of file diff --git a/docs/models/tempotraceresource.md b/docs/models/tempotraceresource.md new file mode 100644 index 00000000..0d0e2ded --- /dev/null +++ b/docs/models/tempotraceresource.md @@ -0,0 +1,8 @@ +# TempoTraceResource + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `attributes` | List[[models.TempoTraceAttribute](../models/tempotraceattribute.md)] | :heavy_minus_sign: | The attributes of the resource | \ No newline at end of file diff --git a/docs/models/tempotracescope.md b/docs/models/tempotracescope.md new file mode 100644 index 00000000..f3678a9f --- /dev/null +++ b/docs/models/tempotracescope.md @@ -0,0 +1,8 @@ +# TempoTraceScope + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the span | \ No newline at end of file diff --git a/docs/models/tempotracescopekind.md b/docs/models/tempotracescopekind.md new file mode 100644 index 00000000..e08cc9be --- /dev/null +++ b/docs/models/tempotracescopekind.md @@ -0,0 +1,19 @@ +# TempoTraceScopeKind + +## Example Usage + +```python +from mistralai.client.models import TempoTraceScopeKind + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: TempoTraceScopeKind = "SPAN_KIND_INTERNAL" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"SPAN_KIND_INTERNAL"` +- `"SPAN_KIND_SERVER"` +- `"SPAN_KIND_CLIENT"` diff --git a/docs/models/tempotracescopespan.md b/docs/models/tempotracescopespan.md new file mode 100644 index 00000000..e3b6d58a --- /dev/null +++ b/docs/models/tempotracescopespan.md @@ -0,0 +1,9 @@ +# TempoTraceScopeSpan + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `scope` | [models.TempoTraceScope](../models/tempotracescope.md) | :heavy_check_mark: | N/A | +| `spans` | List[[models.TempoTraceSpan](../models/tempotracespan.md)] | :heavy_minus_sign: | The spans of the scope | \ No newline at end of file diff --git a/docs/models/tempotracespan.md b/docs/models/tempotracespan.md new file mode 100644 index 00000000..f657acc6 --- /dev/null +++ b/docs/models/tempotracespan.md @@ -0,0 +1,16 @@ +# TempoTraceSpan + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `trace_id` | *str* | :heavy_check_mark: | The trace ID of the scope | +| `span_id` | *str* | :heavy_check_mark: | The span ID of the scope | +| `parent_span_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The parent span ID of the scope | +| `name` | *str* | :heavy_check_mark: | The name of the scope | +| `kind` | [models.TempoTraceScopeKind](../models/tempotracescopekind.md) | :heavy_check_mark: | N/A | +| `start_time_unix_nano` | *str* | :heavy_check_mark: | The start time of the scope in Unix nano | +| `end_time_unix_nano` | *str* | :heavy_check_mark: | The end time of the scope in Unix nano | +| `attributes` | List[[models.TempoTraceAttribute](../models/tempotraceattribute.md)] | :heavy_minus_sign: | The attributes of the scope | +| `events` | List[[models.TempoTraceEvent](../models/tempotraceevent.md)] | :heavy_minus_sign: | The events of the scope | \ No newline at end of file diff --git a/docs/models/terminateworkflowexecutionv1workflowsexecutionsexecutionidterminatepostrequest.md b/docs/models/terminateworkflowexecutionv1workflowsexecutionsexecutionidterminatepostrequest.md new file mode 100644 index 00000000..227066fb --- /dev/null +++ b/docs/models/terminateworkflowexecutionv1workflowsexecutionsexecutionidterminatepostrequest.md @@ -0,0 +1,8 @@ +# TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `execution_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/textchunk.md b/docs/models/textchunk.md index d488cb51..df0e61c3 100644 --- a/docs/models/textchunk.md +++ b/docs/models/textchunk.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `text` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.TextChunkType]](../models/textchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `type` | *Optional[Literal["text"]]* | :heavy_minus_sign: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/textchunktype.md b/docs/models/textchunktype.md deleted file mode 100644 index e2a2ae8b..00000000 --- a/docs/models/textchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# TextChunkType - - -## Values - -| Name | Value | -| ------ | ------ | -| `TEXT` | text | \ No newline at end of file diff --git a/docs/models/textcontent.md b/docs/models/textcontent.md new file mode 100644 index 00000000..ddd2df02 --- /dev/null +++ b/docs/models/textcontent.md @@ -0,0 +1,14 @@ +# TextContent + +Text content for a message. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | *Literal["text"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `annotations` | [OptionalNullable[models.Annotations]](../models/annotations.md) | :heavy_minus_sign: | N/A | +| `meta` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/textresourcecontents.md b/docs/models/textresourcecontents.md new file mode 100644 index 00000000..daa531e1 --- /dev/null +++ b/docs/models/textresourcecontents.md @@ -0,0 +1,14 @@ +# TextResourceContents + +Text contents of a resource. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `uri` | *str* | :heavy_check_mark: | N/A | +| `mime_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `meta` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/thinkchunk.md b/docs/models/thinkchunk.md index 66b2e0cd..b7494bee 100644 --- a/docs/models/thinkchunk.md +++ b/docs/models/thinkchunk.md @@ -5,6 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `type` | *Optional[Literal["thinking"]]* | :heavy_minus_sign: | N/A | | `thinking` | List[[models.Thinking](../models/thinking.md)] | :heavy_check_mark: | N/A | -| `closed` | *Optional[bool]* | :heavy_minus_sign: | Whether the thinking chunk is closed or not. Currently only used for prefixing. | -| `type` | [Optional[models.ThinkChunkType]](../models/thinkchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | Signature to replay some reasoning blocks across turns. | +| `closed` | *Optional[bool]* | :heavy_minus_sign: | Whether the thinking chunk is closed or not. Currently only used for prefixing. | \ No newline at end of file diff --git a/docs/models/thinkchunktype.md b/docs/models/thinkchunktype.md deleted file mode 100644 index baf6f755..00000000 --- a/docs/models/thinkchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ThinkChunkType - - -## Values - -| Name | Value | -| ---------- | ---------- | -| `THINKING` | thinking | \ No newline at end of file diff --git a/docs/models/thinking.md b/docs/models/thinking.md index c7a0d5c9..d9e51d7d 100644 --- a/docs/models/thinking.md +++ b/docs/models/thinking.md @@ -3,15 +3,21 @@ ## Supported Types -### `models.ReferenceChunk` +### `models.TextChunk` ```python -value: models.ReferenceChunk = /* values here */ +value: models.TextChunk = /* values here */ ``` -### `models.TextChunk` +### `models.ToolReferenceChunk` ```python -value: models.TextChunk = /* values here */ +value: models.ToolReferenceChunk = /* values here */ +``` + +### `models.ReferenceChunk` + +```python +value: models.ReferenceChunk = /* values here */ ``` diff --git a/docs/models/timeseriesmetric.md b/docs/models/timeseriesmetric.md new file mode 100644 index 00000000..2b5fc61d --- /dev/null +++ b/docs/models/timeseriesmetric.md @@ -0,0 +1,10 @@ +# TimeSeriesMetric + +Time-series metric with timestamp-value pairs. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `value` | List[List[[models.TimeSeriesMetricValue2](../models/timeseriesmetricvalue2.md)]] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/timeseriesmetricvalue1.md b/docs/models/timeseriesmetricvalue1.md new file mode 100644 index 00000000..f1783455 --- /dev/null +++ b/docs/models/timeseriesmetricvalue1.md @@ -0,0 +1,17 @@ +# TimeSeriesMetricValue1 + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/models/timeseriesmetricvalue2.md b/docs/models/timeseriesmetricvalue2.md new file mode 100644 index 00000000..c6ba5eca --- /dev/null +++ b/docs/models/timeseriesmetricvalue2.md @@ -0,0 +1,17 @@ +# TimeSeriesMetricValue2 + + +## Supported Types + +### `int` + +```python +value: int = /* values here */ +``` + +### `models.TimeSeriesMetricValue1` + +```python +value: models.TimeSeriesMetricValue1 = /* values here */ +``` + diff --git a/docs/models/timestampgranularity.md b/docs/models/timestampgranularity.md index 0d2a8054..4c84779c 100644 --- a/docs/models/timestampgranularity.md +++ b/docs/models/timestampgranularity.md @@ -1,8 +1,14 @@ # TimestampGranularity +## Example Usage + +```python +from mistralai.client.models import TimestampGranularity +value: TimestampGranularity = "segment" +``` + ## Values -| Name | Value | -| --------- | --------- | -| `SEGMENT` | segment | \ No newline at end of file +- `"segment"` +- `"word"` diff --git a/docs/models/tool.md b/docs/models/tool.md index fb661f72..85888d01 100644 --- a/docs/models/tool.md +++ b/docs/models/tool.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | -| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `type` | *Union[Literal["function"], UnrecognizedStr]* | :heavy_check_mark: | N/A | +| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/toolannotations.md b/docs/models/toolannotations.md new file mode 100644 index 00000000..f3c8fc3c --- /dev/null +++ b/docs/models/toolannotations.md @@ -0,0 +1,22 @@ +# ToolAnnotations + +Additional properties describing a Tool to clients. + +NOTE: all properties in ToolAnnotations are **hints**. +They are not guaranteed to provide a faithful description of +tool behavior (including descriptive properties like `title`). + +Clients should never make tool use decisions based on ToolAnnotations +received from untrusted servers. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `read_only_hint` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `destructive_hint` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `idempotent_hint` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `open_world_hint` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolcall.md b/docs/models/toolcall.md index 3819236b..9d236e8b 100644 --- a/docs/models/toolcall.md +++ b/docs/models/toolcall.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | -| `function` | [models.FunctionCall](../models/functioncall.md) | :heavy_check_mark: | N/A | -| `index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `type` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `function` | [models.FunctionCall](../models/functioncall.md) | :heavy_check_mark: | N/A | +| `index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolcallconfirmation.md b/docs/models/toolcallconfirmation.md new file mode 100644 index 00000000..1812f7d6 --- /dev/null +++ b/docs/models/toolcallconfirmation.md @@ -0,0 +1,9 @@ +# ToolCallConfirmation + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `tool_call_id` | *str* | :heavy_check_mark: | N/A | +| `confirmation` | [models.Confirmation](../models/confirmation.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/toolchoice.md b/docs/models/toolchoice.md index 373046bb..a457f96f 100644 --- a/docs/models/toolchoice.md +++ b/docs/models/toolchoice.md @@ -7,5 +7,5 @@ ToolChoice is either a ToolChoiceEnum or a ToolChoice | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | +| `type` | *Optional[str]* | :heavy_minus_sign: | N/A | | `function` | [models.FunctionName](../models/functionname.md) | :heavy_check_mark: | this restriction of `Function` is used to select a specific function to call | \ No newline at end of file diff --git a/docs/models/toolchoiceenum.md b/docs/models/toolchoiceenum.md index 0be3d6c5..eb1f3629 100644 --- a/docs/models/toolchoiceenum.md +++ b/docs/models/toolchoiceenum.md @@ -1,11 +1,20 @@ # ToolChoiceEnum +## Example Usage + +```python +from mistralai.client.models import ToolChoiceEnum + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ToolChoiceEnum = "auto" +``` + ## Values -| Name | Value | -| ---------- | ---------- | -| `AUTO` | auto | -| `NONE` | none | -| `ANY` | any | -| `REQUIRED` | required | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"auto"` +- `"none"` +- `"any"` +- `"required"` diff --git a/docs/models/toolconfiguration.md b/docs/models/toolconfiguration.md new file mode 100644 index 00000000..89286a17 --- /dev/null +++ b/docs/models/toolconfiguration.md @@ -0,0 +1,10 @@ +# ToolConfiguration + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `exclude` | List[*str*] | :heavy_minus_sign: | N/A | +| `include` | List[*str*] | :heavy_minus_sign: | N/A | +| `requires_confirmation` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolexecution.md b/docs/models/toolexecution.md new file mode 100644 index 00000000..8d385132 --- /dev/null +++ b/docs/models/toolexecution.md @@ -0,0 +1,11 @@ +# ToolExecution + +Execution-related properties for a tool. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `task_support` | [OptionalNullable[models.TaskSupport]](../models/tasksupport.md) | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolexecutiondeltaevent.md b/docs/models/toolexecutiondeltaevent.md index bfc9dc0e..7066f348 100644 --- a/docs/models/toolexecutiondeltaevent.md +++ b/docs/models/toolexecutiondeltaevent.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `type` | [Optional[models.ToolExecutionDeltaEventType]](../models/toolexecutiondeltaeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | -| `arguments` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `type` | *Literal["tool.execution.delta"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | [models.ToolExecutionDeltaEventName](../models/toolexecutiondeltaeventname.md) | :heavy_check_mark: | N/A | +| `arguments` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/toolexecutiondeltaeventname.md b/docs/models/toolexecutiondeltaeventname.md new file mode 100644 index 00000000..9c3edef8 --- /dev/null +++ b/docs/models/toolexecutiondeltaeventname.md @@ -0,0 +1,17 @@ +# ToolExecutionDeltaEventName + + +## Supported Types + +### `models.BuiltInConnectors` + +```python +value: models.BuiltInConnectors = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/toolexecutiondeltaeventtype.md b/docs/models/toolexecutiondeltaeventtype.md deleted file mode 100644 index a4a2f8cc..00000000 --- a/docs/models/toolexecutiondeltaeventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolExecutionDeltaEventType - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `TOOL_EXECUTION_DELTA` | tool.execution.delta | \ No newline at end of file diff --git a/docs/models/toolexecutiondoneevent.md b/docs/models/toolexecutiondoneevent.md index aa28df59..b2d81be3 100644 --- a/docs/models/toolexecutiondoneevent.md +++ b/docs/models/toolexecutiondoneevent.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `type` | [Optional[models.ToolExecutionDoneEventType]](../models/toolexecutiondoneeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | -| `info` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `type` | *Literal["tool.execution.done"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | [models.ToolExecutionDoneEventName](../models/toolexecutiondoneeventname.md) | :heavy_check_mark: | N/A | +| `info` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolexecutiondoneeventname.md b/docs/models/toolexecutiondoneeventname.md new file mode 100644 index 00000000..6449079d --- /dev/null +++ b/docs/models/toolexecutiondoneeventname.md @@ -0,0 +1,17 @@ +# ToolExecutionDoneEventName + + +## Supported Types + +### `models.BuiltInConnectors` + +```python +value: models.BuiltInConnectors = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/toolexecutiondoneeventtype.md b/docs/models/toolexecutiondoneeventtype.md deleted file mode 100644 index 872624c1..00000000 --- a/docs/models/toolexecutiondoneeventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolExecutionDoneEventType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `TOOL_EXECUTION_DONE` | tool.execution.done | \ No newline at end of file diff --git a/docs/models/toolexecutionentry.md b/docs/models/toolexecutionentry.md index 174abdd1..03316381 100644 --- a/docs/models/toolexecutionentry.md +++ b/docs/models/toolexecutionentry.md @@ -3,13 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `object` | [Optional[models.ToolExecutionEntryObject]](../models/toolexecutionentryobject.md) | :heavy_minus_sign: | N/A | -| `type` | [Optional[models.ToolExecutionEntryType]](../models/toolexecutionentrytype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | -| `arguments` | *str* | :heavy_check_mark: | N/A | -| `info` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `object` | *Optional[Literal["entry"]]* | :heavy_minus_sign: | N/A | +| `type` | *Optional[Literal["tool.execution"]]* | :heavy_minus_sign: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `completed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `name` | [models.ToolExecutionEntryName](../models/toolexecutionentryname.md) | :heavy_check_mark: | N/A | +| `arguments` | *str* | :heavy_check_mark: | N/A | +| `info` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolexecutionentryname.md b/docs/models/toolexecutionentryname.md new file mode 100644 index 00000000..fb762a53 --- /dev/null +++ b/docs/models/toolexecutionentryname.md @@ -0,0 +1,17 @@ +# ToolExecutionEntryName + + +## Supported Types + +### `models.BuiltInConnectors` + +```python +value: models.BuiltInConnectors = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/toolexecutionentryobject.md b/docs/models/toolexecutionentryobject.md deleted file mode 100644 index 0ca79af5..00000000 --- a/docs/models/toolexecutionentryobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolExecutionEntryObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `ENTRY` | entry | \ No newline at end of file diff --git a/docs/models/toolexecutionentrytype.md b/docs/models/toolexecutionentrytype.md deleted file mode 100644 index a67629b8..00000000 --- a/docs/models/toolexecutionentrytype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolExecutionEntryType - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `TOOL_EXECUTION` | tool.execution | \ No newline at end of file diff --git a/docs/models/toolexecutionstartedevent.md b/docs/models/toolexecutionstartedevent.md index 82ea65e5..189b8a3d 100644 --- a/docs/models/toolexecutionstartedevent.md +++ b/docs/models/toolexecutionstartedevent.md @@ -3,11 +3,13 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `type` | [Optional[models.ToolExecutionStartedEventType]](../models/toolexecutionstartedeventtype.md) | :heavy_minus_sign: | N/A | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `name` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | -| `arguments` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `type` | *Literal["tool.execution.started"]* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `output_index` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | [models.ToolExecutionStartedEventName](../models/toolexecutionstartedeventname.md) | :heavy_check_mark: | N/A | +| `arguments` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/toolexecutionstartedeventname.md b/docs/models/toolexecutionstartedeventname.md new file mode 100644 index 00000000..3308c483 --- /dev/null +++ b/docs/models/toolexecutionstartedeventname.md @@ -0,0 +1,17 @@ +# ToolExecutionStartedEventName + + +## Supported Types + +### `models.BuiltInConnectors` + +```python +value: models.BuiltInConnectors = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/toolexecutionstartedeventtype.md b/docs/models/toolexecutionstartedeventtype.md deleted file mode 100644 index 56695d1f..00000000 --- a/docs/models/toolexecutionstartedeventtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolExecutionStartedEventType - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `TOOL_EXECUTION_STARTED` | tool.execution.started | \ No newline at end of file diff --git a/docs/models/toolfilechunk.md b/docs/models/toolfilechunk.md index f1b54c7c..d6002175 100644 --- a/docs/models/toolfilechunk.md +++ b/docs/models/toolfilechunk.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `type` | [Optional[models.ToolFileChunkType]](../models/toolfilechunktype.md) | :heavy_minus_sign: | N/A | -| `tool` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | -| `file_id` | *str* | :heavy_check_mark: | N/A | -| `file_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `file_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `type` | *Optional[Literal["tool_file"]]* | :heavy_minus_sign: | N/A | +| `tool` | [models.ToolFileChunkTool](../models/toolfilechunktool.md) | :heavy_check_mark: | N/A | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `file_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `file_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolfilechunktool.md b/docs/models/toolfilechunktool.md new file mode 100644 index 00000000..aa5ac8a9 --- /dev/null +++ b/docs/models/toolfilechunktool.md @@ -0,0 +1,17 @@ +# ToolFileChunkTool + + +## Supported Types + +### `models.BuiltInConnectors` + +```python +value: models.BuiltInConnectors = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/toolfilechunktype.md b/docs/models/toolfilechunktype.md deleted file mode 100644 index 7e99acef..00000000 --- a/docs/models/toolfilechunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolFileChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `TOOL_FILE` | tool_file | \ No newline at end of file diff --git a/docs/models/toolmessage.md b/docs/models/toolmessage.md index a54f4933..7201481e 100644 --- a/docs/models/toolmessage.md +++ b/docs/models/toolmessage.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `role` | *Literal["tool"]* | :heavy_check_mark: | N/A | | `content` | [Nullable[models.ToolMessageContent]](../models/toolmessagecontent.md) | :heavy_check_mark: | N/A | | `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.ToolMessageRole]](../models/toolmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolmessagerole.md b/docs/models/toolmessagerole.md deleted file mode 100644 index c24e59c0..00000000 --- a/docs/models/toolmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `TOOL` | tool | \ No newline at end of file diff --git a/docs/models/toolreferencechunk.md b/docs/models/toolreferencechunk.md index af447aee..49ea4ca7 100644 --- a/docs/models/toolreferencechunk.md +++ b/docs/models/toolreferencechunk.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `type` | [Optional[models.ToolReferenceChunkType]](../models/toolreferencechunktype.md) | :heavy_minus_sign: | N/A | -| `tool` | [models.BuiltInConnectors](../models/builtinconnectors.md) | :heavy_check_mark: | N/A | -| `title` | *str* | :heavy_check_mark: | N/A | -| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `favicon` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | *Optional[Literal["tool_reference"]]* | :heavy_minus_sign: | N/A | +| `tool` | [models.ToolReferenceChunkTool](../models/toolreferencechunktool.md) | :heavy_check_mark: | N/A | +| `title` | *str* | :heavy_check_mark: | N/A | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `favicon` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/toolreferencechunktool.md b/docs/models/toolreferencechunktool.md new file mode 100644 index 00000000..999f7c34 --- /dev/null +++ b/docs/models/toolreferencechunktool.md @@ -0,0 +1,17 @@ +# ToolReferenceChunkTool + + +## Supported Types + +### `models.BuiltInConnectors` + +```python +value: models.BuiltInConnectors = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/toolreferencechunktype.md b/docs/models/toolreferencechunktype.md deleted file mode 100644 index bc57d277..00000000 --- a/docs/models/toolreferencechunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolReferenceChunkType - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `TOOL_REFERENCE` | tool_reference | \ No newline at end of file diff --git a/docs/models/tools.md b/docs/models/tools.md deleted file mode 100644 index f308d732..00000000 --- a/docs/models/tools.md +++ /dev/null @@ -1,41 +0,0 @@ -# Tools - - -## Supported Types - -### `models.CodeInterpreterTool` - -```python -value: models.CodeInterpreterTool = /* values here */ -``` - -### `models.DocumentLibraryTool` - -```python -value: models.DocumentLibraryTool = /* values here */ -``` - -### `models.FunctionTool` - -```python -value: models.FunctionTool = /* values here */ -``` - -### `models.ImageGenerationTool` - -```python -value: models.ImageGenerationTool = /* values here */ -``` - -### `models.WebSearchTool` - -```python -value: models.WebSearchTool = /* values here */ -``` - -### `models.WebSearchPremiumTool` - -```python -value: models.WebSearchPremiumTool = /* values here */ -``` - diff --git a/docs/models/tooltype.md b/docs/models/tooltype.md new file mode 100644 index 00000000..2a64e130 --- /dev/null +++ b/docs/models/tooltype.md @@ -0,0 +1,20 @@ +# ToolType + +## Example Usage + +```python +from mistralai.client.models import ToolType + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ToolType = "rag" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"rag"` +- `"image"` +- `"code"` +- `"event"` diff --git a/docs/models/transcriptionsegmentchunk.md b/docs/models/transcriptionsegmentchunk.md index bebc9f72..d7672c0e 100644 --- a/docs/models/transcriptionsegmentchunk.md +++ b/docs/models/transcriptionsegmentchunk.md @@ -3,10 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `text` | *str* | :heavy_check_mark: | N/A | -| `start` | *float* | :heavy_check_mark: | N/A | -| `end` | *float* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.Type]](../models/type.md) | :heavy_minus_sign: | N/A | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `type` | *Optional[Literal["transcription_segment"]]* | :heavy_minus_sign: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `start` | *float* | :heavy_check_mark: | N/A | +| `end` | *float* | :heavy_check_mark: | N/A | +| `score` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `speaker_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/transcriptionstreamdone.md b/docs/models/transcriptionstreamdone.md index 9ecf7d9c..bca69a2b 100644 --- a/docs/models/transcriptionstreamdone.md +++ b/docs/models/transcriptionstreamdone.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | N/A | -| `text` | *str* | :heavy_check_mark: | N/A | -| `segments` | List[[models.TranscriptionSegmentChunk](../models/transcriptionsegmentchunk.md)] | :heavy_minus_sign: | N/A | -| `usage` | [models.UsageInfo](../models/usageinfo.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.TranscriptionStreamDoneType]](../models/transcriptionstreamdonetype.md) | :heavy_minus_sign: | N/A | -| `language` | *Nullable[str]* | :heavy_check_mark: | N/A | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `segments` | List[[models.TranscriptionSegmentChunk](../models/transcriptionsegmentchunk.md)] | :heavy_minus_sign: | N/A | +| `usage` | [models.UsageInfo](../models/usageinfo.md) | :heavy_check_mark: | N/A | +| `type` | *Literal["transcription.done"]* | :heavy_check_mark: | N/A | +| `language` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/transcriptionstreamdonetype.md b/docs/models/transcriptionstreamdonetype.md deleted file mode 100644 index db092c4f..00000000 --- a/docs/models/transcriptionstreamdonetype.md +++ /dev/null @@ -1,8 +0,0 @@ -# TranscriptionStreamDoneType - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `TRANSCRIPTION_DONE` | transcription.done | \ No newline at end of file diff --git a/docs/models/transcriptionstreameventtypes.md b/docs/models/transcriptionstreameventtypes.md index e4eb25a6..9e49384e 100644 --- a/docs/models/transcriptionstreameventtypes.md +++ b/docs/models/transcriptionstreameventtypes.md @@ -1,11 +1,20 @@ # TranscriptionStreamEventTypes +## Example Usage + +```python +from mistralai.client.models import TranscriptionStreamEventTypes + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: TranscriptionStreamEventTypes = "transcription.language" +``` + ## Values -| Name | Value | -| -------------------------- | -------------------------- | -| `TRANSCRIPTION_LANGUAGE` | transcription.language | -| `TRANSCRIPTION_SEGMENT` | transcription.segment | -| `TRANSCRIPTION_TEXT_DELTA` | transcription.text.delta | -| `TRANSCRIPTION_DONE` | transcription.done | \ No newline at end of file +This is an open enum. Unrecognized values will not fail type checks. + +- `"transcription.language"` +- `"transcription.segment"` +- `"transcription.text.delta"` +- `"transcription.done"` diff --git a/docs/models/transcriptionstreamlanguage.md b/docs/models/transcriptionstreamlanguage.md index e16c8fdc..63fcfbc6 100644 --- a/docs/models/transcriptionstreamlanguage.md +++ b/docs/models/transcriptionstreamlanguage.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `type` | [Optional[models.TranscriptionStreamLanguageType]](../models/transcriptionstreamlanguagetype.md) | :heavy_minus_sign: | N/A | -| `audio_language` | *str* | :heavy_check_mark: | N/A | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `type` | *Literal["transcription.language"]* | :heavy_check_mark: | N/A | +| `audio_language` | *str* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/transcriptionstreamlanguagetype.md b/docs/models/transcriptionstreamlanguagetype.md deleted file mode 100644 index e93521e1..00000000 --- a/docs/models/transcriptionstreamlanguagetype.md +++ /dev/null @@ -1,8 +0,0 @@ -# TranscriptionStreamLanguageType - - -## Values - -| Name | Value | -| ------------------------ | ------------------------ | -| `TRANSCRIPTION_LANGUAGE` | transcription.language | \ No newline at end of file diff --git a/docs/models/transcriptionstreamsegmentdelta.md b/docs/models/transcriptionstreamsegmentdelta.md index 3deeedf0..1b652a3b 100644 --- a/docs/models/transcriptionstreamsegmentdelta.md +++ b/docs/models/transcriptionstreamsegmentdelta.md @@ -3,10 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `text` | *str* | :heavy_check_mark: | N/A | -| `start` | *float* | :heavy_check_mark: | N/A | -| `end` | *float* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.TranscriptionStreamSegmentDeltaType]](../models/transcriptionstreamsegmentdeltatype.md) | :heavy_minus_sign: | N/A | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `type` | *Literal["transcription.segment"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `start` | *float* | :heavy_check_mark: | N/A | +| `end` | *float* | :heavy_check_mark: | N/A | +| `speaker_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/transcriptionstreamsegmentdeltatype.md b/docs/models/transcriptionstreamsegmentdeltatype.md deleted file mode 100644 index 03ff3e8b..00000000 --- a/docs/models/transcriptionstreamsegmentdeltatype.md +++ /dev/null @@ -1,8 +0,0 @@ -# TranscriptionStreamSegmentDeltaType - - -## Values - -| Name | Value | -| ----------------------- | ----------------------- | -| `TRANSCRIPTION_SEGMENT` | transcription.segment | \ No newline at end of file diff --git a/docs/models/transcriptionstreamtextdelta.md b/docs/models/transcriptionstreamtextdelta.md index adddfe18..77bd0ddc 100644 --- a/docs/models/transcriptionstreamtextdelta.md +++ b/docs/models/transcriptionstreamtextdelta.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `text` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.TranscriptionStreamTextDeltaType]](../models/transcriptionstreamtextdeltatype.md) | :heavy_minus_sign: | N/A | -| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `type` | *Literal["transcription.text.delta"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/transcriptionstreamtextdeltatype.md b/docs/models/transcriptionstreamtextdeltatype.md deleted file mode 100644 index b7c9d675..00000000 --- a/docs/models/transcriptionstreamtextdeltatype.md +++ /dev/null @@ -1,8 +0,0 @@ -# TranscriptionStreamTextDeltaType - - -## Values - -| Name | Value | -| -------------------------- | -------------------------- | -| `TRANSCRIPTION_TEXT_DELTA` | transcription.text.delta | \ No newline at end of file diff --git a/docs/models/turbinetoollocale.md b/docs/models/turbinetoollocale.md new file mode 100644 index 00000000..283dd339 --- /dev/null +++ b/docs/models/turbinetoollocale.md @@ -0,0 +1,12 @@ +# TurbineToolLocale + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `name` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `description` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `usage_sentence` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `working_description` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `done_description` | Dict[str, *str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/turbinetoolmeta.md b/docs/models/turbinetoolmeta.md new file mode 100644 index 00000000..2f61a2c4 --- /dev/null +++ b/docs/models/turbinetoolmeta.md @@ -0,0 +1,11 @@ +# TurbineToolMeta + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `locale` | [OptionalNullable[models.TurbineToolLocale]](../models/turbinetoollocale.md) | :heavy_minus_sign: | N/A | +| `tool_type` | [OptionalNullable[models.ToolType]](../models/tooltype.md) | :heavy_minus_sign: | N/A | +| `timeout` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `private_execution` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/two.md b/docs/models/two.md deleted file mode 100644 index 59dc2be2..00000000 --- a/docs/models/two.md +++ /dev/null @@ -1,29 +0,0 @@ -# Two - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/docs/models/type.md b/docs/models/type.md deleted file mode 100644 index d05ead75..00000000 --- a/docs/models/type.md +++ /dev/null @@ -1,8 +0,0 @@ -# Type - - -## Values - -| Name | Value | -| ----------------------- | ----------------------- | -| `TRANSCRIPTION_SEGMENT` | transcription_segment | \ No newline at end of file diff --git a/docs/models/unarchiveftmodelout.md b/docs/models/unarchiveftmodelout.md deleted file mode 100644 index 287c9a00..00000000 --- a/docs/models/unarchiveftmodelout.md +++ /dev/null @@ -1,10 +0,0 @@ -# UnarchiveFTModelOut - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | N/A | -| `object` | [Optional[models.UnarchiveFTModelOutObject]](../models/unarchiveftmodeloutobject.md) | :heavy_minus_sign: | N/A | -| `archived` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/unarchiveftmodeloutobject.md b/docs/models/unarchiveftmodeloutobject.md deleted file mode 100644 index 623dcec2..00000000 --- a/docs/models/unarchiveftmodeloutobject.md +++ /dev/null @@ -1,8 +0,0 @@ -# UnarchiveFTModelOutObject - - -## Values - -| Name | Value | -| ------- | ------- | -| `MODEL` | model | \ No newline at end of file diff --git a/docs/models/unarchivemodelresponse.md b/docs/models/unarchivemodelresponse.md new file mode 100644 index 00000000..375962a7 --- /dev/null +++ b/docs/models/unarchivemodelresponse.md @@ -0,0 +1,10 @@ +# UnarchiveModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `object` | *Optional[Literal["model"]]* | :heavy_minus_sign: | N/A | +| `archived` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/unarchiveworkflowv1workflowsworkflowidentifierunarchiveputrequest.md b/docs/models/unarchiveworkflowv1workflowsworkflowidentifierunarchiveputrequest.md new file mode 100644 index 00000000..e25cd4bc --- /dev/null +++ b/docs/models/unarchiveworkflowv1workflowsworkflowidentifierunarchiveputrequest.md @@ -0,0 +1,8 @@ +# UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/unscheduleworkflowv1workflowsschedulesscheduleiddeleterequest.md b/docs/models/unscheduleworkflowv1workflowsschedulesscheduleiddeleterequest.md new file mode 100644 index 00000000..c2bc3373 --- /dev/null +++ b/docs/models/unscheduleworkflowv1workflowsschedulesscheduleiddeleterequest.md @@ -0,0 +1,8 @@ +# UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updateagentrequest.md b/docs/models/updateagentrequest.md new file mode 100644 index 00000000..b8aa01f6 --- /dev/null +++ b/docs/models/updateagentrequest.md @@ -0,0 +1,18 @@ +# UpdateAgentRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | +| `tools` | List[[models.UpdateAgentRequestTool](../models/updateagentrequesttool.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | +| `completion_args` | [Optional[models.CompletionArgs]](../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `guardrails` | List[[models.GuardrailConfig](../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | +| `deployment_chat` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `version_message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/updateagentrequesttool.md b/docs/models/updateagentrequesttool.md new file mode 100644 index 00000000..cf590a2f --- /dev/null +++ b/docs/models/updateagentrequesttool.md @@ -0,0 +1,47 @@ +# UpdateAgentRequestTool + + +## Supported Types + +### `models.CodeInterpreterTool` + +```python +value: models.CodeInterpreterTool = /* values here */ +``` + +### `models.CustomConnector` + +```python +value: models.CustomConnector = /* values here */ +``` + +### `models.DocumentLibraryTool` + +```python +value: models.DocumentLibraryTool = /* values here */ +``` + +### `models.FunctionTool` + +```python +value: models.FunctionTool = /* values here */ +``` + +### `models.ImageGenerationTool` + +```python +value: models.ImageGenerationTool = /* values here */ +``` + +### `models.WebSearchTool` + +```python +value: models.WebSearchTool = /* values here */ +``` + +### `models.WebSearchPremiumTool` + +```python +value: models.WebSearchPremiumTool = /* values here */ +``` + diff --git a/docs/models/updateconnectorrequest.md b/docs/models/updateconnectorrequest.md new file mode 100644 index 00000000..335588ea --- /dev/null +++ b/docs/models/updateconnectorrequest.md @@ -0,0 +1,17 @@ +# UpdateConnectorRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional human-readable title for the connector. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the connector. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the connector. | +| `icon_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The optional url of the icon you want to associate to the connector. | +| `system_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional system prompt for the connector. | +| `connection_config` | Dict[str, *Any*] | :heavy_minus_sign: | Optional new connection config. | +| `connection_secrets` | Dict[str, *Any*] | :heavy_minus_sign: | Optional new connection secrets | +| `server` | *OptionalNullable[str]* | :heavy_minus_sign: | New server url for your mcp connector. | +| `headers` | Dict[str, *Any*] | :heavy_minus_sign: | New headers for your mcp connector. | +| `auth_data` | [OptionalNullable[models.AuthData]](../models/authdata.md) | :heavy_minus_sign: | New authentication data for your mcp connector. | \ No newline at end of file diff --git a/docs/models/updatedatasetrecordpayloadrequest.md b/docs/models/updatedatasetrecordpayloadrequest.md new file mode 100644 index 00000000..f152d843 --- /dev/null +++ b/docs/models/updatedatasetrecordpayloadrequest.md @@ -0,0 +1,8 @@ +# UpdateDatasetRecordPayloadRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `payload` | [models.ConversationPayload](../models/conversationpayload.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatedatasetrecordpayloadv1observabilitydatasetrecordsdatasetrecordidpayloadputrequest.md b/docs/models/updatedatasetrecordpayloadv1observabilitydatasetrecordsdatasetrecordidpayloadputrequest.md new file mode 100644 index 00000000..fbb4b308 --- /dev/null +++ b/docs/models/updatedatasetrecordpayloadv1observabilitydatasetrecordsdatasetrecordidpayloadputrequest.md @@ -0,0 +1,9 @@ +# UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | +| `update_dataset_record_payload_request` | [models.UpdateDatasetRecordPayloadRequest](../models/updatedatasetrecordpayloadrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatedatasetrecordpropertiesrequest.md b/docs/models/updatedatasetrecordpropertiesrequest.md new file mode 100644 index 00000000..6e98944d --- /dev/null +++ b/docs/models/updatedatasetrecordpropertiesrequest.md @@ -0,0 +1,8 @@ +# UpdateDatasetRecordPropertiesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `properties` | Dict[str, *Any*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatedatasetrecordpropertiesv1observabilitydatasetrecordsdatasetrecordidpropertiesputrequest.md b/docs/models/updatedatasetrecordpropertiesv1observabilitydatasetrecordsdatasetrecordidpropertiesputrequest.md new file mode 100644 index 00000000..6b09e479 --- /dev/null +++ b/docs/models/updatedatasetrecordpropertiesv1observabilitydatasetrecordsdatasetrecordidpropertiesputrequest.md @@ -0,0 +1,9 @@ +# UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | +| `update_dataset_record_properties_request` | [models.UpdateDatasetRecordPropertiesRequest](../models/updatedatasetrecordpropertiesrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatedatasetrequest.md b/docs/models/updatedatasetrequest.md new file mode 100644 index 00000000..2a5194e4 --- /dev/null +++ b/docs/models/updatedatasetrequest.md @@ -0,0 +1,9 @@ +# UpdateDatasetRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/updatedatasetv1observabilitydatasetsdatasetidpatchrequest.md b/docs/models/updatedatasetv1observabilitydatasetsdatasetidpatchrequest.md new file mode 100644 index 00000000..78eae8fb --- /dev/null +++ b/docs/models/updatedatasetv1observabilitydatasetsdatasetidpatchrequest.md @@ -0,0 +1,9 @@ +# UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `update_dataset_request` | [models.UpdateDatasetRequest](../models/updatedatasetrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatedefinition.md b/docs/models/updatedefinition.md new file mode 100644 index 00000000..8cf62617 --- /dev/null +++ b/docs/models/updatedefinition.md @@ -0,0 +1,11 @@ +# UpdateDefinition + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name of the update | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the update | +| `input_schema` | Dict[str, *Any*] | :heavy_check_mark: | Input JSON schema of the update's model | +| `output_schema` | Dict[str, *Any*] | :heavy_minus_sign: | Output JSON schema of the update's model | \ No newline at end of file diff --git a/docs/models/updatedocumentrequest.md b/docs/models/updatedocumentrequest.md new file mode 100644 index 00000000..dd06dd4b --- /dev/null +++ b/docs/models/updatedocumentrequest.md @@ -0,0 +1,9 @@ +# UpdateDocumentRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `attributes` | Dict[str, [models.Attributes](../models/attributes.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/updateftmodelin.md b/docs/models/updateftmodelin.md deleted file mode 100644 index 4e55b1a7..00000000 --- a/docs/models/updateftmodelin.md +++ /dev/null @@ -1,9 +0,0 @@ -# UpdateFTModelIn - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/updateinvocationbody.md b/docs/models/updateinvocationbody.md new file mode 100644 index 00000000..e810a041 --- /dev/null +++ b/docs/models/updateinvocationbody.md @@ -0,0 +1,9 @@ +# UpdateInvocationBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the update to request | +| `input` | [OptionalNullable[models.UpdateInvocationBodyInput]](../models/updateinvocationbodyinput.md) | :heavy_minus_sign: | Input data for the update, matching its schema | \ No newline at end of file diff --git a/docs/models/updateinvocationbodyinput.md b/docs/models/updateinvocationbodyinput.md new file mode 100644 index 00000000..70665f9e --- /dev/null +++ b/docs/models/updateinvocationbodyinput.md @@ -0,0 +1,19 @@ +# UpdateInvocationBodyInput + +Input data for the update, matching its schema + + +## Supported Types + +### `models.NetworkEncodedInput` + +```python +value: models.NetworkEncodedInput = /* values here */ +``` + +### `Dict[str, Any]` + +```python +value: Dict[str, Any] = /* values here */ +``` + diff --git a/docs/models/updatejudgerequest.md b/docs/models/updatejudgerequest.md new file mode 100644 index 00000000..bf28ae7a --- /dev/null +++ b/docs/models/updatejudgerequest.md @@ -0,0 +1,13 @@ +# UpdateJudgeRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `model_name` | *str* | :heavy_check_mark: | N/A | +| `output` | [models.UpdateJudgeRequestOutput](../models/updatejudgerequestoutput.md) | :heavy_check_mark: | N/A | +| `instructions` | *str* | :heavy_check_mark: | N/A | +| `tools` | List[*str*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatejudgerequestoutput.md b/docs/models/updatejudgerequestoutput.md new file mode 100644 index 00000000..a8db68ab --- /dev/null +++ b/docs/models/updatejudgerequestoutput.md @@ -0,0 +1,17 @@ +# UpdateJudgeRequestOutput + + +## Supported Types + +### `models.JudgeClassificationOutput` + +```python +value: models.JudgeClassificationOutput = /* values here */ +``` + +### `models.JudgeRegressionOutput` + +```python +value: models.JudgeRegressionOutput = /* values here */ +``` + diff --git a/docs/models/updatejudgev1observabilityjudgesjudgeidputrequest.md b/docs/models/updatejudgev1observabilityjudgesjudgeidputrequest.md new file mode 100644 index 00000000..bfe3648d --- /dev/null +++ b/docs/models/updatejudgev1observabilityjudgesjudgeidputrequest.md @@ -0,0 +1,9 @@ +# UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `judge_id` | *str* | :heavy_check_mark: | N/A | +| `update_judge_request` | [models.UpdateJudgeRequest](../models/updatejudgerequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatelibraryrequest.md b/docs/models/updatelibraryrequest.md new file mode 100644 index 00000000..32d53eec --- /dev/null +++ b/docs/models/updatelibraryrequest.md @@ -0,0 +1,9 @@ +# UpdateLibraryRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/updatemodelrequest.md b/docs/models/updatemodelrequest.md new file mode 100644 index 00000000..56b84c59 --- /dev/null +++ b/docs/models/updatemodelrequest.md @@ -0,0 +1,9 @@ +# UpdateModelRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/updateruninfo.md b/docs/models/updateruninfo.md new file mode 100644 index 00000000..1f09fb3b --- /dev/null +++ b/docs/models/updateruninfo.md @@ -0,0 +1,9 @@ +# UpdateRunInfo + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `execution_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `chunks_count` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updateruninfov1ragingestionpipelineconfigurationsidruninfoputrequest.md b/docs/models/updateruninfov1ragingestionpipelineconfigurationsidruninfoputrequest.md new file mode 100644 index 00000000..c675adef --- /dev/null +++ b/docs/models/updateruninfov1ragingestionpipelineconfigurationsidruninfoputrequest.md @@ -0,0 +1,9 @@ +# UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `update_run_info` | [models.UpdateRunInfo](../models/updateruninfo.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatevoicev1audiovoicesvoiceidpatchrequest.md b/docs/models/updatevoicev1audiovoicesvoiceidpatchrequest.md new file mode 100644 index 00000000..a8ca8e29 --- /dev/null +++ b/docs/models/updatevoicev1audiovoicesvoiceidpatchrequest.md @@ -0,0 +1,9 @@ +# UpdateVoiceV1AudioVoicesVoiceIDPatchRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `voice_id` | *str* | :heavy_check_mark: | N/A | +| `voice_update_request` | [models.VoiceUpdateRequest](../models/voiceupdaterequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updateworkflowexecutionv1workflowsexecutionsexecutionidupdatespostrequest.md b/docs/models/updateworkflowexecutionv1workflowsexecutionsexecutionidupdatespostrequest.md new file mode 100644 index 00000000..5705af6b --- /dev/null +++ b/docs/models/updateworkflowexecutionv1workflowsexecutionsexecutionidupdatespostrequest.md @@ -0,0 +1,9 @@ +# UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `update_invocation_body` | [models.UpdateInvocationBody](../models/updateinvocationbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updateworkflowresponse.md b/docs/models/updateworkflowresponse.md new file mode 100644 index 00000000..a4e9494e --- /dev/null +++ b/docs/models/updateworkflowresponse.md @@ -0,0 +1,9 @@ +# UpdateWorkflowResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `update_name` | *str* | :heavy_check_mark: | N/A | +| `result` | *Any* | :heavy_check_mark: | The result of the Update workflow call | \ No newline at end of file diff --git a/docs/models/updateworkflowv1workflowsworkflowidentifierputrequest.md b/docs/models/updateworkflowv1workflowsworkflowidentifierputrequest.md new file mode 100644 index 00000000..51877da9 --- /dev/null +++ b/docs/models/updateworkflowv1workflowsworkflowidentifierputrequest.md @@ -0,0 +1,9 @@ +# UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | +| `workflow_update_request` | [models.WorkflowUpdateRequest](../models/workflowupdaterequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/uploadfileout.md b/docs/models/uploadfileout.md deleted file mode 100644 index 6f09c9a6..00000000 --- a/docs/models/uploadfileout.md +++ /dev/null @@ -1,18 +0,0 @@ -# UploadFileOut - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The unique identifier of the file. | 497f6eca-6276-4993-bfeb-53cbbbba6f09 | -| `object` | *str* | :heavy_check_mark: | The object type, which is always "file". | file | -| `size_bytes` | *int* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | -| `created_at` | *int* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | -| `filename` | *str* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | -| `purpose` | [models.FilePurpose](../models/filepurpose.md) | :heavy_check_mark: | N/A | | -| `sample_type` | [models.SampleType](../models/sampletype.md) | :heavy_check_mark: | N/A | | -| `num_lines` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | -| `mimetype` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `source` | [models.Source](../models/source.md) | :heavy_check_mark: | N/A | | -| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/usageinfodollardefs.md b/docs/models/usageinfodollardefs.md new file mode 100644 index 00000000..e5088d43 --- /dev/null +++ b/docs/models/usageinfodollardefs.md @@ -0,0 +1,15 @@ +# UsageInfoDollarDefs + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `prompt_audio_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `prompt_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `total_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `completion_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `request_count` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `prompt_tokens_details` | [OptionalNullable[models.PromptTokensDetails]](../models/prompttokensdetails.md) | :heavy_minus_sign: | N/A | +| `prompt_token_details` | [OptionalNullable[models.PromptTokensDetails]](../models/prompttokensdetails.md) | :heavy_minus_sign: | N/A | +| `num_cached_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/usermessage.md b/docs/models/usermessage.md index 63b01310..e7a932ed 100644 --- a/docs/models/usermessage.md +++ b/docs/models/usermessage.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.UserMessageRole]](../models/usermessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `role` | *Literal["user"]* | :heavy_check_mark: | N/A | +| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/usermessagerole.md b/docs/models/usermessagerole.md deleted file mode 100644 index 171124e4..00000000 --- a/docs/models/usermessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# UserMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `USER` | user | \ No newline at end of file diff --git a/docs/models/validationerror.md b/docs/models/validationerror.md index 7a1654a1..5bcea5b5 100644 --- a/docs/models/validationerror.md +++ b/docs/models/validationerror.md @@ -3,8 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `loc` | List[[models.Loc](../models/loc.md)] | :heavy_check_mark: | N/A | -| `msg` | *str* | :heavy_check_mark: | N/A | -| `type` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `loc` | List[[models.Loc](../models/loc.md)] | :heavy_check_mark: | N/A | +| `msg` | *str* | :heavy_check_mark: | N/A | +| `type` | *str* | :heavy_check_mark: | N/A | +| `input` | *Optional[Any]* | :heavy_minus_sign: | N/A | +| `ctx` | [Optional[models.Context]](../models/context.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/visibility.md b/docs/models/visibility.md new file mode 100644 index 00000000..924f2bdd --- /dev/null +++ b/docs/models/visibility.md @@ -0,0 +1,18 @@ +# Visibility + +## Example Usage + +```python +from mistralai.client.models import Visibility + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Visibility = "model" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"model"` +- `"app"` diff --git a/docs/models/voicecreaterequest.md b/docs/models/voicecreaterequest.md new file mode 100644 index 00000000..e9a3b3a1 --- /dev/null +++ b/docs/models/voicecreaterequest.md @@ -0,0 +1,19 @@ +# VoiceCreateRequest + +Request model for creating a new voice with base64 audio. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `slug` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `languages` | List[*str*] | :heavy_minus_sign: | N/A | +| `gender` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `age` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | +| `color` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retention_notice` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `sample_audio` | *str* | :heavy_check_mark: | Base64-encoded audio file | +| `sample_filename` | *OptionalNullable[str]* | :heavy_minus_sign: | Original filename for extension detection | \ No newline at end of file diff --git a/docs/models/voicelistresponse.md b/docs/models/voicelistresponse.md new file mode 100644 index 00000000..d2d40dff --- /dev/null +++ b/docs/models/voicelistresponse.md @@ -0,0 +1,14 @@ +# VoiceListResponse + +Schema for voice list response + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `items` | List[[models.VoiceResponse](../models/voiceresponse.md)] | :heavy_check_mark: | N/A | +| `total` | *int* | :heavy_check_mark: | N/A | +| `page` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `total_pages` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/voiceresponse.md b/docs/models/voiceresponse.md new file mode 100644 index 00000000..3ec6d540 --- /dev/null +++ b/docs/models/voiceresponse.md @@ -0,0 +1,20 @@ +# VoiceResponse + +Schema for voice response + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `slug` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `languages` | List[*str*] | :heavy_minus_sign: | N/A | +| `gender` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `age` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | +| `color` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retention_notice` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `user_id` | *Nullable[str]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/voiceupdaterequest.md b/docs/models/voiceupdaterequest.md new file mode 100644 index 00000000..924b5f47 --- /dev/null +++ b/docs/models/voiceupdaterequest.md @@ -0,0 +1,14 @@ +# VoiceUpdateRequest + +Request model for partially updating voice metadata. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `languages` | List[*str*] | :heavy_minus_sign: | N/A | +| `gender` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `age` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/wandbintegration.md b/docs/models/wandbintegration.md index 199d2edd..c73952d9 100644 --- a/docs/models/wandbintegration.md +++ b/docs/models/wandbintegration.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `type` | [Optional[models.WandbIntegrationType]](../models/wandbintegrationtype.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["wandb"]* | :heavy_check_mark: | N/A | | `project` | *str* | :heavy_check_mark: | The name of the project that the new run will be created under. | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | A display name to set for the run. If not set, will use the job ID as the name. | | `api_key` | *str* | :heavy_check_mark: | The WandB API key to use for authentication. | diff --git a/docs/models/wandbintegrationout.md b/docs/models/wandbintegrationout.md deleted file mode 100644 index cec02ed8..00000000 --- a/docs/models/wandbintegrationout.md +++ /dev/null @@ -1,12 +0,0 @@ -# WandbIntegrationOut - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `type` | [Optional[models.WandbIntegrationOutType]](../models/wandbintegrationouttype.md) | :heavy_minus_sign: | N/A | -| `project` | *str* | :heavy_check_mark: | The name of the project that the new run will be created under. | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | A display name to set for the run. If not set, will use the job ID as the name. | -| `run_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/wandbintegrationouttype.md b/docs/models/wandbintegrationouttype.md deleted file mode 100644 index 5a7533c9..00000000 --- a/docs/models/wandbintegrationouttype.md +++ /dev/null @@ -1,8 +0,0 @@ -# WandbIntegrationOutType - - -## Values - -| Name | Value | -| ------- | ------- | -| `WANDB` | wandb | \ No newline at end of file diff --git a/docs/models/wandbintegrationresult.md b/docs/models/wandbintegrationresult.md new file mode 100644 index 00000000..d12bc311 --- /dev/null +++ b/docs/models/wandbintegrationresult.md @@ -0,0 +1,12 @@ +# WandbIntegrationResult + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `type` | *Literal["wandb"]* | :heavy_check_mark: | N/A | +| `project` | *str* | :heavy_check_mark: | The name of the project that the new run will be created under. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | A display name to set for the run. If not set, will use the job ID as the name. | +| `run_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/wandbintegrationtype.md b/docs/models/wandbintegrationtype.md deleted file mode 100644 index 4fdffe22..00000000 --- a/docs/models/wandbintegrationtype.md +++ /dev/null @@ -1,8 +0,0 @@ -# WandbIntegrationType - - -## Values - -| Name | Value | -| ------- | ------- | -| `WANDB` | wandb | \ No newline at end of file diff --git a/docs/models/websearchpremiumtool.md b/docs/models/websearchpremiumtool.md index 941fc2b8..78b736cd 100644 --- a/docs/models/websearchpremiumtool.md +++ b/docs/models/websearchpremiumtool.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `type` | [Optional[models.WebSearchPremiumToolType]](../models/websearchpremiumtooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["web_search_premium"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/websearchpremiumtooltype.md b/docs/models/websearchpremiumtooltype.md deleted file mode 100644 index 348bfe85..00000000 --- a/docs/models/websearchpremiumtooltype.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebSearchPremiumToolType - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `WEB_SEARCH_PREMIUM` | web_search_premium | \ No newline at end of file diff --git a/docs/models/websearchtool.md b/docs/models/websearchtool.md index c8d708bd..4ca7333c 100644 --- a/docs/models/websearchtool.md +++ b/docs/models/websearchtool.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `type` | [Optional[models.WebSearchToolType]](../models/websearchtooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `tool_configuration` | [OptionalNullable[models.ToolConfiguration]](../models/toolconfiguration.md) | :heavy_minus_sign: | N/A | +| `type` | *Literal["web_search"]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/websearchtooltype.md b/docs/models/websearchtooltype.md deleted file mode 100644 index 57b6acbb..00000000 --- a/docs/models/websearchtooltype.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebSearchToolType - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `WEB_SEARCH` | web_search | \ No newline at end of file diff --git a/docs/models/workflow.md b/docs/models/workflow.md new file mode 100644 index 00000000..b1765cc4 --- /dev/null +++ b/docs/models/workflow.md @@ -0,0 +1,19 @@ +# Workflow + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier of the workflow | +| `name` | *str* | :heavy_check_mark: | Name of the workflow | +| `display_name` | *str* | :heavy_check_mark: | Display name of the workflow | +| `type` | [models.WorkflowType](../models/workflowtype.md) | :heavy_check_mark: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the workflow | +| `customer_id` | *str* | :heavy_check_mark: | Customer ID of the workflow | +| `workspace_id` | *str* | :heavy_check_mark: | Workspace ID of the workflow | +| `shared_namespace` | *OptionalNullable[str]* | :heavy_minus_sign: | Reserved namespace for shared workflows (e.g., 'shared:my-shared-workflow') | +| `available_in_chat_assistant` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow is available in chat assistant | +| `is_technical` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow is technical (e.g. SDK-managed) | +| `on_behalf_of` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow must run associated to a user's identity | +| `archived` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow is archived | \ No newline at end of file diff --git a/docs/models/workflowarchiveresponse.md b/docs/models/workflowarchiveresponse.md new file mode 100644 index 00000000..6192c2b2 --- /dev/null +++ b/docs/models/workflowarchiveresponse.md @@ -0,0 +1,8 @@ +# WorkflowArchiveResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `workflow` | [models.Workflow](../models/workflow.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/workflowbasicdefinition.md b/docs/models/workflowbasicdefinition.md new file mode 100644 index 00000000..a534ad34 --- /dev/null +++ b/docs/models/workflowbasicdefinition.md @@ -0,0 +1,13 @@ +# WorkflowBasicDefinition + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | The name of the workflow | +| `display_name` | *str* | :heavy_check_mark: | The display name of the workflow | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the workflow | +| `metadata` | [Optional[models.WorkflowMetadata]](../models/workflowmetadata.md) | :heavy_minus_sign: | N/A | +| `archived` | *bool* | :heavy_check_mark: | Whether the workflow is archived | \ No newline at end of file diff --git a/docs/models/workflowcodedefinition.md b/docs/models/workflowcodedefinition.md new file mode 100644 index 00000000..f8cf3bbd --- /dev/null +++ b/docs/models/workflowcodedefinition.md @@ -0,0 +1,15 @@ +# WorkflowCodeDefinition + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `input_schema` | Dict[str, *Any*] | :heavy_check_mark: | Input schema of the workflow's run method | +| `output_schema` | Dict[str, *Any*] | :heavy_minus_sign: | Output schema of the workflow's run method | +| `signals` | List[[models.SignalDefinition](../models/signaldefinition.md)] | :heavy_minus_sign: | Signal handlers defined by the workflow | +| `queries` | List[[models.QueryDefinition](../models/querydefinition.md)] | :heavy_minus_sign: | Query handlers defined by the workflow | +| `updates` | List[[models.UpdateDefinition](../models/updatedefinition.md)] | :heavy_minus_sign: | Update handlers defined by the workflow | +| `enforce_determinism` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow enforces deterministic execution | +| `execution_timeout` | *Optional[float]* | :heavy_minus_sign: | Maximum total execution time including retries and continue-as-new | +| `plugin_metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Plugin-specific metadata (e.g. connector declarations) | \ No newline at end of file diff --git a/docs/models/workfloweventtype.md b/docs/models/workfloweventtype.md new file mode 100644 index 00000000..ebfe2d86 --- /dev/null +++ b/docs/models/workfloweventtype.md @@ -0,0 +1,29 @@ +# WorkflowEventType + +## Example Usage + +```python +from mistralai.client.models import WorkflowEventType +value: WorkflowEventType = "WORKFLOW_EXECUTION_STARTED" +``` + + +## Values + +- `"WORKFLOW_EXECUTION_STARTED"` +- `"WORKFLOW_EXECUTION_COMPLETED"` +- `"WORKFLOW_EXECUTION_FAILED"` +- `"WORKFLOW_EXECUTION_CANCELED"` +- `"WORKFLOW_EXECUTION_CONTINUED_AS_NEW"` +- `"WORKFLOW_TASK_TIMED_OUT"` +- `"WORKFLOW_TASK_FAILED"` +- `"CUSTOM_TASK_STARTED"` +- `"CUSTOM_TASK_IN_PROGRESS"` +- `"CUSTOM_TASK_COMPLETED"` +- `"CUSTOM_TASK_FAILED"` +- `"CUSTOM_TASK_TIMED_OUT"` +- `"CUSTOM_TASK_CANCELED"` +- `"ACTIVITY_TASK_STARTED"` +- `"ACTIVITY_TASK_COMPLETED"` +- `"ACTIVITY_TASK_RETRYING"` +- `"ACTIVITY_TASK_FAILED"` diff --git a/docs/models/workflowexecutioncanceledattributes.md b/docs/models/workflowexecutioncanceledattributes.md new file mode 100644 index 00000000..8c2929eb --- /dev/null +++ b/docs/models/workflowexecutioncanceledattributes.md @@ -0,0 +1,11 @@ +# WorkflowExecutionCanceledAttributes + +Attributes for workflow execution canceled events. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the task within the workflow execution. | +| `reason` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reason provided for the cancellation. | \ No newline at end of file diff --git a/docs/models/workflowexecutioncanceledresponse.md b/docs/models/workflowexecutioncanceledresponse.md new file mode 100644 index 00000000..f9f4c01d --- /dev/null +++ b/docs/models/workflowexecutioncanceledresponse.md @@ -0,0 +1,20 @@ +# WorkflowExecutionCanceledResponse + +Emitted when a workflow execution is canceled. + +This is a terminal event indicating the workflow was explicitly canceled. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["WORKFLOW_EXECUTION_CANCELED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.WorkflowExecutionCanceledAttributes](../models/workflowexecutioncanceledattributes.md) | :heavy_check_mark: | Attributes for workflow execution canceled events. | \ No newline at end of file diff --git a/docs/models/workflowexecutioncompletedattributesresponse.md b/docs/models/workflowexecutioncompletedattributesresponse.md new file mode 100644 index 00000000..53596a91 --- /dev/null +++ b/docs/models/workflowexecutioncompletedattributesresponse.md @@ -0,0 +1,11 @@ +# WorkflowExecutionCompletedAttributesResponse + +Attributes for workflow execution completed events. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the task within the workflow execution. | +| `result` | [models.JSONPayloadResponse](../models/jsonpayloadresponse.md) | :heavy_check_mark: | A payload containing arbitrary JSON data.

Used for complete state snapshots or final results.
When encrypted, the value field contains base64-encoded encrypted data
and encoding_options indicates the type of encryption applied. | \ No newline at end of file diff --git a/docs/models/workflowexecutioncompletedresponse.md b/docs/models/workflowexecutioncompletedresponse.md new file mode 100644 index 00000000..a4d40dc5 --- /dev/null +++ b/docs/models/workflowexecutioncompletedresponse.md @@ -0,0 +1,20 @@ +# WorkflowExecutionCompletedResponse + +Emitted when a workflow execution completes successfully. + +This is a terminal event indicating the workflow finished without errors. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["WORKFLOW_EXECUTION_COMPLETED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.WorkflowExecutionCompletedAttributesResponse](../models/workflowexecutioncompletedattributesresponse.md) | :heavy_check_mark: | Attributes for workflow execution completed events. | \ No newline at end of file diff --git a/docs/models/workflowexecutioncontinuedasnewattributesresponse.md b/docs/models/workflowexecutioncontinuedasnewattributesresponse.md new file mode 100644 index 00000000..13e21499 --- /dev/null +++ b/docs/models/workflowexecutioncontinuedasnewattributesresponse.md @@ -0,0 +1,13 @@ +# WorkflowExecutionContinuedAsNewAttributesResponse + +Attributes for workflow execution continued-as-new events. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the task within the workflow execution. | +| `new_execution_run_id` | *str* | :heavy_check_mark: | The run ID of the new workflow execution that continues this workflow. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the continued workflow. | +| `input` | [models.JSONPayloadResponse](../models/jsonpayloadresponse.md) | :heavy_check_mark: | A payload containing arbitrary JSON data.

Used for complete state snapshots or final results.
When encrypted, the value field contains base64-encoded encrypted data
and encoding_options indicates the type of encryption applied. | \ No newline at end of file diff --git a/docs/models/workflowexecutioncontinuedasnewresponse.md b/docs/models/workflowexecutioncontinuedasnewresponse.md new file mode 100644 index 00000000..e6a7212a --- /dev/null +++ b/docs/models/workflowexecutioncontinuedasnewresponse.md @@ -0,0 +1,21 @@ +# WorkflowExecutionContinuedAsNewResponse + +Emitted when a workflow continues as a new execution. + +This occurs when a workflow uses continue-as-new to reset its history +while maintaining logical continuity. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["WORKFLOW_EXECUTION_CONTINUED_AS_NEW"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.WorkflowExecutionContinuedAsNewAttributesResponse](../models/workflowexecutioncontinuedasnewattributesresponse.md) | :heavy_check_mark: | Attributes for workflow execution continued-as-new events. | \ No newline at end of file diff --git a/docs/models/workflowexecutionfailedattributes.md b/docs/models/workflowexecutionfailedattributes.md new file mode 100644 index 00000000..9fa14fa4 --- /dev/null +++ b/docs/models/workflowexecutionfailedattributes.md @@ -0,0 +1,11 @@ +# WorkflowExecutionFailedAttributes + +Attributes for workflow execution failed events. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the task within the workflow execution. | +| `failure` | [models.Failure](../models/failure.md) | :heavy_check_mark: | Represents an error or exception that occurred during execution. | \ No newline at end of file diff --git a/docs/models/workflowexecutionfailedresponse.md b/docs/models/workflowexecutionfailedresponse.md new file mode 100644 index 00000000..222fbfd7 --- /dev/null +++ b/docs/models/workflowexecutionfailedresponse.md @@ -0,0 +1,20 @@ +# WorkflowExecutionFailedResponse + +Emitted when a workflow execution fails due to an unhandled exception. + +This is a terminal event indicating the workflow ended with an error. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["WORKFLOW_EXECUTION_FAILED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.WorkflowExecutionFailedAttributes](../models/workflowexecutionfailedattributes.md) | :heavy_check_mark: | Attributes for workflow execution failed events. | \ No newline at end of file diff --git a/docs/models/workflowexecutionlistresponse.md b/docs/models/workflowexecutionlistresponse.md new file mode 100644 index 00000000..0434e948 --- /dev/null +++ b/docs/models/workflowexecutionlistresponse.md @@ -0,0 +1,11 @@ +# WorkflowExecutionListResponse + +Deprecated: use WorkflowRunListResponse instead. Will be removed in the next major version. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `executions` | List[[models.WorkflowExecutionWithoutResultResponse](../models/workflowexecutionwithoutresultresponse.md)] | :heavy_check_mark: | A list of workflow executions | +| `next_page_token` | *OptionalNullable[str]* | :heavy_minus_sign: | Token to use for fetching the next page of results. Null if this is the last page. | \ No newline at end of file diff --git a/docs/models/workflowexecutionprogresstraceevent.md b/docs/models/workflowexecutionprogresstraceevent.md new file mode 100644 index 00000000..ac50a894 --- /dev/null +++ b/docs/models/workflowexecutionprogresstraceevent.md @@ -0,0 +1,17 @@ +# WorkflowExecutionProgressTraceEvent + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [Optional[models.EventType]](../models/eventtype.md) | :heavy_minus_sign: | N/A | +| `name` | *str* | :heavy_check_mark: | Name of the event | +| `id` | *str* | :heavy_check_mark: | The ID of the event | +| `timestamp_unix_nano` | *int* | :heavy_check_mark: | The timestamp of the event in nanoseconds since the Unix epoch | +| `attributes` | Dict[str, [Nullable[models.WorkflowExecutionTraceSummaryAttributesValues]](../models/workflowexecutiontracesummaryattributesvalues.md)] | :heavy_check_mark: | The attributes of the event | +| `internal` | *Optional[bool]* | :heavy_minus_sign: | Whether the event is internal | +| `status` | [Optional[models.EventProgressStatus]](../models/eventprogressstatus.md) | :heavy_minus_sign: | N/A | +| `start_time_unix_ms` | *int* | :heavy_check_mark: | The start time of the event in milliseconds since the Unix epoch | +| `end_time_unix_ms` | *OptionalNullable[int]* | :heavy_minus_sign: | The end time of the event in milliseconds since the Unix epoch | +| `error` | *OptionalNullable[str]* | :heavy_minus_sign: | The error message, if any | \ No newline at end of file diff --git a/docs/models/workflowexecutionrequest.md b/docs/models/workflowexecutionrequest.md new file mode 100644 index 00000000..4b61c7b7 --- /dev/null +++ b/docs/models/workflowexecutionrequest.md @@ -0,0 +1,15 @@ +# WorkflowExecutionRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `execution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Allows you to specify a custom execution ID. If not provided, a random ID will be generated. | +| `input` | *OptionalNullable[Any]* | :heavy_minus_sign: | The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. | +| `wait_for_result` | *Optional[bool]* | :heavy_minus_sign: | If true, wait for the workflow to complete and return the result directly. | +| `timeout_seconds` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum time to wait for completion when wait_for_result is true. | +| `custom_tracing_attributes` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `extensions` | Dict[str, *Any*] | :heavy_minus_sign: | Plugin-specific data to propagate into WorkflowContext.extensions at execution time. | +| ~~`task_queue`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use deployment_name instead. | +| `deployment_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the deployment to route this execution to | \ No newline at end of file diff --git a/docs/models/workflowexecutionresponse.md b/docs/models/workflowexecutionresponse.md new file mode 100644 index 00000000..03f10100 --- /dev/null +++ b/docs/models/workflowexecutionresponse.md @@ -0,0 +1,17 @@ +# WorkflowExecutionResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `workflow_name` | *str* | :heavy_check_mark: | The name of the workflow | +| `execution_id` | *str* | :heavy_check_mark: | The ID of the workflow execution | +| `parent_execution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The parent execution ID of the workflow execution | +| `root_execution_id` | *str* | :heavy_check_mark: | The root execution ID of the workflow execution | +| `run_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique run identifier (database UUID) | +| `status` | [Nullable[models.WorkflowExecutionStatus]](../models/workflowexecutionstatus.md) | :heavy_check_mark: | The status of the workflow execution | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The start time of the workflow execution | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The end time of the workflow execution, if available | +| `total_duration_ms` | *OptionalNullable[int]* | :heavy_minus_sign: | The total duration of the trace in milliseconds | +| `result` | *Nullable[Any]* | :heavy_check_mark: | The result of the workflow execution, if available | \ No newline at end of file diff --git a/docs/models/workflowexecutionstartedattributesresponse.md b/docs/models/workflowexecutionstartedattributesresponse.md new file mode 100644 index 00000000..63c20eb1 --- /dev/null +++ b/docs/models/workflowexecutionstartedattributesresponse.md @@ -0,0 +1,13 @@ +# WorkflowExecutionStartedAttributesResponse + +Attributes for workflow execution started events. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the task within the workflow execution. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow being executed. | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The user-friendly display name of the workflow, if available. | +| `input` | [models.JSONPayloadResponse](../models/jsonpayloadresponse.md) | :heavy_check_mark: | A payload containing arbitrary JSON data.

Used for complete state snapshots or final results.
When encrypted, the value field contains base64-encoded encrypted data
and encoding_options indicates the type of encryption applied. | \ No newline at end of file diff --git a/docs/models/workflowexecutionstartedresponse.md b/docs/models/workflowexecutionstartedresponse.md new file mode 100644 index 00000000..7c370d46 --- /dev/null +++ b/docs/models/workflowexecutionstartedresponse.md @@ -0,0 +1,20 @@ +# WorkflowExecutionStartedResponse + +Emitted when a workflow execution begins. + +This is the first event in any workflow execution lifecycle. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["WORKFLOW_EXECUTION_STARTED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.WorkflowExecutionStartedAttributesResponse](../models/workflowexecutionstartedattributesresponse.md) | :heavy_check_mark: | Attributes for workflow execution started events. | \ No newline at end of file diff --git a/docs/models/workflowexecutionstatus.md b/docs/models/workflowexecutionstatus.md new file mode 100644 index 00000000..1be6d741 --- /dev/null +++ b/docs/models/workflowexecutionstatus.md @@ -0,0 +1,24 @@ +# WorkflowExecutionStatus + +## Example Usage + +```python +from mistralai.client.models import WorkflowExecutionStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: WorkflowExecutionStatus = "RUNNING" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"RUNNING"` +- `"COMPLETED"` +- `"FAILED"` +- `"CANCELED"` +- `"TERMINATED"` +- `"CONTINUED_AS_NEW"` +- `"TIMED_OUT"` +- `"RETRYING_AFTER_ERROR"` diff --git a/docs/models/workflowexecutionsyncresponse.md b/docs/models/workflowexecutionsyncresponse.md new file mode 100644 index 00000000..88cbc21c --- /dev/null +++ b/docs/models/workflowexecutionsyncresponse.md @@ -0,0 +1,12 @@ +# WorkflowExecutionSyncResponse + +Response model for synchronous workflow execution + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `workflow_name` | *str* | :heavy_check_mark: | Name of the workflow that was executed | +| `execution_id` | *str* | :heavy_check_mark: | ID of the workflow execution | +| `result` | *Any* | :heavy_check_mark: | The result of the workflow execution | \ No newline at end of file diff --git a/docs/models/workflowexecutiontraceevent.md b/docs/models/workflowexecutiontraceevent.md new file mode 100644 index 00000000..b6bb388c --- /dev/null +++ b/docs/models/workflowexecutiontraceevent.md @@ -0,0 +1,13 @@ +# WorkflowExecutionTraceEvent + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [Optional[models.EventType]](../models/eventtype.md) | :heavy_minus_sign: | N/A | +| `name` | *str* | :heavy_check_mark: | Name of the event | +| `id` | *str* | :heavy_check_mark: | The ID of the event | +| `timestamp_unix_nano` | *int* | :heavy_check_mark: | The timestamp of the event in nanoseconds since the Unix epoch | +| `attributes` | Dict[str, [Nullable[models.WorkflowExecutionTraceSummaryAttributesValues]](../models/workflowexecutiontracesummaryattributesvalues.md)] | :heavy_check_mark: | The attributes of the event | +| `internal` | *Optional[bool]* | :heavy_minus_sign: | Whether the event is internal | \ No newline at end of file diff --git a/docs/models/workflowexecutiontraceeventsresponse.md b/docs/models/workflowexecutiontraceeventsresponse.md new file mode 100644 index 00000000..d24dfcaf --- /dev/null +++ b/docs/models/workflowexecutiontraceeventsresponse.md @@ -0,0 +1,18 @@ +# WorkflowExecutionTraceEventsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `workflow_name` | *str* | :heavy_check_mark: | The name of the workflow | +| `execution_id` | *str* | :heavy_check_mark: | The ID of the workflow execution | +| `parent_execution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The parent execution ID of the workflow execution | +| `root_execution_id` | *str* | :heavy_check_mark: | The root execution ID of the workflow execution | +| `run_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique run identifier (database UUID) | +| `status` | [Nullable[models.WorkflowExecutionStatus]](../models/workflowexecutionstatus.md) | :heavy_check_mark: | The status of the workflow execution | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The start time of the workflow execution | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The end time of the workflow execution, if available | +| `total_duration_ms` | *OptionalNullable[int]* | :heavy_minus_sign: | The total duration of the trace in milliseconds | +| `result` | *Nullable[Any]* | :heavy_check_mark: | The result of the workflow execution, if available | +| `events` | List[[models.WorkflowExecutionTraceEventsResponseEvent](../models/workflowexecutiontraceeventsresponseevent.md)] | :heavy_minus_sign: | The events of the workflow execution | \ No newline at end of file diff --git a/docs/models/workflowexecutiontraceeventsresponseevent.md b/docs/models/workflowexecutiontraceeventsresponseevent.md new file mode 100644 index 00000000..81c4f573 --- /dev/null +++ b/docs/models/workflowexecutiontraceeventsresponseevent.md @@ -0,0 +1,17 @@ +# WorkflowExecutionTraceEventsResponseEvent + + +## Supported Types + +### `models.WorkflowExecutionTraceEvent` + +```python +value: models.WorkflowExecutionTraceEvent = /* values here */ +``` + +### `models.WorkflowExecutionProgressTraceEvent` + +```python +value: models.WorkflowExecutionProgressTraceEvent = /* values here */ +``` + diff --git a/docs/models/workflowexecutiontraceotelresponse.md b/docs/models/workflowexecutiontraceotelresponse.md new file mode 100644 index 00000000..cc4ff9ca --- /dev/null +++ b/docs/models/workflowexecutiontraceotelresponse.md @@ -0,0 +1,20 @@ +# WorkflowExecutionTraceOTelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `workflow_name` | *str* | :heavy_check_mark: | The name of the workflow | +| `execution_id` | *str* | :heavy_check_mark: | The ID of the workflow execution | +| `parent_execution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The parent execution ID of the workflow execution | +| `root_execution_id` | *str* | :heavy_check_mark: | The root execution ID of the workflow execution | +| `run_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique run identifier (database UUID) | +| `status` | [Nullable[models.WorkflowExecutionStatus]](../models/workflowexecutionstatus.md) | :heavy_check_mark: | The status of the workflow execution | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The start time of the workflow execution | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The end time of the workflow execution, if available | +| `total_duration_ms` | *OptionalNullable[int]* | :heavy_minus_sign: | The total duration of the trace in milliseconds | +| `result` | *Nullable[Any]* | :heavy_check_mark: | The result of the workflow execution, if available | +| `data_source` | *str* | :heavy_check_mark: | The data source of the trace | +| `otel_trace_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the trace | +| `otel_trace_data` | [OptionalNullable[models.TempoGetTraceResponse]](../models/tempogettraceresponse.md) | :heavy_minus_sign: | The raw OpenTelemetry trace data | \ No newline at end of file diff --git a/docs/models/workflowexecutiontracesummaryattributesvalues.md b/docs/models/workflowexecutiontracesummaryattributesvalues.md new file mode 100644 index 00000000..04bd34ab --- /dev/null +++ b/docs/models/workflowexecutiontracesummaryattributesvalues.md @@ -0,0 +1,35 @@ +# WorkflowExecutionTraceSummaryAttributesValues + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `int` + +```python +value: int = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + +### `List[Any]` + +```python +value: List[Any] = /* values here */ +``` + diff --git a/docs/models/workflowexecutiontracesummaryresponse.md b/docs/models/workflowexecutiontracesummaryresponse.md new file mode 100644 index 00000000..c0380e78 --- /dev/null +++ b/docs/models/workflowexecutiontracesummaryresponse.md @@ -0,0 +1,18 @@ +# WorkflowExecutionTraceSummaryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `workflow_name` | *str* | :heavy_check_mark: | The name of the workflow | +| `execution_id` | *str* | :heavy_check_mark: | The ID of the workflow execution | +| `parent_execution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The parent execution ID of the workflow execution | +| `root_execution_id` | *str* | :heavy_check_mark: | The root execution ID of the workflow execution | +| `run_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique run identifier (database UUID) | +| `status` | [Nullable[models.WorkflowExecutionStatus]](../models/workflowexecutionstatus.md) | :heavy_check_mark: | The status of the workflow execution | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The start time of the workflow execution | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The end time of the workflow execution, if available | +| `total_duration_ms` | *OptionalNullable[int]* | :heavy_minus_sign: | The total duration of the trace in milliseconds | +| `result` | *Nullable[Any]* | :heavy_check_mark: | The result of the workflow execution, if available | +| `span_tree` | [OptionalNullable[models.WorkflowExecutionTraceSummarySpan]](../models/workflowexecutiontracesummaryspan.md) | :heavy_minus_sign: | The root span of the trace | \ No newline at end of file diff --git a/docs/models/workflowexecutiontracesummaryspan.md b/docs/models/workflowexecutiontracesummaryspan.md new file mode 100644 index 00000000..8ee487a2 --- /dev/null +++ b/docs/models/workflowexecutiontracesummaryspan.md @@ -0,0 +1,14 @@ +# WorkflowExecutionTraceSummarySpan + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `span_id` | *str* | :heavy_check_mark: | The ID of the span | +| `name` | *str* | :heavy_check_mark: | The name of the span | +| `start_time_unix_nano` | *int* | :heavy_check_mark: | The start time of the span in nanoseconds since the Unix epoch | +| `end_time_unix_nano` | *Nullable[int]* | :heavy_check_mark: | The end time of the span in nanoseconds since the Unix epoch | +| `attributes` | Dict[str, [Nullable[models.WorkflowExecutionTraceSummaryAttributesValues]](../models/workflowexecutiontracesummaryattributesvalues.md)] | :heavy_check_mark: | The attributes of the span | +| `events` | List[[models.WorkflowExecutionTraceEvent](../models/workflowexecutiontraceevent.md)] | :heavy_check_mark: | The events of the span | +| `children` | List[[models.WorkflowExecutionTraceSummarySpan](../models/workflowexecutiontracesummaryspan.md)] | :heavy_minus_sign: | The child spans of the span | \ No newline at end of file diff --git a/docs/models/workflowexecutionwithoutresultresponse.md b/docs/models/workflowexecutionwithoutresultresponse.md new file mode 100644 index 00000000..47d79589 --- /dev/null +++ b/docs/models/workflowexecutionwithoutresultresponse.md @@ -0,0 +1,16 @@ +# WorkflowExecutionWithoutResultResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `workflow_name` | *str* | :heavy_check_mark: | The name of the workflow | +| `execution_id` | *str* | :heavy_check_mark: | The ID of the workflow execution | +| `parent_execution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The parent execution ID of the workflow execution | +| `root_execution_id` | *str* | :heavy_check_mark: | The root execution ID of the workflow execution | +| `run_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique run identifier (database UUID) | +| `status` | [Nullable[models.WorkflowExecutionStatus]](../models/workflowexecutionstatus.md) | :heavy_check_mark: | The status of the workflow execution | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The start time of the workflow execution | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The end time of the workflow execution, if available | +| `total_duration_ms` | *OptionalNullable[int]* | :heavy_minus_sign: | The total duration of the trace in milliseconds | \ No newline at end of file diff --git a/docs/models/workflowgetresponse.md b/docs/models/workflowgetresponse.md new file mode 100644 index 00000000..ef9baa44 --- /dev/null +++ b/docs/models/workflowgetresponse.md @@ -0,0 +1,8 @@ +# WorkflowGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `workflow` | [models.WorkflowWithWorkerStatus](../models/workflowwithworkerstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/workflowlistresponse.md b/docs/models/workflowlistresponse.md new file mode 100644 index 00000000..d36e48c6 --- /dev/null +++ b/docs/models/workflowlistresponse.md @@ -0,0 +1,9 @@ +# WorkflowListResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `workflows` | List[[models.WorkflowBasicDefinition](../models/workflowbasicdefinition.md)] | :heavy_check_mark: | A list of workflows | +| `next_cursor` | *Nullable[str]* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/workflowmetadata.md b/docs/models/workflowmetadata.md new file mode 100644 index 00000000..c69cb08b --- /dev/null +++ b/docs/models/workflowmetadata.md @@ -0,0 +1,8 @@ +# WorkflowMetadata + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `shared_namespace` | *OptionalNullable[str]* | :heavy_minus_sign: | Namespace for shared workflows, None if user-owned | \ No newline at end of file diff --git a/docs/models/workflowmetrics.md b/docs/models/workflowmetrics.md new file mode 100644 index 00000000..4936382b --- /dev/null +++ b/docs/models/workflowmetrics.md @@ -0,0 +1,17 @@ +# WorkflowMetrics + +Complete metrics for a specific workflow. + +This type combines all metric categories. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `execution_count` | [models.ScalarMetric](../models/scalarmetric.md) | :heavy_check_mark: | Scalar metric with a single value. | +| `success_count` | [models.ScalarMetric](../models/scalarmetric.md) | :heavy_check_mark: | Scalar metric with a single value. | +| `error_count` | [models.ScalarMetric](../models/scalarmetric.md) | :heavy_check_mark: | Scalar metric with a single value. | +| `average_latency_ms` | [models.ScalarMetric](../models/scalarmetric.md) | :heavy_check_mark: | Scalar metric with a single value. | +| `latency_over_time` | [models.TimeSeriesMetric](../models/timeseriesmetric.md) | :heavy_check_mark: | Time-series metric with timestamp-value pairs. | +| `retry_rate` | [models.ScalarMetric](../models/scalarmetric.md) | :heavy_check_mark: | Scalar metric with a single value. | \ No newline at end of file diff --git a/docs/models/workflowregistration.md b/docs/models/workflowregistration.md new file mode 100644 index 00000000..52658c64 --- /dev/null +++ b/docs/models/workflowregistration.md @@ -0,0 +1,14 @@ +# WorkflowRegistration + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier of the workflow registration | +| `deployment_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Deployment ID this registration belongs to | +| ~~`task_queue`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use deployment_id instead. Will be removed in a future release. | +| `definition` | [models.WorkflowCodeDefinition](../models/workflowcodedefinition.md) | :heavy_check_mark: | N/A | +| `workflow_id` | *str* | :heavy_check_mark: | Workflow ID of the workflow | +| `workflow` | [OptionalNullable[models.Workflow]](../models/workflow.md) | :heavy_minus_sign: | Workflow of the workflow registration | +| `compatible_with_chat_assistant` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow is compatible with chat assistant | \ No newline at end of file diff --git a/docs/models/workflowregistrationgetresponse.md b/docs/models/workflowregistrationgetresponse.md new file mode 100644 index 00000000..c524fc68 --- /dev/null +++ b/docs/models/workflowregistrationgetresponse.md @@ -0,0 +1,9 @@ +# WorkflowRegistrationGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `workflow_registration` | [models.WorkflowRegistrationWithWorkerStatus](../models/workflowregistrationwithworkerstatus.md) | :heavy_check_mark: | N/A | +| `workflow_version` | [models.WorkflowRegistrationWithWorkerStatus](../models/workflowregistrationwithworkerstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/workflowregistrationlistresponse.md b/docs/models/workflowregistrationlistresponse.md new file mode 100644 index 00000000..e37b3671 --- /dev/null +++ b/docs/models/workflowregistrationlistresponse.md @@ -0,0 +1,10 @@ +# WorkflowRegistrationListResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `workflow_registrations` | List[[models.WorkflowRegistration](../models/workflowregistration.md)] | :heavy_check_mark: | A list of workflow registrations | +| `next_cursor` | *Nullable[str]* | :heavy_check_mark: | N/A | +| `workflow_versions` | List[[models.WorkflowRegistration](../models/workflowregistration.md)] | :heavy_check_mark: | Deprecated: use workflow_registrations | \ No newline at end of file diff --git a/docs/models/workflowregistrationwithworkerstatus.md b/docs/models/workflowregistrationwithworkerstatus.md new file mode 100644 index 00000000..f85563ce --- /dev/null +++ b/docs/models/workflowregistrationwithworkerstatus.md @@ -0,0 +1,15 @@ +# WorkflowRegistrationWithWorkerStatus + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier of the workflow registration | +| `deployment_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Deployment ID this registration belongs to | +| ~~`task_queue`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use deployment_id instead. Will be removed in a future release. | +| `definition` | [models.WorkflowCodeDefinition](../models/workflowcodedefinition.md) | :heavy_check_mark: | N/A | +| `workflow_id` | *str* | :heavy_check_mark: | Workflow ID of the workflow | +| `workflow` | [OptionalNullable[models.Workflow]](../models/workflow.md) | :heavy_minus_sign: | Workflow of the workflow registration | +| `compatible_with_chat_assistant` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow is compatible with chat assistant | +| `active` | *bool* | :heavy_check_mark: | Whether the workflow registration is active | \ No newline at end of file diff --git a/docs/models/workflowschedulelistresponse.md b/docs/models/workflowschedulelistresponse.md new file mode 100644 index 00000000..7142185b --- /dev/null +++ b/docs/models/workflowschedulelistresponse.md @@ -0,0 +1,8 @@ +# WorkflowScheduleListResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `schedules` | List[[models.ScheduleDefinitionOutput](../models/scheduledefinitionoutput.md)] | :heavy_check_mark: | A list of workflow schedules | \ No newline at end of file diff --git a/docs/models/workflowschedulepauserequest.md b/docs/models/workflowschedulepauserequest.md new file mode 100644 index 00000000..3abd719f --- /dev/null +++ b/docs/models/workflowschedulepauserequest.md @@ -0,0 +1,8 @@ +# WorkflowSchedulePauseRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note recorded in Temporal when pausing or resuming a schedule | \ No newline at end of file diff --git a/docs/models/workflowschedulerequest.md b/docs/models/workflowschedulerequest.md new file mode 100644 index 00000000..a6255c75 --- /dev/null +++ b/docs/models/workflowschedulerequest.md @@ -0,0 +1,14 @@ +# WorkflowScheduleRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `schedule` | [models.ScheduleDefinition](../models/scheduledefinition.md) | :heavy_check_mark: | Specification of the times scheduled actions may occur.

The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and
:py:attr:`cron_expressions` excluding anything in :py:attr:`skip`.

Used for input where schedule_id is optional (can be provided or auto-generated). | +| `workflow_registration_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the workflow registration to schedule | +| `workflow_version_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Deprecated: use workflow_registration_id | +| `workflow_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | The name or ID of the workflow to schedule | +| ~~`workflow_task_queue`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use deployment_name instead. | +| `schedule_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Allows you to specify a custom schedule ID. If not provided, a random ID will be generated. | +| `deployment_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the deployment to route this schedule to | \ No newline at end of file diff --git a/docs/models/workflowscheduleresponse.md b/docs/models/workflowscheduleresponse.md new file mode 100644 index 00000000..96d7ced7 --- /dev/null +++ b/docs/models/workflowscheduleresponse.md @@ -0,0 +1,8 @@ +# WorkflowScheduleResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `schedule_id` | *str* | :heavy_check_mark: | The ID of the schedule | \ No newline at end of file diff --git a/docs/models/workflowtaskfailedattributes.md b/docs/models/workflowtaskfailedattributes.md new file mode 100644 index 00000000..c6515f84 --- /dev/null +++ b/docs/models/workflowtaskfailedattributes.md @@ -0,0 +1,11 @@ +# WorkflowTaskFailedAttributes + +Attributes for workflow task failed events. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the task within the workflow execution. | +| `failure` | [models.Failure](../models/failure.md) | :heavy_check_mark: | Represents an error or exception that occurred during execution. | \ No newline at end of file diff --git a/docs/models/workflowtaskfailedresponse.md b/docs/models/workflowtaskfailedresponse.md new file mode 100644 index 00000000..731ed219 --- /dev/null +++ b/docs/models/workflowtaskfailedresponse.md @@ -0,0 +1,21 @@ +# WorkflowTaskFailedResponse + +Emitted when a workflow task fails. + +This indicates an error occurred during workflow task execution, +which may trigger a retry depending on configuration. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["WORKFLOW_TASK_FAILED"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.WorkflowTaskFailedAttributes](../models/workflowtaskfailedattributes.md) | :heavy_check_mark: | Attributes for workflow task failed events. | \ No newline at end of file diff --git a/docs/models/workflowtasktimedoutattributes.md b/docs/models/workflowtasktimedoutattributes.md new file mode 100644 index 00000000..7f298ea2 --- /dev/null +++ b/docs/models/workflowtasktimedoutattributes.md @@ -0,0 +1,11 @@ +# WorkflowTaskTimedOutAttributes + +Attributes for workflow task timed out events. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `task_id` | *str* | :heavy_check_mark: | Unique identifier for the task within the workflow execution. | +| `timeout_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of timeout that occurred (e.g., 'START_TO_CLOSE', 'SCHEDULE_TO_START'). | \ No newline at end of file diff --git a/docs/models/workflowtasktimedoutresponse.md b/docs/models/workflowtasktimedoutresponse.md new file mode 100644 index 00000000..ea3edade --- /dev/null +++ b/docs/models/workflowtasktimedoutresponse.md @@ -0,0 +1,21 @@ +# WorkflowTaskTimedOutResponse + +Emitted when a workflow task times out. + +This indicates the workflow task (a unit of workflow execution) exceeded +its configured timeout. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | Unique identifier for this event instance. | +| `event_timestamp` | *int* | :heavy_check_mark: | Unix timestamp in nanoseconds when the event was created. | +| `root_workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the root workflow that initiated this execution chain. | +| `parent_workflow_exec_id` | *Nullable[str]* | :heavy_check_mark: | Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set. | +| `workflow_exec_id` | *str* | :heavy_check_mark: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *str* | :heavy_check_mark: | Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same. | +| `workflow_name` | *str* | :heavy_check_mark: | The registered name of the workflow that emitted this event. | +| `event_type` | *Optional[Literal["WORKFLOW_TASK_TIMED_OUT"]]* | :heavy_minus_sign: | Event type discriminator. | +| `attributes` | [models.WorkflowTaskTimedOutAttributes](../models/workflowtasktimedoutattributes.md) | :heavy_check_mark: | Attributes for workflow task timed out events. | \ No newline at end of file diff --git a/docs/models/workflowtype.md b/docs/models/workflowtype.md new file mode 100644 index 00000000..93aa31f1 --- /dev/null +++ b/docs/models/workflowtype.md @@ -0,0 +1,13 @@ +# WorkflowType + +## Example Usage + +```python +from mistralai.client.models import WorkflowType +value: WorkflowType = "code" +``` + + +## Values + +- `"code"` diff --git a/docs/models/workflowunarchiveresponse.md b/docs/models/workflowunarchiveresponse.md new file mode 100644 index 00000000..667c9387 --- /dev/null +++ b/docs/models/workflowunarchiveresponse.md @@ -0,0 +1,8 @@ +# WorkflowUnarchiveResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `workflow` | [models.Workflow](../models/workflow.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/workflowupdaterequest.md b/docs/models/workflowupdaterequest.md new file mode 100644 index 00000000..f8ce41ed --- /dev/null +++ b/docs/models/workflowupdaterequest.md @@ -0,0 +1,10 @@ +# WorkflowUpdateRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | New display name value | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description value | +| `available_in_chat_assistant` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to make the workflow available in the chat assistant | \ No newline at end of file diff --git a/docs/models/workflowupdateresponse.md b/docs/models/workflowupdateresponse.md new file mode 100644 index 00000000..68faf7c0 --- /dev/null +++ b/docs/models/workflowupdateresponse.md @@ -0,0 +1,8 @@ +# WorkflowUpdateResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `workflow` | [models.Workflow](../models/workflow.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/workflowwithworkerstatus.md b/docs/models/workflowwithworkerstatus.md new file mode 100644 index 00000000..daa637fa --- /dev/null +++ b/docs/models/workflowwithworkerstatus.md @@ -0,0 +1,20 @@ +# WorkflowWithWorkerStatus + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier of the workflow | +| `name` | *str* | :heavy_check_mark: | Name of the workflow | +| `display_name` | *str* | :heavy_check_mark: | Display name of the workflow | +| `type` | [models.WorkflowType](../models/workflowtype.md) | :heavy_check_mark: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the workflow | +| `customer_id` | *str* | :heavy_check_mark: | Customer ID of the workflow | +| `workspace_id` | *str* | :heavy_check_mark: | Workspace ID of the workflow | +| `shared_namespace` | *OptionalNullable[str]* | :heavy_minus_sign: | Reserved namespace for shared workflows (e.g., 'shared:my-shared-workflow') | +| `available_in_chat_assistant` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow is available in chat assistant | +| `is_technical` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow is technical (e.g. SDK-managed) | +| `on_behalf_of` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow must run associated to a user's identity | +| `archived` | *Optional[bool]* | :heavy_minus_sign: | Whether the workflow is archived | +| `active` | *bool* | :heavy_check_mark: | Whether the workflow is active | \ No newline at end of file diff --git a/docs/sdks/accesses/README.md b/docs/sdks/accesses/README.md index f06cce76..09515e0b 100644 --- a/docs/sdks/accesses/README.md +++ b/docs/sdks/accesses/README.md @@ -1,5 +1,4 @@ -# Accesses -(*beta.libraries.accesses*) +# Beta.Libraries.Accesses ## Overview @@ -19,7 +18,7 @@ Given a library, list all of the Entity that have access and to what level. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -43,14 +42,14 @@ with Mistral( ### Response -**[models.ListSharingOut](../../models/listsharingout.md)** +**[models.ListSharingResponse](../../models/listsharingresponse.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update_or_create @@ -60,7 +59,7 @@ Given a library id, you can create or update the access level of an entity. You ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -68,7 +67,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.libraries.accesses.update_or_create(library_id="36de3a24-5b1c-4c8f-9d84-d5642205a976", org_id="aadd9ae1-f285-4437-884a-091c77efa6fd", level="Viewer", share_with_uuid="0ae92ecb-21ed-47c5-9f7e-0b2cbe325a20", share_with_type="User") + res = mistral.beta.libraries.accesses.update_or_create(library_id="36de3a24-5b1c-4c8f-9d84-d5642205a976", level="Viewer", share_with_uuid="0ae92ecb-21ed-47c5-9f7e-0b2cbe325a20", share_with_type="User") # Handle response print(res) @@ -80,32 +79,32 @@ with Mistral( | Parameter | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `library_id` | *str* | :heavy_check_mark: | N/A | -| `org_id` | *str* | :heavy_check_mark: | N/A | | `level` | [models.ShareEnum](../../models/shareenum.md) | :heavy_check_mark: | N/A | | `share_with_uuid` | *str* | :heavy_check_mark: | The id of the entity (user, workspace or organization) to share with | | `share_with_type` | [models.EntityType](../../models/entitytype.md) | :heavy_check_mark: | The type of entity, used to share a library. | +| `org_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.SharingOut](../../models/sharingout.md)** +**[models.Sharing](../../models/sharing.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete -Given a library id, you can delete the access level of an entity. An owner cannot delete it's own access. You have to be the owner of the library to delete an acces other than yours. +Given a library id, you can delete the access level of an entity. An owner cannot delete its own access. You have to be the owner of the library to delete an access other than yours. ### Example Usage ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -113,7 +112,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.libraries.accesses.delete(library_id="709e3cad-9fb2-4f4e-bf88-143cf1808107", org_id="0814a235-c2d0-4814-875a-4b85f93d3dc7", share_with_uuid="b843cc47-ce8f-4354-8cfc-5fcd7fb2865b", share_with_type="User") + res = mistral.beta.libraries.accesses.delete(library_id="709e3cad-9fb2-4f4e-bf88-143cf1808107", share_with_uuid="b843cc47-ce8f-4354-8cfc-5fcd7fb2865b", share_with_type="User") # Handle response print(res) @@ -125,18 +124,18 @@ with Mistral( | Parameter | Type | Required | Description | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `library_id` | *str* | :heavy_check_mark: | N/A | -| `org_id` | *str* | :heavy_check_mark: | N/A | | `share_with_uuid` | *str* | :heavy_check_mark: | The id of the entity (user, workspace or organization) to share with | | `share_with_type` | [models.EntityType](../../models/entitytype.md) | :heavy_check_mark: | The type of entity, used to share a library. | +| `org_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.SharingOut](../../models/sharingout.md)** +**[models.Sharing](../../models/sharing.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index a4e8b22e..03917165 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -1,5 +1,4 @@ # Agents -(*agents*) ## Overview @@ -16,9 +15,9 @@ Agents Completion ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -28,10 +27,12 @@ with Mistral( res = mistral.agents.complete(messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], agent_id="", stream=False) + ], agent_id="", stream=False, response_format={ + "type": "text", + }) # Handle response print(res) @@ -40,24 +41,28 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `messages` | List[[models.AgentsCompletionRequestMessages](../../models/agentscompletionrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.AgentsCompletionRequestStop]](../../models/agentscompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.AgentsCompletionRequestToolChoice]](../../models/agentscompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `messages` | List[[models.AgentsCompletionRequestMessage](../../models/agentscompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [OptionalNullable[models.AgentsCompletionRequestStop]](../../models/agentscompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.AgentsCompletionRequestTool](../../models/agentscompletionrequesttool.md)] | :heavy_minus_sign: | N/A | | +| `tool_choice` | [Optional[models.AgentsCompletionRequestToolChoice]](../../models/agentscompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -67,8 +72,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## stream @@ -78,7 +83,7 @@ Mistral AI provides the ability to stream responses back to a client in order to ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -88,10 +93,12 @@ with Mistral( res = mistral.agents.stream(messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], agent_id="", stream=True) + ], agent_id="", stream=True, response_format={ + "type": "text", + }) with res as event_stream: for event in event_stream: @@ -102,32 +109,36 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `messages` | List[[models.AgentsCompletionStreamRequestMessages](../../models/agentscompletionstreamrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.AgentsCompletionStreamRequestStop]](../../models/agentscompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.AgentsCompletionStreamRequestToolChoice]](../../models/agentscompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `messages` | List[[models.AgentsCompletionStreamRequestMessage](../../models/agentscompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `agent_id` | *str* | :heavy_check_mark: | The ID of the agent to use for this completion. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [OptionalNullable[models.AgentsCompletionStreamRequestStop]](../../models/agentscompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.AgentsCompletionStreamRequestTool](../../models/agentscompletionstreamrequesttool.md)] | :heavy_minus_sign: | N/A | | +| `tool_choice` | [Optional[models.AgentsCompletionStreamRequestToolChoice]](../../models/agentscompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[Union[eventstreaming.EventStream[models.CompletionEvent], eventstreaming.EventStreamAsync[models.CompletionEvent]]](../../models/.md)** +**Union[eventstreaming.EventStream[models.CompletionEvent], eventstreaming.EventStreamAsync[models.CompletionEvent]]** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/audio/README.md b/docs/sdks/audio/README.md deleted file mode 100644 index 2101c266..00000000 --- a/docs/sdks/audio/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Audio -(*audio*) - -## Overview - -### Available Operations diff --git a/docs/sdks/batch/README.md b/docs/sdks/batch/README.md deleted file mode 100644 index ec7d8340..00000000 --- a/docs/sdks/batch/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Batch -(*batch*) - -## Overview - -### Available Operations diff --git a/docs/sdks/batchjobs/README.md b/docs/sdks/batchjobs/README.md new file mode 100644 index 00000000..b9655075 --- /dev/null +++ b/docs/sdks/batchjobs/README.md @@ -0,0 +1,229 @@ +# Batch.Jobs + +## Overview + +### Available Operations + +* [list](#list) - Get Batch Jobs +* [create](#create) - Create Batch Job +* [get](#get) - Get Batch Job +* [delete](#delete) - Delete Batch Job +* [cancel](#cancel) - Cancel Batch Job + +## list + +Get a list of batch jobs for your organization and user. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.batch.jobs.list(page=0, page_size=100, created_by_me=False, order_by="-created") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `created_after` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `created_by_me` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `status` | List[[models.BatchJobStatus](../../models/batchjobstatus.md)] | :heavy_minus_sign: | N/A | +| `order_by` | [Optional[models.OrderBy]](../../models/orderby.md) | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListBatchJobsResponse](../../models/listbatchjobsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Create a new batch job, it will be queued for processing. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.batch.jobs.create(endpoint="/v1/moderations", model="mistral-small-latest", timeout_hours=24) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `endpoint` | [models.APIEndpoint](../../models/apiendpoint.md) | :heavy_check_mark: | N/A | | +| `input_files` | List[*str*] | :heavy_minus_sign: | A list of `.jsonl` files for batch inference.
Each line must be a JSON object with a `body` field containing the request payload:
```json
{"custom_id": "0", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French cheese?"}]}}
{"custom_id": "1", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French wine?"}]}}
``` | | +| `requests` | List[[models.BatchRequest](../../models/batchrequest.md)] | :heavy_minus_sign: | N/A | | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The model to be used for batch inference. | **Example 1:** mistral-small-latest
**Example 2:** mistral-medium-latest | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here. | | +| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | The metadata of your choice to be associated with the batch inference job. | | +| `timeout_hours` | *Optional[int]* | :heavy_minus_sign: | The timeout in hours for the batch inference job. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.BatchJob](../../models/batchjob.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get a batch job details by its UUID. + +Args: + inline: If True, return results inline in the response. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.batch.jobs.get(job_id="4017dc9f-b629-42f4-9700-8c681b9e7f0f") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `job_id` | *str* | :heavy_check_mark: | N/A | +| `inline` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.BatchJob](../../models/batchjob.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Request the deletion of a batch job. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.batch.jobs.delete(job_id="d9e71426-5791-49ad-b8d1-cf0d90d1b7d0") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `job_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeleteBatchJobResponse](../../models/deletebatchjobresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## cancel + +Request the cancellation of a batch job. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.batch.jobs.cancel(job_id="4fb29d1c-535b-4f0a-a1cb-2167f86da569") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `job_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.BatchJob](../../models/batchjob.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/beta/README.md b/docs/sdks/beta/README.md deleted file mode 100644 index f5b5f822..00000000 --- a/docs/sdks/beta/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Beta -(*beta*) - -## Overview - -### Available Operations diff --git a/docs/sdks/betaagents/README.md b/docs/sdks/betaagents/README.md new file mode 100644 index 00000000..56773f08 --- /dev/null +++ b/docs/sdks/betaagents/README.md @@ -0,0 +1,503 @@ +# Beta.Agents + +## Overview + +(beta) Agents API + +### Available Operations + +* [create](#create) - Create an agent that can be used within a conversation. +* [list](#list) - List agent entities. +* [get](#get) - Retrieve an agent entity. +* [update](#update) - Update an agent entity. +* [delete](#delete) - Delete an agent entity. +* [update_version](#update_version) - Update an agent version. +* [list_versions](#list_versions) - List all versions of an agent. +* [get_version](#get_version) - Retrieve a specific version of an agent. +* [create_version_alias](#create_version_alias) - Create or update an agent version alias. +* [list_version_aliases](#list_version_aliases) - List all aliases for an agent. +* [delete_version_alias](#delete_version_alias) - Delete an agent version alias. + +## create + +Create a new agent giving it instructions, tools, description. The agent is then available to be used as a regular assistant in a conversation or as part of an agent pool from which it can be used. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.create(model="LeBaron", name="", completion_args={ + "response_format": { + "type": "text", + }, + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | +| `tools` | List[[models.CreateAgentRequestTool](../../models/createagentrequesttool.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | +| `completion_args` | [Optional[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `version_message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Agent](../../models/agent.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +Retrieve a list of agent entities sorted by creation time. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.list(page=0, page_size=20) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number (0-indexed) | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of agents per page | +| `deployment_chat` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `sources` | List[[models.RequestSource](../../models/requestsource.md)] | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by agent name | +| `search` | *OptionalNullable[str]* | :heavy_minus_sign: | Search agents by name or ID | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**List[models.Agent]** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Given an agent, retrieve an agent entity with its attributes. The agent_version parameter can be an integer version number or a string alias. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.get(agent_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `agent_version` | [OptionalNullable[models.AgentsAPIV1AgentsGetAgentVersion]](../../models/agentsapiv1agentsgetagentversion.md) | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Agent](../../models/agent.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Update an agent attributes and create a new version. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.update(agent_id="", completion_args={ + "response_format": { + "type": "text", + }, + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | +| `tools` | List[[models.UpdateAgentRequestTool](../../models/updateagentrequesttool.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | +| `completion_args` | [Optional[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | +| `deployment_chat` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `version_message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Agent](../../models/agent.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Delete an agent entity. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.agents.delete(agent_id="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update_version + +Switch the version of an agent. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.update_version(agent_id="", version=157995) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `version` | *int* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Agent](../../models/agent.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_versions + +Retrieve all versions for a specific agent with full agent context. Supports pagination. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.list_versions(agent_id="", page=0, page_size=20) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number (0-indexed) | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of versions per page | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**List[models.Agent]** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_version + +Get a specific agent version by version number. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.get_version(agent_id="", version="788393") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `version` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Agent](../../models/agent.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create_version_alias + +Create a new alias or update an existing alias to point to a specific version. Aliases are unique per agent and can be reassigned to different versions. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.create_version_alias(agent_id="", alias="", version=595141) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `alias` | *str* | :heavy_check_mark: | N/A | +| `version` | *int* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.AgentAliasResponse](../../models/agentaliasresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_version_aliases + +Retrieve all version aliases for a specific agent. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.agents.list_version_aliases(agent_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**List[models.AgentAliasResponse]** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete_version_alias + +Delete an existing alias for an agent. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.agents.delete_version_alias(agent_id="", alias="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `agent_id` | *str* | :heavy_check_mark: | N/A | +| `alias` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/campaigns/README.md b/docs/sdks/campaigns/README.md new file mode 100644 index 00000000..d5d7e4d4 --- /dev/null +++ b/docs/sdks/campaigns/README.md @@ -0,0 +1,267 @@ +# Beta.Observability.Campaigns + +## Overview + +### Available Operations + +* [create](#create) - Create and start a new campaign +* [list](#list) - Get all campaigns +* [fetch](#fetch) - Get campaign by id +* [delete](#delete) - Delete a campaign +* [fetch_status](#fetch_status) - Get campaign status by campaign id +* [list_events](#list_events) - Get event ids that were selected by the given campaign + +## create + +Create and start a new campaign + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.campaigns.create(search_params={ + "filters": { + "field": "", + "op": "lt", + "value": "", + }, + }, judge_id="9b501b9f-3525-44a7-a51a-5352679be9ed", name="", description="shakily triangular scotch requirement whether once oh", max_nb_events=232889) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `search_params` | [models.FilterPayload](../../models/filterpayload.md) | :heavy_check_mark: | N/A | +| `judge_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `max_nb_events` | *int* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Campaign](../../models/campaign.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +Get all campaigns + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.campaigns.list(page_size=50, page=1) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `q` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListCampaignsResponse](../../models/listcampaignsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch + +Get campaign by id + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.campaigns.fetch(campaign_id="fd7945d6-00e2-4852-9054-bcbb968d7f98") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Campaign](../../models/campaign.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Delete a campaign + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.observability.campaigns.delete(campaign_id="90e07b45-8cf7-4081-8558-a786779e039d") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch_status + +Get campaign status by campaign id + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.campaigns.fetch_status(campaign_id="4b1dd9a5-8dc9-48e1-bd11-29443e959902") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.FetchCampaignStatusResponse](../../models/fetchcampaignstatusresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_events + +Get event ids that were selected by the given campaign + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.campaigns.list_events(campaign_id="305b5e46-a650-4d8a-8b5b-d23ef90ec831", page_size=50, page=1) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListCampaignSelectedEventsResponse](../../models/listcampaignselectedeventsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index c5c45e0f..96a1e204 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -1,5 +1,4 @@ # Chat -(*chat*) ## Overview @@ -18,7 +17,7 @@ Chat Completion ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -26,12 +25,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.chat.complete(model="mistral-small-latest", messages=[ + res = mistral.chat.complete(model="mistral-large-latest", messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], stream=False) + ], stream=False, response_format={ + "type": "text", + }) # Handle response print(res) @@ -40,27 +41,31 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. | mistral-small-latest | -| `messages` | List[[models.Messages](../../models/messages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.Stop]](../../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](https://docs.mistral.ai/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](https://docs.mistral.ai/models) for model descriptions. | mistral-large-latest | +| `messages` | List[[models.ChatCompletionRequestMessage](../../models/chatcompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [OptionalNullable[models.ChatCompletionRequestStop]](../../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.ChatCompletionRequestTool](../../models/chatcompletionrequesttool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -70,8 +75,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## stream @@ -81,7 +86,7 @@ Mistral AI provides the ability to stream responses back to a client in order to ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -89,12 +94,14 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.chat.stream(model="mistral-small-latest", messages=[ + res = mistral.chat.stream(model="mistral-large-latest", messages=[ { - "content": "Who is the best French painter? Answer in one short sentence.", "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", }, - ], stream=True) + ], stream=True, response_format={ + "type": "text", + }) with res as event_stream: for event in event_stream: @@ -105,35 +112,39 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. | mistral-small-latest | -| `messages` | List[[models.ChatCompletionStreamRequestMessages](../../models/chatcompletionstreamrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.ChatCompletionStreamRequestStop]](../../models/chatcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](https://docs.mistral.ai/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](https://docs.mistral.ai/models) for model descriptions. | mistral-large-latest | +| `messages` | List[[models.ChatCompletionStreamRequestMessage](../../models/chatcompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [OptionalNullable[models.ChatCompletionStreamRequestStop]](../../models/chatcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.ChatCompletionStreamRequestTool](../../models/chatcompletionstreamrequesttool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. | | +| `reasoning_effort` | [OptionalNullable[models.ReasoningEffort]](../../models/reasoningeffort.md) | :heavy_minus_sign: | N/A | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[Union[eventstreaming.EventStream[models.CompletionEvent], eventstreaming.EventStreamAsync[models.CompletionEvent]]](../../models/.md)** +**Union[eventstreaming.EventStream[models.CompletionEvent], eventstreaming.EventStreamAsync[models.CompletionEvent]]** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chatcompletionevents/README.md b/docs/sdks/chatcompletionevents/README.md new file mode 100644 index 00000000..c3f19868 --- /dev/null +++ b/docs/sdks/chatcompletionevents/README.md @@ -0,0 +1,244 @@ +# Beta.Observability.ChatCompletionEvents + +## Overview + +### Available Operations + +* [search](#search) - Get Chat Completion Events +* [search_ids](#search_ids) - Alternative to /search that returns only the IDs and that can return many IDs at once +* [fetch](#fetch) - Get Chat Completion Event +* [fetch_similar_events](#fetch_similar_events) - Get Similar Chat Completion Events +* [judge](#judge) - Run Judge on an event based on the given options + +## search + +Get Chat Completion Events + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.chat_completion_events.search(search_params={ + "filters": None, + }, page_size=50) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `search_params` | [models.FilterPayload](../../models/filterpayload.md) | :heavy_check_mark: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `extra_fields` | List[*str*] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.SearchChatCompletionEventsResponse](../../models/searchchatcompletioneventsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## search_ids + +Alternative to /search that returns only the IDs and that can return many IDs at once + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.chat_completion_events.search_ids(search_params={ + "filters": { + "field": "", + "op": "lt", + "value": "", + }, + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `search_params` | [models.FilterPayload](../../models/filterpayload.md) | :heavy_check_mark: | N/A | +| `extra_fields` | List[*str*] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.SearchChatCompletionEventIdsResponse](../../models/searchchatcompletioneventidsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch + +Get Chat Completion Event + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.chat_completion_events.fetch(event_id="e79bf81b-b37f-425e-9dff-071a54592e44") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ChatCompletionEvent](../../models/chatcompletionevent.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch_similar_events + +Get Similar Chat Completion Events + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.chat_completion_events.fetch_similar_events(event_id="b7be6e08-d068-45fc-b77a-966232e92fd6") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.SearchChatCompletionEventsResponse](../../models/searchchatcompletioneventsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## judge + +Run Judge on an event based on the given options + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.chat_completion_events.judge(event_id="dfcd5582-1373-4de5-af51-987464da561c", judge_definition={ + "name": "", + "description": "total plain self-confidence candid hungrily partial astride cruelly brr", + "model_name": "", + "output": { + "type": "CLASSIFICATION", + "options": [ + { + "value": "", + "description": "indeed insolence delightfully following", + }, + ], + }, + "instructions": "", + "tools": [], + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `event_id` | *str* | :heavy_check_mark: | N/A | +| `judge_definition` | [models.CreateJudgeRequest](../../models/createjudgerequest.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.JudgeOutput](../../models/judgeoutput.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/classifiers/README.md b/docs/sdks/classifiers/README.md index 87eb8d69..dc0f4984 100644 --- a/docs/sdks/classifiers/README.md +++ b/docs/sdks/classifiers/README.md @@ -1,5 +1,4 @@ # Classifiers -(*classifiers*) ## Overview @@ -18,9 +17,9 @@ Moderations ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -28,10 +27,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.classifiers.moderate(model="Durango", inputs=[ - "", - "", - ]) + res = mistral.classifiers.moderate(model="mistral-moderation-latest", inputs="") # Handle response print(res) @@ -40,11 +36,12 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. | -| `inputs` | [models.ClassificationRequestInputs](../../models/classificationrequestinputs.md) | :heavy_check_mark: | Text to classify. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-moderation-latest | +| `inputs` | [models.ClassificationRequestInputs](../../models/classificationrequestinputs.md) | :heavy_check_mark: | Text to classify. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -54,8 +51,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## moderate_chat @@ -63,9 +60,9 @@ Chat Moderations ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -75,8 +72,8 @@ with Mistral( res = mistral.classifiers.moderate_chat(inputs=[ { - "content": "", "role": "tool", + "content": "", }, ], model="LeBaron") @@ -87,11 +84,11 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `inputs` | [models.ChatModerationRequestInputs](../../models/chatmoderationrequestinputs.md) | :heavy_check_mark: | Chat to classify | -| `model` | *str* | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `inputs` | [models.ChatModerationRequestInputs3](../../models/chatmoderationrequestinputs3.md) | :heavy_check_mark: | Chat to classify | +| `model` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -101,8 +98,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## classify @@ -112,7 +109,7 @@ Classifications ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -120,7 +117,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.classifiers.classify(model="Silverado", inputs=[ + res = mistral.classifiers.classify(model="mistral-moderation-latest", inputs=[ "", ]) @@ -131,11 +128,12 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. | -| `inputs` | [models.ClassificationRequestInputs](../../models/classificationrequestinputs.md) | :heavy_check_mark: | Text to classify. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-moderation-latest | +| `inputs` | [models.ClassificationRequestInputs](../../models/classificationrequestinputs.md) | :heavy_check_mark: | Text to classify. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -145,8 +143,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## classify_chat @@ -156,7 +154,7 @@ Chat Classifications ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -164,12 +162,12 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.classifiers.classify_chat(model="Camry", inputs=[ + res = mistral.classifiers.classify_chat(model="Camry", input=[ { "messages": [ { - "content": "", "role": "system", + "content": "", }, ], }, @@ -185,7 +183,7 @@ with Mistral( | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `model` | *str* | :heavy_check_mark: | N/A | -| `inputs` | [models.Inputs](../../models/inputs.md) | :heavy_check_mark: | Chat to classify | +| `input` | [models.Inputs](../../models/inputs.md) | :heavy_check_mark: | Chat to classify | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -196,5 +194,5 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/connectors/README.md b/docs/sdks/connectors/README.md new file mode 100644 index 00000000..753c1cf3 --- /dev/null +++ b/docs/sdks/connectors/README.md @@ -0,0 +1,813 @@ +# Beta.Connectors + +## Overview + +(beta) Connectors API - manage your connectors + +### Available Operations + +* [create](#create) - Create a new connector. +* [list](#list) - List all connectors. +* [get_auth_url](#get_auth_url) - Get the auth URL for a connector. +* [call_tool](#call_tool) - Call Connector Tool +* [list_tools](#list_tools) - List tools for a connector. +* [get_authentication_methods](#get_authentication_methods) - Get authentication methods for a connector. +* [list_organization_credentials](#list_organization_credentials) - List organization credentials for a connector. +* [create_or_update_organization_credentials](#create_or_update_organization_credentials) - Create or update organization credentials for a connector. +* [list_workspace_credentials](#list_workspace_credentials) - List workspace credentials for a connector. +* [create_or_update_workspace_credentials](#create_or_update_workspace_credentials) - Create or update workspace credentials for a connector. +* [list_user_credentials](#list_user_credentials) - List user credentials for a connector. +* [create_or_update_user_credentials](#create_or_update_user_credentials) - Create or update user credentials for a connector. +* [delete_organization_credentials](#delete_organization_credentials) - Delete organization credentials for a connector. +* [delete_workspace_credentials](#delete_workspace_credentials) - Delete workspace credentials for a connector. +* [delete_user_credentials](#delete_user_credentials) - Delete user credentials for a connector. +* [get](#get) - Get a connector. +* [update](#update) - Update a connector. +* [delete](#delete) - Delete a connector. + +## create + +Create a new MCP connector. You can customize its visibility, url and auth type. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.create(name="", description="unibody usually despite slushy wherever reward stingy from", server="https://royal-majority.net/") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes. | +| `description` | *str* | :heavy_check_mark: | The description of the connector. | +| `server` | *str* | :heavy_check_mark: | The url of the MCP server. | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional human-readable title for the connector. | +| `icon_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The optional url of the icon you want to associate to the connector. | +| `visibility` | [Optional[models.ResourceVisibility]](../../models/resourcevisibility.md) | :heavy_minus_sign: | N/A | +| `headers` | Dict[str, *Any*] | :heavy_minus_sign: | Optional organization-level headers to be sent with the request to the mcp server. | +| `auth_data` | [OptionalNullable[models.AuthData]](../../models/authdata.md) | :heavy_minus_sign: | Optional additional authentication data for the connector. | +| `system_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional system prompt for the connector. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Connector](../../models/connector.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +List all your custom connectors with keyset pagination and filters. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.list(page_size=100) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `query_filters` | [Optional[models.ConnectorsQueryFilters]](../../models/connectorsqueryfilters.md) | :heavy_minus_sign: | N/A | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.PaginatedConnectors](../../models/paginatedconnectors.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_auth_url + +Get the OAuth2 authorization URL for a connector to initiate user authentication. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.get_auth_url(connector_id_or_name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `app_return_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `credentials_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.AuthURLResponse](../../models/authurlresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## call_tool + +Call a tool on an MCP connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.call_tool(tool_name="", connector_id_or_name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `tool_name` | *str* | :heavy_check_mark: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `credentials_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `arguments` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ConnectorToolCallResponse](../../models/connectortoolcallresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_tools + +List all tools available for an MCP connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.list_tools(connector_id_or_name="", page=1, page_size=100, refresh=False, pretty=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `refresh` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `pretty` | *Optional[bool]* | :heavy_minus_sign: | Return a simplified payload with only name, description, annotations, and a compact inputSchema. | +| `credentials_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ResponseConnectorListToolsV1](../../models/responseconnectorlisttoolsv1.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_authentication_methods + +Get the authentication schema for a connector. Returns the list of supported authentication methods and their required headers. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.get_authentication_methods(connector_id_or_name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[List[models.PublicAuthenticationMethod]](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_organization_credentials + +List all credentials configured at the organization level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.list_organization_credentials(connector_id_or_name="", fetch_default=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `auth_type` | [OptionalNullable[models.OutboundAuthenticationType]](../../models/outboundauthenticationtype.md) | :heavy_minus_sign: | N/A | +| `fetch_default` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CredentialsResponse](../../models/credentialsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create_or_update_organization_credentials + +Create or update credentials at the organization level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.create_or_update_organization_credentials(connector_id_or_name="", name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | Name of the credentials. Use this name to access or modify your credentials. | +| `is_default` | *OptionalNullable[bool]* | :heavy_minus_sign: | Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. | +| `credentials` | [OptionalNullable[models.ConnectionCredentials]](../../models/connectioncredentials.md) | :heavy_minus_sign: | The credential data (headers, bearer_token). | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_workspace_credentials + +List all credentials configured at the workspace level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.list_workspace_credentials(connector_id_or_name="", fetch_default=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `auth_type` | [OptionalNullable[models.OutboundAuthenticationType]](../../models/outboundauthenticationtype.md) | :heavy_minus_sign: | N/A | +| `fetch_default` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CredentialsResponse](../../models/credentialsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create_or_update_workspace_credentials + +Create or update credentials at the workspace level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.create_or_update_workspace_credentials(connector_id_or_name="", name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | Name of the credentials. Use this name to access or modify your credentials. | +| `is_default` | *OptionalNullable[bool]* | :heavy_minus_sign: | Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. | +| `credentials` | [OptionalNullable[models.ConnectionCredentials]](../../models/connectioncredentials.md) | :heavy_minus_sign: | The credential data (headers, bearer_token). | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_user_credentials + +List all credentials configured at the user level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.list_user_credentials(connector_id_or_name="", fetch_default=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `auth_type` | [OptionalNullable[models.OutboundAuthenticationType]](../../models/outboundauthenticationtype.md) | :heavy_minus_sign: | N/A | +| `fetch_default` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CredentialsResponse](../../models/credentialsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create_or_update_user_credentials + +Create or update credentials at the user level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.create_or_update_user_credentials(connector_id_or_name="", name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | Name of the credentials. Use this name to access or modify your credentials. | +| `is_default` | *OptionalNullable[bool]* | :heavy_minus_sign: | Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. | +| `credentials` | [OptionalNullable[models.ConnectionCredentials]](../../models/connectioncredentials.md) | :heavy_minus_sign: | The credential data (headers, bearer_token). | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete_organization_credentials + +Delete credentials at the organization level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.delete_organization_credentials(credentials_name="", connector_id_or_name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `credentials_name` | *str* | :heavy_check_mark: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete_workspace_credentials + +Delete credentials at the workspace level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.delete_workspace_credentials(credentials_name="", connector_id_or_name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `credentials_name` | *str* | :heavy_check_mark: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete_user_credentials + +Delete credentials at the user level for a given connector. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.delete_user_credentials(credentials_name="", connector_id_or_name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `credentials_name` | *str* | :heavy_check_mark: | N/A | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get a connector by its ID or name. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.get(connector_id_or_name="", fetch_customer_data=False, fetch_connection_secrets=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `connector_id_or_name` | *str* | :heavy_check_mark: | N/A | +| `fetch_customer_data` | *Optional[bool]* | :heavy_minus_sign: | Fetch the customer data associated with the connector (e.g. customer secrets / config). | +| `fetch_connection_secrets` | *Optional[bool]* | :heavy_minus_sign: | Fetch the general connection secrets associated with the connector. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Connector](../../models/connector.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Update a connector by its ID. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.update(connector_id="81d30634-113f-4dce-a89e-7786be2d8693") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional human-readable title for the connector. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the connector. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the connector. | +| `icon_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The optional url of the icon you want to associate to the connector. | +| `system_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional system prompt for the connector. | +| `connection_config` | Dict[str, *Any*] | :heavy_minus_sign: | Optional new connection config. | +| `connection_secrets` | Dict[str, *Any*] | :heavy_minus_sign: | Optional new connection secrets | +| `server` | *OptionalNullable[str]* | :heavy_minus_sign: | New server url for your mcp connector. | +| `headers` | Dict[str, *Any*] | :heavy_minus_sign: | New headers for your mcp connector. | +| `auth_data` | [OptionalNullable[models.AuthData]](../../models/authdata.md) | :heavy_minus_sign: | New authentication data for your mcp connector. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Connector](../../models/connector.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Delete a connector by its ID. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.connectors.delete(connector_id="5c3269fe-6a18-4216-b1fb-b093005874cd") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `connector_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.MessageResponse](../../models/messageresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/conversations/README.md b/docs/sdks/conversations/README.md index d3ce96c2..e6c73e23 100644 --- a/docs/sdks/conversations/README.md +++ b/docs/sdks/conversations/README.md @@ -1,5 +1,4 @@ -# Conversations -(*beta.conversations*) +# Beta.Conversations ## Overview @@ -10,6 +9,7 @@ * [start](#start) - Create a conversation and append entries to it. * [list](#list) - List all created conversations. * [get](#get) - Retrieve a conversation information. +* [delete](#delete) - Delete a conversation. * [append](#append) - Append new entries to an existing conversation. * [get_history](#get_history) - Retrieve all entries in a conversation. * [get_messages](#get_messages) - Retrieve all messages in a conversation. @@ -26,7 +26,7 @@ Create a new conversation, using a base model or an agent and append entries. Co ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -34,7 +34,11 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.start(inputs="", stream=False) + res = mistral.beta.conversations.start(inputs="", completion_args={ + "response_format": { + "type": "text", + }, + }) # Handle response print(res) @@ -43,20 +47,22 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `inputs` | [models.ConversationInputs](../../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | -| `handoff_execution` | [OptionalNullable[models.HandoffExecution]](../../models/handoffexecution.md) | :heavy_minus_sign: | N/A | -| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `tools` | List[[models.Tools](../../models/tools.md)] | :heavy_minus_sign: | N/A | -| `completion_args` | [OptionalNullable[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `inputs` | [models.ConversationInputs](../../models/conversationinputs.md) | :heavy_check_mark: | N/A | +| `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `handoff_execution` | [OptionalNullable[models.ConversationRequestHandoffExecution]](../../models/conversationrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | +| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `tools` | List[[models.ConversationRequestTool](../../models/conversationrequesttool.md)] | :heavy_minus_sign: | N/A | +| `completion_args` | [OptionalNullable[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | N/A | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_version` | [OptionalNullable[models.ConversationRequestAgentVersion]](../../models/conversationrequestagentversion.md) | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -66,8 +72,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -77,7 +83,7 @@ Retrieve a list of conversation entities sorted by creation time. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -98,18 +104,19 @@ with Mistral( | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `page` | *Optional[int]* | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[List[models.ResponseBody]](../../models/.md)** +**List[models.AgentsAPIV1ConversationsListResponse]** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -119,7 +126,7 @@ Given a conversation_id retrieve a conversation entity with its attributes. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -143,14 +150,50 @@ with Mistral( ### Response -**[models.AgentsAPIV1ConversationsGetResponseV1ConversationsGet](../../models/agentsapiv1conversationsgetresponsev1conversationsget.md)** +**[models.ResponseV1ConversationsGet](../../models/responsev1conversationsget.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Delete a conversation given a conversation_id. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.conversations.delete(conversation_id="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `conversation_id` | *str* | :heavy_check_mark: | ID of the conversation from which we are fetching metadata. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## append @@ -160,7 +203,7 @@ Run completion on the history of the conversation and the user entries. Return t ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -168,7 +211,11 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.append(conversation_id="", inputs=[], stream=False, store=True, handoff_execution="server") + res = mistral.beta.conversations.append(conversation_id="", store=True, handoff_execution="server", completion_args={ + "response_format": { + "type": "text", + }, + }) # Handle response print(res) @@ -180,11 +227,11 @@ with Mistral( | Parameter | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `conversation_id` | *str* | :heavy_check_mark: | ID of the conversation to which we append entries. | -| `inputs` | [models.ConversationInputs](../../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `inputs` | [Optional[models.ConversationInputs]](../../models/conversationinputs.md) | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationAppendRequestHandoffExecution]](../../models/conversationappendrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | | `completion_args` | [Optional[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `tool_confirmations` | List[[models.ToolCallConfirmation](../../models/toolcallconfirmation.md)] | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -195,8 +242,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_history @@ -206,7 +253,7 @@ Given a conversation_id retrieve all the entries belonging to that conversation. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -236,8 +283,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_messages @@ -247,7 +294,7 @@ Given a conversation_id retrieve all the messages belonging to that conversation ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -277,8 +324,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## restart @@ -288,7 +335,7 @@ Given a conversation_id and an id, recreate a conversation from this point and r ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -296,7 +343,11 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.restart(conversation_id="", inputs="", from_entry_id="", stream=False, store=True, handoff_execution="server") + res = mistral.beta.conversations.restart(conversation_id="", from_entry_id="", store=True, handoff_execution="server", completion_args={ + "response_format": { + "type": "text", + }, + }) # Handle response print(res) @@ -308,12 +359,14 @@ with Mistral( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | `conversation_id` | *str* | :heavy_check_mark: | ID of the original conversation which is being restarted. | -| `inputs` | [models.ConversationInputs](../../models/conversationinputs.md) | :heavy_check_mark: | N/A | | `from_entry_id` | *str* | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `inputs` | [Optional[models.ConversationInputs]](../../models/conversationinputs.md) | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationRestartRequestHandoffExecution]](../../models/conversationrestartrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | | `completion_args` | [Optional[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Custom metadata for the conversation. | +| `agent_version` | [OptionalNullable[models.ConversationRestartRequestAgentVersion]](../../models/conversationrestartrequestagentversion.md) | :heavy_minus_sign: | Specific version of the agent to use when restarting. If not provided, uses the current version. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -324,8 +377,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## start_stream @@ -335,7 +388,7 @@ Create a new conversation, using a base model or an agent and append entries. Co ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -350,7 +403,11 @@ with Mistral( "tool_call_id": "", "result": "", }, - ], stream=True) + ], completion_args={ + "response_format": { + "type": "text", + }, + }) with res as event_stream: for event in event_stream: @@ -364,28 +421,30 @@ with Mistral( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | `inputs` | [models.ConversationInputs](../../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | `handoff_execution` | [OptionalNullable[models.ConversationStreamRequestHandoffExecution]](../../models/conversationstreamrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | | `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `tools` | List[[models.ConversationStreamRequestTools](../../models/conversationstreamrequesttools.md)] | :heavy_minus_sign: | N/A | +| `tools` | List[[models.ConversationStreamRequestTool](../../models/conversationstreamrequesttool.md)] | :heavy_minus_sign: | N/A | | `completion_args` | [OptionalNullable[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | N/A | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | | `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `agent_version` | [OptionalNullable[models.ConversationStreamRequestAgentVersion]](../../models/conversationstreamrequestagentversion.md) | :heavy_minus_sign: | N/A | | `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[Union[eventstreaming.EventStream[models.ConversationEvents], eventstreaming.EventStreamAsync[models.ConversationEvents]]](../../models/.md)** +**Union[eventstreaming.EventStream[models.ConversationEvents], eventstreaming.EventStreamAsync[models.ConversationEvents]]** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## append_stream @@ -395,7 +454,7 @@ Run completion on the history of the conversation and the user entries. Return t ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -403,7 +462,11 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.append_stream(conversation_id="", inputs="", stream=True, store=True, handoff_execution="server") + res = mistral.beta.conversations.append_stream(conversation_id="", store=True, handoff_execution="server", completion_args={ + "response_format": { + "type": "text", + }, + }) with res as event_stream: for event in event_stream: @@ -417,23 +480,23 @@ with Mistral( | Parameter | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | `conversation_id` | *str* | :heavy_check_mark: | ID of the conversation to which we append entries. | -| `inputs` | [models.ConversationInputs](../../models/conversationinputs.md) | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `inputs` | [Optional[models.ConversationInputs]](../../models/conversationinputs.md) | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationAppendStreamRequestHandoffExecution]](../../models/conversationappendstreamrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | | `completion_args` | [Optional[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `tool_confirmations` | List[[models.ToolCallConfirmation](../../models/toolcallconfirmation.md)] | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[Union[eventstreaming.EventStream[models.ConversationEvents], eventstreaming.EventStreamAsync[models.ConversationEvents]]](../../models/.md)** +**Union[eventstreaming.EventStream[models.ConversationEvents], eventstreaming.EventStreamAsync[models.ConversationEvents]]** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## restart_stream @@ -443,7 +506,7 @@ Given a conversation_id and an id, recreate a conversation from this point and r ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -451,15 +514,11 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.conversations.restart_stream(conversation_id="", inputs=[ - { - "object": "entry", - "type": "message.input", - "role": "assistant", - "content": "", - "prefix": False, + res = mistral.beta.conversations.restart_stream(conversation_id="", from_entry_id="", store=True, handoff_execution="server", completion_args={ + "response_format": { + "type": "text", }, - ], from_entry_id="", stream=True, store=True, handoff_execution="server") + }) with res as event_stream: for event in event_stream: @@ -473,21 +532,23 @@ with Mistral( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `conversation_id` | *str* | :heavy_check_mark: | ID of the original conversation which is being restarted. | -| `inputs` | [models.ConversationInputs](../../models/conversationinputs.md) | :heavy_check_mark: | N/A | | `from_entry_id` | *str* | :heavy_check_mark: | N/A | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `inputs` | [Optional[models.ConversationInputs]](../../models/conversationinputs.md) | :heavy_minus_sign: | N/A | | `store` | *Optional[bool]* | :heavy_minus_sign: | Whether to store the results into our servers or not. | | `handoff_execution` | [Optional[models.ConversationRestartStreamRequestHandoffExecution]](../../models/conversationrestartstreamrequesthandoffexecution.md) | :heavy_minus_sign: | N/A | | `completion_args` | [Optional[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | +| `guardrails` | List[[models.GuardrailConfig](../../models/guardrailconfig.md)] | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Custom metadata for the conversation. | +| `agent_version` | [OptionalNullable[models.ConversationRestartStreamRequestAgentVersion]](../../models/conversationrestartstreamrequestagentversion.md) | :heavy_minus_sign: | Specific version of the agent to use when restarting. If not provided, uses the current version. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[Union[eventstreaming.EventStream[models.ConversationEvents], eventstreaming.EventStreamAsync[models.ConversationEvents]]](../../models/.md)** +**Union[eventstreaming.EventStream[models.ConversationEvents], eventstreaming.EventStreamAsync[models.ConversationEvents]]** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/datasets/README.md b/docs/sdks/datasets/README.md new file mode 100644 index 00000000..c04ced0c --- /dev/null +++ b/docs/sdks/datasets/README.md @@ -0,0 +1,669 @@ +# Beta.Observability.Datasets + +## Overview + +### Available Operations + +* [create](#create) - Create a new empty dataset +* [list](#list) - List existing datasets +* [fetch](#fetch) - Get dataset by id +* [delete](#delete) - Delete a dataset +* [update](#update) - Patch dataset +* [list_records](#list_records) - List existing records in the dataset +* [create_record](#create_record) - Add a conversation to the dataset +* [import_from_campaign](#import_from_campaign) - Populate the dataset with a campaign +* [import_from_explorer](#import_from_explorer) - Populate the dataset with samples from the explorer +* [import_from_file](#import_from_file) - Populate the dataset with samples from an uploaded file +* [import_from_playground](#import_from_playground) - Populate the dataset with samples from the playground +* [import_from_dataset_records](#import_from_dataset_records) - Populate the dataset with samples from another dataset +* [export_to_jsonl](#export_to_jsonl) - Export to the Files API and retrieve presigned URL to download the resulting JSONL file +* [fetch_task](#fetch_task) - Get status of a dataset import task +* [list_tasks](#list_tasks) - List import tasks for the given dataset + +## create + +Create a new empty dataset + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.create(name="", description="citizen whoever sustenance necessary vibrant openly") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Dataset](../../models/dataset.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +List existing datasets + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.list(page_size=50, page=1) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `q` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListDatasetsResponse](../../models/listdatasetsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch + +Get dataset by id + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.fetch(dataset_id="036fa362-e080-4fa5-beff-a334a70efb58") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetPreview](../../models/datasetpreview.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Delete a dataset + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.observability.datasets.delete(dataset_id="baf961a3-bb8e-4085-89ef-de9c5d8c4e77") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Patch dataset + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.update(dataset_id="95be9afc-fc05-44a6-af9f-2362de1224f9") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetPreview](../../models/datasetpreview.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_records + +List existing records in the dataset + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.list_records(dataset_id="444d2a88-e636-4bc0-ab6c-919bedaed112", page_size=50, page=1) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListDatasetRecordsResponse](../../models/listdatasetrecordsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create_record + +Add a conversation to the dataset + +### Example Usage + + +```python +from mistralai.client import Mistral, models +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.create_record(dataset_id="4c54ed13-1459-44e1-8696-1a6df06f7177", payload=models.ConversationPayload( + messages=[ + { + "key": "", + }, + { + "key": "", + "key1": "", + }, + ], + ), properties={ + "key": "", + "key1": "", + "key2": "", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `payload` | [models.ConversationPayload](../../models/conversationpayload.md) | :heavy_check_mark: | N/A | +| `properties` | Dict[str, *Any*] | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetRecord](../../models/datasetrecord.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## import_from_campaign + +Populate the dataset with a campaign + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.import_from_campaign(dataset_id="306b5f31-e31c-4e06-9220-e3008c61bf1b", campaign_id="71a2e42d-7414-4fe6-89cb-44a2122b6f6b") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `campaign_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetImportTask](../../models/datasetimporttask.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## import_from_explorer + +Populate the dataset with samples from the explorer + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.import_from_explorer(dataset_id="ee1930e9-54f7-4c68-aa8a-40fe5d2a3485", completion_event_ids=[ + "", + "", + "", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `completion_event_ids` | List[*str*] | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetImportTask](../../models/datasetimporttask.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## import_from_file + +Populate the dataset with samples from an uploaded file + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.import_from_file(dataset_id="1c96c925-cc58-4529-863d-9fe66a6f1924", file_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetImportTask](../../models/datasetimporttask.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## import_from_playground + +Populate the dataset with samples from the playground + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.import_from_playground(dataset_id="5cb42584-5fcf-4837-997a-6a67c5e6900d", conversation_ids=[]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `conversation_ids` | List[*str*] | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetImportTask](../../models/datasetimporttask.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## import_from_dataset_records + +Populate the dataset with samples from another dataset + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.import_from_dataset_records(dataset_id="ada96a08-d724-4e5c-9111-aaf1bdb7d588", dataset_record_ids=[ + "58fe798a-537b-4c61-9efc-d1d96d5d264a", + "cfa1d197-deda-456e-906b-dd84dccfcd17", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `dataset_record_ids` | List[*str*] | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetImportTask](../../models/datasetimporttask.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## export_to_jsonl + +Export to the Files API and retrieve presigned URL to download the resulting JSONL file + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.export_to_jsonl(dataset_id="d521add6-d909-4a69-a460-cb880d87b773") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ExportDatasetResponse](../../models/exportdatasetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch_task + +Get status of a dataset import task + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.fetch_task(dataset_id="b64b504e-58a2-4d52-979b-e2634b301235", task_id="1713cde2-dea1-410d-851e-8cea964ffa14") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `task_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetImportTask](../../models/datasetimporttask.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_tasks + +List import tasks for the given dataset + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.list_tasks(dataset_id="29903443-7f9c-42a6-9b6b-fc5cbef4191a", page_size=50, page=1) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_id` | *str* | :heavy_check_mark: | N/A | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListDatasetImportTasksResponse](../../models/listdatasetimporttasksresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/deployments/README.md b/docs/sdks/deployments/README.md new file mode 100644 index 00000000..941b5538 --- /dev/null +++ b/docs/sdks/deployments/README.md @@ -0,0 +1,91 @@ +# Workflows.Deployments + +## Overview + +### Available Operations + +* [list_deployments](#list_deployments) - List Deployments +* [get_deployment](#get_deployment) - Get Deployment + +## list_deployments + +List Deployments + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.deployments.list_deployments(active_only=True) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `active_only` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `workflow_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeploymentListResponse](../../models/deploymentlistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_deployment + +Get Deployment + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.deployments.get_deployment(name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DeploymentDetailResponse](../../models/deploymentdetailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/documents/README.md b/docs/sdks/documents/README.md index 71848b07..eabe9976 100644 --- a/docs/sdks/documents/README.md +++ b/docs/sdks/documents/README.md @@ -1,5 +1,4 @@ -# Documents -(*beta.libraries.documents*) +# Beta.Libraries.Documents ## Overview @@ -7,7 +6,7 @@ ### Available Operations -* [list](#list) - List document in a given library. +* [list](#list) - List documents in a given library. * [upload](#upload) - Upload a new document. * [get](#get) - Retrieve the metadata of a specific document. * [update](#update) - Update the metadata of a specific document. @@ -26,7 +25,7 @@ Given a library, lists the document that have been uploaded to that library. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -49,20 +48,21 @@ with Mistral( | `search` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | | `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `filters_attributes` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `sort_by` | *Optional[str]* | :heavy_minus_sign: | N/A | | `sort_order` | *Optional[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.ListDocumentOut](../../models/listdocumentout.md)** +**[models.ListDocumentsResponse](../../models/listdocumentsresponse.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## upload @@ -72,7 +72,7 @@ Given a library, upload a new document to that library. It is queued for process ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -100,14 +100,14 @@ with Mistral( ### Response -**[models.DocumentOut](../../models/documentout.md)** +**[models.Document](../../models/document.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -117,7 +117,7 @@ Given a library and a document in this library, you can retrieve the metadata of ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -142,14 +142,14 @@ with Mistral( ### Response -**[models.DocumentOut](../../models/documentout.md)** +**[models.Document](../../models/document.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -159,7 +159,7 @@ Given a library and a document in that library, update the name of that document ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -180,19 +180,20 @@ with Mistral( | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `library_id` | *str* | :heavy_check_mark: | N/A | | `document_id` | *str* | :heavy_check_mark: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `attributes` | Dict[str, [models.Attributes](../../models/attributes.md)] | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.DocumentOut](../../models/documentout.md)** +**[models.Document](../../models/document.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -202,7 +203,7 @@ Given a library and a document in that library, delete that document. The docume ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -228,8 +229,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## text_content @@ -239,7 +240,7 @@ Given a library and a document in that library, you can retrieve the text conten ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -260,6 +261,8 @@ with Mistral( | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `library_id` | *str* | :heavy_check_mark: | N/A | | `document_id` | *str* | :heavy_check_mark: | N/A | +| `page_start` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `page_end` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -270,8 +273,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## status @@ -281,7 +284,7 @@ Given a library and a document in that library, retrieve the processing status o ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -306,14 +309,14 @@ with Mistral( ### Response -**[models.ProcessingStatusOut](../../models/processingstatusout.md)** +**[models.ProcessingStatus](../../models/processingstatus.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_signed_url @@ -323,7 +326,7 @@ Given a library and a document in that library, retrieve the signed URL of a spe ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -348,14 +351,14 @@ with Mistral( ### Response -**[str](../../models/.md)** +**str** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## extracted_text_signed_url @@ -365,7 +368,7 @@ Given a library and a document in that library, retrieve the signed URL of text ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -390,14 +393,14 @@ with Mistral( ### Response -**[str](../../models/.md)** +**str** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## reprocess @@ -407,7 +410,7 @@ Given a library and a document in that library, reprocess that document, it will ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -433,5 +436,5 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/embeddings/README.md b/docs/sdks/embeddings/README.md index 9554e7b7..cb207d8b 100644 --- a/docs/sdks/embeddings/README.md +++ b/docs/sdks/embeddings/README.md @@ -1,5 +1,4 @@ # Embeddings -(*embeddings*) ## Overview @@ -15,9 +14,9 @@ Embeddings ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -37,14 +36,15 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-embed | -| `inputs` | [models.EmbeddingRequestInputs](../../models/embeddingrequestinputs.md) | :heavy_check_mark: | Text to embed. | [
"Embed this sentence.",
"As well as this one."
] | -| `output_dimension` | *OptionalNullable[int]* | :heavy_minus_sign: | The dimension of the output embeddings. | | -| `output_dtype` | [Optional[models.EmbeddingDtype]](../../models/embeddingdtype.md) | :heavy_minus_sign: | N/A | | -| `encoding_format` | [Optional[models.EncodingFormat]](../../models/encodingformat.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. | mistral-embed | +| `inputs` | [models.EmbeddingRequestInputs](../../models/embeddingrequestinputs.md) | :heavy_check_mark: | Text to embed. | [
"Embed this sentence.",
"As well as this one."
] | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `output_dimension` | *OptionalNullable[int]* | :heavy_minus_sign: | The dimension of the output embeddings when feature available. If not provided, a default output dimension will be used. | | +| `output_dtype` | [Optional[models.EmbeddingDtype]](../../models/embeddingdtype.md) | :heavy_minus_sign: | N/A | | +| `encoding_format` | [Optional[models.EncodingFormat]](../../models/encodingformat.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -54,5 +54,5 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/events/README.md b/docs/sdks/events/README.md new file mode 100644 index 00000000..de6b43fc --- /dev/null +++ b/docs/sdks/events/README.md @@ -0,0 +1,107 @@ +# Events + +## Overview + +### Available Operations + +* [get_stream_events](#get_stream_events) - Get Stream Events +* [get_workflow_events](#get_workflow_events) - Get Workflow Events + +## get_stream_events + +Get Stream Events + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.events.get_stream_events(scope="*", activity_name="*", activity_id="*", workflow_name="*", workflow_exec_id="*", root_workflow_exec_id="*", parent_workflow_exec_id="*", stream="*", start_seq=0) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `scope` | [Optional[models.Scope]](../../models/scope.md) | :heavy_minus_sign: | N/A | +| `activity_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `activity_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `workflow_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `root_workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `parent_workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `stream` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `start_seq` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `metadata_filters` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `workflow_event_types` | List[[models.WorkflowEventType](../../models/workfloweventtype.md)] | :heavy_minus_sign: | N/A | +| `last_event_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[Union[eventstreaming.EventStream[models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody], eventstreaming.EventStreamAsync[models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody]]](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow_events + +Get Workflow Events + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.events.get_workflow_events(limit=100) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `root_workflow_exec_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Execution ID of the root workflow that initiated this execution chain. | +| `workflow_exec_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Run ID of the workflow that emitted this event. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of events to return. | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor for pagination. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListWorkflowEventResponse](../../models/listworkfloweventresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/executions/README.md b/docs/sdks/executions/README.md new file mode 100644 index 00000000..1bf4ed25 --- /dev/null +++ b/docs/sdks/executions/README.md @@ -0,0 +1,599 @@ +# Workflows.Executions + +## Overview + +### Available Operations + +* [get_workflow_execution](#get_workflow_execution) - Get Workflow Execution +* [get_workflow_execution_history](#get_workflow_execution_history) - Get Workflow Execution History +* [signal_workflow_execution](#signal_workflow_execution) - Signal Workflow Execution +* [query_workflow_execution](#query_workflow_execution) - Query Workflow Execution +* [terminate_workflow_execution](#terminate_workflow_execution) - Terminate Workflow Execution +* [batch_terminate_workflow_executions](#batch_terminate_workflow_executions) - Batch Terminate Workflow Executions +* [cancel_workflow_execution](#cancel_workflow_execution) - Cancel Workflow Execution +* [batch_cancel_workflow_executions](#batch_cancel_workflow_executions) - Batch Cancel Workflow Executions +* [reset_workflow](#reset_workflow) - Reset Workflow +* [update_workflow_execution](#update_workflow_execution) - Update Workflow Execution +* [get_workflow_execution_trace_otel](#get_workflow_execution_trace_otel) - Get Workflow Execution Trace Otel +* [get_workflow_execution_trace_summary](#get_workflow_execution_trace_summary) - Get Workflow Execution Trace Summary +* [get_workflow_execution_trace_events](#get_workflow_execution_trace_events) - Get Workflow Execution Trace Events +* [stream](#stream) - Stream + +## get_workflow_execution + +Get Workflow Execution + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.get_workflow_execution(execution_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowExecutionResponse](../../models/workflowexecutionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow_execution_history + +Get Workflow Execution History + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.get_workflow_execution_history(execution_id="", decode_payloads=True) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `decode_payloads` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[Any](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## signal_workflow_execution + +Signal Workflow Execution + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.signal_workflow_execution(execution_id="", name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | The name of the signal to send | +| `input` | [OptionalNullable[models.SignalInvocationBodyInput]](../../models/signalinvocationbodyinput.md) | :heavy_minus_sign: | Input data for the signal, matching its schema | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.SignalWorkflowResponse](../../models/signalworkflowresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## query_workflow_execution + +Query Workflow Execution + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.query_workflow_execution(execution_id="", name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | The name of the query to request | +| `input` | [OptionalNullable[models.QueryInvocationBodyInput]](../../models/queryinvocationbodyinput.md) | :heavy_minus_sign: | Input data for the query, matching its schema | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.QueryWorkflowResponse](../../models/queryworkflowresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## terminate_workflow_execution + +Terminate Workflow Execution + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.workflows.executions.terminate_workflow_execution(execution_id="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## batch_terminate_workflow_executions + +Batch Terminate Workflow Executions + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.batch_terminate_workflow_executions(execution_ids=[ + "", + "", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_ids` | List[*str*] | :heavy_check_mark: | List of execution IDs to process | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.BatchExecutionResponse](../../models/batchexecutionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## cancel_workflow_execution + +Cancel Workflow Execution + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.workflows.executions.cancel_workflow_execution(execution_id="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## batch_cancel_workflow_executions + +Batch Cancel Workflow Executions + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.batch_cancel_workflow_executions(execution_ids=[]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_ids` | List[*str*] | :heavy_check_mark: | List of execution IDs to process | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.BatchExecutionResponse](../../models/batchexecutionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## reset_workflow + +Reset Workflow + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.workflows.executions.reset_workflow(execution_id="", event_id=24149, exclude_signals=False, exclude_updates=False) + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `event_id` | *int* | :heavy_check_mark: | The event ID to reset the workflow execution to | +| `reason` | *OptionalNullable[str]* | :heavy_minus_sign: | Reason for resetting the workflow execution | +| `exclude_signals` | *Optional[bool]* | :heavy_minus_sign: | Whether to exclude signals that happened after the reset point | +| `exclude_updates` | *Optional[bool]* | :heavy_minus_sign: | Whether to exclude updates that happened after the reset point | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update_workflow_execution + +Update Workflow Execution + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.update_workflow_execution(execution_id="", name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | The name of the update to request | +| `input` | [OptionalNullable[models.UpdateInvocationBodyInput]](../../models/updateinvocationbodyinput.md) | :heavy_minus_sign: | Input data for the update, matching its schema | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.UpdateWorkflowResponse](../../models/updateworkflowresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow_execution_trace_otel + +Get Workflow Execution Trace Otel + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.get_workflow_execution_trace_otel(execution_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowExecutionTraceOTelResponse](../../models/workflowexecutiontraceotelresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow_execution_trace_summary + +Get Workflow Execution Trace Summary + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.get_workflow_execution_trace_summary(execution_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowExecutionTraceSummaryResponse](../../models/workflowexecutiontracesummaryresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow_execution_trace_events + +Get Workflow Execution Trace Events + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.get_workflow_execution_trace_events(execution_id="", merge_same_id_events=False, include_internal_events=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `merge_same_id_events` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `include_internal_events` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowExecutionTraceEventsResponse](../../models/workflowexecutiontraceeventsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## stream + +Stream + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.executions.stream(execution_id="") + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `execution_id` | *str* | :heavy_check_mark: | N/A | +| `event_source` | [OptionalNullable[models.EventSource]](../../models/eventsource.md) | :heavy_minus_sign: | N/A | +| `last_event_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[Union[eventstreaming.EventStream[models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody], eventstreaming.EventStreamAsync[models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody]]](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/fields/README.md b/docs/sdks/fields/README.md new file mode 100644 index 00000000..3c842441 --- /dev/null +++ b/docs/sdks/fields/README.md @@ -0,0 +1,133 @@ +# Beta.Observability.ChatCompletionEvents.Fields + +## Overview + +### Available Operations + +* [list](#list) - Get Chat Completion Fields +* [fetch_options](#fetch_options) - Get Chat Completion Field Options +* [fetch_option_counts](#fetch_option_counts) - Get Chat Completion Field Options Counts + +## list + +Get Chat Completion Fields + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.chat_completion_events.fields.list() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListChatCompletionFieldsResponse](../../models/listchatcompletionfieldsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch_options + +Get Chat Completion Field Options + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.chat_completion_events.fields.fetch_options(field_name="", operator="startswith") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `field_name` | *str* | :heavy_check_mark: | N/A | +| `operator` | [models.Operator](../../models/operator.md) | :heavy_check_mark: | The operator to use for filtering options | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.FetchChatCompletionFieldOptionsResponse](../../models/fetchchatcompletionfieldoptionsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch_option_counts + +Get Chat Completion Field Options Counts + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.chat_completion_events.fields.fetch_option_counts(field_name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `field_name` | *str* | :heavy_check_mark: | N/A | +| `filter_params` | [OptionalNullable[models.FilterPayload]](../../models/filterpayload.md) | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.FetchFieldOptionCountsResponse](../../models/fetchfieldoptioncountsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/files/README.md b/docs/sdks/files/README.md index e8d28c86..d0e88f2e 100644 --- a/docs/sdks/files/README.md +++ b/docs/sdks/files/README.md @@ -1,5 +1,4 @@ # Files -(*files*) ## Overview @@ -24,9 +23,9 @@ Please contact us if you need to increase these storage limits. ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -37,7 +36,7 @@ with Mistral( res = mistral.files.upload(file={ "file_name": "example.file", "content": open("example.file", "rb"), - }) + }, visibility="workspace") # Handle response print(res) @@ -49,18 +48,20 @@ with Mistral( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `file` | [models.File](../../models/file.md) | :heavy_check_mark: | The File object (not file name) to be uploaded.
To upload a file and specify a custom file name you should format your request as such:
```bash
file=@path/to/your/file.jsonl;filename=custom_name.jsonl
```
Otherwise, you can just keep the original file name:
```bash
file=@path/to/your/file.jsonl
``` | +| `expiry` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `visibility` | [Optional[models.FilesAPIRoutesUploadFileFileVisibility]](../../models/filesapiroutesuploadfilefilevisibility.md) | :heavy_minus_sign: | N/A | | `purpose` | [Optional[models.FilePurpose]](../../models/filepurpose.md) | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.UploadFileOut](../../models/uploadfileout.md)** +**[models.CreateFileResponse](../../models/createfileresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -68,9 +69,9 @@ Returns a list of files that belong to the user's organization. ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -78,7 +79,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.files.list(page=0, page_size=100) + res = mistral.files.list(page=0, page_size=100, include_total=True) # Handle response print(res) @@ -91,21 +92,23 @@ with Mistral( | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `page` | *Optional[int]* | :heavy_minus_sign: | N/A | | `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `include_total` | *Optional[bool]* | :heavy_minus_sign: | N/A | | `sample_type` | List[[models.SampleType](../../models/sampletype.md)] | :heavy_minus_sign: | N/A | | `source` | List[[models.Source](../../models/source.md)] | :heavy_minus_sign: | N/A | | `search` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `purpose` | [OptionalNullable[models.FilePurpose]](../../models/filepurpose.md) | :heavy_minus_sign: | N/A | +| `mimetypes` | List[*str*] | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.ListFilesOut](../../models/listfilesout.md)** +**[models.ListFilesResponse](../../models/listfilesresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.SDKError | 4XX, 5XX | \*/\* | ## retrieve @@ -113,9 +116,9 @@ Returns information about a specific file. ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -139,13 +142,13 @@ with Mistral( ### Response -**[models.RetrieveFileOut](../../models/retrievefileout.md)** +**[models.GetFileResponse](../../models/getfileresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -153,9 +156,9 @@ Delete a file. ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -179,13 +182,13 @@ with Mistral( ### Response -**[models.DeleteFileOut](../../models/deletefileout.md)** +**[models.DeleteFileResponse](../../models/deletefileresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.SDKError | 4XX, 5XX | \*/\* | ## download @@ -195,7 +198,7 @@ Download a file ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -219,13 +222,13 @@ with Mistral( ### Response -**[httpx.Response](../../models/.md)** +**httpx.Response** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_signed_url @@ -233,9 +236,9 @@ Get Signed Url ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -252,18 +255,18 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `file_id` | *str* | :heavy_check_mark: | N/A | -| `expiry` | *Optional[int]* | :heavy_minus_sign: | Number of hours before the url becomes invalid. Defaults to 24h | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `file_id` | *str* | :heavy_check_mark: | N/A | +| `expiry` | *Optional[int]* | :heavy_minus_sign: | Number of hours before the URL becomes invalid. Defaults to 24h. Must be between 1h and 168h. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.FileSignedURL](../../models/filesignedurl.md)** +**[models.GetSignedURLResponse](../../models/getsignedurlresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/fim/README.md b/docs/sdks/fim/README.md index cce1c070..57320084 100644 --- a/docs/sdks/fim/README.md +++ b/docs/sdks/fim/README.md @@ -1,5 +1,4 @@ # Fim -(*fim*) ## Overview @@ -16,9 +15,9 @@ FIM completion. ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -26,7 +25,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fim.complete(model="codestral-2405", prompt="def", top_p=1, stream=False, suffix="return a+b") + res = mistral.fim.complete(model="codestral-latest", prompt="def", stream=False, suffix="return a+b") # Handle response print(res) @@ -37,16 +36,18 @@ with Mistral( | Parameter | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | +| `model` | *str* | :heavy_check_mark: | ID of the model with FIM to use. | codestral-latest | | `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | | `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.FIMCompletionRequestStop]](../../models/fimcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `stop` | [OptionalNullable[models.FIMCompletionRequestStop]](../../models/fimcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | | `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -57,8 +58,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## stream @@ -68,7 +69,7 @@ Mistral AI provides the ability to stream responses back to a client in order to ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -76,7 +77,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.fim.stream(model="codestral-2405", prompt="def", top_p=1, stream=True, suffix="return a+b") + res = mistral.fim.stream(model="codestral-latest", prompt="def", stream=True, suffix="return a+b") with res as event_stream: for event in event_stream: @@ -89,25 +90,27 @@ with Mistral( | Parameter | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | +| `model` | *str* | :heavy_check_mark: | ID of the model with FIM to use. | codestral-latest | | `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | | `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.FIMCompletionStreamRequestStop]](../../models/fimcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `stop` | [OptionalNullable[models.FIMCompletionStreamRequestStop]](../../models/fimcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | | `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response -**[Union[eventstreaming.EventStream[models.CompletionEvent], eventstreaming.EventStreamAsync[models.CompletionEvent]]](../../models/.md)** +**Union[eventstreaming.EventStream[models.CompletionEvent], eventstreaming.EventStreamAsync[models.CompletionEvent]]** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/finetuning/README.md b/docs/sdks/finetuning/README.md deleted file mode 100644 index 3e0f12ce..00000000 --- a/docs/sdks/finetuning/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# FineTuning -(*fine_tuning*) - -## Overview - -### Available Operations diff --git a/docs/sdks/finetuningjobs/README.md b/docs/sdks/finetuningjobs/README.md new file mode 100644 index 00000000..4262b3a9 --- /dev/null +++ b/docs/sdks/finetuningjobs/README.md @@ -0,0 +1,232 @@ +# FineTuning.Jobs + +## Overview + +### Available Operations + +* [list](#list) - Get Fine Tuning Jobs +* [create](#create) - Create Fine Tuning Job +* [get](#get) - Get Fine Tuning Job +* [cancel](#cancel) - Cancel Fine Tuning Job +* [start](#start) - Start Fine Tuning Job + +## list + +Get a list of fine-tuning jobs for your organization and user. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.fine_tuning.jobs.list(page=0, page_size=100, created_by_me=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *Optional[int]* | :heavy_minus_sign: | The page number of the results to be returned. | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | The number of items to return per page. | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The model name used for fine-tuning to filter on. When set, the other results are not displayed. | +| `created_after` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date/time to filter on. When set, the results for previous creation times are not displayed. | +| `created_before` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `created_by_me` | *Optional[bool]* | :heavy_minus_sign: | When set, only return results for jobs created by the API caller. Other results are not displayed. | +| `status` | [OptionalNullable[models.JobsAPIRoutesFineTuningGetFineTuningJobsStatus]](../../models/jobsapiroutesfinetuninggetfinetuningjobsstatus.md) | :heavy_minus_sign: | The current job state to filter on. When set, the other results are not displayed. | +| `wandb_project` | *OptionalNullable[str]* | :heavy_minus_sign: | The Weights and Biases project to filter on. When set, the other results are not displayed. | +| `wandb_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The Weight and Biases run name to filter on. When set, the other results are not displayed. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | The model suffix to filter on. When set, the other results are not displayed. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListFineTuningJobsResponse](../../models/listfinetuningjobsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Create a new fine-tuning job, it will be queued for processing. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.fine_tuning.jobs.create(model="Camaro", hyperparameters={ + "learning_rate": 0.0001, + }, invalid_sample_skip_percentage=0) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | N/A | +| `hyperparameters` | [models.Hyperparameters](../../models/hyperparameters.md) | :heavy_check_mark: | N/A | +| `training_files` | List[[models.TrainingFile](../../models/trainingfile.md)] | :heavy_minus_sign: | N/A | +| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` | +| `integrations` | List[[models.CreateFineTuningJobRequestIntegration](../../models/createfinetuningjobrequestintegration.md)] | :heavy_minus_sign: | A list of integrations to enable for your fine-tuning job. | +| `auto_start` | *Optional[bool]* | :heavy_minus_sign: | This field will be required in a future release. | +| `invalid_sample_skip_percentage` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `job_type` | [OptionalNullable[models.FineTuneableModelType]](../../models/finetuneablemodeltype.md) | :heavy_minus_sign: | N/A | +| `repositories` | List[[models.CreateFineTuningJobRequestRepository](../../models/createfinetuningjobrequestrepository.md)] | :heavy_minus_sign: | N/A | +| `classifier_targets` | List[[models.ClassifierTarget](../../models/classifiertarget.md)] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse](../../models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get a fine-tuned job details by its UUID. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.fine_tuning.jobs.get(job_id="c167a961-ffca-4bcf-93ac-6169468dd389") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `job_id` | *str* | :heavy_check_mark: | The ID of the job to analyse. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.JobsAPIRoutesFineTuningGetFineTuningJobResponse](../../models/jobsapiroutesfinetuninggetfinetuningjobresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## cancel + +Request the cancellation of a fine tuning job. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.fine_tuning.jobs.cancel(job_id="6188a2f6-7513-4e0f-89cc-3f8088523a49") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `job_id` | *str* | :heavy_check_mark: | The ID of the job to cancel. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse](../../models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## start + +Request the start of a validated fine tuning job. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.fine_tuning.jobs.start(job_id="56553e4d-0679-471e-b9ac-59a77d671103") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `job_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.JobsAPIRoutesFineTuningStartFineTuningJobResponse](../../models/jobsapiroutesfinetuningstartfinetuningjobresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/ingestionpipelineconfigurations/README.md b/docs/sdks/ingestionpipelineconfigurations/README.md new file mode 100644 index 00000000..671a7182 --- /dev/null +++ b/docs/sdks/ingestionpipelineconfigurations/README.md @@ -0,0 +1,134 @@ +# Beta.Rag.IngestionPipelineConfigurations + +## Overview + +### Available Operations + +* [list](#list) - List ingestion pipeline configurations +* [register](#register) - Register Config +* [update_run_info](#update_run_info) - Update Run Info + +## list + +For the current workspace, lists all of the registered ingestion pipeline configurations. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.rag.ingestion_pipeline_configurations.list() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[List[models.IngestionPipelineConfiguration]](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## register + +Register an ingestion configuration. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.rag.ingestion_pipeline_configurations.register(name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `pipeline_composition` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.IngestionPipelineConfiguration](../../models/ingestionpipelineconfiguration.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update_run_info + +Update Run Info + +### Example Usage + + +```python +from mistralai.client import Mistral +from mistralai.client.utils import parse_datetime +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.rag.ingestion_pipeline_configurations.update_run_info(id="6b630c1b-b57e-4237-a015-ff6247cbbcf8", execution_time=parse_datetime("2024-06-27T06:29:04.390Z"), chunks_count=983906) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `execution_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `chunks_count` | *int* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.IngestionPipelineConfiguration](../../models/ingestionpipelineconfiguration.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/jobs/README.md b/docs/sdks/jobs/README.md deleted file mode 100644 index b06170f8..00000000 --- a/docs/sdks/jobs/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# Jobs -(*fine_tuning.jobs*) - -## Overview - -### Available Operations - -* [list](#list) - Get Fine Tuning Jobs -* [create](#create) - Create Fine Tuning Job -* [get](#get) - Get Fine Tuning Job -* [cancel](#cancel) - Cancel Fine Tuning Job -* [start](#start) - Start Fine Tuning Job - -## list - -Get a list of fine-tuning jobs for your organization and user. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.fine_tuning.jobs.list(page=0, page_size=100, created_by_me=False) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `page` | *Optional[int]* | :heavy_minus_sign: | The page number of the results to be returned. | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | The number of items to return per page. | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The model name used for fine-tuning to filter on. When set, the other results are not displayed. | -| `created_after` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date/time to filter on. When set, the results for previous creation times are not displayed. | -| `created_before` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `created_by_me` | *Optional[bool]* | :heavy_minus_sign: | When set, only return results for jobs created by the API caller. Other results are not displayed. | -| `status` | [OptionalNullable[models.QueryParamStatus]](../../models/queryparamstatus.md) | :heavy_minus_sign: | The current job state to filter on. When set, the other results are not displayed. | -| `wandb_project` | *OptionalNullable[str]* | :heavy_minus_sign: | The Weights and Biases project to filter on. When set, the other results are not displayed. | -| `wandb_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The Weight and Biases run name to filter on. When set, the other results are not displayed. | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | The model suffix to filter on. When set, the other results are not displayed. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.JobsOut](../../models/jobsout.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | - -## create - -Create a new fine-tuning job, it will be queued for processing. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.fine_tuning.jobs.create(model="Camaro", hyperparameters={ - "learning_rate": 0.0001, - }, invalid_sample_skip_percentage=0) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | The name of the model to fine-tune. | -| `hyperparameters` | [models.Hyperparameters](../../models/hyperparameters.md) | :heavy_check_mark: | N/A | -| `training_files` | List[[models.TrainingFile](../../models/trainingfile.md)] | :heavy_minus_sign: | N/A | -| `validation_files` | List[*str*] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` | -| `integrations` | List[[models.JobInIntegrations](../../models/jobinintegrations.md)] | :heavy_minus_sign: | A list of integrations to enable for your fine-tuning job. | -| `auto_start` | *Optional[bool]* | :heavy_minus_sign: | This field will be required in a future release. | -| `invalid_sample_skip_percentage` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `job_type` | [OptionalNullable[models.FineTuneableModelType]](../../models/finetuneablemodeltype.md) | :heavy_minus_sign: | N/A | -| `repositories` | List[[models.JobInRepositories](../../models/jobinrepositories.md)] | :heavy_minus_sign: | N/A | -| `classifier_targets` | List[[models.ClassifierTargetIn](../../models/classifiertargetin.md)] | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse](../../models/jobsapiroutesfinetuningcreatefinetuningjobresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | - -## get - -Get a fine-tuned job details by its UUID. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.fine_tuning.jobs.get(job_id="c167a961-ffca-4bcf-93ac-6169468dd389") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `job_id` | *str* | :heavy_check_mark: | The ID of the job to analyse. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.JobsAPIRoutesFineTuningGetFineTuningJobResponse](../../models/jobsapiroutesfinetuninggetfinetuningjobresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | - -## cancel - -Request the cancellation of a fine tuning job. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.fine_tuning.jobs.cancel(job_id="6188a2f6-7513-4e0f-89cc-3f8088523a49") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `job_id` | *str* | :heavy_check_mark: | The ID of the job to cancel. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse](../../models/jobsapiroutesfinetuningcancelfinetuningjobresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | - -## start - -Request the start of a validated fine tuning job. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.fine_tuning.jobs.start(job_id="56553e4d-0679-471e-b9ac-59a77d671103") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `job_id` | *str* | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.JobsAPIRoutesFineTuningStartFineTuningJobResponse](../../models/jobsapiroutesfinetuningstartfinetuningjobresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/judges/README.md b/docs/sdks/judges/README.md new file mode 100644 index 00000000..34d16739 --- /dev/null +++ b/docs/sdks/judges/README.md @@ -0,0 +1,280 @@ +# Beta.Observability.Judges + +## Overview + +### Available Operations + +* [create](#create) - Create a new judge +* [list](#list) - Get judges with optional filtering and search +* [fetch](#fetch) - Get judge by id +* [delete](#delete) - Delete a judge +* [update](#update) - Update a judge +* [judge_conversation](#judge_conversation) - Run a saved judge on a conversation + +## create + +Create a new judge + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.judges.create(name="", description="border freely down whenever broadly whenever restructure catalyze after", model_name="", output={ + "type": "REGRESSION", + "min": 0, + "min_description": "", + "max": 1, + "max_description": "", + }, instructions="", tools=[ + "", + "", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `model_name` | *str* | :heavy_check_mark: | N/A | +| `output` | [models.CreateJudgeRequestOutput](../../models/createjudgerequestoutput.md) | :heavy_check_mark: | N/A | +| `instructions` | *str* | :heavy_check_mark: | N/A | +| `tools` | List[*str*] | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Judge](../../models/judge.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +Get judges with optional filtering and search + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.judges.list(page_size=50, page=1) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `type_filter` | List[[models.JudgeOutputType](../../models/judgeoutputtype.md)] | :heavy_minus_sign: | Filter by judge output types | +| `model_filter` | List[*str*] | :heavy_minus_sign: | Filter by model names | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `q` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListJudgesResponse](../../models/listjudgesresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## fetch + +Get judge by id + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.judges.fetch(judge_id="19ae5cf8-2ade-4a40-b9d2-730aaebe8429") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `judge_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.Judge](../../models/judge.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Delete a judge + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.observability.judges.delete(judge_id="80deecde-e10f-409c-a13a-c242d3760f6e") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `judge_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Update a judge + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.observability.judges.update(judge_id="9f28c7db-1fb7-4e1c-b137-d7039561ddb7", name="", description="noteworthy and unless", model_name="", output={ + "type": "REGRESSION", + "min": 0, + "min_description": "", + "max": 1, + "max_description": "", + }, instructions="", tools=[]) + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `judge_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *str* | :heavy_check_mark: | N/A | +| `model_name` | *str* | :heavy_check_mark: | N/A | +| `output` | [models.UpdateJudgeRequestOutput](../../models/updatejudgerequestoutput.md) | :heavy_check_mark: | N/A | +| `instructions` | *str* | :heavy_check_mark: | N/A | +| `tools` | List[*str*] | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## judge_conversation + +Run a saved judge on a conversation + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.judges.judge_conversation(judge_id="7fb9f06a-22fb-45db-ad58-6a5715280755", messages=[]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `judge_id` | *str* | :heavy_check_mark: | N/A | +| `messages` | List[Dict[str, *Any*]] | :heavy_check_mark: | N/A | +| `properties` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.JudgeOutput](../../models/judgeoutput.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/libraries/README.md b/docs/sdks/libraries/README.md index 14d39f97..d282f541 100644 --- a/docs/sdks/libraries/README.md +++ b/docs/sdks/libraries/README.md @@ -1,5 +1,4 @@ -# Libraries -(*beta.libraries*) +# Beta.Libraries ## Overview @@ -10,7 +9,7 @@ * [list](#list) - List all libraries you have access to. * [create](#create) - Create a new Library. * [get](#get) - Detailed information about a specific Library. -* [delete](#delete) - Delete a library and all of it's document. +* [delete](#delete) - Delete a library and all of its documents. * [update](#update) - Update a library. ## list @@ -21,7 +20,7 @@ List all libraries that you have created or have been shared with you. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -29,7 +28,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.beta.libraries.list() + res = mistral.beta.libraries.list(page_size=100, page=0) # Handle response print(res) @@ -38,19 +37,24 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `search` | *OptionalNullable[str]* | :heavy_minus_sign: | Case-insensitive search on the library name. | +| `filter_owned_by_me` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter libraries by whether they were created by the current authenticated identity. Set to true for created by me, false for only libraries shared with me, or None to disable this filter. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.ListLibraryOut](../../models/listlibraryout.md)** +**[models.ListLibrariesResponse](../../models/listlibrariesresponse.md)** ### Errors -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## create @@ -60,7 +64,7 @@ Create a new Library, you will be marked as the owner and only you will have the ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -77,23 +81,24 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `chunk_size` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `chunk_size` | *OptionalNullable[int]* | :heavy_minus_sign: | The size of the chunks (in characters) to split document text into. Must be between 256 and 32768. | +| `owner_type` | [OptionalNullable[models.OwnerType]](../../models/ownertype.md) | :heavy_minus_sign: | Determines who owns the created library. 'User' creates a private library accessible only to its owner. 'Workspace' creates a library shared with the workspace. Defaults to 'Workspace' for API key sessions. Only API keys with the 'Private and shared connectors' connector access scope can create private, user-owned libraries. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.LibraryOut](../../models/libraryout.md)** +**[models.Library](../../models/library.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -103,7 +108,7 @@ Given a library id, details information about that Library. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -127,14 +132,14 @@ with Mistral( ### Response -**[models.LibraryOut](../../models/libraryout.md)** +**[models.Library](../../models/library.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -144,7 +149,7 @@ Given a library id, deletes it together with all documents that have been upload ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -168,14 +173,14 @@ with Mistral( ### Response -**[models.LibraryOut](../../models/libraryout.md)** +**[models.Library](../../models/library.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -185,7 +190,7 @@ Given a library id, you can update the name and description. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -205,17 +210,17 @@ with Mistral( | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `library_id` | *str* | :heavy_check_mark: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[models.LibraryOut](../../models/libraryout.md)** +**[models.Library](../../models/library.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/metrics/README.md b/docs/sdks/metrics/README.md new file mode 100644 index 00000000..08a5ccb9 --- /dev/null +++ b/docs/sdks/metrics/README.md @@ -0,0 +1,69 @@ +# Workflows.Metrics + +## Overview + +### Available Operations + +* [get_workflow_metrics](#get_workflow_metrics) - Get Workflow Metrics + +## get_workflow_metrics + +Get comprehensive metrics for a specific workflow. + +Args: + workflow_name: The name of the workflow type to get metrics for + start_time: Optional start time filter (ISO 8601 format) + end_time: Optional end time filter (ISO 8601 format) + +Returns: + WorkflowMetrics: Dictionary containing metrics: + - execution_count: Total number of executions + - success_count: Number of successful executions + - error_count: Number of failed/terminated executions + - average_latency_ms: Average execution duration in milliseconds + - retry_rate: Proportion of workflows with retries + - latency_over_time: Time-series data of execution durations + +Example: + GET /v1/workflows/MyWorkflow/metrics + GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z + GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z&end_time=2025-12-31T23:59:59Z + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.metrics.get_workflow_metrics(workflow_name="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `workflow_name` | *str* | :heavy_check_mark: | N/A | +| `start_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter workflows started after this time (ISO 8601) | +| `end_time` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Filter workflows started before this time (ISO 8601) | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowMetrics](../../models/workflowmetrics.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/mistral/README.md b/docs/sdks/mistral/README.md deleted file mode 100644 index 4b9573d0..00000000 --- a/docs/sdks/mistral/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Mistral SDK - -## Overview - -Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. - -### Available Operations diff --git a/docs/sdks/mistralagents/README.md b/docs/sdks/mistralagents/README.md deleted file mode 100644 index 44b7fcf2..00000000 --- a/docs/sdks/mistralagents/README.md +++ /dev/null @@ -1,234 +0,0 @@ -# MistralAgents -(*beta.agents*) - -## Overview - -(beta) Agents API - -### Available Operations - -* [create](#create) - Create a agent that can be used within a conversation. -* [list](#list) - List agent entities. -* [get](#get) - Retrieve an agent entity. -* [update](#update) - Update an agent entity. -* [update_version](#update_version) - Update an agent version. - -## create - -Create a new agent giving it instructions, tools, description. The agent is then available to be used as a regular assistant in a conversation or as part of an agent pool from which it can be used. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.beta.agents.create(model="LeBaron", name="") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | -| `tools` | List[[models.AgentCreationRequestTools](../../models/agentcreationrequesttools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | -| `completion_args` | [Optional[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.Agent](../../models/agent.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | - -## list - -Retrieve a list of agent entities sorted by creation time. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.beta.agents.list(page=0, page_size=20) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[List[models.Agent]](../../models/.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | - -## get - -Given an agent retrieve an agent entity with its attributes. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.beta.agents.get(agent_id="") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.Agent](../../models/agent.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | - -## update - -Update an agent attributes and create a new version. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.beta.agents.update(agent_id="") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | N/A | -| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | Instruction prompt the model will follow during the conversation. | -| `tools` | List[[models.AgentUpdateRequestTools](../../models/agentupdaterequesttools.md)] | :heavy_minus_sign: | List of tools which are available to the model during the conversation. | -| `completion_args` | [Optional[models.CompletionArgs]](../../models/completionargs.md) | :heavy_minus_sign: | White-listed arguments from the completion API | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `handoffs` | List[*str*] | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.Agent](../../models/agent.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | - -## update_version - -Switch the version of an agent. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.beta.agents.update_version(agent_id="", version=157995) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `agent_id` | *str* | :heavy_check_mark: | N/A | -| `version` | *int* | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.Agent](../../models/agent.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/mistraljobs/README.md b/docs/sdks/mistraljobs/README.md deleted file mode 100644 index 0ef3f138..00000000 --- a/docs/sdks/mistraljobs/README.md +++ /dev/null @@ -1,185 +0,0 @@ -# MistralJobs -(*batch.jobs*) - -## Overview - -### Available Operations - -* [list](#list) - Get Batch Jobs -* [create](#create) - Create Batch Job -* [get](#get) - Get Batch Job -* [cancel](#cancel) - Cancel Batch Job - -## list - -Get a list of batch jobs for your organization and user. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.batch.jobs.list(page=0, page_size=100, created_by_me=False) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `page` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `page_size` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | -| `created_after` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `created_by_me` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `status` | List[[models.BatchJobStatus](../../models/batchjobstatus.md)] | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.BatchJobsOut](../../models/batchjobsout.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | - -## create - -Create a new batch job, it will be queued for processing. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.batch.jobs.create(input_files=[ - "fe3343a2-3b8d-404b-ba32-a78dede2614a", - ], endpoint="/v1/moderations", timeout_hours=24) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `input_files` | List[*str*] | :heavy_check_mark: | N/A | -| `endpoint` | [models.APIEndpoint](../../models/apiendpoint.md) | :heavy_check_mark: | N/A | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `agent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A | -| `timeout_hours` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.BatchJobOut](../../models/batchjobout.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | - -## get - -Get a batch job details by its UUID. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.batch.jobs.get(job_id="4017dc9f-b629-42f4-9700-8c681b9e7f0f") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `job_id` | *str* | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.BatchJobOut](../../models/batchjobout.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | - -## cancel - -Request the cancellation of a batch job. - -### Example Usage - - -```python -from mistralai import Mistral -import os - - -with Mistral( - api_key=os.getenv("MISTRAL_API_KEY", ""), -) as mistral: - - res = mistral.batch.jobs.cancel(job_id="4fb29d1c-535b-4f0a-a1cb-2167f86da569") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `job_id` | *str* | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - -### Response - -**[models.BatchJobOut](../../models/batchjobout.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/models/README.md b/docs/sdks/models/README.md index 3877c545..f585dcbe 100644 --- a/docs/sdks/models/README.md +++ b/docs/sdks/models/README.md @@ -1,5 +1,4 @@ # Models -(*models*) ## Overview @@ -20,9 +19,9 @@ List all models available to the user. ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -41,6 +40,8 @@ with Mistral( | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `provider` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -51,8 +52,8 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## retrieve @@ -60,9 +61,9 @@ Retrieve information about a model. ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -86,14 +87,14 @@ with Mistral( ### Response -**[models.RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet](../../models/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md)** +**[models.ResponseRetrieveModelV1ModelsModelIDGet](../../models/responseretrievemodelv1modelsmodelidget.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -101,9 +102,9 @@ Delete a fine-tuned model. ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -127,14 +128,14 @@ with Mistral( ### Response -**[models.DeleteModelOut](../../models/deletemodelout.md)** +**[models.DeleteModelResponse](../../models/deletemodelresponse.md)** ### Errors | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -144,7 +145,7 @@ Update a model name or description. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -176,7 +177,7 @@ with Mistral( | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.SDKError | 4XX, 5XX | \*/\* | ## archive @@ -186,7 +187,7 @@ Archive a fine-tuned model. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -210,13 +211,13 @@ with Mistral( ### Response -**[models.ArchiveFTModelOut](../../models/archiveftmodelout.md)** +**[models.ArchiveModelResponse](../../models/archivemodelresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.SDKError | 4XX, 5XX | \*/\* | ## unarchive @@ -226,7 +227,7 @@ Un-archive a fine-tuned model. ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -250,10 +251,10 @@ with Mistral( ### Response -**[models.UnarchiveFTModelOut](../../models/unarchiveftmodelout.md)** +**[models.UnarchiveModelResponse](../../models/unarchivemodelresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/ocr/README.md b/docs/sdks/ocr/README.md index c0c1293e..533b1bb2 100644 --- a/docs/sdks/ocr/README.md +++ b/docs/sdks/ocr/README.md @@ -1,5 +1,4 @@ # Ocr -(*ocr*) ## Overview @@ -15,9 +14,9 @@ OCR ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -26,10 +25,12 @@ with Mistral( ) as mistral: res = mistral.ocr.process(model="CX-9", document={ - "image_url": { - "url": "https://measly-scrap.com", - }, - "type": "image_url", + "type": "document_url", + "document_url": "https://upset-labourer.net/", + }, bbox_annotation_format={ + "type": "text", + }, document_annotation_format={ + "type": "text", }) # Handle response @@ -39,18 +40,22 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *Nullable[str]* | :heavy_check_mark: | N/A | -| `document` | [models.Document](../../models/document.md) | :heavy_check_mark: | Document to run OCR on | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `pages` | List[*int*] | :heavy_minus_sign: | Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 | -| `include_image_base64` | *OptionalNullable[bool]* | :heavy_minus_sign: | Include image URLs in response | -| `image_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | Max images to extract | -| `image_min_size` | *OptionalNullable[int]* | :heavy_minus_sign: | Minimum height and width of image to extract | -| `bbox_annotation_format` | [OptionalNullable[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field | -| `document_annotation_format` | [OptionalNullable[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `document` | [models.DocumentUnion](../../models/documentunion.md) | :heavy_check_mark: | Document to run OCR on | | +| `pages` | [OptionalNullable[models.Pages]](../../models/pages.md) | :heavy_minus_sign: | Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0. | | +| `include_image_base64` | *OptionalNullable[bool]* | :heavy_minus_sign: | Include image URLs in response | | +| `image_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | Max images to extract | | +| `image_min_size` | *OptionalNullable[int]* | :heavy_minus_sign: | Minimum height and width of image to extract | | +| `bbox_annotation_format` | [OptionalNullable[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `document_annotation_format` | [OptionalNullable[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `document_annotation_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided. | | +| `table_format` | [OptionalNullable[models.TableFormat]](../../models/tableformat.md) | :heavy_minus_sign: | N/A | | +| `extract_header` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `extract_footer` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `confidence_scores_granularity` | [OptionalNullable[models.ConfidenceScoresGranularity]](../../models/confidencescoresgranularity.md) | :heavy_minus_sign: | Granularity for confidence scores: 'word' (per-word scores) or 'page' (aggregate only). Defaults to None (no confidence scores) to keep response payload small. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -60,5 +65,5 @@ with Mistral( | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/records/README.md b/docs/sdks/records/README.md new file mode 100644 index 00000000..ce8f1f68 --- /dev/null +++ b/docs/sdks/records/README.md @@ -0,0 +1,277 @@ +# Beta.Observability.Datasets.Records + +## Overview + +### Available Operations + +* [fetch](#fetch) - Get the content of a given conversation from a dataset +* [delete](#delete) - Delete a record from a dataset +* [bulk_delete](#bulk_delete) - Delete multiple records from datasets +* [judge](#judge) - Run Judge on a dataset record based on the given options +* [update_payload](#update_payload) - Update a dataset record conversation payload +* [update_properties](#update_properties) - Update conversation properties + +## fetch + +Get the content of a given conversation from a dataset + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.records.fetch(dataset_record_id="ce995349-abbf-45c0-be75-885fc1c4b4c0") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.DatasetRecord](../../models/datasetrecord.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Delete a record from a dataset + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.observability.datasets.records.delete(dataset_record_id="799fed99-80b4-4a9a-a15e-05352b811702") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## bulk_delete + +Delete multiple records from datasets + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.observability.datasets.records.bulk_delete(dataset_record_ids=[ + "22fc78f7-e774-4ab5-b1ea-63852992ef31", + "1c533b4f-882e-4bd0-9ef6-9933b825f8b1", + ]) + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_record_ids` | List[*str*] | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## judge + +Run Judge on a dataset record based on the given options + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.beta.observability.datasets.records.judge(dataset_record_id="9de5d7a1-787a-45dd-b668-9f3407e76d8b", judge_definition={ + "name": "", + "description": "wisely railway deceivingly arcade minion back what yowza outrun service", + "model_name": "", + "output": { + "type": "CLASSIFICATION", + "options": [ + { + "value": "", + "description": "spork excluding without retrospectivity bah next yearly", + }, + ], + }, + "instructions": "", + "tools": [ + "", + ], + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | +| `judge_definition` | [models.CreateJudgeRequest](../../models/createjudgerequest.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.JudgeOutput](../../models/judgeoutput.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update_payload + +Update a dataset record conversation payload + +### Example Usage + + +```python +from mistralai.client import Mistral, models +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.observability.datasets.records.update_payload(dataset_record_id="17506b15-748e-4e7c-9737-c97c44d04b0f", payload=models.ConversationPayload( + messages=[ + { + "key": "", + }, + { + + }, + { + "key": "", + }, + ], + )) + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | +| `payload` | [models.ConversationPayload](../../models/conversationpayload.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update_properties + +Update conversation properties + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.beta.observability.datasets.records.update_properties(dataset_record_id="a4deefc5-0905-427e-ad15-1090ef9e216d", properties={ + "key": "", + "key1": "", + "key2": "", + }) + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `dataset_record_id` | *str* | :heavy_check_mark: | N/A | +| `properties` | Dict[str, *Any*] | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------- | ------------------------- | ------------------------- | +| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/runs/README.md b/docs/sdks/runs/README.md new file mode 100644 index 00000000..7ed91420 --- /dev/null +++ b/docs/sdks/runs/README.md @@ -0,0 +1,140 @@ +# Workflows.Runs + +## Overview + +### Available Operations + +* [list_runs](#list_runs) - List Runs +* [get_run](#get_run) - Get Run +* [get_run_history](#get_run_history) - Get Run History + +## list_runs + +List Runs + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.runs.list_runs(page_size=50) + + while res is not None: + # Handle items + + res = res.next() + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `workflow_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by workflow name or id | +| `search` | *OptionalNullable[str]* | :heavy_minus_sign: | Search by workflow name, display name or id | +| `status` | [OptionalNullable[models.ListRunsV1WorkflowsRunsGetStatus]](../../models/listrunsv1workflowsrunsgetstatus.md) | :heavy_minus_sign: | Filter by workflow status | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Filter by user id. Use 'current' to filter by the authenticated user | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of items per page | +| `next_page_token` | *OptionalNullable[str]* | :heavy_minus_sign: | Token for the next page of results | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListRunsV1WorkflowsRunsGetResponse](../../models/listrunsv1workflowsrunsgetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_run + +Get Run + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.runs.get_run(run_id="553b071e-3d04-46aa-aa9a-0fca61dc60fa") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `run_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowExecutionResponse](../../models/workflowexecutionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_run_history + +Get Run History + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.runs.get_run_history(run_id="f7296489-0212-4239-9e35-12fabfe8cd11", decode_payloads=True) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `run_id` | *str* | :heavy_check_mark: | N/A | +| `decode_payloads` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[Any](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/schedules/README.md b/docs/sdks/schedules/README.md new file mode 100644 index 00000000..7bf59931 --- /dev/null +++ b/docs/sdks/schedules/README.md @@ -0,0 +1,209 @@ +# Workflows.Schedules + +## Overview + +### Available Operations + +* [get_schedules](#get_schedules) - Get Schedules +* [schedule_workflow](#schedule_workflow) - Schedule Workflow +* [unschedule_workflow](#unschedule_workflow) - Unschedule Workflow +* [pause_schedule](#pause_schedule) - Pause Schedule +* [resume_schedule](#resume_schedule) - Resume Schedule + +## get_schedules + +Get Schedules + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.schedules.get_schedules() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowScheduleListResponse](../../models/workflowschedulelistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## schedule_workflow + +Schedule Workflow + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.schedules.schedule_workflow(schedule={ + "input": "", + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `schedule` | [models.ScheduleDefinition](../../models/scheduledefinition.md) | :heavy_check_mark: | Specification of the times scheduled actions may occur.

The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and
:py:attr:`cron_expressions` excluding anything in :py:attr:`skip`.

Used for input where schedule_id is optional (can be provided or auto-generated). | +| `workflow_registration_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the workflow registration to schedule | +| `workflow_version_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Deprecated: use workflow_registration_id | +| `workflow_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | The name or ID of the workflow to schedule | +| `workflow_task_queue` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use deployment_name instead. | +| `schedule_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Allows you to specify a custom schedule ID. If not provided, a random ID will be generated. | +| `deployment_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the deployment to route this schedule to | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowScheduleResponse](../../models/workflowscheduleresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## unschedule_workflow + +Unschedule Workflow + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.workflows.schedules.unschedule_workflow(schedule_id="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## pause_schedule + +Pause Schedule + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.workflows.schedules.pause_schedule(schedule_id="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note recorded in Temporal when pausing or resuming a schedule | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## resume_schedule + +Resume Schedule + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + mistral.workflows.schedules.resume_schedule(schedule_id="") + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `schedule_id` | *str* | :heavy_check_mark: | N/A | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note recorded in Temporal when pausing or resuming a schedule | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/speech/README.md b/docs/sdks/speech/README.md new file mode 100644 index 00000000..7cd76ff4 --- /dev/null +++ b/docs/sdks/speech/README.md @@ -0,0 +1,59 @@ +# Audio.Speech + +## Overview + +### Available Operations + +* [complete](#complete) - Speech + +## complete + +Speech + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.speech.complete(input="", stream=False, additional_properties={ + + }) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `input` | *str* | :heavy_check_mark: | Text to generate a speech from | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `voice_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The preset or custom voice to use for generating the speech. | +| `ref_audio` | *OptionalNullable[str]* | :heavy_minus_sign: | The audio reference for generating the speech. | +| `response_format` | [Optional[models.SpeechOutputFormat]](../../models/speechoutputformat.md) | :heavy_minus_sign: | N/A | +| `additional_properties` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.SpeechV1AudioSpeechPostResponse](../../models/speechv1audiospeechpostresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/transcriptions/README.md b/docs/sdks/transcriptions/README.md index 022066ac..7357f9e9 100644 --- a/docs/sdks/transcriptions/README.md +++ b/docs/sdks/transcriptions/README.md @@ -1,5 +1,4 @@ -# Transcriptions -(*audio.transcriptions*) +# Audio.Transcriptions ## Overview @@ -8,7 +7,7 @@ API for audio transcription. ### Available Operations * [complete](#complete) - Create Transcription -* [stream](#stream) - Create streaming transcription (SSE) +* [stream](#stream) - Create Streaming Transcription (SSE) ## complete @@ -16,9 +15,9 @@ Create Transcription ### Example Usage - + ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -26,7 +25,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.audio.transcriptions.complete(model="Model X") + res = mistral.audio.transcriptions.complete(model="voxtral-mini-latest", diarize=False) # Handle response print(res) @@ -35,16 +34,18 @@ with Mistral( ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | N/A | -| `file` | [Optional[models.File]](../../models/file.md) | :heavy_minus_sign: | N/A | -| `file_url` | *OptionalNullable[str]* | :heavy_minus_sign: | Url of a file to be transcribed | -| `file_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of a file uploaded to /v1/files | -| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | Language of the audio, e.g. 'en'. Providing the language can boost accuracy. | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `timestamp_granularities` | List[[models.TimestampGranularity](../../models/timestampgranularity.md)] | :heavy_minus_sign: | Granularities of timestamps to include in the response. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to be used. | **Example 1:** voxtral-mini-latest
**Example 2:** voxtral-mini-2507 | +| `file` | [Optional[models.File]](../../models/file.md) | :heavy_minus_sign: | N/A | | +| `file_url` | *OptionalNullable[str]* | :heavy_minus_sign: | Url of a file to be transcribed | | +| `file_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of a file uploaded to /v1/files | | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | Language of the audio, e.g. 'en'. Providing the language can boost accuracy. | | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | +| `diarize` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `context_bias` | List[*str*] | :heavy_minus_sign: | N/A | | +| `timestamp_granularities` | List[[models.TimestampGranularity](../../models/timestampgranularity.md)] | :heavy_minus_sign: | Granularities of timestamps to include in the response. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -54,17 +55,17 @@ with Mistral( | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | +| errors.SDKError | 4XX, 5XX | \*/\* | ## stream -Create streaming transcription (SSE) +Create Streaming Transcription (SSE) ### Example Usage ```python -from mistralai import Mistral +from mistralai.client import Mistral import os @@ -72,7 +73,7 @@ with Mistral( api_key=os.getenv("MISTRAL_API_KEY", ""), ) as mistral: - res = mistral.audio.transcriptions.stream(model="Camry") + res = mistral.audio.transcriptions.stream(model="Camry", diarize=False) with res as event_stream: for event in event_stream: @@ -91,15 +92,17 @@ with Mistral( | `file_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of a file uploaded to /v1/files | | `language` | *OptionalNullable[str]* | :heavy_minus_sign: | Language of the audio, e.g. 'en'. Providing the language can boost accuracy. | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `diarize` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `context_bias` | List[*str*] | :heavy_minus_sign: | N/A | | `timestamp_granularities` | List[[models.TimestampGranularity](../../models/timestampgranularity.md)] | :heavy_minus_sign: | Granularities of timestamps to include in the response. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response -**[Union[eventstreaming.EventStream[models.TranscriptionStreamEvents], eventstreaming.EventStreamAsync[models.TranscriptionStreamEvents]]](../../models/.md)** +**Union[eventstreaming.EventStream[models.TranscriptionStreamEvents], eventstreaming.EventStreamAsync[models.TranscriptionStreamEvents]]** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| models.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/voices/README.md b/docs/sdks/voices/README.md new file mode 100644 index 00000000..49b8533f --- /dev/null +++ b/docs/sdks/voices/README.md @@ -0,0 +1,274 @@ +# Audio.Voices + +## Overview + +### Available Operations + +* [list](#list) - List all voices +* [create](#create) - Create a new voice +* [delete](#delete) - Delete a custom voice +* [update](#update) - Update voice metadata +* [get](#get) - Get voice details +* [get_sample_audio](#get_sample_audio) - Get voice sample audio + +## list + +List all voices (excluding sample data) + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.voices.list(limit=10, offset=0, type_="all") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of voices to return | +| `offset` | *Optional[int]* | :heavy_minus_sign: | Offset for pagination | +| `type` | [Optional[models.ListVoicesV1AudioVoicesGetType]](../../models/listvoicesv1audiovoicesgettype.md) | :heavy_minus_sign: | Filter the voices between customs and presets | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.VoiceListResponse](../../models/voicelistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Create a new voice with a base64-encoded audio sample + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.voices.create(name="", sample_audio="", retention_notice=30) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | +| `sample_audio` | *str* | :heavy_check_mark: | Base64-encoded audio file | +| `slug` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `languages` | List[*str*] | :heavy_minus_sign: | N/A | +| `gender` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `age` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | +| `color` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retention_notice` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `sample_filename` | *OptionalNullable[str]* | :heavy_minus_sign: | Original filename for extension detection | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.VoiceResponse](../../models/voiceresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Delete a custom voice + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.voices.delete(voice_id="f42bf0d7-8a10-4b98-bbfa-589a232209d2") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `voice_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.VoiceResponse](../../models/voiceresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Update voice metadata (name, gender, languages, age, tags). + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.voices.update(voice_id="030a6b20-e287-414d-9a77-6b76a4a56c9d") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `voice_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `languages` | List[*str*] | :heavy_minus_sign: | N/A | +| `gender` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `age` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.VoiceResponse](../../models/voiceresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get voice details (excluding sample) + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.voices.get(voice_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `voice_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.VoiceResponse](../../models/voiceresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_sample_audio + +Get the audio sample for a voice + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.audio.voices.get_sample_audio(voice_id="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `voice_id` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[httpx.Response](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md new file mode 100644 index 00000000..45759776 --- /dev/null +++ b/docs/sdks/workflows/README.md @@ -0,0 +1,423 @@ +# Workflows + +## Overview + +### Available Operations + +* [get_workflows](#get_workflows) - Get Workflows +* [get_workflow_registrations](#get_workflow_registrations) - Get Workflow Registrations +* [execute_workflow](#execute_workflow) - Execute Workflow +* [~~execute_workflow_registration~~](#execute_workflow_registration) - Execute Workflow Registration :warning: **Deprecated** +* [get_workflow](#get_workflow) - Get Workflow +* [update_workflow](#update_workflow) - Update Workflow +* [get_workflow_registration](#get_workflow_registration) - Get Workflow Registration +* [archive_workflow](#archive_workflow) - Archive Workflow +* [unarchive_workflow](#unarchive_workflow) - Unarchive Workflow + +## get_workflows + +Get Workflows + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.get_workflows(active_only=False, include_shared=True, limit=50) + + while res is not None: + # Handle items + + res = res.next() + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `active_only` | *Optional[bool]* | :heavy_minus_sign: | Whether to only return active workflows | +| `include_shared` | *Optional[bool]* | :heavy_minus_sign: | Whether to include shared workflows | +| `available_in_chat_assistant` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to only return workflows available in chat assistant | +| `archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by archived state. False=exclude archived, True=only archived, None=include all | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor for pagination | +| `limit` | *Optional[int]* | :heavy_minus_sign: | The maximum number of workflows to return | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.GetWorkflowsV1WorkflowsGetResponse](../../models/getworkflowsv1workflowsgetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow_registrations + +Get Workflow Registrations + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.get_workflow_registrations(active_only=False, include_shared=True, with_workflow=False, limit=50) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `workflow_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The workflow ID to filter by | +| `task_queue` | *OptionalNullable[str]* | :heavy_minus_sign: | The task queue to filter by | +| `active_only` | *Optional[bool]* | :heavy_minus_sign: | Whether to only return active workflows versions | +| `include_shared` | *Optional[bool]* | :heavy_minus_sign: | Whether to include shared workflow versions | +| `workflow_search` | *OptionalNullable[str]* | :heavy_minus_sign: | The workflow name to filter by | +| `archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | Filter by archived state. False=exclude archived, True=only archived, None=include all | +| `with_workflow` | *Optional[bool]* | :heavy_minus_sign: | Whether to include the workflow definition | +| `available_in_chat_assistant` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to only return workflows available in chat assistant | +| `limit` | *Optional[int]* | :heavy_minus_sign: | The maximum number of workflows versions to return | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | The cursor for pagination | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowRegistrationListResponse](../../models/workflowregistrationlistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## execute_workflow + +Execute Workflow + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.execute_workflow(workflow_identifier="", wait_for_result=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | +| `execution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Allows you to specify a custom execution ID. If not provided, a random ID will be generated. | +| `input` | *OptionalNullable[Any]* | :heavy_minus_sign: | The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. | +| `wait_for_result` | *Optional[bool]* | :heavy_minus_sign: | If true, wait for the workflow to complete and return the result directly. | +| `timeout_seconds` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum time to wait for completion when wait_for_result is true. | +| `custom_tracing_attributes` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `extensions` | Dict[str, *Any*] | :heavy_minus_sign: | Plugin-specific data to propagate into WorkflowContext.extensions at execution time. | +| `task_queue` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use deployment_name instead. | +| `deployment_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the deployment to route this execution to | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost](../../models/responseexecuteworkflowv1workflowsworkflowidentifierexecutepost.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## ~~execute_workflow_registration~~ + +Execute Workflow Registration + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.execute_workflow_registration(workflow_registration_id="de11d76a-e0fb-44dd-abd9-2e75fc275b94", wait_for_result=False) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `workflow_registration_id` | *str* | :heavy_check_mark: | N/A | +| `execution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Allows you to specify a custom execution ID. If not provided, a random ID will be generated. | +| `input` | *OptionalNullable[Any]* | :heavy_minus_sign: | The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. | +| `wait_for_result` | *Optional[bool]* | :heavy_minus_sign: | If true, wait for the workflow to complete and return the result directly. | +| `timeout_seconds` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum time to wait for completion when wait_for_result is true. | +| `custom_tracing_attributes` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `extensions` | Dict[str, *Any*] | :heavy_minus_sign: | Plugin-specific data to propagate into WorkflowContext.extensions at execution time. | +| `task_queue` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use deployment_name instead. | +| `deployment_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the deployment to route this execution to | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost](../../models/responseexecuteworkflowregistrationv1workflowsregistrationsworkflowregistrationidexecutepost.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow + +Get Workflow + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.get_workflow(workflow_identifier="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowGetResponse](../../models/workflowgetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update_workflow + +Update Workflow + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.update_workflow(workflow_identifier="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | New display name value | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description value | +| `available_in_chat_assistant` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to make the workflow available in the chat assistant | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowUpdateResponse](../../models/workflowupdateresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow_registration + +Get Workflow Registration + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.get_workflow_registration(workflow_registration_id="c4d86c40-960f-4e9a-9d6f-ad8342d7aa83", with_workflow=False, include_shared=True) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `workflow_registration_id` | *str* | :heavy_check_mark: | N/A | +| `with_workflow` | *Optional[bool]* | :heavy_minus_sign: | Whether to include the workflow definition | +| `include_shared` | *Optional[bool]* | :heavy_minus_sign: | Whether to include shared workflow versions | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowRegistrationGetResponse](../../models/workflowregistrationgetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## archive_workflow + +Archive Workflow + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.archive_workflow(workflow_identifier="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowArchiveResponse](../../models/workflowarchiveresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## unarchive_workflow + +Unarchive Workflow + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.unarchive_workflow(workflow_identifier="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `workflow_identifier` | *str* | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.WorkflowUnarchiveResponse](../../models/workflowunarchiveresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/workflowsevents/README.md b/docs/sdks/workflowsevents/README.md new file mode 100644 index 00000000..3915eb24 --- /dev/null +++ b/docs/sdks/workflowsevents/README.md @@ -0,0 +1,107 @@ +# Workflows.Events + +## Overview + +### Available Operations + +* [get_stream_events](#get_stream_events) - Get Stream Events +* [get_workflow_events](#get_workflow_events) - Get Workflow Events + +## get_stream_events + +Get Stream Events + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.events.get_stream_events(scope="*", activity_name="*", activity_id="*", workflow_name="*", workflow_exec_id="*", root_workflow_exec_id="*", parent_workflow_exec_id="*", stream="*", start_seq=0) + + with res as event_stream: + for event in event_stream: + # handle event + print(event, flush=True) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `scope` | [Optional[models.Scope]](../../models/scope.md) | :heavy_minus_sign: | N/A | +| `activity_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `activity_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `workflow_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `root_workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `parent_workflow_exec_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `stream` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `start_seq` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `metadata_filters` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `workflow_event_types` | List[[models.WorkflowEventType](../../models/workfloweventtype.md)] | :heavy_minus_sign: | N/A | +| `last_event_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[Union[eventstreaming.EventStream[models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody], eventstreaming.EventStreamAsync[models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody]]](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_workflow_events + +Get Workflow Events + +### Example Usage + + +```python +from mistralai.client import Mistral +import os + + +with Mistral( + api_key=os.getenv("MISTRAL_API_KEY", ""), +) as mistral: + + res = mistral.workflows.events.get_workflow_events(limit=100) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `root_workflow_exec_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Execution ID of the root workflow that initiated this execution chain. | +| `workflow_exec_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Execution ID of the workflow that emitted this event. | +| `workflow_run_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Run ID of the workflow that emitted this event. | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of events to return. | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor for pagination. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.ListWorkflowEventResponse](../../models/listworkfloweventresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/azure/.env.example b/examples/azure/.env.example new file mode 100644 index 00000000..7467bf2e --- /dev/null +++ b/examples/azure/.env.example @@ -0,0 +1,4 @@ +AZURE_API_KEY=your-azure-api-key +AZURE_ENDPOINT=https://your-endpoint.services.ai.azure.com/models +AZURE_MODEL=your-deployment-name +AZURE_API_VERSION=2024-05-01-preview diff --git a/examples/azure/az_chat_no_streaming.py.py b/examples/azure/az_chat_no_streaming.py.py deleted file mode 100644 index 485b594e..00000000 --- a/examples/azure/az_chat_no_streaming.py.py +++ /dev/null @@ -1,16 +0,0 @@ -import os - -from mistralai_azure import MistralAzure - -client = MistralAzure( - azure_api_key=os.environ["AZURE_API_KEY"], - azure_endpoint=os.environ["AZURE_ENDPOINT"], -) - -res = client.chat.complete( - messages=[ - {"role": "user", "content": "What is the capital of France?"}, - ], - # you don't need model as it will always be "azureai" -) -print(res.choices[0].message.content) diff --git a/examples/azure/chat_no_streaming.py b/examples/azure/chat_no_streaming.py new file mode 100644 index 00000000..952b171d --- /dev/null +++ b/examples/azure/chat_no_streaming.py @@ -0,0 +1,22 @@ +import os + +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.models import ChatCompletionRequestMessage, UserMessage + +AZURE_API_KEY = os.environ.get("AZURE_API_KEY", "") +AZURE_ENDPOINT = os.environ.get("AZURE_ENDPOINT", "") +AZURE_MODEL = os.environ.get("AZURE_MODEL", "mistral-small-2503") +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +# The SDK automatically injects api-version as a query parameter +client = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, +) + +messages: list[ChatCompletionRequestMessage] = [ + UserMessage(content="What is the capital of France?"), +] +res = client.chat.complete(model=AZURE_MODEL, messages=messages) +print(res.choices[0].message.content) diff --git a/examples/azure/chat_no_streaming.py.py b/examples/azure/chat_no_streaming.py.py deleted file mode 100644 index 485b594e..00000000 --- a/examples/azure/chat_no_streaming.py.py +++ /dev/null @@ -1,16 +0,0 @@ -import os - -from mistralai_azure import MistralAzure - -client = MistralAzure( - azure_api_key=os.environ["AZURE_API_KEY"], - azure_endpoint=os.environ["AZURE_ENDPOINT"], -) - -res = client.chat.complete( - messages=[ - {"role": "user", "content": "What is the capital of France?"}, - ], - # you don't need model as it will always be "azureai" -) -print(res.choices[0].message.content) diff --git a/examples/fixtures/ft_training_file.jsonl b/examples/fixtures/ft_training_file.jsonl index eecd016c..a889941a 100644 --- a/examples/fixtures/ft_training_file.jsonl +++ b/examples/fixtures/ft_training_file.jsonl @@ -18,4 +18,4 @@ {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What is the smallest country in the world?"}, {"role": "assistant", "content": "Vatican City. Smaller than your average theme park."}]} {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What language has the most native speakers?"}, {"role": "assistant", "content": "Mandarin Chinese. Because it's not all about English, you know."}]} {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What is the hardest natural substance on Earth?"}, {"role": "assistant", "content": "Diamond. Not your average rock."}]} -{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What element does 'O' represent on the periodic table?"}, {"role": "assistant", "content": "Oxygen. The stuff you breathe. Hopefully, this isn't news."}]} +{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What element does 'O' represent on the periodic table?"}, {"role": "assistant", "content": "Oxygen. The stuff you breathe. Hopefully this isn't news."}]} diff --git a/examples/gcp/.env.example b/examples/gcp/.env.example new file mode 100644 index 00000000..6721bd37 --- /dev/null +++ b/examples/gcp/.env.example @@ -0,0 +1,3 @@ +GCP_PROJECT_ID=your-gcp-project-id +GCP_REGION=us-central1 +GCP_MODEL=mistral-small-2503 diff --git a/examples/gcp/async_chat_no_streaming.py b/examples/gcp/async_chat_no_streaming.py index 178f151c..61a2d076 100755 --- a/examples/gcp/async_chat_no_streaming.py +++ b/examples/gcp/async_chat_no_streaming.py @@ -1,19 +1,43 @@ #!/usr/bin/env python +""" +Example: Async chat completion with GCP Vertex AI. + +The SDK automatically: +- Detects credentials via google.auth.default() +- Auto-refreshes tokens when they expire +- Builds the Vertex AI URL from project_id and region + +Prerequisites: + gcloud auth application-default login + +Usage: + GCP_PROJECT_ID=your-project GCP_REGION=us-central1 GCP_MODEL=mistral-small-2503 python async_chat_no_streaming.py +""" import asyncio import os -from mistralai_gcp import MistralGoogleCloud -from mistralai_gcp.models.usermessage import UserMessage +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.models import UserMessage +# Configuration from environment variables +GCP_PROJECT_ID = os.environ.get("GCP_PROJECT_ID") # Optional: auto-detected from credentials +GCP_REGION = os.environ.get("GCP_REGION", "us-central1") +GCP_MODEL = os.environ.get("GCP_MODEL", "mistral-small-2503") -async def main(): - model = "mistral-large-2407" - client = MistralGoogleCloud(project_id=os.environ["GCP_PROJECT_ID"]) +async def main(): + # The SDK automatically handles: + # - Credential detection via google.auth.default() + # - Token refresh when expired + # - Vertex AI URL construction + client = MistralGCP( + project_id=GCP_PROJECT_ID, + region=GCP_REGION, + ) chat_response = await client.chat.complete_async( - model=model, + model=GCP_MODEL, messages=[UserMessage(content="What is the best French cheese?")], ) diff --git a/examples/gcp/gcp_async_chat_no_streaming.py b/examples/gcp/gcp_async_chat_no_streaming.py deleted file mode 100755 index 178f151c..00000000 --- a/examples/gcp/gcp_async_chat_no_streaming.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python - -import asyncio -import os - -from mistralai_gcp import MistralGoogleCloud -from mistralai_gcp.models.usermessage import UserMessage - - -async def main(): - model = "mistral-large-2407" - - client = MistralGoogleCloud(project_id=os.environ["GCP_PROJECT_ID"]) - - chat_response = await client.chat.complete_async( - model=model, - messages=[UserMessage(content="What is the best French cheese?")], - ) - - print(chat_response.choices[0].message.content) - - -if __name__ == "__main__": - asyncio.run(main()) diff --git a/examples/mistral/agents/async_agents_no_streaming.py b/examples/mistral/agents/async_agents_no_streaming.py index 45f300ac..bb2d767a 100755 --- a/examples/mistral/agents/async_agents_no_streaming.py +++ b/examples/mistral/agents/async_agents_no_streaming.py @@ -3,22 +3,32 @@ import asyncio import os -from mistralai import Mistral -from mistralai.models import UserMessage +from mistralai.client import Mistral +from mistralai.client.models import UserMessage + +MODEL = "mistral-medium-latest" async def main(): api_key = os.environ["MISTRAL_API_KEY"] - agent_id = os.environ["MISTRAL_AGENT_ID"] - client = Mistral(api_key=api_key) - chat_response = await client.agents.complete_async( - agent_id=agent_id, - messages=[UserMessage(content="What is the best French cheese?")], + # Create a fresh agent for this run to avoid version accumulation + agent = client.beta.agents.create( + model=MODEL, + name="cheese-expert-example", + instructions="You are a helpful assistant.", ) - print(chat_response.choices[0].message.content) + try: + chat_response = await client.agents.complete_async( + agent_id=agent.id, + messages=[UserMessage(content="What is the best French cheese?")], + ) + + print(chat_response.choices[0].message.content) + finally: + client.beta.agents.delete(agent_id=agent.id) if __name__ == "__main__": diff --git a/examples/mistral/agents/async_conversation_agent.py b/examples/mistral/agents/async_conversation_agent.py index 54f002ac..981f13c7 100644 --- a/examples/mistral/agents/async_conversation_agent.py +++ b/examples/mistral/agents/async_conversation_agent.py @@ -2,7 +2,7 @@ import asyncio import os -from mistralai import Mistral +from mistralai.client import Mistral MODEL = "mistral-medium-latest" diff --git a/examples/mistral/agents/async_conversation_run.py b/examples/mistral/agents/async_conversation_run.py index 9e118037..bb96ed78 100644 --- a/examples/mistral/agents/async_conversation_run.py +++ b/examples/mistral/agents/async_conversation_run.py @@ -2,55 +2,26 @@ import asyncio import os -from mistralai import Mistral +from mistralai.client import Mistral from mistralai.extra.run.context import RunContext -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel -MODEL = "mistral-medium-latest" - - -def math_question_generator(question_num: int): - """Random generator of mathematical question - - Args: - question_num (int): the number of the question that will be returned, should be between 1-100 - """ - return ( - "solve the following differential equation: `y'' + 3y' + 2y = 0`" - if question_num % 2 == 0 - else "solve the following differential equation: `y'' - 4y' + 4y = e^x`" - ) +MODEL = "mistral-medium-2505" async def main(): api_key = os.environ["MISTRAL_API_KEY"] client = Mistral(api_key=api_key) - class Explanation(BaseModel): - explanation: str - output: str - - class MathDemonstration(BaseModel): - steps: list[Explanation] - final_answer: str + class MathResult(BaseModel): + answer: int - async with RunContext(model=MODEL, output_format=MathDemonstration) as run_ctx: - # register a new function that can be executed on the client side - run_ctx.register_func(math_question_generator) + async with RunContext(model=MODEL, output_format=MathResult) as run_ctx: run_result = await client.beta.conversations.run_async( run_ctx=run_ctx, - instructions="Use the code interpreter to help you when asked mathematical questions.", - inputs=[ - {"role": "user", "content": "hey"}, - {"role": "assistant", "content": "hello"}, - {"role": "user", "content": "Request a math question and answer it."}, - ], - tools=[{"type": "code_interpreter"}], + inputs=[{"role": "user", "content": "What is 2 + 2?"}], ) - print("All run entries:") - for entry in run_result.output_entries: - print(f"{entry}") - print(f"Final model: {run_result.output_as_model}") + print(f"Result: {run_result.output_as_model}") if __name__ == "__main__": diff --git a/examples/mistral/agents/async_conversation_run_code_interpreter.py b/examples/mistral/agents/async_conversation_run_code_interpreter.py new file mode 100644 index 00000000..10c81d77 --- /dev/null +++ b/examples/mistral/agents/async_conversation_run_code_interpreter.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +import asyncio +import os + +from mistralai.client import Mistral +from mistralai.extra.run.context import RunContext +from mistralai.client.types import BaseModel + +MODEL = "mistral-medium-2505" + + +def math_question_generator(question_num: int): + """Random generator of mathematical question + + Args: + question_num (int): the number of the question that will be returned, should be between 1-100 + """ + return ( + "solve the following differential equation: `y'' + 3y' + 2y = 0`" + if question_num % 2 == 0 + else "solve the following differential equation: `y'' - 4y' + 4y = e^x`" + ) + + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + client = Mistral(api_key=api_key) + + class Explanation(BaseModel): + explanation: str + output: str + + class MathDemonstration(BaseModel): + steps: list[Explanation] + final_answer: str + + async with RunContext(model=MODEL, output_format=MathDemonstration) as run_ctx: + # register a new function that can be executed on the client side + run_ctx.register_func(math_question_generator) + run_result = await client.beta.conversations.run_async( + run_ctx=run_ctx, + instructions="Use the code interpreter to help you when asked mathematical questions.", + inputs=[ + {"role": "user", "content": "hey"}, + {"role": "assistant", "content": "hello"}, + {"role": "user", "content": "Request a math question and answer it."}, + ], + tools=[{"type": "code_interpreter"}], + ) + print("All run entries:") + for entry in run_result.output_entries: + print(f"{entry}") + print(f"Final model: {run_result.output_as_model}") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/agents/async_conversation_run_mcp.py b/examples/mistral/agents/async_conversation_run_mcp.py index 0e373715..52550004 100644 --- a/examples/mistral/agents/async_conversation_run_mcp.py +++ b/examples/mistral/agents/async_conversation_run_mcp.py @@ -3,7 +3,7 @@ import os import random -from mistralai import Mistral +from mistralai.client import Mistral from mistralai.extra.run.context import RunContext from mcp import StdioServerParameters from mistralai.extra.mcp.stdio import ( @@ -11,7 +11,7 @@ ) from pathlib import Path -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel cwd = Path(__file__).parent MODEL = "mistral-medium-latest" diff --git a/examples/mistral/agents/async_conversation_run_mcp_remote.py b/examples/mistral/agents/async_conversation_run_mcp_remote.py index 7b2f46a6..d6fac492 100644 --- a/examples/mistral/agents/async_conversation_run_mcp_remote.py +++ b/examples/mistral/agents/async_conversation_run_mcp_remote.py @@ -2,7 +2,7 @@ import asyncio import os -from mistralai import Mistral +from mistralai.client import Mistral from mistralai.extra.run.context import RunContext from mistralai.extra.mcp.sse import ( diff --git a/examples/mistral/agents/async_conversation_run_mcp_remote_auth.py b/examples/mistral/agents/async_conversation_run_mcp_remote_auth.py index f69d8096..c255895e 100644 --- a/examples/mistral/agents/async_conversation_run_mcp_remote_auth.py +++ b/examples/mistral/agents/async_conversation_run_mcp_remote_auth.py @@ -5,7 +5,7 @@ import threading import webbrowser -from mistralai import Mistral +from mistralai.client import Mistral from mistralai.extra.run.context import RunContext from mistralai.extra.mcp.sse import ( diff --git a/examples/mistral/agents/async_conversation_run_stream.py b/examples/mistral/agents/async_conversation_run_stream.py index 1e6ad87b..431b9cc9 100644 --- a/examples/mistral/agents/async_conversation_run_stream.py +++ b/examples/mistral/agents/async_conversation_run_stream.py @@ -3,14 +3,14 @@ import os import random -from mistralai import Mistral +from mistralai.client import Mistral from mistralai.extra.run.context import RunContext from mcp import StdioServerParameters from mistralai.extra.mcp.stdio import MCPClientSTDIO from pathlib import Path from mistralai.extra.run.result import RunResult -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel cwd = Path(__file__).parent MODEL = "mistral-medium-latest" diff --git a/examples/mistral/agents/async_multi_turn_conversation.py b/examples/mistral/agents/async_multi_turn_conversation.py new file mode 100644 index 00000000..9a41a097 --- /dev/null +++ b/examples/mistral/agents/async_multi_turn_conversation.py @@ -0,0 +1,76 @@ +import os +import asyncio +import logging +import time + +from mistralai.client import Mistral +from mistralai.extra.run.context import RunContext + + +MODEL = "mistral-medium-latest" + +USER_MESSAGE = """ +Please make the Secret Santa for me +To properly do it you need to: +- Get the friend you were assigned to (using the get_secret_santa_assignment function) +- Read into his gift wishlist what they would like to receive (using the get_gift_wishlist function) +- Buy the gift (using the buy_gift function) +- Find the best website to buy the gift using a web search +- Send it to them (using the send_gift function) +""" + + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + client = Mistral( + api_key=api_key, debug_logger=logging.getLogger("mistralai") + ) + + # Create a fresh agent for this run to avoid version accumulation + agent = client.beta.agents.create( + model=MODEL, + name="secret-santa-example", + instructions="You are a helpful assistant that helps with Secret Santa.", + ) + + try: + async with RunContext(agent_id=agent.id) as run_context: + run_context.register_func(get_secret_santa_assignment) + run_context.register_func(get_gift_wishlist) + run_context.register_func(buy_gift) + run_context.register_func(send_gift) + + await client.beta.conversations.run_async( + run_ctx=run_context, + inputs=USER_MESSAGE, + ) + finally: + client.beta.agents.delete(agent_id=agent.id) + + +def get_secret_santa_assignment(): + """Get the friend you were assigned to""" + time.sleep(2) + return "John Doe" + + +def get_gift_wishlist(friend_name: str): + """Get the gift wishlist of the friend you were assigned to""" + time.sleep(1.5) + return ["Book", "Chocolate", "T-Shirt"] + + +def buy_gift(gift_name: str): + """Buy the gift you want to send to your friend""" + time.sleep(1.1) + return f"Bought {gift_name}" + + +def send_gift(friend_name: str, gift_name: str, website: str): + """Send the gift to your friend""" + time.sleep(2.2) + return f"Sent {gift_name} to {friend_name} bought on {website}" + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/audio/async_realtime_transcription_dual_delay_microphone.py b/examples/mistral/audio/async_realtime_transcription_dual_delay_microphone.py new file mode 100644 index 00000000..7653b0ed --- /dev/null +++ b/examples/mistral/audio/async_realtime_transcription_dual_delay_microphone.py @@ -0,0 +1,473 @@ +#!/usr/bin/env python +# /// script +# requires-python = ">=3.9" +# dependencies = [ +# "mistralai[realtime]", +# "pyaudio", +# "rich", +# ] +# [tool.uv.sources] +# mistralai = { path = "../../..", editable = true } +# /// + +import argparse +import asyncio +import difflib +import os +import sys +from dataclasses import dataclass +from typing import AsyncIterator, Sequence + +from rich.align import Align +from rich.console import Console +from rich.layout import Layout +from rich.live import Live +from rich.panel import Panel +from rich.text import Text + +from mistralai.client import Mistral +from mistralai.extra.realtime import UnknownRealtimeEvent +from mistralai.client.models import ( + AudioFormat, + RealtimeTranscriptionError, + RealtimeTranscriptionSessionCreated, + TranscriptionStreamDone, + TranscriptionStreamTextDelta, +) + +from pyaudio_utils import load_pyaudio + +console = Console() + + +@dataclass +class DualTranscriptState: + """Tracks transcript state for dual-delay transcription.""" + + fast_full_text: str = "" + slow_full_text: str = "" + fast_status: str = "🔌 Connecting..." + slow_status: str = "🔌 Connecting..." + error: str | None = None + fast_done: bool = False + slow_done: bool = False + + def set_error(self, message: str) -> None: + self.error = message + self.fast_status = "❌ Error" + self.slow_status = "❌ Error" + + +class DualTranscriptDisplay: + """Renders a live dual-delay transcription UI.""" + + def __init__( + self, + *, + model: str, + fast_delay_ms: int, + slow_delay_ms: int, + state: DualTranscriptState, + ) -> None: + self.model = model + self.fast_delay_ms = fast_delay_ms + self.slow_delay_ms = slow_delay_ms + self.state = state + + @staticmethod + def _normalize_word(word: str) -> str: + return word.strip(".,!?;:\"'()[]{}").lower() + + def _compute_display_texts(self) -> tuple[str, str]: + slow_words = self.state.slow_full_text.split() + fast_words = self.state.fast_full_text.split() + + if not slow_words: + partial_text = f" {self.state.fast_full_text}".rstrip() + return "", partial_text + + slow_norm = [self._normalize_word(word) for word in slow_words] + fast_norm = [self._normalize_word(word) for word in fast_words] + + matcher = difflib.SequenceMatcher(None, slow_norm, fast_norm) + last_fast_index = 0 + slow_progress = 0 + for block in matcher.get_matching_blocks(): + if block.size == 0: + continue + slow_end = block.a + block.size + if slow_end > slow_progress: + slow_progress = slow_end + last_fast_index = block.b + block.size + + if last_fast_index < len(fast_words): + ahead_words = fast_words[last_fast_index:] + partial_text = " " + " ".join(ahead_words) if ahead_words else "" + else: + partial_text = "" + + return self.state.slow_full_text, partial_text + + @staticmethod + def _status_style(status: str) -> str: + if "Listening" in status: + return "green" + if "Connecting" in status: + return "yellow dim" + if "Done" in status or "Stopped" in status: + return "dim" + return "red" + + def render(self) -> Layout: + layout = Layout() + + header_text = Text() + header_text.append("│ ", style="dim") + header_text.append(self.model, style="dim") + header_text.append(" │ ", style="dim") + header_text.append( + f"fast {self.fast_delay_ms}ms", style="bright_yellow" + ) + header_text.append( + f" {self.state.fast_status}", + style=self._status_style(self.state.fast_status), + ) + header_text.append(" │ ", style="dim") + header_text.append(f"slow {self.slow_delay_ms}ms", style="white") + header_text.append( + f" {self.state.slow_status}", + style=self._status_style(self.state.slow_status), + ) + + header = Align.left(header_text, vertical="middle", pad=False) + + final_text, partial_text = self._compute_display_texts() + transcript_text = Text() + if final_text or partial_text: + transcript_text.append(final_text, style="white") + transcript_text.append(partial_text, style="bright_yellow") + else: + transcript_text.append("...", style="dim") + + transcript = Panel( + Align.left(transcript_text, vertical="top"), + border_style="dim", + padding=(1, 2), + ) + + footer_text = Text() + footer_text.append("ctrl+c", style="dim") + footer_text.append(" quit", style="dim italic") + footer = Align.left(footer_text, vertical="middle", pad=False) + + if self.state.error: + layout.split_column( + Layout(header, name="header", size=1), + Layout(transcript, name="body"), + Layout( + Panel(Text(self.state.error, style="red"), border_style="red"), + name="error", + size=4, + ), + Layout(footer, name="footer", size=1), + ) + else: + layout.split_column( + Layout(header, name="header", size=1), + Layout(transcript, name="body"), + Layout(footer, name="footer", size=1), + ) + + return layout + + +async def iter_microphone( + *, + sample_rate: int, + chunk_duration_ms: int, +) -> AsyncIterator[bytes]: + """ + Yield microphone PCM chunks using PyAudio (16-bit mono). + Encoding is always pcm_s16le. + """ + pyaudio = load_pyaudio() + + p = pyaudio.PyAudio() + chunk_samples = int(sample_rate * chunk_duration_ms / 1000) + + stream = p.open( + format=pyaudio.paInt16, + channels=1, + rate=sample_rate, + input=True, + frames_per_buffer=chunk_samples, + ) + + loop = asyncio.get_running_loop() + try: + while True: + data = await loop.run_in_executor(None, stream.read, chunk_samples, False) + yield data + finally: + stream.stop_stream() + stream.close() + p.terminate() + + +async def queue_audio_iter( + queue: asyncio.Queue[bytes | None], +) -> AsyncIterator[bytes]: + """Yield audio chunks from a queue until a None sentinel is received.""" + while True: + chunk = await queue.get() + if chunk is None: + break + yield chunk + + +async def broadcast_microphone( + *, + sample_rate: int, + chunk_duration_ms: int, + queues: Sequence[asyncio.Queue[bytes | None]], +) -> None: + """Read from the microphone once and broadcast to multiple queues.""" + try: + async for chunk in iter_microphone( + sample_rate=sample_rate, chunk_duration_ms=chunk_duration_ms + ): + for queue in queues: + await queue.put(chunk) + finally: + for queue in queues: + while True: + try: + queue.put_nowait(None) + break + except asyncio.QueueFull: + try: + queue.get_nowait() + except asyncio.QueueEmpty: + break + + +def _status_for_event(event: object) -> str: + if isinstance(event, RealtimeTranscriptionSessionCreated): + return "🎤 Listening..." + return "✅ Done" + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser( + description="Dual-delay real-time microphone transcription." + ) + parser.add_argument( + "--model", + default="voxtral-mini-transcribe-realtime-2602", + help="Model ID", + ) + parser.add_argument( + "--fast-delay-ms", + type=int, + default=240, + help="Fast target streaming delay in ms", + ) + parser.add_argument( + "--slow-delay-ms", + type=int, + default=2400, + help="Slow target streaming delay in ms", + ) + parser.add_argument( + "--sample-rate", + type=int, + default=16000, + choices=[8000, 16000, 22050, 44100, 48000], + help="Sample rate in Hz", + ) + parser.add_argument( + "--chunk-duration", + type=int, + default=10, + help="Chunk duration in ms", + ) + parser.add_argument( + "--api-key", + default=os.environ.get("MISTRAL_API_KEY"), + help="Mistral API key", + ) + parser.add_argument( + "--base-url", + default=os.environ.get("MISTRAL_BASE_URL", "wss://api.mistral.ai"), + ) + return parser.parse_args() + + +async def run_stream( + *, + client: Mistral, + model: str, + delay_ms: int, + audio_stream: AsyncIterator[bytes], + audio_format: AudioFormat, + state: DualTranscriptState, + update_queue: asyncio.Queue[None], + is_fast: bool, +) -> None: + try: + async for event in client.audio.realtime.transcribe_stream( + audio_stream=audio_stream, + model=model, + audio_format=audio_format, + target_streaming_delay_ms=delay_ms, + ): + if isinstance(event, RealtimeTranscriptionSessionCreated): + if is_fast: + state.fast_status = _status_for_event(event) + else: + state.slow_status = _status_for_event(event) + elif isinstance(event, TranscriptionStreamTextDelta): + if is_fast: + state.fast_full_text += event.text + else: + state.slow_full_text += event.text + elif isinstance(event, TranscriptionStreamDone): + if is_fast: + state.fast_status = _status_for_event(event) + state.fast_done = True + else: + state.slow_status = _status_for_event(event) + state.slow_done = True + break + elif isinstance(event, RealtimeTranscriptionError): + state.set_error(str(event.error)) + break + elif isinstance(event, UnknownRealtimeEvent): + continue + + if update_queue.empty(): + update_queue.put_nowait(None) + except Exception as exc: # pragma: no cover - safety net for UI demo + state.set_error(str(exc)) + if update_queue.empty(): + update_queue.put_nowait(None) + + +async def ui_loop( + display: DualTranscriptDisplay, + update_queue: asyncio.Queue[None], + stop_event: asyncio.Event, + *, + refresh_hz: float = 12.0, +) -> None: + with Live( + display.render(), console=console, refresh_per_second=refresh_hz, screen=True + ) as live: + while not stop_event.is_set(): + try: + await asyncio.wait_for(update_queue.get(), timeout=0.25) + except asyncio.TimeoutError: + pass + live.update(display.render()) + + +async def main() -> int: + args = parse_args() + api_key = args.api_key or os.environ["MISTRAL_API_KEY"] + + try: + load_pyaudio() + except RuntimeError as exc: + console.print(str(exc), style="red") + return 1 + + state = DualTranscriptState() + display = DualTranscriptDisplay( + model=args.model, + fast_delay_ms=args.fast_delay_ms, + slow_delay_ms=args.slow_delay_ms, + state=state, + ) + + client = Mistral(api_key=api_key, server_url=args.base_url) + audio_format = AudioFormat(encoding="pcm_s16le", sample_rate=args.sample_rate) + + fast_queue: asyncio.Queue[bytes | None] = asyncio.Queue(maxsize=50) + slow_queue: asyncio.Queue[bytes | None] = asyncio.Queue(maxsize=50) + + stop_event = asyncio.Event() + update_queue: asyncio.Queue[None] = asyncio.Queue(maxsize=1) + + broadcaster = asyncio.create_task( + broadcast_microphone( + sample_rate=args.sample_rate, + chunk_duration_ms=args.chunk_duration, + queues=(fast_queue, slow_queue), + ) + ) + + fast_task = asyncio.create_task( + run_stream( + client=client, + model=args.model, + delay_ms=args.fast_delay_ms, + audio_stream=queue_audio_iter(fast_queue), + audio_format=audio_format, + state=state, + update_queue=update_queue, + is_fast=True, + ) + ) + + slow_task = asyncio.create_task( + run_stream( + client=client, + model=args.model, + delay_ms=args.slow_delay_ms, + audio_stream=queue_audio_iter(slow_queue), + audio_format=audio_format, + state=state, + update_queue=update_queue, + is_fast=False, + ) + ) + + ui_task = asyncio.create_task( + ui_loop(display, update_queue, stop_event, refresh_hz=12.0) + ) + + try: + while True: + await asyncio.sleep(0.1) + for task in (broadcaster, fast_task, slow_task): + if not task.done(): + continue + exc = task.exception() + if exc: + state.set_error(str(exc)) + if update_queue.empty(): + update_queue.put_nowait(None) + stop_event.set() + break + if state.error: + stop_event.set() + break + if state.fast_done and state.slow_done: + stop_event.set() + break + except KeyboardInterrupt: + state.fast_status = "⏹️ Stopped" + state.slow_status = "⏹️ Stopped" + stop_event.set() + finally: + broadcaster.cancel() + fast_task.cancel() + slow_task.cancel() + await asyncio.gather(broadcaster, fast_task, slow_task, return_exceptions=True) + await ui_task + + return 0 if not state.error else 1 + + +if __name__ == "__main__": + sys.exit(asyncio.run(main())) diff --git a/examples/mistral/audio/async_realtime_transcription_microphone.py b/examples/mistral/audio/async_realtime_transcription_microphone.py new file mode 100644 index 00000000..49568aea --- /dev/null +++ b/examples/mistral/audio/async_realtime_transcription_microphone.py @@ -0,0 +1,251 @@ +#!/usr/bin/env python +# /// script +# requires-python = ">=3.9" +# dependencies = [ +# "mistralai[realtime]", +# "pyaudio", +# "rich", +# ] +# [tool.uv.sources] +# mistralai = { path = "../../..", editable = true } +# /// + +import argparse +import asyncio +import os +import sys +from typing import AsyncIterator + +from rich.align import Align +from rich.console import Console +from rich.layout import Layout +from rich.live import Live +from rich.panel import Panel +from rich.text import Text + +from mistralai.client import Mistral +from mistralai.extra.realtime import UnknownRealtimeEvent +from mistralai.client.models import ( + AudioFormat, + RealtimeTranscriptionError, + RealtimeTranscriptionSessionCreated, + TranscriptionStreamDone, + TranscriptionStreamTextDelta, +) + +from pyaudio_utils import load_pyaudio + +console = Console() + + +class TranscriptDisplay: + """Manages the live transcript display.""" + + def __init__(self, model: str, target_streaming_delay_ms: int | None) -> None: + self.model = model + self.target_streaming_delay_ms = target_streaming_delay_ms + self.transcript = "" + self.status = "🔌 Connecting..." + self.error: str | None = None + + def set_listening(self) -> None: + self.status = "🎤 Listening..." + + def add_text(self, text: str) -> None: + self.transcript += text + + def set_done(self) -> None: + self.status = "✅ Done" + + def set_error(self, error: str) -> None: + self.status = "❌ Error" + self.error = error + + def render(self) -> Layout: + layout = Layout() + + # Create minimal header + header_text = Text() + header_text.append("│ ", style="dim") + header_text.append(self.model, style="dim") + if self.target_streaming_delay_ms is not None: + header_text.append( + f" · delay {self.target_streaming_delay_ms}ms", style="dim" + ) + header_text.append(" │ ", style="dim") + + if "Listening" in self.status: + status_style = "green" + elif "Connecting" in self.status: + status_style = "yellow dim" + elif "Done" in self.status or "Stopped" in self.status: + status_style = "dim" + else: + status_style = "red" + header_text.append(self.status, style=status_style) + + header = Align.left(header_text, vertical="middle", pad=False) + + # Create main transcript area - no title, minimal border + transcript_text = Text( + self.transcript or "...", style="white" if self.transcript else "dim" + ) + transcript = Panel( + Align.left(transcript_text, vertical="top"), + border_style="dim", + padding=(1, 2), + ) + + # Minimal footer + footer_text = Text() + footer_text.append("ctrl+c", style="dim") + footer_text.append(" quit", style="dim italic") + footer = Align.left(footer_text, vertical="middle", pad=False) + + # Handle error display + if self.error: + layout.split_column( + Layout(header, name="header", size=1), + Layout(transcript, name="body"), + Layout( + Panel(Text(self.error, style="red"), border_style="red"), + name="error", + size=4, + ), + Layout(footer, name="footer", size=1), + ) + else: + layout.split_column( + Layout(header, name="header", size=1), + Layout(transcript, name="body"), + Layout(footer, name="footer", size=1), + ) + + return layout + + +async def iter_microphone( + *, + sample_rate: int, + chunk_duration_ms: int, +) -> AsyncIterator[bytes]: + """ + Yield microphone PCM chunks using PyAudio (16-bit mono). + Encoding is always pcm_s16le. + """ + pyaudio = load_pyaudio() + + p = pyaudio.PyAudio() + chunk_samples = int(sample_rate * chunk_duration_ms / 1000) + + stream = p.open( + format=pyaudio.paInt16, + channels=1, + rate=sample_rate, + input=True, + frames_per_buffer=chunk_samples, + ) + + loop = asyncio.get_running_loop() + try: + while True: + # stream.read is blocking; run it off-thread + data = await loop.run_in_executor(None, stream.read, chunk_samples, False) + yield data + finally: + stream.stop_stream() + stream.close() + p.terminate() + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser(description="Real-time microphone transcription.") + parser.add_argument("--model", default="voxtral-mini-transcribe-realtime-2602", help="Model ID") + parser.add_argument( + "--sample-rate", + type=int, + default=16000, + choices=[8000, 16000, 22050, 44100, 48000], + help="Sample rate in Hz", + ) + parser.add_argument( + "--chunk-duration", type=int, default=10, help="Chunk duration in ms" + ) + parser.add_argument( + "--target-streaming-delay-ms", + type=int, + default=None, + help="Target streaming delay in milliseconds", + ) + parser.add_argument( + "--api-key", default=os.environ.get("MISTRAL_API_KEY"), help="Mistral API key" + ) + parser.add_argument( + "--base-url", + default=os.environ.get("MISTRAL_BASE_URL", "wss://api.mistral.ai"), + ) + return parser.parse_args() + + +async def main() -> int: + args = parse_args() + api_key = args.api_key or os.environ["MISTRAL_API_KEY"] + + try: + load_pyaudio() + except RuntimeError as exc: + console.print(str(exc), style="red") + return 1 + + client = Mistral(api_key=api_key, server_url=args.base_url) + + # microphone is always pcm_s16le here + audio_format = AudioFormat(encoding="pcm_s16le", sample_rate=args.sample_rate) + + mic_stream = iter_microphone( + sample_rate=args.sample_rate, chunk_duration_ms=args.chunk_duration + ) + + display = TranscriptDisplay( + model=args.model, target_streaming_delay_ms=args.target_streaming_delay_ms + ) + + with Live( + display.render(), console=console, refresh_per_second=10, screen=True + ) as live: + try: + async for event in client.audio.realtime.transcribe_stream( + audio_stream=mic_stream, + model=args.model, + audio_format=audio_format, + target_streaming_delay_ms=args.target_streaming_delay_ms, + ): + if isinstance(event, RealtimeTranscriptionSessionCreated): + display.set_listening() + live.update(display.render()) + elif isinstance(event, TranscriptionStreamTextDelta): + display.add_text(event.text) + live.update(display.render()) + elif isinstance(event, TranscriptionStreamDone): + display.set_done() + live.update(display.render()) + break + elif isinstance(event, RealtimeTranscriptionError): + display.set_error(str(event.error)) + live.update(display.render()) + return 1 + elif isinstance(event, UnknownRealtimeEvent): + continue + except KeyboardInterrupt: + display.status = "⏹️ Stopped" + live.update(display.render()) + except Exception as exc: + display.set_error(str(exc)) + live.update(display.render()) + return 1 + + return 0 + + +if __name__ == "__main__": + sys.exit(asyncio.run(main())) diff --git a/examples/mistral/audio/async_realtime_transcription_stream.py b/examples/mistral/audio/async_realtime_transcription_stream.py new file mode 100644 index 00000000..c005cf3f --- /dev/null +++ b/examples/mistral/audio/async_realtime_transcription_stream.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python + +import argparse +import asyncio +import os +import subprocess +import sys +import tempfile +from pathlib import Path +from typing import AsyncIterator + +from mistralai.client import Mistral +from mistralai.extra.realtime.connection import UnknownRealtimeEvent +from mistralai.client.models import ( + AudioFormat, + RealtimeTranscriptionError, + TranscriptionStreamDone, + TranscriptionStreamTextDelta, +) + + +def convert_audio_to_pcm( + input_path: Path, +) -> Path: + temp_file = tempfile.NamedTemporaryFile(suffix=".pcm", delete=False) + temp_path = Path(temp_file.name) + temp_file.close() + + cmd = [ + "ffmpeg", + "-y", + "-i", + str(input_path), + "-f", + "s16le", + "-ar", + str(16000), + "-ac", + "1", + str(temp_path), + ] + + try: + subprocess.run(cmd, check=True, capture_output=True, text=True) + except subprocess.CalledProcessError as exc: + temp_path.unlink(missing_ok=True) + raise RuntimeError(f"ffmpeg conversion failed: {exc.stderr}") from exc + + return temp_path + + +async def aiter_audio_file( + path: Path, + *, + chunk_size: int = 4096, + chunk_delay: float = 0.0, +) -> AsyncIterator[bytes]: + with open(path, "rb") as f: + while True: + chunk = f.read(chunk_size) + if not chunk: + break + yield chunk + if chunk_delay > 0: + await asyncio.sleep(chunk_delay) + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser( + description="Real-time audio transcription via WebSocket (iterator-based)." + ) + parser.add_argument("file", type=Path, help="Path to the audio file") + parser.add_argument("--model", default="voxtral-mini-2601", help="Model ID") + parser.add_argument( + "--api-key", + default=os.environ.get("MISTRAL_API_KEY"), + help="Mistral API key", + ) + parser.add_argument( + "--base-url", + default=os.environ.get("MISTRAL_BASE_URL", "https://api.mistral.ai"), + help="API base URL (http/https/ws/wss)", + ) + parser.add_argument( + "--chunk-size", type=int, default=4096, help="Audio chunk size in bytes" + ) + parser.add_argument( + "--chunk-delay", + type=float, + default=0.01, + help="Delay between chunks in seconds", + ) + parser.add_argument( + "--target-streaming-delay-ms", + type=int, + default=None, + help="Target streaming delay in milliseconds", + ) + parser.add_argument( + "--no-convert", + action="store_true", + help="Skip ffmpeg conversion (input must be raw PCM)", + ) + return parser.parse_args() + + +async def main() -> int: + args = parse_args() + api_key = args.api_key or os.environ["MISTRAL_API_KEY"] + + pcm_path = args.file + temp_path = None + + if not args.no_convert and args.file.suffix.lower() not in (".pcm", ".raw"): + pcm_path = convert_audio_to_pcm(args.file) + temp_path = pcm_path + + client = Mistral(api_key=api_key, server_url=args.base_url) + + try: + async for event in client.audio.realtime.transcribe_stream( + audio_stream=aiter_audio_file( + pcm_path, + chunk_size=args.chunk_size, + chunk_delay=args.chunk_delay, + ), + model=args.model, + audio_format=AudioFormat(encoding="pcm_s16le", sample_rate=16000), + target_streaming_delay_ms=args.target_streaming_delay_ms, + ): + if isinstance(event, TranscriptionStreamTextDelta): + print(event.text, end="", flush=True) + elif isinstance(event, TranscriptionStreamDone): + print() + break + elif isinstance(event, RealtimeTranscriptionError): + print(f"\nError: {event.error}", file=sys.stderr) + break + elif isinstance(event, UnknownRealtimeEvent): + # ignore future / unknown events; keep going + continue + + finally: + if temp_path is not None: + temp_path.unlink(missing_ok=True) + + return 0 + + +if __name__ == "__main__": + sys.exit(asyncio.run(main())) diff --git a/examples/mistral/audio/chat_base64.py b/examples/mistral/audio/chat_base64.py index ea5ea79a..d6afb2ab 100755 --- a/examples/mistral/audio/chat_base64.py +++ b/examples/mistral/audio/chat_base64.py @@ -2,9 +2,8 @@ import base64 import os -from mistralai import Mistral -from mistralai.models import UserMessage - +from mistralai.client import Mistral +from mistralai.client.models import UserMessage def main(): @@ -16,13 +15,17 @@ def main(): content = f.read() chat_response = client.chat.complete( model=model, - messages=[UserMessage(content=[ - {"type": "text", "text": "What's in this audio file?"}, - { - "type": "input_audio", - "input_audio": base64.b64encode(content).decode('utf-8'), - }, - ])], + messages=[ + UserMessage( + content=[ + {"type": "text", "text": "What's in this audio file?"}, + { + "type": "input_audio", + "input_audio": base64.b64encode(content).decode("utf-8"), + }, + ] + ) + ], ) print(chat_response.choices[0].message.content) diff --git a/examples/mistral/audio/chat_no_streaming.py b/examples/mistral/audio/chat_no_streaming.py index 2caebb25..87237ec0 100755 --- a/examples/mistral/audio/chat_no_streaming.py +++ b/examples/mistral/audio/chat_no_streaming.py @@ -2,9 +2,8 @@ import os -from mistralai import Mistral -from mistralai.models import UserMessage - +from mistralai.client import Mistral +from mistralai.client.models import UserMessage def main(): @@ -15,13 +14,17 @@ def main(): chat_response = client.chat.complete( model=model, - messages=[UserMessage(content=[ - {"type": "text", "text": "What is this audio about?"}, - { - "type": "input_audio", - "input_audio": "https://docs.mistral.ai/audio/bcn_weather.mp3", - }, - ])], + messages=[ + UserMessage( + content=[ + {"type": "text", "text": "What is this audio about?"}, + { + "type": "input_audio", + "input_audio": "https://docs.mistral.ai/audio/bcn_weather.mp3", + }, + ] + ) + ], ) print(chat_response.choices[0].message.content) diff --git a/examples/mistral/audio/chat_streaming.py b/examples/mistral/audio/chat_streaming.py index 060bfdd9..b418ef57 100755 --- a/examples/mistral/audio/chat_streaming.py +++ b/examples/mistral/audio/chat_streaming.py @@ -2,9 +2,9 @@ import os -from mistralai import Mistral, File -from mistralai.models import UserMessage - +from mistralai.client import Mistral +from mistralai.client.models import File +from mistralai.client.models import UserMessage def main(): @@ -13,19 +13,25 @@ def main(): client = Mistral(api_key=api_key) with open("examples/fixtures/bcn_weather.mp3", "rb") as f: - file = client.files.upload(file=File(content=f, file_name=f.name), purpose="audio") + file = client.files.upload( + file=File(content=f, file_name=f.name), purpose="audio" + ) print(f"Uploaded audio file, id={file.id}") signed_url = client.files.get_signed_url(file_id=file.id) try: chat_response = client.chat.stream( model=model, - messages=[UserMessage(content=[ - {"type": "text", "text": "What is this audio about?"}, - { - "type": "input_audio", - "input_audio": signed_url.url, - }, - ])], + messages=[ + UserMessage( + content=[ + {"type": "text", "text": "What is this audio about?"}, + { + "type": "input_audio", + "input_audio": signed_url.url, + }, + ] + ) + ], ) for chunk in chat_response: print(chunk.data.choices[0].delta.content) @@ -33,5 +39,6 @@ def main(): client.files.delete(file_id=file.id) print(f"Deleted audio file, id={file.id}") + if __name__ == "__main__": main() diff --git a/examples/mistral/audio/pyaudio_utils.py b/examples/mistral/audio/pyaudio_utils.py new file mode 100644 index 00000000..af72a885 --- /dev/null +++ b/examples/mistral/audio/pyaudio_utils.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +from types import ModuleType + + +def load_pyaudio() -> ModuleType: + """ + Import PyAudio with a friendly error when PortAudio is missing. + + Raises: + RuntimeError: If PyAudio/PortAudio cannot be imported. + """ + try: + import pyaudio + except Exception as exc: + details = str(exc).lower() + if isinstance(exc, ModuleNotFoundError) and exc.name == "pyaudio": + message = ( + "PyAudio is required to use the microphone.\n" + "Install PortAudio (eg. for macos: brew install portaudio), then " + "reinstall PyAudio." + ) + elif "pyaudio._portaudio" in details or "portaudio" in details: + message = ( + "PyAudio is installed, but the PortAudio native library is missing or " + "failed to load.\n" + "Install PortAudio (eg. for macos: brew install portaudio), then " + "reinstall PyAudio." + ) + else: + message = ( + "PyAudio is required to use the microphone, but it could not be " + "imported.\n" + "Install PortAudio (eg. for macos: brew install portaudio), then " + "reinstall PyAudio." + ) + raise RuntimeError(message) from exc + return pyaudio diff --git a/examples/mistral/audio/transcription_async.py b/examples/mistral/audio/transcription_async.py index 9092fc03..f04f397e 100644 --- a/examples/mistral/audio/transcription_async.py +++ b/examples/mistral/audio/transcription_async.py @@ -2,7 +2,8 @@ import os import asyncio -from mistralai import Mistral, File +from mistralai.client import Mistral +from mistralai.client.models import File async def main(): diff --git a/examples/mistral/audio/transcription_diarize_async.py b/examples/mistral/audio/transcription_diarize_async.py new file mode 100644 index 00000000..4b511c87 --- /dev/null +++ b/examples/mistral/audio/transcription_diarize_async.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import os +import asyncio +import pathlib +from mistralai.client import Mistral +from mistralai.client.models import File + +fixture_dir = pathlib.Path(__file__).parents[2] / "fixtures" + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + model = "voxtral-mini-2602" + + client = Mistral(api_key=api_key) + with open(fixture_dir / "bcn_weather.mp3", "rb") as f: + response = await client.audio.transcriptions.complete_async( + model=model, + file=File(content=f, file_name=f.name), + diarize=True, + timestamp_granularities=["segment"], + ) + for segment in response.segments: + speaker = segment.speaker_id or "unknown" + print( + f"[{segment.start:.1f}s → {segment.end:.1f}s] {speaker}: {segment.text.strip()}" + ) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/audio/transcription_segments.py b/examples/mistral/audio/transcription_segments.py index 626b83e2..3d691711 100644 --- a/examples/mistral/audio/transcription_segments.py +++ b/examples/mistral/audio/transcription_segments.py @@ -2,7 +2,7 @@ import os -from mistralai import Mistral +from mistralai.client import Mistral def main(): diff --git a/examples/mistral/audio/transcription_segments_stream.py b/examples/mistral/audio/transcription_segments_stream.py index bedfbd40..32edf951 100644 --- a/examples/mistral/audio/transcription_segments_stream.py +++ b/examples/mistral/audio/transcription_segments_stream.py @@ -2,7 +2,7 @@ import os -from mistralai import Mistral +from mistralai.client import Mistral def main(): diff --git a/examples/mistral/audio/transcription_stream_async.py b/examples/mistral/audio/transcription_stream_async.py index b7f553b3..3055f3de 100644 --- a/examples/mistral/audio/transcription_stream_async.py +++ b/examples/mistral/audio/transcription_stream_async.py @@ -2,7 +2,8 @@ import asyncio import os -from mistralai import Mistral, File +from mistralai.client import Mistral +from mistralai.client.models import File async def main(): diff --git a/examples/mistral/audio/transcription_url.py b/examples/mistral/audio/transcription_url.py index b194b50c..907f830d 100644 --- a/examples/mistral/audio/transcription_url.py +++ b/examples/mistral/audio/transcription_url.py @@ -2,7 +2,7 @@ import os -from mistralai import Mistral +from mistralai.client import Mistral def main(): diff --git a/examples/mistral/chat/async_chat_no_streaming.py b/examples/mistral/chat/async_chat_no_streaming.py index 9448f09d..ad45d0fd 100755 --- a/examples/mistral/chat/async_chat_no_streaming.py +++ b/examples/mistral/chat/async_chat_no_streaming.py @@ -3,8 +3,8 @@ import asyncio import os -from mistralai import Mistral -from mistralai.models import UserMessage +from mistralai.client import Mistral +from mistralai.client.models import UserMessage async def main(): diff --git a/examples/mistral/chat/async_chat_with_image_no_streaming.py b/examples/mistral/chat/async_chat_with_image_no_streaming.py index efadff89..5d2cbdaa 100755 --- a/examples/mistral/chat/async_chat_with_image_no_streaming.py +++ b/examples/mistral/chat/async_chat_with_image_no_streaming.py @@ -4,8 +4,8 @@ import os -from mistralai import Mistral -from mistralai.models import UserMessage +from mistralai.client import Mistral +from mistralai.client.models import UserMessage async def main(): diff --git a/examples/mistral/chat/async_chat_with_streaming.py b/examples/mistral/chat/async_chat_with_streaming.py index 1ef500ae..1642ea41 100755 --- a/examples/mistral/chat/async_chat_with_streaming.py +++ b/examples/mistral/chat/async_chat_with_streaming.py @@ -3,8 +3,8 @@ import asyncio import os -from mistralai import Mistral -from mistralai.models import UserMessage +from mistralai.client import Mistral +from mistralai.client.models import UserMessage async def main(): diff --git a/examples/mistral/chat/async_structured_outputs.py b/examples/mistral/chat/async_structured_outputs.py index a512d38f..09ed5737 100644 --- a/examples/mistral/chat/async_structured_outputs.py +++ b/examples/mistral/chat/async_structured_outputs.py @@ -4,7 +4,7 @@ import os from pydantic import BaseModel -from mistralai import Mistral +from mistralai.client import Mistral async def main(): diff --git a/examples/mistral/chat/chat_no_streaming.py b/examples/mistral/chat/chat_no_streaming.py index 72506dd9..5f6968ca 100755 --- a/examples/mistral/chat/chat_no_streaming.py +++ b/examples/mistral/chat/chat_no_streaming.py @@ -2,8 +2,8 @@ import os -from mistralai import Mistral -from mistralai.models import UserMessage +from mistralai.client import Mistral +from mistralai.client.models import UserMessage def main(): diff --git a/examples/mistral/chat/chat_prediction.py b/examples/mistral/chat/chat_prediction.py index 1ff87e3f..88c57e77 100644 --- a/examples/mistral/chat/chat_prediction.py +++ b/examples/mistral/chat/chat_prediction.py @@ -2,8 +2,8 @@ import os -from mistralai import Mistral -from mistralai.models import UserMessage +from mistralai.client import Mistral +from mistralai.client.models import UserMessage def main(): diff --git a/examples/mistral/chat/chat_with_streaming.py b/examples/mistral/chat/chat_with_streaming.py index 66b167f1..94a3e29c 100755 --- a/examples/mistral/chat/chat_with_streaming.py +++ b/examples/mistral/chat/chat_with_streaming.py @@ -2,8 +2,8 @@ import os -from mistralai import Mistral -from mistralai.models import UserMessage +from mistralai.client import Mistral +from mistralai.client.models import UserMessage def main(): diff --git a/examples/mistral/chat/chatbot_with_streaming.py b/examples/mistral/chat/chatbot_with_streaming.py index 8d47deb5..eae79dcf 100755 --- a/examples/mistral/chat/chatbot_with_streaming.py +++ b/examples/mistral/chat/chatbot_with_streaming.py @@ -7,9 +7,10 @@ import os import readline import sys +from typing import Any -from mistralai import Mistral -from mistralai.models import AssistantMessage, SystemMessage, UserMessage +from mistralai.client import Mistral +from mistralai.client.models import AssistantMessage, SystemMessage, UserMessage MODEL_LIST = [ "mistral-small-latest", @@ -21,7 +22,7 @@ DEFAULT_TEMPERATURE = 0.7 LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s" # A dictionary of all commands and their arguments, used for tab completion. -COMMAND_LIST = { +COMMAND_LIST: dict[str, Any] = { "/new": {}, "/help": {}, "/model": {model: {} for model in MODEL_LIST}, # Nested completions for models diff --git a/examples/mistral/chat/completion_with_streaming.py b/examples/mistral/chat/completion_with_streaming.py index 5bee2033..399e8638 100644 --- a/examples/mistral/chat/completion_with_streaming.py +++ b/examples/mistral/chat/completion_with_streaming.py @@ -3,7 +3,7 @@ import asyncio import os -from mistralai import Mistral +from mistralai.client import Mistral async def main(): diff --git a/examples/mistral/chat/function_calling.py b/examples/mistral/chat/function_calling.py index aba7d671..bd694d8c 100644 --- a/examples/mistral/chat/function_calling.py +++ b/examples/mistral/chat/function_calling.py @@ -1,16 +1,21 @@ import functools import json import os -from typing import Dict, List - -from mistralai import Mistral -from mistralai.models.assistantmessage import AssistantMessage -from mistralai.models.function import Function -from mistralai.models.toolmessage import ToolMessage -from mistralai.models.usermessage import UserMessage +from typing import Any + +from mistralai.client import Mistral +from mistralai.client.models import ( + AssistantMessage, + ChatCompletionRequestMessage, + Function, + Tool, + ToolMessage, + UserMessage, +) +from mistralai.client.models.chatcompletionrequest import ChatCompletionRequestTool # Assuming we have the following data -data = { +data: dict[str, list[Any]] = { "transaction_id": ["T1001", "T1002", "T1003", "T1004", "T1005"], "customer_id": ["C001", "C002", "C003", "C002", "C001"], "payment_amount": [125.50, 89.99, 120.00, 54.30, 210.20], @@ -25,20 +30,18 @@ } -def retrieve_payment_status(data: Dict[str, List], transaction_id: str) -> str: +def retrieve_payment_status(data: dict[str, list[Any]], transaction_id: str) -> str: for i, r in enumerate(data["transaction_id"]): if r == transaction_id: return json.dumps({"status": data["payment_status"][i]}) - else: - return json.dumps({"status": "Error - transaction id not found"}) + return json.dumps({"status": "Error - transaction id not found"}) -def retrieve_payment_date(data: Dict[str, List], transaction_id: str) -> str: +def retrieve_payment_date(data: dict[str, list[Any]], transaction_id: str) -> str: for i, r in enumerate(data["transaction_id"]): if r == transaction_id: return json.dumps({"date": data["payment_date"][i]}) - else: - return json.dumps({"status": "Error - transaction id not found"}) + return json.dumps({"status": "Error - transaction id not found"}) names_to_functions = { @@ -46,10 +49,9 @@ def retrieve_payment_date(data: Dict[str, List], transaction_id: str) -> str: "retrieve_payment_date": functools.partial(retrieve_payment_date, data=data), } -tools = [ - { - "type": "function", - "function": Function( +tools: list[ChatCompletionRequestTool] = [ + Tool( + function=Function( name="retrieve_payment_status", description="Get payment status of a transaction id", parameters={ @@ -63,10 +65,9 @@ def retrieve_payment_date(data: Dict[str, List], transaction_id: str) -> str: }, }, ), - }, - { - "type": "function", - "function": Function( + ), + Tool( + function=Function( name="retrieve_payment_date", description="Get payment date of a transaction id", parameters={ @@ -80,7 +81,7 @@ def retrieve_payment_date(data: Dict[str, List], transaction_id: str) -> str: }, }, ), - }, + ), ] api_key = os.environ["MISTRAL_API_KEY"] @@ -88,28 +89,31 @@ def retrieve_payment_date(data: Dict[str, List], transaction_id: str) -> str: client = Mistral(api_key=api_key) -messages = [UserMessage(content="What's the status of my transaction?")] +messages: list[ChatCompletionRequestMessage] = [ + UserMessage(content="What's the status of my transaction?") +] -response = client.chat.complete( - model=model, messages=messages, tools=tools, temperature=0 -) +response = client.chat.complete(model=model, messages=messages, tools=tools, temperature=0) +assert response.choices[0].message is not None +assert response.choices[0].message is not None print(response.choices[0].message.content) messages.append(AssistantMessage(content=response.choices[0].message.content)) messages.append(UserMessage(content="My transaction ID is T1001.")) -response = client.chat.complete( - model=model, messages=messages, tools=tools, temperature=0 -) +response = client.chat.complete(model=model, messages=messages, tools=tools, temperature=0) +assert response.choices[0].message is not None -tool_call = response.choices[0].message.tool_calls[0] +assert response.choices[0].message is not None +tool_calls = response.choices[0].message.tool_calls +if not tool_calls: + raise RuntimeError("Expected tool calls") +tool_call = tool_calls[0] function_name = tool_call.function.name -function_params = json.loads(tool_call.function.arguments) +function_params = json.loads(str(tool_call.function.arguments)) -print( - f"calling function_name: {function_name}, with function_params: {function_params}" -) +print(f"calling function_name: {function_name}, with function_params: {function_params}") function_result = names_to_functions[function_name](**function_params) @@ -128,8 +132,8 @@ def retrieve_payment_date(data: Dict[str, List], transaction_id: str) -> str: ) print(messages) -response = client.chat.complete( - model=model, messages=messages, tools=tools, temperature=0 -) +response = client.chat.complete(model=model, messages=messages, tools=tools, temperature=0) +assert response.choices[0].message is not None +assert response.choices[0].message is not None print(f"{response.choices[0].message.content}") diff --git a/examples/mistral/chat/json_format.py b/examples/mistral/chat/json_format.py index 23c38680..8fa1416a 100755 --- a/examples/mistral/chat/json_format.py +++ b/examples/mistral/chat/json_format.py @@ -2,8 +2,8 @@ import os -from mistralai import Mistral -from mistralai.models import UserMessage +from mistralai.client import Mistral +from mistralai.client.models import UserMessage def main(): diff --git a/examples/mistral/chat/reasoning.py b/examples/mistral/chat/reasoning.py new file mode 100644 index 00000000..1e2b1348 --- /dev/null +++ b/examples/mistral/chat/reasoning.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +import os + +from mistralai.client import Mistral +from mistralai.client.models import TextChunk, ThinkChunk, UserMessage + + +def main(): + api_key = os.environ["MISTRAL_API_KEY"] + model = "mistral-medium-3-5" + + # Bump request timeout because reasoning runs can be long. + client = Mistral(api_key=api_key, timeout_ms=300_000) + + chat_response = client.chat.complete( + model=model, + messages=[ + UserMessage( + content=( + "John is one of 4 children. The first sister is 4 years old. " + "Next year, the second sister will be twice as old as the first sister. " + "The third sister is two years older than the second sister. " + "The third sister is half the age of her older brother. " + "How old is John?" + ) + ) + ], + reasoning_effort="high", + temperature=0.7, + ) + + # With reasoning_effort="high", message.content is a list of chunks. + # With reasoning_effort="none", message.content is a plain string. + content = chat_response.choices[0].message.content + if isinstance(content, str): + print(content) + return + + for chunk in content or []: + if isinstance(chunk, ThinkChunk): + print("--- thinking ---") + for inner in chunk.thinking: + if isinstance(inner, TextChunk): + print(inner.text) + print("--- /thinking ---") + elif isinstance(chunk, TextChunk): + print(chunk.text) + + +if __name__ == "__main__": + main() diff --git a/examples/mistral/chat/reasoning_multi_turn.py b/examples/mistral/chat/reasoning_multi_turn.py new file mode 100644 index 00000000..84b880de --- /dev/null +++ b/examples/mistral/chat/reasoning_multi_turn.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python + +# Multi-turn conversation with a reasoning model. +# +# IMPORTANT: for Mistral Medium 3.5, always replay the assistant turn +# back into `messages` with its ThinkChunks intact. Dropping the +# reasoning trace across turns DEGRADES the model's performance. +# +# This example runs a 3-turn math chain and prints per-turn token +# usage. The prompt grows as the reasoning trace accumulates; that +# growth is expected. + +import os + +from mistralai.client import Mistral +from mistralai.client.models import TextChunk, UserMessage + +MODEL = "mistral-medium-3-5" +TURNS = [ + "What is 17 * 23?", + "Now multiply that by 3.", + "And subtract 100 from the result.", +] + + +def final_text(content): + if isinstance(content, str): + return content + return "".join(c.text for c in (content or []) if isinstance(c, TextChunk)) + + +def main(): + # Bump request timeout because reasoning runs can be long. + client = Mistral(api_key=os.environ["MISTRAL_API_KEY"], timeout_ms=300_000) + + messages = [] + total_prompt = 0 + total_completion = 0 + + for i, user_text in enumerate(TURNS, start=1): + messages.append(UserMessage(content=user_text)) + response = client.chat.complete( + model=MODEL, + messages=messages, + reasoning_effort="high", + temperature=0.7, + ) + message = response.choices[0].message + usage = response.usage + total_prompt += usage.prompt_tokens + total_completion += usage.completion_tokens + + print( + f"turn {i}: prompt={usage.prompt_tokens:>4} " + f"completion={usage.completion_tokens:>4} -> {final_text(message.content)}" + ) + # Append the full assistant message back into history so the + # ThinkChunks are preserved across turns. + messages.append(message) + + print( + f"TOTAL: prompt={total_prompt} completion={total_completion} " + f"(sum {total_prompt + total_completion})" + ) + + +if __name__ == "__main__": + main() diff --git a/examples/mistral/chat/reasoning_response_shape.py b/examples/mistral/chat/reasoning_response_shape.py new file mode 100644 index 00000000..6cb820ab --- /dev/null +++ b/examples/mistral/chat/reasoning_response_shape.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +# Print the raw shape of a chat response when using `reasoning_effort`. +# Run this first to see what ThinkChunk / TextChunk look like in the wire +# format, then move on to the other reasoning_*.py examples. + +import json +import os + +from mistralai.client import Mistral +from mistralai.client.models import UserMessage + + +def main(): + # Bump request timeout because reasoning runs can be long. + client = Mistral(api_key=os.environ["MISTRAL_API_KEY"], timeout_ms=300_000) + + prompt = "What is 12 * 14? Answer in one short sentence." + + for effort in ["high", "none"]: + print(f"\n========== reasoning_effort={effort!r} ==========") + response = client.chat.complete( + model="mistral-medium-3-5", + messages=[UserMessage(content=prompt)], + reasoning_effort=effort, + temperature=0.7, + ) + message = response.choices[0].message + print(f"type(message.content) = {type(message.content).__name__}") + print("message.content =") + if isinstance(message.content, str): + print(json.dumps(message.content, indent=2)) + else: + print( + json.dumps( + [chunk.model_dump() for chunk in message.content], + indent=2, + ) + ) + + +if __name__ == "__main__": + main() diff --git a/examples/mistral/chat/reasoning_with_streaming.py b/examples/mistral/chat/reasoning_with_streaming.py new file mode 100644 index 00000000..377844a2 --- /dev/null +++ b/examples/mistral/chat/reasoning_with_streaming.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python + +import os + +from mistralai.client import Mistral +from mistralai.client.models import TextChunk, ThinkChunk, UserMessage + + +def main(): + api_key = os.environ["MISTRAL_API_KEY"] + model = "mistral-medium-3-5" + + # Bump request timeout because reasoning runs can be long. + client = Mistral(api_key=api_key, timeout_ms=300_000) + + # While the model is thinking, delta.content is a list containing a + # ThinkChunk. After the thinking phase ends, delta.content arrives as + # plain string fragments. The transition event may contain both a closing + # ThinkChunk and the first TextChunk in a single list. + in_thinking = False + for event in client.chat.stream( + model=model, + messages=[ + UserMessage( + content=( + "If a train leaves Paris at 9am going 120 km/h and another " + "leaves Lyon at 10am going 150 km/h on the same track, " + "when do they meet? Paris-Lyon is 465 km." + ) + ) + ], + reasoning_effort="high", + temperature=0.7, + ): + delta = event.data.choices[0].delta.content + if not delta: + continue + + if isinstance(delta, str): + if in_thinking: + print("\n--- /thinking ---") + in_thinking = False + print(delta, end="", flush=True) + continue + + for chunk in delta: + if isinstance(chunk, ThinkChunk): + if not in_thinking: + print("--- thinking ---") + in_thinking = True + for inner in chunk.thinking: + if isinstance(inner, TextChunk): + print(inner.text, end="", flush=True) + elif isinstance(chunk, TextChunk): + if in_thinking: + print("\n--- /thinking ---") + in_thinking = False + print(chunk.text, end="", flush=True) + + print() + + +if __name__ == "__main__": + main() diff --git a/examples/mistral/chat/structured_outputs.py b/examples/mistral/chat/structured_outputs.py index bc4a5e18..64521f46 100644 --- a/examples/mistral/chat/structured_outputs.py +++ b/examples/mistral/chat/structured_outputs.py @@ -3,7 +3,7 @@ import os from pydantic import BaseModel -from mistralai import Mistral +from mistralai.client import Mistral def main(): diff --git a/examples/mistral/chat/structured_outputs_with_json_schema.py b/examples/mistral/chat/structured_outputs_with_json_schema.py index 69ac9690..2f99f747 100644 --- a/examples/mistral/chat/structured_outputs_with_json_schema.py +++ b/examples/mistral/chat/structured_outputs_with_json_schema.py @@ -2,7 +2,7 @@ import os -from mistralai import Mistral +from mistralai.client import Mistral def main(): diff --git a/examples/mistral/chat/structured_outputs_with_pydantic.py b/examples/mistral/chat/structured_outputs_with_pydantic.py index 299f7509..ded9d52d 100644 --- a/examples/mistral/chat/structured_outputs_with_pydantic.py +++ b/examples/mistral/chat/structured_outputs_with_pydantic.py @@ -3,7 +3,7 @@ import os from pydantic import BaseModel -from mistralai import Mistral +from mistralai.client import Mistral from typing import List diff --git a/examples/mistral/classifier/async_classifier.py b/examples/mistral/classifier/async_classifier.py index 10c8bb76..881f6a69 100644 --- a/examples/mistral/classifier/async_classifier.py +++ b/examples/mistral/classifier/async_classifier.py @@ -2,7 +2,8 @@ from pprint import pprint import asyncio -from mistralai import Mistral, TrainingFile, ClassifierTrainingParametersIn +from mistralai.client import Mistral +from mistralai.client.models import ClassifierFineTuningJob, ClassifierFineTuningJobDetails, ClassifierTrainingParameters, TrainingFile import os @@ -26,7 +27,7 @@ async def upload_files(client: Mistral, file_names: list[str]) -> list[str]: return file_ids -async def train_classifier(client: Mistral,training_file_ids: list[str]) -> str: +async def train_classifier(client: Mistral, training_file_ids: list[str]) -> str | None: print("Creating job...") job = await client.fine_tuning.jobs.create_async( model="ministral-3b-latest", @@ -35,11 +36,14 @@ async def train_classifier(client: Mistral,training_file_ids: list[str]) -> str: TrainingFile(file_id=training_file_id) for training_file_id in training_file_ids ], - hyperparameters=ClassifierTrainingParametersIn( + hyperparameters=ClassifierTrainingParameters( learning_rate=0.0001, ), auto_start=True, ) + if not isinstance(job, ClassifierFineTuningJob): + print("Unexpected job type returned") + return None print(f"Job created ({job.id})") @@ -47,6 +51,8 @@ async def train_classifier(client: Mistral,training_file_ids: list[str]) -> str: while True: await asyncio.sleep(10) detailed_job = await client.fine_tuning.jobs.get_async(job_id=job.id) + if not isinstance(detailed_job, ClassifierFineTuningJobDetails): + raise Exception(f"Unexpected job type: {type(detailed_job)}") if detailed_job.status not in [ "QUEUED", "STARTED", @@ -62,6 +68,9 @@ async def train_classifier(client: Mistral,training_file_ids: list[str]) -> str: print("Training failed") raise Exception(f"Job failed {detailed_job.status}") + if not detailed_job.fine_tuned_model: + print("No fine-tuned model returned") + return None print(f"Training succeed: {detailed_job.fine_tuned_model}") return detailed_job.fine_tuned_model diff --git a/examples/mistral/embeddings/async_embeddings.py b/examples/mistral/embeddings/async_embeddings.py index 781e87af..413769f3 100755 --- a/examples/mistral/embeddings/async_embeddings.py +++ b/examples/mistral/embeddings/async_embeddings.py @@ -3,7 +3,7 @@ import asyncio import os -from mistralai import Mistral +from mistralai.client import Mistral async def main(): diff --git a/examples/mistral/embeddings/embeddings.py b/examples/mistral/embeddings/embeddings.py index 046c87d4..64301ca0 100755 --- a/examples/mistral/embeddings/embeddings.py +++ b/examples/mistral/embeddings/embeddings.py @@ -2,7 +2,7 @@ import os -from mistralai import Mistral +from mistralai.client import Mistral def main(): diff --git a/examples/mistral/fim/async_code_completion.py b/examples/mistral/fim/async_code_completion.py index a6bc5717..cb6db241 100644 --- a/examples/mistral/fim/async_code_completion.py +++ b/examples/mistral/fim/async_code_completion.py @@ -3,7 +3,7 @@ import asyncio import os -from mistralai import Mistral +from mistralai.client import Mistral async def main(): diff --git a/examples/mistral/fim/code_completion.py b/examples/mistral/fim/code_completion.py index f3d70a68..4f25c59c 100644 --- a/examples/mistral/fim/code_completion.py +++ b/examples/mistral/fim/code_completion.py @@ -3,7 +3,7 @@ import asyncio import os -from mistralai import Mistral +from mistralai.client import Mistral async def main(): diff --git a/examples/mistral/jobs/async_batch_job_chat_completion_inline.py b/examples/mistral/jobs/async_batch_job_chat_completion_inline.py new file mode 100644 index 00000000..d2a1679f --- /dev/null +++ b/examples/mistral/jobs/async_batch_job_chat_completion_inline.py @@ -0,0 +1,49 @@ +from mistralai.client import Mistral +from mistralai.client.models import BatchRequest, UserMessage +import os +import asyncio + + +async def main(): + client = Mistral(api_key=os.environ["MISTRAL_API_KEY"]) + + requests = [BatchRequest( + custom_id=str(i), + body=dict( + model="mistral-medium-latest", + messages=[UserMessage( + content=f"What's i + {i}" + )] + ) + ) for i in range(5) + ] + + job = await client.batch.jobs.create_async( + requests=requests, + model="mistral-small-latest", + endpoint="/v1/chat/completions", + metadata={"job_type": "testing"} + ) + + print(f"Created job with ID: {job.id}") + + max_wait = 60 # 1 minute timeout for CI + elapsed = 0 + while job.status not in ["SUCCESS", "FAILED", "CANCELLED"]: + await asyncio.sleep(1) + elapsed += 1 + if elapsed >= max_wait: + print(f"Timeout after {max_wait}s, job still {job.status}") + return + job = await client.batch.jobs.get_async(job_id=job.id) + print(f"Job status: {job.status}") + + print(f"Job is done, status {job.status}") + if job.outputs: + for res in job.outputs: + print(res["response"]["body"]) + else: + print(f"No outputs (succeeded: {job.succeeded_requests}, failed: {job.failed_requests})") + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/jobs/async_files.py b/examples/mistral/jobs/async_files.py index 4dc21542..4bec5237 100644 --- a/examples/mistral/jobs/async_files.py +++ b/examples/mistral/jobs/async_files.py @@ -3,8 +3,8 @@ import asyncio import os -from mistralai import Mistral -from mistralai.models import File +from mistralai.client import Mistral +from mistralai.client.models import File async def main(): diff --git a/examples/mistral/jobs/async_fine_tuning.py b/examples/mistral/jobs/async_fine_tuning.py new file mode 100644 index 00000000..080dbe03 --- /dev/null +++ b/examples/mistral/jobs/async_fine_tuning.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +import asyncio +import os + +from mistralai.client import Mistral +from mistralai.client.models import File, CompletionTrainingParametersIn + + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + + client = Mistral(api_key=api_key) + + # Create new files + with open("examples/fixtures/ft_training_file.jsonl", "rb") as f: + training_file = await client.files.upload_async( + file=File(file_name="file.jsonl", content=f) + ) + with open("examples/fixtures/ft_validation_file.jsonl", "rb") as f: + validation_file = await client.files.upload_async( + file=File(file_name="validation_file.jsonl", content=f) + ) + + # Create a new job + created_job = await client.fine_tuning.jobs.create_async( + model="mistral-small-latest", + training_files=[{"file_id": training_file.id, "weight": 1}], + validation_files=[validation_file.id], + hyperparameters=CompletionTrainingParametersIn( + training_steps=1, + learning_rate=0.0001, + ), + ) + print(created_job) + + # List jobs + jobs = await client.fine_tuning.jobs.list_async(page=0, page_size=5) + print(jobs) + + # Retrieve a job + retrieved_job = await client.fine_tuning.jobs.get_async(job_id=created_job.id) + print(retrieved_job) + + # Cancel a job + canceled_job = await client.fine_tuning.jobs.cancel_async(job_id=created_job.id) + print(canceled_job) + + # Delete files + await client.files.delete_async(file_id=training_file.id) + await client.files.delete_async(file_id=validation_file.id) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/jobs/async_fine_tuning_chat.py b/examples/mistral/jobs/async_fine_tuning_chat.py new file mode 100644 index 00000000..f170fed4 --- /dev/null +++ b/examples/mistral/jobs/async_fine_tuning_chat.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python +import asyncio +import json +import os +import random +from pathlib import Path + +from mistralai.client import Mistral +from mistralai.client.models import ( + File, + CompletionTrainingParametersIn, +) + +POLLING_INTERVAL = 10 + +cwd = Path(__file__).parent + +user_contents = [ + "How far is the Moon from Earth?", + "What's the largest ocean on Earth?", + "How many continents are there?", + "What's the powerhouse of the cell?", + "What's the speed of light?", + "Can you solve a Rubik's Cube?", + "What is the tallest mountain in the world?", + "Who painted the Mona Lisa?", +] + +# List of assistant contents +assistant_contents = [ + "Around 384,400 kilometers. Give or take a few, like that really matters.", + "The Pacific Ocean. You know, the one that covers more than 60 million square miles. No big deal.", + "There are seven continents. I hope that wasn't too hard to count.", + "The mitochondria. Remember that from high school biology?", + "Approximately 299,792 kilometers per second. You know, faster than your internet speed.", + "I could if I had hands. What's your excuse?", + "Mount Everest, standing at 29,029 feet. You know, just a little hill.", + "Leonardo da Vinci. Just another guy who liked to doodle.", +] + +system_message = "Marv is a factual chatbot that is also sarcastic" + +def create_validation_file() -> bytes: + return json.dumps({ + "messages": [ + {"role": "user", "content": "How long does it take to travel around the Earth?"}, + {"role": "assistant", "content": "Around 24 hours if you're the Earth itself. For you, depends on your mode of transportation."} + ], + "temperature": random.random() + }).encode() + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + client = Mistral(api_key=api_key) + + requests = [] + for um, am in zip( + random.sample(user_contents, len(user_contents)), + random.sample(assistant_contents, len(assistant_contents)), + ): + requests.append(json.dumps({ + "messages": [ + {"role": "system", "content": system_message}, + {"role": "user", "content": um}, + {"role": "assistant", "content": am}, + ] + })) + + # Create new files + training_file = await client.files.upload_async( + file=File( + file_name="file.jsonl", content=("\n".join(requests)).encode() + ), + purpose="fine-tune", + ) + + validation_file = await client.files.upload_async( + file=File( + file_name="validation_file.jsonl", content=create_validation_file() + ), + purpose="fine-tune", + ) + # Create a new job + created_job = await client.fine_tuning.jobs.create_async( + model="mistral-small-latest", + training_files=[{"file_id": training_file.id, "weight": 1}], + validation_files=[validation_file.id], + hyperparameters=CompletionTrainingParametersIn( + training_steps=1, + learning_rate=0.0001, + ), + ) + + while created_job.status in ["RUNNING", "STARTED", "QUEUED", "VALIDATING", "VALIDATED"]: + created_job = await client.fine_tuning.jobs.get_async(job_id=created_job.id) + print(f"Job is {created_job.status}, waiting {POLLING_INTERVAL} seconds") + await asyncio.sleep(POLLING_INTERVAL) + + if created_job.status == "FAILED": + print("Job failed") + raise Exception(f"Job failed with {created_job.status}") + + print(created_job) + # Chat with model + response = await client.chat.complete_async( + model=created_job.fine_tuned_model, + messages=[ + { + "role": "system", + "content": "Marv is a factual chatbot that is also sarcastic.", + }, + {"role": "user", "content": "What is the capital of France ?"}, + ], + ) + + print(response.choices[0].message.content) + + # Delete files + await client.files.delete_async(file_id=training_file.id) + await client.files.delete_async(file_id=validation_file.id) + + # Delete fine-tuned model + await client.models.delete_async(model_id=created_job.fine_tuned_model) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/jobs/async_jobs.py b/examples/mistral/jobs/async_jobs.py deleted file mode 100644 index 44a58af1..00000000 --- a/examples/mistral/jobs/async_jobs.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python - -import asyncio -import os - -from mistralai import Mistral -from mistralai.models import File, CompletionTrainingParametersIn - - -async def main(): - api_key = os.environ["MISTRAL_API_KEY"] - - client = Mistral(api_key=api_key) - - # Create new files - with open("examples/fixtures/ft_training_file.jsonl", "rb") as f: - training_file = await client.files.upload_async( - file=File(file_name="file.jsonl", content=f) - ) - with open("examples/fixtures/ft_validation_file.jsonl", "rb") as f: - validation_file = await client.files.upload_async( - file=File(file_name="validation_file.jsonl", content=f) - ) - - # Create a new job - created_job = await client.fine_tuning.jobs.create_async( - model="open-mistral-7b", - training_files=[{"file_id": training_file.id, "weight": 1}], - validation_files=[validation_file.id], - hyperparameters=CompletionTrainingParametersIn( - training_steps=1, - learning_rate=0.0001, - ), - ) - print(created_job) - - # List jobs - jobs = await client.fine_tuning.jobs.list_async(page=0, page_size=5) - print(jobs) - - # Retrieve a job - retrieved_job = await client.fine_tuning.jobs.get_async(job_id=created_job.id) - print(retrieved_job) - - # Cancel a job - canceled_job = await client.fine_tuning.jobs.cancel_async(job_id=created_job.id) - print(canceled_job) - - # Delete files - await client.files.delete_async(file_id=training_file.id) - await client.files.delete_async(file_id=validation_file.id) - - -if __name__ == "__main__": - asyncio.run(main()) diff --git a/examples/mistral/jobs/async_jobs_chat.py b/examples/mistral/jobs/async_jobs_chat.py deleted file mode 100644 index 80e598c7..00000000 --- a/examples/mistral/jobs/async_jobs_chat.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python -import asyncio -import json -import os -import random -from pathlib import Path - -from mistralai import Mistral -from mistralai.models import ( - File, - CompletionTrainingParametersIn, -) - -POLLING_INTERVAL = 10 - -cwd = Path(__file__).parent - -user_contents = [ - "How far is the Moon from Earth?", - "What's the largest ocean on Earth?", - "How many continents are there?", - "What's the powerhouse of the cell?", - "What's the speed of light?", - "Can you solve a Rubik's Cube?", - "What is the tallest mountain in the world?", - "Who painted the Mona Lisa?", -] - -# List of assistant contents -assistant_contents = [ - "Around 384,400 kilometers. Give or take a few, like that really matters.", - "The Pacific Ocean. You know, the one that covers more than 60 million square miles. No big deal.", - "There are seven continents. I hope that wasn't too hard to count.", - "The mitochondria. Remember that from high school biology?", - "Approximately 299,792 kilometers per second. You know, faster than your internet speed.", - "I could if I had hands. What's your excuse?", - "Mount Everest, standing at 29,029 feet. You know, just a little hill.", - "Leonardo da Vinci. Just another guy who liked to doodle.", -] - -system_message = "Marv is a factual chatbot that is also sarcastic" - -def create_validation_file() -> bytes: - return json.dumps({ - "messages": [ - {"role": "user", "content": "How long does it take to travel around the Earth?"}, - {"role": "assistant", "content": "Around 24 hours if you're the Earth itself. For you, depends on your mode of transportation."} - ], - "temperature": random.random() - }).encode() - -async def main(): - api_key = os.environ["MISTRAL_API_KEY"] - client = Mistral(api_key=api_key) - - requests = [] - for um, am in zip( - random.sample(user_contents, len(user_contents)), - random.sample(assistant_contents, len(assistant_contents)), - ): - requests.append(json.dumps({ - "messages": [ - {"role": "system", "content": system_message}, - {"role": "user", "content": um}, - {"role": "assistant", "content": am}, - ] - })) - - # Create new files - training_file = await client.files.upload_async( - file=File( - file_name="file.jsonl", content=("\n".join(requests)).encode() - ), - purpose="fine-tune", - ) - - validation_file = await client.files.upload_async( - file=File( - file_name="validation_file.jsonl", content=create_validation_file() - ), - purpose="fine-tune", - ) - # Create a new job - created_job = await client.fine_tuning.jobs.create_async( - model="open-mistral-7b", - training_files=[{"file_id": training_file.id, "weight": 1}], - validation_files=[validation_file.id], - hyperparameters=CompletionTrainingParametersIn( - training_steps=1, - learning_rate=0.0001, - ), - ) - - while created_job.status in ["RUNNING", "STARTED", "QUEUED", "VALIDATING", "VALIDATED"]: - created_job = await client.fine_tuning.jobs.get_async(job_id=created_job.id) - print(f"Job is {created_job.status}, waiting {POLLING_INTERVAL} seconds") - await asyncio.sleep(POLLING_INTERVAL) - - if created_job.status == "FAILED": - print("Job failed") - raise Exception(f"Job failed with {created_job.status}") - - print(created_job) - # Chat with model - response = await client.chat.complete_async( - model=created_job.fine_tuned_model, - messages=[ - { - "role": "system", - "content": "Marv is a factual chatbot that is also sarcastic.", - }, - {"role": "user", "content": "What is the capital of France ?"}, - ], - ) - - print(response.choices[0].message.content) - - # Delete files - await client.files.delete_async(file_id=training_file.id) - await client.files.delete_async(file_id=validation_file.id) - - # Delete fine-tuned model - await client.models.delete_async(model_id=created_job.fine_tuned_model) - - -if __name__ == "__main__": - asyncio.run(main()) diff --git a/examples/mistral/jobs/async_jobs_ocr_batch_annotation.py b/examples/mistral/jobs/async_jobs_ocr_batch_annotation.py new file mode 100644 index 00000000..8ddde775 --- /dev/null +++ b/examples/mistral/jobs/async_jobs_ocr_batch_annotation.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +import asyncio +import json +import os +from typing import List + +import httpx +from pydantic import BaseModel, Field + +from mistralai.client import Mistral +from mistralai.extra import response_format_from_pydantic_model +from mistralai.client.models import File + +SAMPLE_PDF_URL = "https://arxiv.org/pdf/2401.04088" + + +class Table(BaseModel): + name: str = Field(description="The name or title of the table") + + +class TableExtraction(BaseModel): + tables: List[Table] = Field(description="List of tables found in the document") + + +def create_ocr_batch_request(custom_id: str, document_url: str) -> dict: + """Batch requests require custom_id and body wrapper.""" + response_format = response_format_from_pydantic_model(TableExtraction) + return { + "custom_id": custom_id, + "body": { + "document": {"type": "document_url", "document_url": document_url}, + "document_annotation_format": response_format, + "pages": [0, 1, 2, 3, 4, 5, 6, 7], + "include_image_base64": False, + }, + } + + +async def main(): + client = Mistral(api_key=os.environ["MISTRAL_API_KEY"]) + + document_urls = [SAMPLE_PDF_URL] + + batch_requests = [ + json.dumps(create_ocr_batch_request(custom_id=str(i), document_url=url)) + for i, url in enumerate(document_urls) + ] + batch_content = "\n".join(batch_requests) + + print("Uploading batch file...") + batch_file = await client.files.upload_async( + file=File(file_name="ocr_batch.jsonl", content=batch_content.encode()), + purpose="batch", + ) + print(f"Batch file uploaded: {batch_file.id}") + + print("Creating batch job...") + created_job = await client.batch.jobs.create_async( + model="mistral-ocr-latest", + input_files=[batch_file.id], + endpoint="/v1/ocr", + ) + print(f"Batch job created: {created_job.id}") + + print("Waiting for job completion...") + job = await client.batch.jobs.get_async(job_id=created_job.id) + while job.status not in ["SUCCESS", "FAILED", "CANCELLED"]: + print(f"Status: {job.status}") + await asyncio.sleep(5) + job = await client.batch.jobs.get_async(job_id=created_job.id) + + print(f"Job status: {job.status}") + + async with httpx.AsyncClient() as http_client: + if job.output_file: + signed_url = await client.files.get_signed_url_async( + file_id=job.output_file + ) + response = await http_client.get(signed_url.url) + for line in response.content.decode().strip().split("\n"): + result = json.loads(line) + annotation = result["response"]["body"].get("document_annotation") + if annotation: + tables = TableExtraction.model_validate_json(annotation) + for table in tables.tables: + print(table.name) + + if job.error_file: + signed_url = await client.files.get_signed_url_async(file_id=job.error_file) + response = await http_client.get(signed_url.url) + print("Errors:", response.content.decode()) + + print("\nCleaning up...") + await client.files.delete_async(file_id=batch_file.id) + print("Done!") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/jobs/dry_run_job.py b/examples/mistral/jobs/dry_run_job.py deleted file mode 100644 index 84a2d0ce..00000000 --- a/examples/mistral/jobs/dry_run_job.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python - -import asyncio -import os - -from mistralai import Mistral -from mistralai.models import CompletionTrainingParametersIn - - -async def main(): - api_key = os.environ["MISTRAL_API_KEY"] - - client = Mistral(api_key=api_key) - - # Create new files - with open("examples/fixtures/ft_training_file.jsonl", "rb") as f: - training_file = await client.files.upload_async( - file={"file_name": "test-file.jsonl", "content": f} - ) - - # Create a new job - dry_run_job = await client.fine_tuning.jobs.create_async( - model="open-mistral-7b", - training_files=[{"file_id": training_file.id, "weight": 1}], - hyperparameters=CompletionTrainingParametersIn( - training_steps=1, - learning_rate=0.0001, - warmup_fraction=0.01, - ), - auto_start=False, - ) - - print("Dry run job created") - print(f"Job ID: {dry_run_job}") - print(f"Train tokens: {dry_run_job.trained_tokens}") - print(f"Dataset tokens: {dry_run_job.metadata.data_tokens}") - print(f"Epochs number: {dry_run_job.hyperparameters.epochs}") - print(f"Expected duration: {dry_run_job.metadata.expected_duration_seconds}") - print(f"Cost: {dry_run_job.metadata.cost} {dry_run_job.metadata.cost_currency}") - - -if __name__ == "__main__": - asyncio.run(main()) diff --git a/examples/mistral/jobs/files.py b/examples/mistral/jobs/files.py index 5dce880b..50f6472c 100644 --- a/examples/mistral/jobs/files.py +++ b/examples/mistral/jobs/files.py @@ -2,8 +2,8 @@ import os -from mistralai import Mistral -from mistralai.models import File +from mistralai.client import Mistral +from mistralai.client.models import File def main(): diff --git a/examples/mistral/jobs/fine_tuning.py b/examples/mistral/jobs/fine_tuning.py new file mode 100644 index 00000000..2d155cc2 --- /dev/null +++ b/examples/mistral/jobs/fine_tuning.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +import os + +from mistralai.client import Mistral +from mistralai.client.models import File, CompletionTrainingParametersIn + + +def main(): + api_key = os.environ["MISTRAL_API_KEY"] + + client = Mistral(api_key=api_key) + + # Create new files + with open("examples/fixtures/ft_training_file.jsonl", "rb") as f: + training_file = client.files.upload( + file=File(file_name="file.jsonl", content=f) + ) + with open("examples/fixtures/ft_validation_file.jsonl", "rb") as f: + validation_file = client.files.upload( + file=File(file_name="validation_file.jsonl", content=f) + ) + + # Create a new job + created_job = client.fine_tuning.jobs.create( + model="mistral-small-latest", + training_files=[{"file_id": training_file.id, "weight": 1}], + validation_files=[validation_file.id], + hyperparameters=CompletionTrainingParametersIn( + training_steps=1, + learning_rate=0.0001, + ), + ) + print(created_job) + + # List jobs + jobs = client.fine_tuning.jobs.list(page=0, page_size=5) + print(jobs) + + # Retrieve a job + retrieved_job = client.fine_tuning.jobs.get(job_id=created_job.id) + print(retrieved_job) + + # Cancel a job + canceled_job = client.fine_tuning.jobs.cancel(job_id=created_job.id) + print(canceled_job) + + # Delete files + client.files.delete(file_id=training_file.id) + client.files.delete(file_id=validation_file.id) + + +if __name__ == "__main__": + main() diff --git a/examples/mistral/jobs/fine_tuning_dry_run.py b/examples/mistral/jobs/fine_tuning_dry_run.py new file mode 100644 index 00000000..d0c6f733 --- /dev/null +++ b/examples/mistral/jobs/fine_tuning_dry_run.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +import asyncio +import os + +from mistralai.client import Mistral +from mistralai.client.models import CompletionTrainingParametersIn + + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + + client = Mistral(api_key=api_key) + + # Create new files + with open("examples/fixtures/ft_training_file.jsonl", "rb") as f: + training_file = await client.files.upload_async( + file={"file_name": "test-file.jsonl", "content": f} + ) + + # Create a new job + dry_run_job = await client.fine_tuning.jobs.create_async( + model="mistral-small-latest", + training_files=[{"file_id": training_file.id, "weight": 1}], + hyperparameters=CompletionTrainingParametersIn( + training_steps=1, + learning_rate=0.0001, + warmup_fraction=0.01, + ), + auto_start=False, + ) + + print("Dry run job created") + print(f"Job ID: {dry_run_job}") + print(f"Train tokens: {dry_run_job.trained_tokens}") + print(f"Dataset tokens: {dry_run_job.metadata.data_tokens}") + print(f"Epochs number: {dry_run_job.hyperparameters.epochs}") + print(f"Expected duration: {dry_run_job.metadata.expected_duration_seconds}") + print(f"Cost: {dry_run_job.metadata.cost} {dry_run_job.metadata.cost_currency}") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/jobs/jobs.py b/examples/mistral/jobs/jobs.py deleted file mode 100644 index f65fda8e..00000000 --- a/examples/mistral/jobs/jobs.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python -import os - -from mistralai import Mistral -from mistralai.models import File, CompletionTrainingParametersIn - - -def main(): - api_key = os.environ["MISTRAL_API_KEY"] - - client = Mistral(api_key=api_key) - - # Create new files - with open("examples/fixtures/ft_training_file.jsonl", "rb") as f: - training_file = client.files.upload( - file=File(file_name="file.jsonl", content=f) - ) - with open("examples/fixtures/ft_validation_file.jsonl", "rb") as f: - validation_file = client.files.upload( - file=File(file_name="validation_file.jsonl", content=f) - ) - - # Create a new job - created_job = client.fine_tuning.jobs.create( - model="open-mistral-7b", - training_files=[{"file_id": training_file.id, "weight": 1}], - validation_files=[validation_file.id], - hyperparameters=CompletionTrainingParametersIn( - training_steps=1, - learning_rate=0.0001, - ), - ) - print(created_job) - - # List jobs - jobs = client.fine_tuning.jobs.list(page=0, page_size=5) - print(jobs) - - # Retrieve a job - retrieved_job = client.fine_tuning.jobs.get(job_id=created_job.id) - print(retrieved_job) - - # Cancel a job - canceled_job = client.fine_tuning.jobs.cancel(job_id=created_job.id) - print(canceled_job) - - # Delete files - client.files.delete(file_id=training_file.id) - client.files.delete(file_id=validation_file.id) - - -if __name__ == "__main__": - main() diff --git a/examples/mistral/libraries/async_libraries.py b/examples/mistral/libraries/async_libraries.py index b2f9d4c4..fc5e6541 100644 --- a/examples/mistral/libraries/async_libraries.py +++ b/examples/mistral/libraries/async_libraries.py @@ -3,8 +3,8 @@ import os import asyncio -from mistralai import Mistral -from mistralai.models import File +from mistralai.client import Mistral +from mistralai.client.models import File async def main(): diff --git a/examples/mistral/libraries/libraries.py b/examples/mistral/libraries/libraries.py index 88436540..8e4b2998 100644 --- a/examples/mistral/libraries/libraries.py +++ b/examples/mistral/libraries/libraries.py @@ -2,8 +2,8 @@ import os -from mistralai import Mistral -from mistralai.models import File +from mistralai.client import Mistral +from mistralai.client.models import File def main(): diff --git a/examples/mistral/models/async_list_models.py b/examples/mistral/models/async_list_models.py index 4243d862..8b1ac503 100755 --- a/examples/mistral/models/async_list_models.py +++ b/examples/mistral/models/async_list_models.py @@ -3,7 +3,7 @@ import asyncio import os -from mistralai import Mistral +from mistralai.client import Mistral async def main(): diff --git a/examples/mistral/models/list_models.py b/examples/mistral/models/list_models.py index c6c0c855..9b68f806 100755 --- a/examples/mistral/models/list_models.py +++ b/examples/mistral/models/list_models.py @@ -2,7 +2,7 @@ import os -from mistralai import Mistral +from mistralai.client import Mistral def main(): diff --git a/examples/mistral/ocr/ocr_process_from_file.py b/examples/mistral/ocr/ocr_process_from_file.py index 84a7b4d8..9368ceeb 100644 --- a/examples/mistral/ocr/ocr_process_from_file.py +++ b/examples/mistral/ocr/ocr_process_from_file.py @@ -1,4 +1,4 @@ -from mistralai import Mistral +from mistralai.client import Mistral import os import json from pathlib import Path diff --git a/examples/mistral/ocr/ocr_process_from_url.py b/examples/mistral/ocr/ocr_process_from_url.py index 55f31282..4f3b0224 100644 --- a/examples/mistral/ocr/ocr_process_from_url.py +++ b/examples/mistral/ocr/ocr_process_from_url.py @@ -1,7 +1,7 @@ import json import os -from mistralai import Mistral +from mistralai.client import Mistral MISTRAL_7B_PDF_URL = "https://arxiv.org/pdf/2310.06825.pdf" diff --git a/examples/mistral/workflows/_workflow_get_scheduler_namespace.py b/examples/mistral/workflows/_workflow_get_scheduler_namespace.py new file mode 100644 index 00000000..10a9b760 --- /dev/null +++ b/examples/mistral/workflows/_workflow_get_scheduler_namespace.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +import asyncio +import os + +from mistralai.client import Mistral +from mistralai.extra.workflows.helpers import get_scheduler_namespace + + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + + client = Mistral(api_key=api_key) + print(await get_scheduler_namespace(client)) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/workflows/async_workflow_execute.py b/examples/mistral/workflows/async_workflow_execute.py new file mode 100644 index 00000000..737253ab --- /dev/null +++ b/examples/mistral/workflows/async_workflow_execute.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +import asyncio +import os + +from mistralai.client import Mistral + +WORKFLOW_NAME = "example-hello-world-workflow" + + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + + client = Mistral(api_key=api_key) + + # Execute workflow and wait for result using wait_for_result parameter + response = await client.workflows.execute_workflow_async( + workflow_identifier=WORKFLOW_NAME, + input={"document_title": "hello world"}, + wait_for_result=True, + timeout_seconds=60.0, + ) + + print(f"Workflow: {response.workflow_name}") + print(f"Execution ID: {response.execution_id}") + print(f"Result: {response.result}") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/workflows/async_workflow_execute_and_wait.py b/examples/mistral/workflows/async_workflow_execute_and_wait.py new file mode 100644 index 00000000..964bc75a --- /dev/null +++ b/examples/mistral/workflows/async_workflow_execute_and_wait.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +import asyncio +import os + +from mistralai.client import Mistral + +WORKFLOW_NAME = "example-hello-world-workflow" + + +async def main(): + api_key = os.environ["MISTRAL_API_KEY"] + + client = Mistral(api_key=api_key) + + # Example 1: Using API sync mode (server-side waiting) + result = await client.workflows.execute_workflow_and_wait_async( + workflow_identifier=WORKFLOW_NAME, + input={"document_title": "hello world"}, + use_api_sync=True, + timeout_seconds=60.0, + ) + print(f"Result (API sync): {result}") + + # Example 2: Using polling mode (client-side waiting) + result = await client.workflows.execute_workflow_and_wait_async( + workflow_identifier=WORKFLOW_NAME, + input={"document_title": "hello world"}, + use_api_sync=False, + polling_interval=5, + max_attempts=12, # 12 attempts * 5 seconds = 60 seconds max + ) + print(f"Result (polling): {result}") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/mistral/workflows/workflow_execute.py b/examples/mistral/workflows/workflow_execute.py new file mode 100644 index 00000000..650f9352 --- /dev/null +++ b/examples/mistral/workflows/workflow_execute.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +import os + +from mistralai.client import Mistral + +WORKFLOW_NAME = "example-hello-world-workflow" + + +def main(): + api_key = os.environ["MISTRAL_API_KEY"] + + client = Mistral(api_key=api_key) + + # Execute workflow and wait for result using wait_for_result parameter + response = client.workflows.execute_workflow( + workflow_identifier=WORKFLOW_NAME, + input={"document_title": "hello world"}, + wait_for_result=True, + timeout_seconds=60.0, + ) + + print(f"Workflow: {response.workflow_name}") + print(f"Execution ID: {response.execution_id}") + print(f"Result: {response.result}") + + +if __name__ == "__main__": + main() diff --git a/examples/mistral/workflows/workflow_execute_and_wait.py b/examples/mistral/workflows/workflow_execute_and_wait.py new file mode 100644 index 00000000..6a50aa88 --- /dev/null +++ b/examples/mistral/workflows/workflow_execute_and_wait.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +import os + +from mistralai.client import Mistral + +WORKFLOW_NAME = "example-hello-world-workflow" + + +def main(): + api_key = os.environ["MISTRAL_API_KEY"] + + client = Mistral(api_key=api_key) + + # Example 1: Using API sync mode (server-side waiting) + result = client.workflows.execute_workflow_and_wait( + workflow_identifier=WORKFLOW_NAME, + input={"document_title": "hello world"}, + use_api_sync=True, + timeout_seconds=60.0, + ) + print(f"Result (API sync): {result}") + + # Example 2: Using polling mode (client-side waiting) + result = client.workflows.execute_workflow_and_wait( + workflow_identifier=WORKFLOW_NAME, + input={"document_title": "hello world"}, + use_api_sync=False, + polling_interval=5, + max_attempts=12, # 12 attempts * 5 seconds = 60 seconds max + ) + print(f"Result (polling): {result}") + + +if __name__ == "__main__": + main() diff --git a/packages/azure/.genignore b/packages/azure/.genignore new file mode 100644 index 00000000..c4f3ac71 --- /dev/null +++ b/packages/azure/.genignore @@ -0,0 +1,7 @@ +pyproject.toml +src/mistralai/azure/client/sdk.py +src/mistralai/azure/client/_hooks/registration.py +README.md +USAGE.md +docs/sdks/**/README.md +scripts/prepare_readme.py diff --git a/packages/mistralai_azure/.gitattributes b/packages/azure/.gitattributes similarity index 100% rename from packages/mistralai_azure/.gitattributes rename to packages/azure/.gitattributes diff --git a/packages/azure/.gitignore b/packages/azure/.gitignore new file mode 100644 index 00000000..b386de74 --- /dev/null +++ b/packages/azure/.gitignore @@ -0,0 +1,15 @@ +.env +.env.local +**/__pycache__/ +**/.speakeasy/temp/ +**/.speakeasy/logs/ +.speakeasy/reports +README-PYPI.md +.venv/ +venv/ +src/*.egg-info/ +__pycache__/ +.pytest_cache/ +.python-version +.DS_Store +pyrightconfig.json diff --git a/packages/azure/.speakeasy/gen.lock b/packages/azure/.speakeasy/gen.lock new file mode 100644 index 00000000..ec39708b --- /dev/null +++ b/packages/azure/.speakeasy/gen.lock @@ -0,0 +1,891 @@ +lockVersion: 2.0.0 +id: dc40fa48-2c4d-46ad-ac8b-270749770f34 +management: + docChecksum: 564969ee9c3ae8a740e47605a64c0077 + docVersion: 1.0.0 + speakeasyVersion: 1.729.0 + generationVersion: 2.841.0 + releaseVersion: 2.0.0 + configChecksum: 62c02749475cfa5a77859c3b5fab5b8f + repoURL: https://github.com/mistralai/client-python.git + repoSubDirectory: packages/azure + installationURL: https://github.com/mistralai/client-python.git#subdirectory=packages/azure + published: true +persistentEdits: + generation_id: b492a8a2-7f2d-419f-bbf4-8db30c210bb5 + pristine_commit_hash: 0d59853df8a614bb4710a34bfea9a6211af33fae + pristine_tree_hash: 9cc57b34f00c96452174bfa6fa5b7e02c099aeca +features: + python: + additionalDependencies: 1.0.0 + additionalProperties: 1.0.1 + configurableModuleName: 0.2.0 + constsAndDefaults: 1.0.7 + core: 6.0.12 + defaultEnabledRetries: 0.2.0 + enumUnions: 0.1.0 + envVarSecurityUsage: 0.3.2 + examples: 3.0.2 + flatRequests: 1.0.1 + globalSecurity: 3.0.5 + globalSecurityCallbacks: 1.0.0 + globalSecurityFlattening: 1.0.0 + globalServerURLs: 3.2.0 + includes: 3.0.0 + methodArguments: 1.0.2 + nameOverrides: 3.0.3 + nullables: 1.0.2 + openEnums: 1.0.4 + responseFormat: 1.1.0 + retries: 3.0.4 + sdkHooks: 1.2.1 + serverEvents: 1.0.13 + serverEventsSentinels: 0.1.0 + serverIDs: 3.0.0 + unions: 3.1.4 +trackedFiles: + .gitattributes: + id: 24139dae6567 + last_write_checksum: sha1:53134de3ada576f37c22276901e1b5b6d85cd2da + pristine_git_object: 4d75d59008e4d8609876d263419a9dc56c8d6f3a + .vscode/settings.json: + id: 89aa447020cd + last_write_checksum: sha1:f84632c81029fcdda8c3b0c768d02b836fc80526 + pristine_git_object: 8d79f0abb72526f1fb34a4c03e5bba612c6ba2ae + docs/errors/httpvalidationerror.md: + id: 7fe2e5327e07 + last_write_checksum: sha1:277a46811144643262651853dc6176d21b33573e + pristine_git_object: 712a148c3e2305dca4c702851865f9f8c8e674cc + docs/models/arguments.md: + id: 7ea5e33709a7 + last_write_checksum: sha1:09eea126210d7fd0353e60a76bf1dbed173f13ec + pristine_git_object: 2e54e27e0ca97bee87918b2ae38cc6c335669a79 + docs/models/assistantmessage.md: + id: 7e0218023943 + last_write_checksum: sha1:47d5cd1a1bef9e398c12c207f5b3d8486d94f359 + pristine_git_object: 9ef638379aee1198742743800e778409c47a9b9d + docs/models/assistantmessagecontent.md: + id: 9f1795bbe642 + last_write_checksum: sha1:1ce4066623a8d62d969e5ed3a088d73a9ba26643 + pristine_git_object: 047b7cf95f4db203bf2c501680b73ca0562a122d + docs/models/builtinconnectors.md: + id: 9d14e972f08a + last_write_checksum: sha1:1f32eb515e32c58685d0bdc15de09656194c508c + pristine_git_object: f96f50444aaa23ca291db2fd0dc69db0d9d149d9 + docs/models/chatcompletionchoice.md: + id: 0d15c59ab501 + last_write_checksum: sha1:a6274a39a4239e054816d08517bf8507cb5c4564 + pristine_git_object: deaa0ea073e1b6c21bd466c10db31db2464066f1 + docs/models/chatcompletionchoicefinishreason.md: + id: 225764da91d3 + last_write_checksum: sha1:b894d3408cb801e072c3c302a5676ff939d59284 + pristine_git_object: b2f15ecbe88328de95b4961ddb3940fd8a6ee64b + docs/models/chatcompletionrequest.md: + id: adffe90369d0 + last_write_checksum: sha1:00453565d70739471a4e1872c93b5b7e66fe6cb6 + pristine_git_object: f8715cd0a335c6dc0fda4b60400f11c4aa8a0a06 + docs/models/chatcompletionrequestmessage.md: + id: 3f5e170d418c + last_write_checksum: sha1:7921c5a508a9f88adc01caab34e26182b8035607 + pristine_git_object: 91e9e062d0ef0cb69235c4ae4516548733ce28a9 + docs/models/chatcompletionrequeststop.md: + id: fcaf5bbea451 + last_write_checksum: sha1:71a25f84f0d88c7acf72e801ced6159546201851 + pristine_git_object: 749296d420c0671d2a1d6d22483b51f577a86485 + docs/models/chatcompletionrequesttoolchoice.md: + id: b97041b2f15b + last_write_checksum: sha1:7ad7eb133f70e07d0d6a9def36aadd08b35cf861 + pristine_git_object: dc82a8ef91e7bfd44f1d2d9d9a4ef61b6e76cc34 + docs/models/chatcompletionresponse.md: + id: 7c53b24681b9 + last_write_checksum: sha1:a56581c0846638cfe6df26d3045fb4f874ccd931 + pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b + docs/models/chatcompletionstreamrequest.md: + id: cf8f29558a68 + last_write_checksum: sha1:7233a19b12f3204b8e2259a4a09d0d9726609e4e + pristine_git_object: cc82a8c707268084865f86d71be82de5ebf6f821 + docs/models/chatcompletionstreamrequestmessage.md: + id: 053a98476cd2 + last_write_checksum: sha1:8270692463fab1243d9de4bbef7162daa64e52c5 + pristine_git_object: 2e4e93acca8983a3ea27b391d4606518946e13fe + docs/models/chatcompletionstreamrequeststop.md: + id: d0e89a4dca78 + last_write_checksum: sha1:a889e9580fa94bda7c848682d6ba501b7f5c0f41 + pristine_git_object: a48460a92ac47fec1de2188ba46b238229736d32 + docs/models/chatcompletionstreamrequesttoolchoice.md: + id: 210d5e5b1413 + last_write_checksum: sha1:0543164caf3f4fb2bef3061dbd1a5e6b34b17ae9 + pristine_git_object: 43f3ca3809bf1a2a040e2ad7c19a2b22db0b73f8 + docs/models/completionchunk.md: + id: 60cb30423c60 + last_write_checksum: sha1:61b976fe2e71236cf7941ee1635decc31bd304b2 + pristine_git_object: 7f8ab5e631e2c6d1d9830325e591a7e434b83a35 + docs/models/completionevent.md: + id: e57cd17cb9dc + last_write_checksum: sha1:4f59c67af0b11c77b80d2b9c7aca36484d2be219 + pristine_git_object: 7a66e8fee2bb0f1c58166177653893bb05b98f1d + docs/models/completionresponsestreamchoice.md: + id: d56824d615a6 + last_write_checksum: sha1:0296a490df009dbfd04893fdebcc88dd6102a872 + pristine_git_object: 1532c25b8fc065d486f52d4610a7f757e5340875 + docs/models/completionresponsestreamchoicefinishreason.md: + id: 5f1fbfc90b8e + last_write_checksum: sha1:20824b4a223cbd3658b32440973a7d47dcd108b9 + pristine_git_object: 0fece473297227c75db4e7ded63417a2f117cac0 + docs/models/contentchunk.md: + id: d2d3a32080cd + last_write_checksum: sha1:5839a26cdc412b78caad7fb59df97bdcea57be6d + pristine_git_object: 22023e8b19692df969693b7a14f8cf6e0143859f + docs/models/context.md: + id: e8f2f9e54b8e + last_write_checksum: sha1:4c14b386f9f89d98f4dd9487ab030f10478c0e63 + pristine_git_object: 107f1bd428b1f39b36f75e5a10532bc462967ce5 + docs/models/deltamessage.md: + id: 6c5ed6b60968 + last_write_checksum: sha1:00052476b9b2474dbc149f18dd18c71c86d0fc74 + pristine_git_object: e0ee575f3fce7c312114ce8c5390efc5c4854952 + docs/models/deltamessagecontent.md: + id: 7307bedc8733 + last_write_checksum: sha1:a1211b8cb576ad1358e68983680ee326c3920a5e + pristine_git_object: 8142772d7ea33ad8a75cf9cf822564ba3f630de2 + docs/models/document.md: + id: cd1d2a444370 + last_write_checksum: sha1:d00a2ac808a0ae83a7b97da87e647ecc8dca9c52 + pristine_git_object: 509d43b733d68d462853d9eb52fc913c855dff40 + docs/models/documenturlchunk.md: + id: 48437d297408 + last_write_checksum: sha1:5f9294355929d66834c52c67990ba36a7f81387d + pristine_git_object: 9dbfbe5074de81b9fcf6f5bae8a0423fb2c82f71 + docs/models/filechunk.md: + id: edc076728e9d + last_write_checksum: sha1:07ab5db503211adba2fa099e66d12ac3c4bbf680 + pristine_git_object: 18217114060ac4e4b45fefabace4628684f27e5c + docs/models/format_.md: + id: a17c22228eda + last_write_checksum: sha1:dad6de59fec6378d50356007602e2a0254d8d2e4 + pristine_git_object: 97d286a4ed7cff0a4058bbfa06c4573428182876 + docs/models/function.md: + id: 416a80fba031 + last_write_checksum: sha1:a9485076d430a7753558461ce87bf42d09e34511 + pristine_git_object: b2bdb3fe82520ea79d0cf1a10ee41c844f90b859 + docs/models/functioncall.md: + id: a78cd1d7f605 + last_write_checksum: sha1:65bf78744b8531cdefb6a288f1af5cbf9d9e2395 + pristine_git_object: 7ccd90dca4868db9b6e178712f95d375210013c8 + docs/models/functionname.md: + id: 4b3bd62c0f26 + last_write_checksum: sha1:754fe32bdffe53c1057b302702f5516f4e551cfb + pristine_git_object: 87d7b4852de629015166605b273deb9341202dc0 + docs/models/imagedetail.md: + id: f8217529b496 + last_write_checksum: sha1:fdf19ac9459f64616240955cb81a84ef03e775c8 + pristine_git_object: 1e5ba3fd405a14e5e2872cc85504584dca19b726 + docs/models/imageurl.md: + id: e75dd23cec1d + last_write_checksum: sha1:a5cf621ce58a9cc7c96afa7de53367eac7b4cb0b + pristine_git_object: 6358e0acb2dea4816203413842243704ca955783 + docs/models/imageurlchunk.md: + id: 4407097bfff3 + last_write_checksum: sha1:da7a792f7b649f311062338dfbf3d25ff55fe6c5 + pristine_git_object: db0c53d22e29fa25222edb86b264e5135879a029 + docs/models/imageurlunion.md: + id: 9d3c691a9db0 + last_write_checksum: sha1:4e32bcd7d44746d2ddbfafbef96152bb2bdb2a15 + pristine_git_object: db97130f26199dcb354ecb7469d09530b035daa2 + docs/models/jsonschema.md: + id: a6b15ed6fac8 + last_write_checksum: sha1:523465666ad3c292252b3fe60f345c7ffb29053f + pristine_git_object: 7ff7c070353c58290416aff5b01d1dfc43905269 + docs/models/loc.md: + id: b071d5a509cc + last_write_checksum: sha1:09a04749333ab50ae806c3ac6adcaa90d54df0f1 + pristine_git_object: d6094ac2c6e0326c039dad2f6b89158694ef6aa7 + docs/models/mistralpromptmode.md: + id: d17d5db4d3b6 + last_write_checksum: sha1:abcb7205c5086169c7d9449d15ac142448a7d258 + pristine_git_object: c3409d03b9646e21a3793372d06dcae6fef95463 + docs/models/ocrimageobject.md: + id: b72f3c5853b2 + last_write_checksum: sha1:90c5158dec6a7b31c858677b6a8efa1e3cabd504 + pristine_git_object: 3c0d5544a80499b011467f29ef83d49f53801af6 + docs/models/ocrpagedimensions.md: + id: b3429f9883f5 + last_write_checksum: sha1:6435aa56e6153b0c90a546818ed780105ae1042a + pristine_git_object: c93ca64d5e20319ec6ec1bcb82b28c6ce0940f29 + docs/models/ocrpageobject.md: + id: 88a9e101b11e + last_write_checksum: sha1:091077fedf1b699d5160a21fe352056c247ef988 + pristine_git_object: 02473d44f73485fd7b7f0031d51bfac835d4036e + docs/models/ocrrequest.md: + id: 6862a3fc2d0f + last_write_checksum: sha1:eefa8ad80773e00ac297f3cf806704ac6ac3557d + pristine_git_object: 2d26c19fd1cecb234d7fb761dd73cc0a59e622ad + docs/models/ocrresponse.md: + id: 30042328fb78 + last_write_checksum: sha1:8e4a4ae404ea752f3e9f1108c2a5f89ed6cfb143 + pristine_git_object: 0a309317644eedc643009b6cec3a7dbb142b1a15 + docs/models/ocrtableobject.md: + id: c967796380e6 + last_write_checksum: sha1:3b78858cc130fc8792ec3d149c8f657fd3f7a4c3 + pristine_git_object: 4e27697c15983f86274648b2d7bacac557081630 + docs/models/ocrusageinfo.md: + id: 419abbb8353a + last_write_checksum: sha1:6e717a3f3de3c464e8b3237f06867cdfecec339e + pristine_git_object: d9d79125cb02bc2b09d8dc543a5e2d4a6c55571c + docs/models/prediction.md: + id: 3c70b2262201 + last_write_checksum: sha1:ca8a77219e6113f2358a5363e935288d90df0725 + pristine_git_object: fae3c1ca4ba2c2ddb3b7de401ecdc8d56dcc7740 + docs/models/referencechunk.md: + id: 07895f9debfd + last_write_checksum: sha1:4384049375a2566c7567599f97ce1ec19e9f6276 + pristine_git_object: d847e24845a399c7ca93d54701832fb65e01b3ab + docs/models/responseformat.md: + id: 50a1e4140614 + last_write_checksum: sha1:e877b2e81470ef5eec5675dfb91a47e74d5d3add + pristine_git_object: 5cab22f2bf1c412699f6a7ed18ef801ecbc3ee4b + docs/models/responseformats.md: + id: cf1f250b82db + last_write_checksum: sha1:105e1f9181913104b554051838cbdd0f728aa2c4 + pristine_git_object: 2f5f1e5511b048323fee18a0ffdd506fe2b3d56f + docs/models/security.md: + id: 452e4d4eb67a + last_write_checksum: sha1:ce2871b49c1632d50e22d0b1ebe4999021d52313 + pristine_git_object: c698674c513f5b20c04f629e50154e67977275f7 + docs/models/systemmessage.md: + id: fdb7963e1cdf + last_write_checksum: sha1:c7603c5ce77ba2bcbda9eff65eeafdb1e9ecbec7 + pristine_git_object: 10bda10f921fb5d66c1606ff18e654b4e78ab197 + docs/models/systemmessagecontent.md: + id: 94a56febaeda + last_write_checksum: sha1:6cb10b4b860b4204df57a29c650c85c826395aeb + pristine_git_object: 0c87baf3c2fade64a2738a9a4b3ce19647e5dc9a + docs/models/systemmessagecontentchunks.md: + id: cea1c19e9d7a + last_write_checksum: sha1:986aec0f8098158515bbccd0c22e0b3d4151bb32 + pristine_git_object: 40030c170746d9953d25b979ab7e6f522018e230 + docs/models/tableformat.md: + id: d8cd08c55c3c + last_write_checksum: sha1:e0736ea9576466d71821aa1e67fc632cc5a85414 + pristine_git_object: 54f029b814fdcfa2e93e2b8b0594ef9e4eab792a + docs/models/textchunk.md: + id: 6cd12e0ef110 + last_write_checksum: sha1:aa448d4937c0c1cd562621f0a9080aa0dc6e4bd1 + pristine_git_object: b266619dcb57222ec343f373c43b2b5cef5b8b93 + docs/models/thinkchunk.md: + id: bca24d7153f6 + last_write_checksum: sha1:2b8ff7737fa7255673ca31da7cb2e6803fce9e02 + pristine_git_object: b07f598ebc5f0e9c041186c081dc98bc21104bdb + docs/models/thinking.md: + id: 07234f8dd364 + last_write_checksum: sha1:90c0b34284137712678b0671e9f4bfb319548cbf + pristine_git_object: d9e51d7dc93b24edd807b018393eab38143d46f4 + docs/models/tool.md: + id: 8966139dbeed + last_write_checksum: sha1:1725bf53fc9f1ca3f332322d91de24c9d58adc6a + pristine_git_object: fb661f72887271d5bb470e4edf025a32b00ade17 + docs/models/toolcall.md: + id: 80892ea1a051 + last_write_checksum: sha1:cb27b9d36cfe6227978c7a7a01b1349b6bac99d9 + pristine_git_object: 3819236b9f3eee2f6878818cfbbe2817e97f7de2 + docs/models/toolchoice.md: + id: "097076343426" + last_write_checksum: sha1:25b33b34da02c3b46349dc8b6223f9ae18370d16 + pristine_git_object: 373046bbbc834169293b4f4ae8b2e238f952ddde + docs/models/toolchoiceenum.md: + id: 15410de51ffc + last_write_checksum: sha1:ca0cf9bf128bebc8faedd9333cc6a56b30f58130 + pristine_git_object: 0be3d6c54b13a8bf30773398a2c12e0d30d3ae58 + docs/models/toolmessage.md: + id: 0553747c37a1 + last_write_checksum: sha1:ac61e644ba7c6da607cb479eafd1db78d8e8012e + pristine_git_object: 7201481e61e269b238887deec30c03f7e16c53d7 + docs/models/toolmessagecontent.md: + id: f0522d2d3c93 + last_write_checksum: sha1:783769c0200baa1b6751327aa3e009fa83da72ee + pristine_git_object: 5c76091fbd2c8e0d768921fab19c7b761df73411 + docs/models/toolreferencechunk.md: + id: 10414b39b7b3 + last_write_checksum: sha1:a0e93881de5ecaf765300d45a18ab21dcffe54f9 + pristine_git_object: 9fc10399fe4ce9eb3b5e87a6bc609643d6a2cb3a + docs/models/tooltypes.md: + id: adb50fe63ea2 + last_write_checksum: sha1:f224c3d8732450b9c969b3e04027b7df7892694c + pristine_git_object: 84e49253c9b9bd1bd314e2a126106404cbb52f16 + docs/models/toolunion.md: + id: ad708b0ce4e0 + last_write_checksum: sha1:61909a56240c784e05f13dff8d9787272e1aa8bc + pristine_git_object: 2dcb3deec9f05d1e578c485a47a8ddd10b375f48 + docs/models/usageinfo.md: + id: ec6fe65028a9 + last_write_checksum: sha1:cf71fb9676d870eba7c4d10a69636e1db4054adc + pristine_git_object: f5204ac94a4d6191839031c66c5a9bc0124a1f35 + docs/models/usermessage.md: + id: ed66d7a0f80b + last_write_checksum: sha1:f0ed7d9cb7264f1d9e4a9190772df3f15e25346c + pristine_git_object: e7a932ed71496fa7cc358388c650d25f166f27a4 + docs/models/usermessagecontent.md: + id: 52c072c851e8 + last_write_checksum: sha1:1de02bcf7082768ebe1bb912fdbebbec5a577b5a + pristine_git_object: 8350f9e8f8996c136093e38760990f62fd01f8cf + docs/models/utils/retryconfig.md: + id: 4343ac43161c + last_write_checksum: sha1:562c0f21e308ad10c27f85f75704c15592c6929d + pristine_git_object: 69dd549ec7f5f885101d08dd502e25748183aebf + docs/models/validationerror.md: + id: 304bdf06ef8b + last_write_checksum: sha1:1f297f34069668f6107f2c0389606efe413ff5a8 + pristine_git_object: 5bcea5b5d12e72222720af2c014d64ec4bdfee4a + py.typed: + id: 258c3ed47ae4 + last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 + pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 + pylintrc: + id: 7ce8b9f946e6 + last_write_checksum: sha1:8f871a5aac4b10bff724c9d91b8d7496eb1fbdde + pristine_git_object: 0391ac11bdc5526b697b69d047d568a611ce87d0 + scripts/prepare_readme.py: + id: e0c5957a6035 + last_write_checksum: sha1:26b29aad3c23a98912fd881698c976aac55749fe + pristine_git_object: 2b2577ea83873f64aa9f91d9d762bc6e1f250977 + scripts/publish.sh: + id: fe273b08f514 + last_write_checksum: sha1:b290b25b36dca3d5eb1a2e66a2e1bcf2e7326cf3 + pristine_git_object: c35748f360329c2bc370e9b189f49b1a360b2c48 + src/mistralai/azure/client/__init__.py: + id: 5624bda9196d + last_write_checksum: sha1:da077c0bdfcef64a4a5aea91a17292f72fa2b088 + pristine_git_object: 833c68cd526fe34aab2b7e7c45f974f7f4b9e120 + src/mistralai/azure/client/_hooks/__init__.py: + id: 850c237217cb + last_write_checksum: sha1:e3111289afd28ad557c21d9e2f918caabfb7037d + pristine_git_object: 2ee66cdd592fe41731c24ddd407c8ca31c50aec1 + src/mistralai/azure/client/_hooks/sdkhooks.py: + id: e9923767446c + last_write_checksum: sha1:ae162d6e73be0eb767c353c815d76b034395d50f + pristine_git_object: 2080681b7f2c52fcb80dcb95eff48654763e6258 + src/mistralai/azure/client/_hooks/types.py: + id: 07c892e06527 + last_write_checksum: sha1:fde2e0f6da6930232b67682009de520724b23398 + pristine_git_object: 3e4e39555d60adebe84e596c8323ee5b80676fc9 + src/mistralai/azure/client/_version.py: + id: a77160e60e5d + last_write_checksum: sha1:991341c1aaa4a0fc2ef89aa7a69429b54764d309 + pristine_git_object: 8923c29dad7a842f2137ae6e466c8a7ddf13823d + src/mistralai/azure/client/basesdk.py: + id: 5a585a95ec21 + last_write_checksum: sha1:0c2e686aa42d6aeeb103193aa058d6ddff7bcf74 + pristine_git_object: 0d4d9a440e6c7726b6bc7fc6525aa3dc009847eb + src/mistralai/azure/client/chat.py: + id: c18454e628d7 + last_write_checksum: sha1:884e22b0e313662c67cec7101765d8d7ef0bc48a + pristine_git_object: 1051f9527851894988f7e1689923575cf72a0896 + src/mistralai/azure/client/errors/__init__.py: + id: f377703514d9 + last_write_checksum: sha1:36c516c11f8083c3380a72c1d0f0718a3345f24b + pristine_git_object: 79e2712c2e62121fb6dbaab15ca8487f0e16b07c + src/mistralai/azure/client/errors/httpvalidationerror.py: + id: c3ec0ad923e9 + last_write_checksum: sha1:f45b41c1ad980c5d481158209bf23fa795cc68bc + pristine_git_object: b4f2691e630a095ff09fbbce5e2ea3063592084f + src/mistralai/azure/client/errors/mistralazureerror.py: + id: fae868afae89 + last_write_checksum: sha1:25f4411c7411faad753d46118edf74828b1c9f7c + pristine_git_object: c5bf17528c7cf25bac8f8874f58692c601fcdd76 + src/mistralai/azure/client/errors/no_response_error.py: + id: b838df044e62 + last_write_checksum: sha1:7f326424a7d5ae1bcd5c89a0d6b3dbda9138942f + pristine_git_object: 1deab64bc43e1e65bf3c412d326a4032ce342366 + src/mistralai/azure/client/errors/responsevalidationerror.py: + id: 77ac5e93cdda + last_write_checksum: sha1:c1e045dbdda0199bc1d563819c0b38e877d0efef + pristine_git_object: 02397334d2b3bf2516808b69b2548564f650cbe0 + src/mistralai/azure/client/errors/sdkerror.py: + id: dfdd4b1d8928 + last_write_checksum: sha1:edc2baf6feb199e1b1ff1aad681622b44804299d + pristine_git_object: c4f3616cd2720a9b5d2a2c5b2d22a305629ebbe6 + src/mistralai/azure/client/httpclient.py: + id: 60c81037fbd0 + last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 + pristine_git_object: 89560b566073785535643e694c112bedbd3db13d + src/mistralai/azure/client/models/__init__.py: + id: "335011330e21" + last_write_checksum: sha1:6ae218231fc52b0ce36cf3ed2116c93e4782791f + pristine_git_object: 79c5df321d8d95cecd502e22a521165f70c5c635 + src/mistralai/azure/client/models/assistantmessage.py: + id: 353ed9110f97 + last_write_checksum: sha1:973979ac03f86f26ee9a540aaaa8f70a7011daca + pristine_git_object: e9ae6e82c3c758561c8c9663f27b2fd7e38d2911 + src/mistralai/azure/client/models/builtinconnectors.py: + id: d260ad466b17 + last_write_checksum: sha1:4e94744e3854d4cdc9d1272e4f1d9371f9829a5f + pristine_git_object: 6a3b2476d54096722eb3e7a271629d108028bd35 + src/mistralai/azure/client/models/chatcompletionchoice.py: + id: 6942c7db5891 + last_write_checksum: sha1:817bfda6120a98248322c308629e404081e01279 + pristine_git_object: 67b5ba694217f4f3b95589d7f84af6a9bea9802d + src/mistralai/azure/client/models/chatcompletionrequest.py: + id: 0c711c870184 + last_write_checksum: sha1:ffdd11a4945dd805c9a73328749c2f4d9b6f80e6 + pristine_git_object: edd0fdc74a1b81f458d6083e79dc393e488da36a + src/mistralai/azure/client/models/chatcompletionresponse.py: + id: bdfacf065e9e + last_write_checksum: sha1:c72fb624e7475a551d37e0b291b64bcf772c402a + pristine_git_object: d41f9c6fab670cf7c961f50b1302f9a88cf48162 + src/mistralai/azure/client/models/chatcompletionstreamrequest.py: + id: da00a7feb4ef + last_write_checksum: sha1:8bb36693fed73a50d59687ca8b30a2c443708610 + pristine_git_object: 2edfbed98462eab43f322b9c706721365e410bb9 + src/mistralai/azure/client/models/completionchunk.py: + id: 28d620f25510 + last_write_checksum: sha1:84d1c55ef7bdb438e7f536a604a070799d054281 + pristine_git_object: 0e64bbc8aa0293c9d763db56287f296909260c38 + src/mistralai/azure/client/models/completionevent.py: + id: a6f00a747933 + last_write_checksum: sha1:3d04bfbdaf11c52af5613ed0fd70c8dbc59f6d49 + pristine_git_object: c4b272871d9b3ea8443f469d29b0825706c25c00 + src/mistralai/azure/client/models/completionresponsestreamchoice.py: + id: 3ba5d7ba8a13 + last_write_checksum: sha1:4de311509c71c8f582b2c767febea89f1acd341a + pristine_git_object: 20a271401ff98d69525947ab929078af83aab1f1 + src/mistralai/azure/client/models/contentchunk.py: + id: 1f65e4f8f731 + last_write_checksum: sha1:cf11e1f061d3c8af040ebbdba0b25d4177e1cea4 + pristine_git_object: 17efcc7d5825461576cf61257908688cffd23eb7 + src/mistralai/azure/client/models/deltamessage.py: + id: b7dab1d158de + last_write_checksum: sha1:190c2809d575244eda5efbb1e00a4ec5811aea29 + pristine_git_object: 567e772fc1b376efaec1a2dfd660bc74a916f8ee + src/mistralai/azure/client/models/documenturlchunk.py: + id: e56fec6e977f + last_write_checksum: sha1:0313d94f343d46dac7cc3adc392feaf06fa2b2a4 + pristine_git_object: 2dea80056f6752bdaa5d00f391cb6f54371a9d2b + src/mistralai/azure/client/models/filechunk.py: + id: 150d9f180110 + last_write_checksum: sha1:6d12d630a5bfd601836f9cb3d63b9eb2f15f880d + pristine_git_object: 6baa0cba81535e157c0f81ae2648362f7bd1adbd + src/mistralai/azure/client/models/function.py: + id: 6d1e2011a14b + last_write_checksum: sha1:b064eca9256966603581d41b5b2c08cd2448224d + pristine_git_object: 055d3657fd98da63b80deb8cd2054e95a0e66a2b + src/mistralai/azure/client/models/functioncall.py: + id: ced560a1bd57 + last_write_checksum: sha1:490cb3a0305994de063e06fa4c77defa911271f3 + pristine_git_object: d476792ccbb5aa2002deb870f1c81cc1500f59d4 + src/mistralai/azure/client/models/functionname.py: + id: 6f09474ebc85 + last_write_checksum: sha1:651ceed24416ce8192f70db03cc5cd0db685899f + pristine_git_object: 839e0d557a902da6c819210962e38e1df9bda90f + src/mistralai/azure/client/models/imagedetail.py: + id: de211988043d + last_write_checksum: sha1:812f2ec4fc0d8d13db643ed49192384d5a841aa4 + pristine_git_object: 2d074cee614e1c49b69ee4073c3aaaa7a5a2c9e2 + src/mistralai/azure/client/models/imageurl.py: + id: c8882341c798 + last_write_checksum: sha1:8c3c08cc5d33c66b12539270b7edbf157d936f86 + pristine_git_object: bcb4fe43d334752be501d694543250d7e632a9c7 + src/mistralai/azure/client/models/imageurlchunk.py: + id: b6f0abb574d7 + last_write_checksum: sha1:417618d9d2aba85386a100dfe818d13342830526 + pristine_git_object: 7213c49846a4107271d017dd695648d98c2efa94 + src/mistralai/azure/client/models/jsonschema.py: + id: bfd486f4bb18 + last_write_checksum: sha1:ccb2b53bd2351ec5119d9a7914a1a42c2746a096 + pristine_git_object: 99f2fb8903562465687edfd300d8efd373b92247 + src/mistralai/azure/client/models/mistralpromptmode.py: + id: d0028b1e4129 + last_write_checksum: sha1:46fe1ab8ac2d5867877368a59a4aa5be2fabadeb + pristine_git_object: 26e7adbdc4a981c92d51b72542c966b0ba0fb8f8 + src/mistralai/azure/client/models/ocrimageobject.py: + id: 9c9f987d94bb + last_write_checksum: sha1:423effee97a4120a26ba78c2abe7f6adeb5c733d + pristine_git_object: a23515b346a0f9517fec0b2381e1b0c04cb31816 + src/mistralai/azure/client/models/ocrpagedimensions.py: + id: 7669a25f32b3 + last_write_checksum: sha1:60642db6bb61f0e96204fb78d3aa0bd80dd0a7e5 + pristine_git_object: 12858da92de99aa6da9d6e148df3ba7ee37496c7 + src/mistralai/azure/client/models/ocrpageobject.py: + id: eea193b05126 + last_write_checksum: sha1:b8370ac0611dc3eccf09dddf85d1c39d3a11224b + pristine_git_object: 434c8988f124f93180e6cefa15b3aee067937946 + src/mistralai/azure/client/models/ocrrequest.py: + id: 365a5b4776a2 + last_write_checksum: sha1:e684da1b6db18cb9c5ce95b9cc58556e05a9ea9b + pristine_git_object: a2cd341593c9db3644076d39352abca6815efc56 + src/mistralai/azure/client/models/ocrresponse.py: + id: b8cde8c16a4c + last_write_checksum: sha1:55e81631f6fe57aaf58178460e1c5fc69fa19377 + pristine_git_object: 3dc09fd770a064e69e84519bd0f0c9127ebd8176 + src/mistralai/azure/client/models/ocrtableobject.py: + id: c2cd51b8789e + last_write_checksum: sha1:86a8fd2241cf6a636e81e58484a90bdb7880085e + pristine_git_object: f1de5428a71f9d42cd9f9e764d0bbf88f3aad8cc + src/mistralai/azure/client/models/ocrusageinfo.py: + id: 5e9118cac468 + last_write_checksum: sha1:97887b58cfe6ebd9ebd5905c6c7485525d6dc788 + pristine_git_object: f63315d23a1659aee4333b45c4239861aa5220d7 + src/mistralai/azure/client/models/prediction.py: + id: bd6abfa93083 + last_write_checksum: sha1:07d06d5629af183f999e043744a67868ef779bcc + pristine_git_object: 1fa1d78248628ccdc102ce0631d344150addfd2d + src/mistralai/azure/client/models/referencechunk.py: + id: c9612f854670 + last_write_checksum: sha1:e81e758e00db915e68f58ffa1e03b2c473f64477 + pristine_git_object: f7af9bf9a73e0d782e5e6c6a7866af6fbc3668d8 + src/mistralai/azure/client/models/responseformat.py: + id: c124e7c316aa + last_write_checksum: sha1:d368a2d4320356b6daab1dd0c62c6c862e902ca0 + pristine_git_object: 20fd2b868506cff278d1d7dc719eddd56ea538b0 + src/mistralai/azure/client/models/responseformats.py: + id: fef416cefcd4 + last_write_checksum: sha1:a212e85d286b5b49219f57d071a2232ff8b5263b + pristine_git_object: cbf83ce7b54ff8634f741334831807bfb5c98991 + src/mistralai/azure/client/models/security.py: + id: 4a2e4760ec08 + last_write_checksum: sha1:0cd2ae54cecd88cfd8d43e92c0d3da7efa48942c + pristine_git_object: 9b83ba98336090bed89fbeda40b4a07b212a1106 + src/mistralai/azure/client/models/systemmessage.py: + id: 8fa0dee9e4e1 + last_write_checksum: sha1:26167db704ece6ef1391d6f474e00f417bff4639 + pristine_git_object: d4bd004476ef653798295fa5df9de68b607f0132 + src/mistralai/azure/client/models/systemmessagecontentchunks.py: + id: 5918e770869d + last_write_checksum: sha1:d1f96498cbb540b91425e70ffa33892ff4d1c8cd + pristine_git_object: 8de71c909eda2ed0166a6be8f8ee029956e5766b + src/mistralai/azure/client/models/textchunk.py: + id: 9c81c76a6325 + last_write_checksum: sha1:28b8f4e030d365e5bf2f2f2720a7919b29616564 + pristine_git_object: 9295148588a143278ff5f48f9142347e35cfdab2 + src/mistralai/azure/client/models/thinkchunk.py: + id: df6bbd55b3eb + last_write_checksum: sha1:b988cdf2755c3192aef30a9b2f945214fbc59785 + pristine_git_object: ec8e7f95be2ff0d742acb1fdea2867e23788cb06 + src/mistralai/azure/client/models/tool.py: + id: 4075ef72c086 + last_write_checksum: sha1:4bef6d64b6426fdeff5031557c3c0e37f5c33b9a + pristine_git_object: 87329bdb73526120a3f63d48299114485a7fe038 + src/mistralai/azure/client/models/toolcall.py: + id: c65e6f79e539 + last_write_checksum: sha1:a3b36214b4533b79868630348762206a0e5ca26e + pristine_git_object: ada1ea65136fa58dce55f2857d895ea916bcd41f + src/mistralai/azure/client/models/toolchoice.py: + id: c25062b5de34 + last_write_checksum: sha1:6212c9366eb3b4f4062c86c00d4502dd03bf5ce1 + pristine_git_object: ddb9e1417c880c44a7f0505bfde839570fa3cd4a + src/mistralai/azure/client/models/toolchoiceenum.py: + id: cc06ba3a8d21 + last_write_checksum: sha1:3dbba9a58c5569aafe115f3f7713a52b01ad8620 + pristine_git_object: 01f6f677b379f9e3c99db9d1ad248cb0033a2804 + src/mistralai/azure/client/models/toolmessage.py: + id: 84ac736fa955 + last_write_checksum: sha1:e4ed14906985fe74fd76a9adb09125ebc1218a1f + pristine_git_object: 670210de0d05b52ee9dffbbb808a87e67c2d37a9 + src/mistralai/azure/client/models/toolreferencechunk.py: + id: b96d2eda57fc + last_write_checksum: sha1:6640e3ce0e2a0478fb29e6ea28ff6c447d4aea44 + pristine_git_object: c9db878fd3234ca46b0f958994e9dda4d68b9171 + src/mistralai/azure/client/models/tooltypes.py: + id: fa881b046d34 + last_write_checksum: sha1:cd28ddc02fff9a5abbb59c82fe9e0dcbdb9b6d2a + pristine_git_object: 1cce7446f2772b998208ea1c78c7969e3881d5d0 + src/mistralai/azure/client/models/usageinfo.py: + id: 3edc9c81b329 + last_write_checksum: sha1:0ac2350e4efa1ed3ffd7d33ac91c3ef564d1d773 + pristine_git_object: 0f04c87c97ff3148106408a46618c848b86c4b37 + src/mistralai/azure/client/models/usermessage.py: + id: 3796508adc07 + last_write_checksum: sha1:8eb35fb07971d74cf2cb0858c037558f52df6aa9 + pristine_git_object: 549b01ca887651a95c5efc8aff3372d32dfdc277 + src/mistralai/azure/client/models/validationerror.py: + id: f2b84813e2ea + last_write_checksum: sha1:10b9637fc1c659518bc5bc9116058ad055869800 + pristine_git_object: f0169e18a5d0e3d1d87fd907697fcca22b11bc06 + src/mistralai/azure/client/ocr.py: + id: 5817c10c9297 + last_write_checksum: sha1:7666ca9f4596cee080952b2f4096bd4176051680 + pristine_git_object: b9270f6a52406d8a9bf02d90c24ae540da6dfb9d + src/mistralai/azure/client/py.typed: + id: e88369f116d2 + last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 + pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 + src/mistralai/azure/client/sdkconfiguration.py: + id: 602f74633eed + last_write_checksum: sha1:163fe779949725d81181f39b70d6922fc2cb8099 + pristine_git_object: 919225f9bf2e4315f879f0da6c7f8b3e6157bd58 + src/mistralai/azure/client/types/__init__.py: + id: f79033f78412 + last_write_checksum: sha1:140ebdd01a46f92ffc710c52c958c4eba3cf68ed + pristine_git_object: fc76fe0c5505e29859b5d2bb707d48fd27661b8c + src/mistralai/azure/client/types/basemodel.py: + id: fd244927c80c + last_write_checksum: sha1:10d84aedeb9d35edfdadf2c3020caa1d24d8b584 + pristine_git_object: a9a640a1a7048736383f96c67c6290c86bf536ee + src/mistralai/azure/client/utils/__init__.py: + id: 26f1a707325b + last_write_checksum: sha1:3ad22a588864c93bd3a16605f669955b5f3b8053 + pristine_git_object: b488c2df1390b22be3050eee72832a91c76d5385 + src/mistralai/azure/client/utils/annotations.py: + id: bb1f6c189fdb + last_write_checksum: sha1:a4824ad65f730303e4e1e3ec1febf87b4eb46dbc + pristine_git_object: 12e0aa4f1151bb52474cc02e88397329b90703f6 + src/mistralai/azure/client/utils/datetimes.py: + id: 2b7db09ee0ab + last_write_checksum: sha1:c721e4123000e7dc61ec52b28a739439d9e17341 + pristine_git_object: a6c52cd61bbe2d459046c940ce5e8c469f2f0664 + src/mistralai/azure/client/utils/dynamic_imports.py: + id: 0ac779c122d9 + last_write_checksum: sha1:a1940c63feb8eddfd8026de53384baf5056d5dcc + pristine_git_object: 673edf82a97d0fea7295625d3e092ea369a36b79 + src/mistralai/azure/client/utils/enums.py: + id: ffbdb1917a68 + last_write_checksum: sha1:bc8c3c1285ae09ba8a094ee5c3d9c7f41fa1284d + pristine_git_object: 3324e1bc2668c54c4d5f5a1a845675319757a828 + src/mistralai/azure/client/utils/eventstreaming.py: + id: bdc37b70360c + last_write_checksum: sha1:ffa870a25a7e4e2015bfd7a467ccd3aa1de97f0e + pristine_git_object: f2052fc22d9fd6c663ba3dce019fe234ca37108b + src/mistralai/azure/client/utils/forms.py: + id: 51696122c557 + last_write_checksum: sha1:0ca31459b99f761fcc6d0557a0a38daac4ad50f4 + pristine_git_object: 1e550bd5c2c35d977ddc10f49d77c23cb12c158d + src/mistralai/azure/client/utils/headers.py: + id: e42840c8cb13 + last_write_checksum: sha1:7c6df233ee006332b566a8afa9ce9a245941d935 + pristine_git_object: 37864cbbbc40d1a47112bbfdd3ba79568fc8818a + src/mistralai/azure/client/utils/logger.py: + id: 9db88755a137 + last_write_checksum: sha1:f3fdb154a3f09b8cc43d74c7e9c02f899f8086e4 + pristine_git_object: b661aff65d38b77d035149699aea09b2785d2fc6 + src/mistralai/azure/client/utils/metadata.py: + id: 44f85bd3b2e2 + last_write_checksum: sha1:c6a560bd0c63ab158582f34dadb69433ea73b3d4 + pristine_git_object: 173b3e5ce658675c2f504222a56b3daaaa68107d + src/mistralai/azure/client/utils/queryparams.py: + id: ec1c03114156 + last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 + pristine_git_object: c04e0db82b68eca041f2cb2614d748fbac80fd41 + src/mistralai/azure/client/utils/requestbodies.py: + id: 1030c47d624d + last_write_checksum: sha1:41e2d2d2d3ecc394c8122ca4d4b85e1c3e03f054 + pristine_git_object: 1de32b6d26f46590232f398fdba6ce0072f1659c + src/mistralai/azure/client/utils/retries.py: + id: d50ed6e400b2 + last_write_checksum: sha1:471372f5c5d1dd5583239c9cf3c75f1b636e5d87 + pristine_git_object: af07d4e941007af4213c5ec9047ef8a2fca04e5e + src/mistralai/azure/client/utils/security.py: + id: 1d35741ce5f1 + last_write_checksum: sha1:435dd8b180cefcd733e635b9fa45512da091d9c0 + pristine_git_object: 17996bd54b8624009802fbbdf30bcb4225b8dfed + src/mistralai/azure/client/utils/serializers.py: + id: a1f26d73c3ad + last_write_checksum: sha1:ce1d8d7f500a9ccba0aeca5057cee9c271f4dfd7 + pristine_git_object: 14321eb479de81d0d9580ec8291e0ff91bf29e57 + src/mistralai/azure/client/utils/unions.py: + id: 9abcc9913e3f + last_write_checksum: sha1:6e38049f323e0b5fb4bd0e88ab51ec447197ccb0 + pristine_git_object: a227f4e87be22fce682fcae5813b71835199ec5e + src/mistralai/azure/client/utils/unmarshal_json_response.py: + id: 947f4fc4db62 + last_write_checksum: sha1:75931131ff498a66a48cfb32dd9d5d61f2c9b4d1 + pristine_git_object: fe0c9b8ecabf8f89e363a050837582df40d67fb4 + src/mistralai/azure/client/utils/url.py: + id: 4976c88d0e3b + last_write_checksum: sha1:6479961baa90432ca25626f8e40a7bbc32e73b41 + pristine_git_object: c78ccbae426ce6d385709d97ce0b1c2813ea2418 + src/mistralai/azure/client/utils/values.py: + id: 3974a1553447 + last_write_checksum: sha1:acaa178a7c41ddd000f58cc691e4632d925b2553 + pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 +examples: + stream_chat: + speakeasy-default-stream-chat: + requestBody: + application/json: {"model": "azureai", "stream": true, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} + responses: + "422": + application/json: {} + chat_completion_v1_chat_completions_post: + speakeasy-default-chat-completion-v1-chat-completions-post: + requestBody: + application/json: {"model": "azureai", "stream": false, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} + responses: + "200": + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} + "422": + application/json: {} + ocr_v1_ocr_post: + speakeasy-default-ocr-v1-ocr-post: + requestBody: + application/json: {"model": "CX-9", "document": {"document_url": "https://upset-labourer.net/", "type": "document_url"}} + responses: + "200": + application/json: {"pages": [], "model": "Golf", "usage_info": {"pages_processed": 944919}} + "422": + application/json: {} + userExample: + requestBody: + application/json: {"model": "CX-9", "document": {"type": "document_url", "document_url": "https://upset-labourer.net/"}, "bbox_annotation_format": {"type": "text"}, "document_annotation_format": {"type": "text"}} + responses: + "200": + application/json: {"pages": [{"index": 1, "markdown": "# LEVERAGING UNLABELED DATA TO PREDICT OUT-OF-DISTRIBUTION PERFORMANCE\nSaurabh Garg*
Carnegie Mellon University
sgarg2@andrew.cmu.edu
Sivaraman Balakrishnan
Carnegie Mellon University
sbalakri@andrew.cmu.edu
Zachary C. Lipton
Carnegie Mellon University
zlipton@andrew.cmu.edu\n## Behnam Neyshabur\nGoogle Research, Blueshift team
neyshabur@google.com\nHanie Sedghi
Google Research, Brain team
hsedghi@google.com\n#### Abstract\nReal-world machine learning deployments are characterized by mismatches between the source (training) and target (test) distributions that may cause performance drops. In this work, we investigate methods for predicting the target domain accuracy using only labeled source data and unlabeled target data. We propose Average Thresholded Confidence (ATC), a practical method that learns a threshold on the model's confidence, predicting accuracy as the fraction of unlabeled examples for which model confidence exceeds that threshold. ATC outperforms previous methods across several model architectures, types of distribution shifts (e.g., due to synthetic corruptions, dataset reproduction, or novel subpopulations), and datasets (WILDS, ImageNet, BREEDS, CIFAR, and MNIST). In our experiments, ATC estimates target performance $2-4 \\times$ more accurately than prior methods. We also explore the theoretical foundations of the problem, proving that, in general, identifying the accuracy is just as hard as identifying the optimal predictor and thus, the efficacy of any method rests upon (perhaps unstated) assumptions on the nature of the shift. Finally, analyzing our method on some toy distributions, we provide insights concerning when it works ${ }^{1}$.\n## 1 INTRODUCTION\nMachine learning models deployed in the real world typically encounter examples from previously unseen distributions. While the IID assumption enables us to evaluate models using held-out data from the source distribution (from which training data is sampled), this estimate is no longer valid in presence of a distribution shift. Moreover, under such shifts, model accuracy tends to degrade (Szegedy et al., 2014; Recht et al., 2019; Koh et al., 2021). Commonly, the only data available to the practitioner are a labeled training set (source) and unlabeled deployment-time data which makes the problem more difficult. In this setting, detecting shifts in the distribution of covariates is known to be possible (but difficult) in theory (Ramdas et al., 2015), and in practice (Rabanser et al., 2018). However, producing an optimal predictor using only labeled source and unlabeled target data is well-known to be impossible absent further assumptions (Ben-David et al., 2010; Lipton et al., 2018).\nTwo vital questions that remain are: (i) the precise conditions under which we can estimate a classifier's target-domain accuracy; and (ii) which methods are most practically useful. To begin, the straightforward way to assess the performance of a model under distribution shift would be to collect labeled (target domain) examples and then to evaluate the model on that data. However, collecting fresh labeled data from the target distribution is prohibitively expensive and time-consuming, especially if the target distribution is non-stationary. Hence, instead of using labeled data, we aim to use unlabeled data from the target distribution, that is comparatively abundant, to predict model performance. Note that in this work, our focus is not to improve performance on the target but, rather, to estimate the accuracy on the target for a given classifier.\n[^0]: Work done in part while Saurabh Garg was interning at Google ${ }^{1}$ Code is available at [https://github.com/saurabhgarg1996/ATC_code](https://github.com/saurabhgarg1996/ATC_code).\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 2, "markdown": "![img-0.jpeg](img-0.jpeg)\nFigure 1: Illustration of our proposed method ATC. Left: using source domain validation data, we identify a threshold on a score (e.g. negative entropy) computed on model confidence such that fraction of examples above the threshold matches the validation set accuracy. ATC estimates accuracy on unlabeled target data as the fraction of examples with the score above the threshold. Interestingly, this threshold yields accurate estimates on a wide set of target distributions resulting from natural and synthetic shifts. Right: Efficacy of ATC over previously proposed approaches on our testbed with a post-hoc calibrated model. To obtain errors on the same scale, we rescale all errors with Average Confidence (AC) error. Lower estimation error is better. See Table 1 for exact numbers and comparison on various types of distribution shift. See Sec. 5 for details on our testbed.\nRecently, numerous methods have been proposed for this purpose (Deng & Zheng, 2021; Chen et al., 2021b; Jiang et al., 2021; Deng et al., 2021; Guillory et al., 2021). These methods either require calibration on the target domain to yield consistent estimates (Jiang et al., 2021; Guillory et al., 2021) or additional labeled data from several target domains to learn a linear regression function on a distributional distance that then predicts model performance (Deng et al., 2021; Deng & Zheng, 2021; Guillory et al., 2021). However, methods that require calibration on the target domain typically yield poor estimates since deep models trained and calibrated on source data are not, in general, calibrated on a (previously unseen) target domain (Ovadia et al., 2019). Besides, methods that leverage labeled data from target domains rely on the fact that unseen target domains exhibit strong linear correlation with seen target domains on the underlying distance measure and, hence, can be rendered ineffective when such target domains with labeled data are unavailable (in Sec. 5.1 we demonstrate such a failure on a real-world distribution shift problem). Therefore, throughout the paper, we assume access to labeled source data and only unlabeled data from target domain(s).\nIn this work, we first show that absent assumptions on the source classifier or the nature of the shift, no method of estimating accuracy will work generally (even in non-contrived settings). To estimate accuracy on target domain perfectly, we highlight that even given perfect knowledge of the labeled source distribution (i.e., $p_{s}(x, y)$ ) and unlabeled target distribution (i.e., $p_{t}(x)$ ), we need restrictions on the nature of the shift such that we can uniquely identify the target conditional $p_{t}(y \\mid x)$. Thus, in general, identifying the accuracy of the classifier is as hard as identifying the optimal predictor.\nSecond, motivated by the superiority of methods that use maximum softmax probability (or logit) of a model for Out-Of-Distribution (OOD) detection (Hendrycks & Gimpel, 2016; Hendrycks et al., 2019), we propose a simple method that leverages softmax probability to predict model performance. Our method, Average Thresholded Confidence (ATC), learns a threshold on a score (e.g., maximum confidence or negative entropy) of model confidence on validation source data and predicts target domain accuracy as the fraction of unlabeled target points that receive a score above that threshold. ATC selects a threshold on validation source data such that the fraction of source examples that receive the score above the threshold match the accuracy of those examples. Our primary contribution in ATC is the proposal of obtaining the threshold and observing its efficacy on (practical) accuracy estimation. Importantly, our work takes a step forward in positively answering the question raised in Deng & Zheng (2021); Deng et al. (2021) about a practical strategy to select a threshold that enables accuracy prediction with thresholded model confidence.\n", "images": [{"id": "img-0.jpeg", "top_left_x": 292, "top_left_y": 217, "bottom_right_x": 1405, "bottom_right_y": 649, "image_base64": ""}], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 3, "markdown": "", "images": [], "dimensions": {"dpi": 539192, "height": 944919, "width": 247256}}, {"index": 27, "markdown": "![img-8.jpeg](img-8.jpeg)\nFigure 9: Scatter plot of predicted accuracy versus (true) OOD accuracy for vision datasets except MNIST with a ResNet50 model. Results reported by aggregating MAE numbers over 4 different seeds.\n", "images": [{"id": "img-8.jpeg", "top_left_x": 290, "top_left_y": 226, "bottom_right_x": 1405, "bottom_right_y": 1834, "image_base64": ""}], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 28, "markdown": "| Dataset | Shift | IM | | AC | | DOC | | GDE | ATC-MC (Ours) | | ATC-NE (Ours) | | | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | | | | Pre T | Post T | Pre T | Post T | Pre T | Post T | Post T | Pre T | Post T | Pre T | Post T | | CIFAR10 | Natural | 6.60 | 5.74 | 9.88 | 6.89 | 7.25 | 6.07 | 4.77 | 3.21 | 3.02 | 2.99 | 2.85 | | | | (0.35) | (0.30) | (0.16) | (0.13) | (0.15) | (0.16) | (0.13) | (0.49) | (0.40) | (0.37) | (0.29) | | | Synthetic | 12.33 | 10.20 | 16.50 | 11.91 | 13.87 | 11.08 | 6.55 | 4.65 | 4.25 | 4.21 | 3.87 | | | | (0.51) | (0.48) | (0.26) | (0.17) | (0.18) | (0.17) | (0.35) | (0.55) | (0.55) | (0.55) | (0.75) | | CIFAR100 | Synthetic | 13.69 | 11.51 | 23.61 | 13.10 | 14.60 | 10.14 | 9.85 | 5.50 | 4.75 | 4.72 | 4.94 | | | | (0.55) | (0.41) | (1.16) | (0.80) | (0.77) | (0.64) | (0.57) | (0.70) | (0.73) | (0.74) | (0.74) | | ImageNet200 | Natural | 12.37 | 8.19 | 22.07 | 8.61 | 15.17 | 7.81 | 5.13 | 4.37 | 2.04 | 3.79 | 1.45 | | | | (0.25) | (0.33) | (0.08) | (0.25) | (0.11) | (0.29) | (0.08) | (0.39) | (0.24) | (0.30) | (0.27) | | | Synthetic | 19.86 | 12.94 | 32.44 | 13.35 | 25.02 | 12.38 | 5.41 | 5.93 | 3.09 | 5.00 | 2.68 | | | | (1.38) | (1.81) | (1.00) | (1.30) | (1.10) | (1.38) | (0.89) | (1.38) | (0.87) | (1.28) | (0.45) | | ImageNet | Natural | 7.77 | 6.50 | 18.13 | 6.02 | 8.13 | 5.76 | 6.23 | 3.88 | 2.17 | 2.06 | 0.80 | | | | (0.27) | (0.33) | (0.23) | (0.34) | (0.27) | (0.37) | (0.41) | (0.53) | (0.62) | (0.54) | (0.44) | | | Synthetic | 13.39 | 10.12 | 24.62 | 8.51 | 13.55 | 7.90 | 6.32 | 3.34 | 2.53 | 2.61 | 4.89 | | | | (0.53) | (0.63) | (0.64) | (0.71) | (0.61) | (0.72) | (0.33) | (0.53) | (0.36) | (0.33) | (0.83) | | FMoW-WILDS | Natural | 5.53 | 4.31 | 33.53 | 12.84 | 5.94 | 4.45 | 5.74 | 3.06 | 2.70 | 3.02 | 2.72 | | | | (0.33) | (0.63) | (0.13) | (12.06) | (0.36) | (0.77) | (0.55) | (0.36) | (0.54) | (0.35) | (0.44) | | RxRx1-WILDS | Natural | 5.80 | 5.72 | 7.90 | 4.84 | 5.98 | 5.98 | 6.03 | 4.66 | 4.56 | 4.41 | 4.47 | | | | (0.17) | (0.15) | (0.24) | (0.09) | (0.15) | (0.13) | (0.08) | (0.38) | (0.38) | (0.31) | (0.26) | | Amazon-WILDS | Natural | 2.40 | 2.29 | 8.01 | 2.38 | 2.40 | 2.28 | 17.87 | 1.65 | 1.62 | 1.60 | 1.59 | | | | (0.08) | (0.09) | (0.53) | (0.17) | (0.09) | (0.09) | (0.18) | (0.06) | (0.05) | (0.14) | (0.15) | | CivilCom.-WILDS | Natural | 12.64 | 10.80 | 16.76 | 11.03 | 13.31 | 10.99 | 16.65 | | 7.14 | | | | | | (0.52) | (0.48) | (0.53) | (0.49) | (0.52) | (0.49) | (0.25) | | (0.41) | | | | MNIST | Natural | 18.48 | 15.99 | 21.17 | 14.81 | 20.19 | 14.56 | 24.42 | 5.02 | 2.40 | 3.14 | 3.50 | | | | (0.45) | (1.53) | (0.24) | (3.89) | (0.23) | (3.47) | (0.41) | (0.44) | (1.83) | (0.49) | (0.17) | | ENTITY-13 | Same | 16.23 | 11.14 | 24.97 | 10.88 | 19.08 | 10.47 | 10.71 | 5.39 | 3.88 | 4.58 | 4.19 | | | | (0.77) | (0.65) | (0.70) | (0.77) | (0.65) | (0.72) | (0.74) | (0.92) | (0.61) | (0.85) | (0.16) | | | Novel | 28.53 | 22.02 | 38.33 | 21.64 | 32.43 | 21.22 | 20.61 | 13.58 | 10.28 | 12.25 | 6.63 | | | | (0.82) | (0.68) | (0.75) | (0.86) | (0.69) | (0.80) | (0.60) | (1.15) | (1.34) | (1.21) | (0.93) | | ENTITY-30 | Same | 18.59 | 14.46 | 28.82 | 14.30 | 21.63 | 13.46 | 12.92 | 9.12 | 7.75 | 8.15 | 7.64 | | | | (0.51) | (0.52) | (0.43) | (0.71) | (0.37) | (0.59) | (0.14) | (0.62) | (0.72) | (0.68) | (0.88) | | | Novel | 32.34 | 26.85 | 44.02 | 26.27 | 36.82 | 25.42 | 23.16 | 17.75 | 14.30 | 15.60 | 10.57 | | | | (0.60) | (0.58) | (0.56) | (0.79) | (0.47) | (0.68) | (0.12) | (0.76) | (0.85) | (0.86) | (0.86) | | NONLIVING-26 | Same | 18.66 | 17.17 | 26.39 | 16.14 | 19.86 | 15.58 | 16.63 | 10.87 | 10.24 | 10.07 | 10.26 | | | | (0.76) | (0.74) | (0.82) | (0.81) | (0.67) | (0.76) | (0.45) | (0.98) | (0.83) | (0.92) | (1.18) | | | Novel | 33.43 | 31.53 | 41.66 | 29.87 | 35.13 | 29.31 | 29.56 | 21.70 | 20.12 | 19.08 | 18.26 | | | | (0.67) | (0.65) | (0.67) | (0.71) | (0.54) | (0.64) | (0.21) | (0.86) | (0.75) | (0.82) | (1.12) | | LIVING-17 | Same | 12.63 | 11.05 | 18.32 | 10.46 | 14.43 | 10.14 | 9.87 | 4.57 | 3.95 | 3.81 | 4.21 | | | | (1.25) | (1.20) | (1.01) | (1.12) | (1.11) | (1.16) | (0.61) | (0.71) | (0.48) | (0.22) | (0.53) | | | Novel | 29.03 | 26.96 | 35.67 | 26.11 | 31.73 | 25.73 | 23.53 | 16.15 | 14.49 | 12.97 | 11.39 | | | | (1.44) | (1.38) | (1.09) | (1.27) | (1.19) | (1.35) | (0.52) | (1.36) | (1.46) | (1.52) | (1.72) |\nTable 3: Mean Absolute estimation Error (MAE) results for different datasets in our setup grouped by the nature of shift. 'Same' refers to same subpopulation shifts and 'Novel' refers novel subpopulation shifts. We include details about the target sets considered in each shift in Table 2. Post T denotes use of TS calibration on source. For language datasets, we use DistilBERT-base-uncased, for vision dataset we report results with DenseNet model with the exception of MNIST where we use FCN. Across all datasets, we observe that ATC achieves superior performance (lower MAE is better). For GDE post T and pre T estimates match since TS doesn't alter the argmax prediction. Results reported by aggregating MAE numbers over 4 different seeds. Values in parenthesis (i.e., $(\\cdot)$ ) denote standard deviation values.\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}, {"index": 29, "markdown": "| Dataset | Shift | IM | | AC | | DOC | | GDE | ATC-MC (Ours) | | ATC-NE (Ours) | | | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | | | | Pre T | Post T | Pre T | Post T | Pre T | Post T | Post T | Pre T | Post T | Pre T | Post T | | CIFAR10 | Natural | 7.14 | 6.20 | 10.25 | 7.06 | 7.68 | 6.35 | 5.74 | 4.02 | 3.85 | 3.76 | 3.38 | | | | (0.14) | (0.11) | (0.31) | (0.33) | (0.28) | (0.27) | (0.25) | (0.38) | (0.30) | (0.33) | (0.32) | | | Synthetic | 12.62 | 10.75 | 16.50 | 11.91 | 13.93 | 11.20 | 7.97 | 5.66 | 5.03 | 4.87 | 3.63 | | | | (0.76) | (0.71) | (0.28) | (0.24) | (0.29) | (0.28) | (0.13) | (0.64) | (0.71) | (0.71) | (0.62) | | CIFAR100 | Synthetic | 12.77 | 12.34 | 16.89 | 12.73 | 11.18 | 9.63 | 12.00 | 5.61 | 5.55 | 5.65 | 5.76 | | | | (0.43) | (0.68) | (0.20) | (2.59) | (0.35) | (1.25) | (0.48) | (0.51) | (0.55) | (0.35) | (0.27) | | ImageNet200 | Natural | 12.63 | 7.99 | 23.08 | 7.22 | 15.40 | 6.33 | 5.00 | 4.60 | 1.80 | 4.06 | 1.38 | | | | (0.59) | (0.47) | (0.31) | (0.22) | (0.42) | (0.24) | (0.36) | (0.63) | (0.17) | (0.69) | (0.29) | | | Synthetic | 20.17 | 11.74 | 33.69 | 9.51 | 25.49 | 8.61 | 4.19 | 5.37 | 2.78 | 4.53 | 3.58 | | | | (0.74) | (0.80) | (0.73) | (0.51) | (0.66) | (0.50) | (0.14) | (0.88) | (0.23) | (0.79) | (0.33) | | ImageNet | Natural | 8.09 | 6.42 | 21.66 | 5.91 | 8.53 | 5.21 | 5.90 | 3.93 | 1.89 | 2.45 | 0.73 | | | | (0.25) | (0.28) | (0.38) | (0.22) | (0.26) | (0.25) | (0.44) | (0.26) | (0.21) | (0.16) | (0.10) | | | Synthetic | 13.93 | 9.90 | 28.05 | 7.56 | 13.82 | 6.19 | 6.70 | 3.33 | 2.55 | 2.12 | 5.06 | | | | (0.14) | (0.23) | (0.39) | (0.13) | (0.31) | (0.07) | (0.52) | (0.25) | (0.25) | (0.31) | (0.27) | | FMoW-WILDS | Natural | 5.15 | 3.55 | 34.64 | 5.03 | 5.58 | 3.46 | 5.08 | 2.59 | 2.33 | 2.52 | 2.22 | | | | (0.19) | (0.41) | (0.22) | (0.29) | (0.17) | (0.37) | (0.46) | (0.32) | (0.28) | (0.25) | (0.30) | | RxRx1-WILDS | Natural | 6.17 | 6.11 | 21.05 | 5.21 | 6.54 | 6.27 | 6.82 | 5.30 | 5.20 | 5.19 | 5.63 | | | | (0.20) | (0.24) | (0.31) | (0.18) | (0.21) | (0.20) | (0.31) | (0.30) | (0.44) | (0.43) | (0.55) | | Entity-13 | Same | 18.32 | 14.38 | 27.79 | 13.56 | 20.50 | 13.22 | 16.09 | 9.35 | 7.50 | 7.80 | 6.94 | | | | (0.29) | (0.53) | (1.18) | (0.58) | (0.47) | (0.58) | (0.84) | (0.79) | (0.65) | (0.62) | (0.71) | | | Novel | 28.82 | 24.03 | 38.97 | 22.96 | 31.66 | 22.61 | 25.26 | 17.11 | 13.96 | 14.75 | 9.94 | | | | (0.30) | (0.55) | (1.32) | (0.59) | (0.54) | (0.58) | (1.08) | (0.93) | (0.64) | (0.78) | | | Entity-30 | Same | 16.91 | 14.61 | 26.84 | 14.37 | 18.60 | 13.11 | 13.74 | 8.54 | 7.94 | 7.77 | 8.04 | | | | (1.33) | (1.11) | (2.15) | (1.34) | (1.69) | (1.30) | (1.07) | (1.47) | (1.38) | (1.44) | (1.51) | | | Novel | 28.66 | 25.83 | 39.21 | 25.03 | 30.95 | 23.73 | 23.15 | 15.57 | 13.24 | 12.44 | 11.05 | | | | (1.16) | (0.88) | (2.03) | (1.11) | (1.64) | (1.11) | (0.51) | (1.44) | (1.15) | (1.26) | (1.13) | | NonLIVING-26 | Same | 17.43 | 15.95 | 27.70 | 15.40 | 18.06 | 14.58 | 16.99 | 10.79 | 10.13 | 10.05 | 10.29 | | | | (0.90) | (0.86) | (0.90) | (0.69) | (1.00) | (0.78) | (1.25) | (0.62) | (0.32) | (0.46) | (0.79) | | | Novel | 29.51 | 27.75 | 40.02 | 26.77 | 30.36 | 25.93 | 27.70 | 19.64 | 17.75 | 16.90 | 15.69 | | | | (0.86) | (0.82) | (0.76) | (0.82) | (0.95) | (0.80) | (1.42) | (0.68) | (0.53) | (0.60) | (0.83) | | LIVING-17 | Same | 14.28 | 12.21 | 23.46 | 11.16 | 15.22 | 10.78 | 10.49 | 4.92 | 4.23 | 4.19 | 4.73 | | | | (0.96) | (0.93) | (1.16) | (0.90) | (0.96) | (0.99) | (0.97) | (0.57) | (0.42) | (0.35) | (0.24) | | | Novel | 28.91 | 26.35 | 38.62 | 24.91 | 30.32 | 24.52 | 22.49 | 15.42 | 13.02 | 12.29 | 10.34 | | | | (0.66) | (0.73) | (1.01) | (0.61) | (0.59) | (0.74) | (0.85) | (0.59) | (0.53) | (0.73) | (0.62) |\nTable 4: Mean Absolute estimation Error (MAE) results for different datasets in our setup grouped by the nature of shift for ResNet model. 'Same' refers to same subpopulation shifts and 'Novel' refers novel subpopulation shifts. We include details about the target sets considered in each shift in Table 2. Post T denotes use of TS calibration on source. Across all datasets, we observe that ATC achieves superior performance (lower MAE is better). For GDE post T and pre T estimates match since TS doesn't alter the argmax prediction. Results reported by aggregating MAE numbers over 4 different seeds. Values in parenthesis (i.e., $(\\cdot)$ ) denote standard deviation values.\n", "images": [], "dimensions": {"dpi": 200, "height": 2200, "width": 1700}}], "model": "mistral-ocr-2503-completion", "usage_info": {"pages_processed": 29, "doc_size_bytes": null}} +examplesVersion: 1.0.2 +generatedTests: {} +releaseNotes: "## Python SDK Changes:\n* `mistral_azure.chat.stream()`: \n * `request.messages[].union(system).content.union(Array)[].union(thinking).thinking[].union(ToolReferenceChunk)` **Added**\n * `error.detail[]` **Changed**\n* `mistral_azure.chat.complete()`: \n * `request.messages[].union(system).content.union(Array)[].union(thinking).thinking[].union(ToolReferenceChunk)` **Added**\n * `error.detail[]` **Changed**\n* `mistral_azure.ocr.process()`: `error.detail[]` **Changed**\n" +generatedFiles: + - .gitattributes + - .vscode/settings.json + - docs/models/arguments.md + - docs/models/assistantmessage.md + - docs/models/assistantmessagecontent.md + - docs/models/assistantmessagerole.md + - docs/models/chatcompletionchoice.md + - docs/models/chatcompletionchoicefinishreason.md + - docs/models/chatcompletionrequest.md + - docs/models/chatcompletionrequestmessages.md + - docs/models/chatcompletionrequeststop.md + - docs/models/chatcompletionrequesttoolchoice.md + - docs/models/chatcompletionresponse.md + - docs/models/chatcompletionstreamrequest.md + - docs/models/chatcompletionstreamrequesttoolchoice.md + - docs/models/completionchunk.md + - docs/models/completionevent.md + - docs/models/completionresponsestreamchoice.md + - docs/models/content.md + - docs/models/contentchunk.md + - docs/models/deltamessage.md + - docs/models/document.md + - docs/models/documenturlchunk.md + - docs/models/documenturlchunktype.md + - docs/models/filechunk.md + - docs/models/finishreason.md + - docs/models/function.md + - docs/models/functioncall.md + - docs/models/functionname.md + - docs/models/httpvalidationerror.md + - docs/models/imageurl.md + - docs/models/imageurlchunk.md + - docs/models/imageurlchunkimageurl.md + - docs/models/imageurlchunktype.md + - docs/models/jsonschema.md + - docs/models/loc.md + - docs/models/messages.md + - docs/models/mistralpromptmode.md + - docs/models/ocrimageobject.md + - docs/models/ocrpagedimensions.md + - docs/models/ocrpageobject.md + - docs/models/ocrrequest.md + - docs/models/ocrresponse.md + - docs/models/ocrusageinfo.md + - docs/models/prediction.md + - docs/models/referencechunk.md + - docs/models/referencechunktype.md + - docs/models/responseformat.md + - docs/models/responseformats.md + - docs/models/role.md + - docs/models/security.md + - docs/models/stop.md + - docs/models/systemmessage.md + - docs/models/systemmessagecontent.md + - docs/models/systemmessagecontentchunks.md + - docs/models/textchunk.md + - docs/models/thinkchunk.md + - docs/models/thinkchunktype.md + - docs/models/thinking.md + - docs/models/tool.md + - docs/models/toolcall.md + - docs/models/toolchoice.md + - docs/models/toolchoiceenum.md + - docs/models/toolmessage.md + - docs/models/toolmessagecontent.md + - docs/models/toolmessagerole.md + - docs/models/tooltypes.md + - docs/models/type.md + - docs/models/usageinfo.md + - docs/models/usermessage.md + - docs/models/usermessagecontent.md + - docs/models/usermessagerole.md + - docs/models/utils/retryconfig.md + - docs/models/validationerror.md + - py.typed + - pylintrc + - scripts/prepare_readme.py + - scripts/publish.sh + - src/mistralai_azure/__init__.py + - src/mistralai_azure/_hooks/__init__.py + - src/mistralai_azure/_hooks/sdkhooks.py + - src/mistralai_azure/_hooks/types.py + - src/mistralai_azure/_version.py + - src/mistralai_azure/basesdk.py + - src/mistralai_azure/chat.py + - src/mistralai_azure/httpclient.py + - src/mistralai_azure/models/__init__.py + - src/mistralai_azure/models/assistantmessage.py + - src/mistralai_azure/models/chatcompletionchoice.py + - src/mistralai_azure/models/chatcompletionrequest.py + - src/mistralai_azure/models/chatcompletionresponse.py + - src/mistralai_azure/models/chatcompletionstreamrequest.py + - src/mistralai_azure/models/completionchunk.py + - src/mistralai_azure/models/completionevent.py + - src/mistralai_azure/models/completionresponsestreamchoice.py + - src/mistralai_azure/models/contentchunk.py + - src/mistralai_azure/models/deltamessage.py + - src/mistralai_azure/models/documenturlchunk.py + - src/mistralai_azure/models/filechunk.py + - src/mistralai_azure/models/function.py + - src/mistralai_azure/models/functioncall.py + - src/mistralai_azure/models/functionname.py + - src/mistralai_azure/models/httpvalidationerror.py + - src/mistralai_azure/models/imageurl.py + - src/mistralai_azure/models/imageurlchunk.py + - src/mistralai_azure/models/jsonschema.py + - src/mistralai_azure/models/mistralazureerror.py + - src/mistralai_azure/models/mistralpromptmode.py + - src/mistralai_azure/models/no_response_error.py + - src/mistralai_azure/models/ocrimageobject.py + - src/mistralai_azure/models/ocrpagedimensions.py + - src/mistralai_azure/models/ocrpageobject.py + - src/mistralai_azure/models/ocrrequest.py + - src/mistralai_azure/models/ocrresponse.py + - src/mistralai_azure/models/ocrusageinfo.py + - src/mistralai_azure/models/prediction.py + - src/mistralai_azure/models/referencechunk.py + - src/mistralai_azure/models/responseformat.py + - src/mistralai_azure/models/responseformats.py + - src/mistralai_azure/models/responsevalidationerror.py + - src/mistralai_azure/models/sdkerror.py + - src/mistralai_azure/models/security.py + - src/mistralai_azure/models/systemmessage.py + - src/mistralai_azure/models/systemmessagecontentchunks.py + - src/mistralai_azure/models/textchunk.py + - src/mistralai_azure/models/thinkchunk.py + - src/mistralai_azure/models/tool.py + - src/mistralai_azure/models/toolcall.py + - src/mistralai_azure/models/toolchoice.py + - src/mistralai_azure/models/toolchoiceenum.py + - src/mistralai_azure/models/toolmessage.py + - src/mistralai_azure/models/tooltypes.py + - src/mistralai_azure/models/usageinfo.py + - src/mistralai_azure/models/usermessage.py + - src/mistralai_azure/models/validationerror.py + - src/mistralai_azure/ocr.py + - src/mistralai_azure/py.typed + - src/mistralai_azure/sdkconfiguration.py + - src/mistralai_azure/types/__init__.py + - src/mistralai_azure/types/basemodel.py + - src/mistralai_azure/utils/__init__.py + - src/mistralai_azure/utils/annotations.py + - src/mistralai_azure/utils/datetimes.py + - src/mistralai_azure/utils/enums.py + - src/mistralai_azure/utils/eventstreaming.py + - src/mistralai_azure/utils/forms.py + - src/mistralai_azure/utils/headers.py + - src/mistralai_azure/utils/logger.py + - src/mistralai_azure/utils/metadata.py + - src/mistralai_azure/utils/queryparams.py + - src/mistralai_azure/utils/requestbodies.py + - src/mistralai_azure/utils/retries.py + - src/mistralai_azure/utils/security.py + - src/mistralai_azure/utils/serializers.py + - src/mistralai_azure/utils/unmarshal_json_response.py + - src/mistralai_azure/utils/url.py + - src/mistralai_azure/utils/values.py diff --git a/packages/azure/.speakeasy/gen.yaml b/packages/azure/.speakeasy/gen.yaml new file mode 100644 index 00000000..58016b88 --- /dev/null +++ b/packages/azure/.speakeasy/gen.yaml @@ -0,0 +1,88 @@ +configVersion: 2.0.0 +generation: + sdkClassName: MistralAzure + maintainOpenAPIOrder: true + usageSnippets: + optionalPropertyRendering: withExample + sdkInitStyle: constructor + useClassNamesForArrayFields: true + fixes: + nameResolutionDec2023: true + nameResolutionFeb2025: true + parameterOrderingFeb2024: true + requestResponseComponentNamesFeb2024: true + securityFeb2025: true + sharedErrorComponentsApr2025: true + sharedNestedComponentsJan2026: true + nameOverrideFeb2026: true + methodSignaturesApr2024: true + auth: + oAuth2ClientCredentialsEnabled: true + oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + schemas: + allOfMergeStrategy: shallowMerge + requestBodyFieldName: "" + versioningStrategy: automatic + persistentEdits: {} + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false +python: + version: 2.0.0 + additionalDependencies: + dev: + pytest: ^8.2.2 + pytest-asyncio: ^0.23.7 + main: {} + allowedRedefinedBuiltins: + - id + - object + - input + - dir + asyncMode: both + authors: + - Mistral + baseErrorName: MistralAzureError + clientServerStatusCodesAsErrors: true + constFieldCasing: normal + defaultErrorName: SDKError + description: Python Client SDK for the Mistral AI API in Azure. + enableCustomCodeRegions: false + enumFormat: union + fixFlags: + asyncPaginationSep2025: true + conflictResistantModelImportsFeb2026: true + responseRequiredSep2024: true + flatAdditionalProperties: true + flattenGlobalSecurity: true + flattenRequests: true + flatteningOrder: parameters-first + forwardCompatibleEnumsByDefault: true + forwardCompatibleUnionsByDefault: tagged-only + imports: + option: openapi + paths: + callbacks: "" + errors: errors + operations: "" + shared: "" + webhooks: "" + inferUnionDiscriminators: true + inputModelSuffix: input + license: "" + maxMethodParams: 999 + methodArguments: infer-optional-args + moduleName: mistralai.azure.client + multipartArrayFormat: standard + outputModelSuffix: output + packageManager: uv + packageName: mistralai-azure + preApplyUnionDiscriminators: true + pytestFilterWarnings: [] + pytestTimeout: 0 + responseFormat: flat + sseFlatResponse: false + templateVersion: v2 + useAsyncHooks: false diff --git a/packages/mistralai_azure/CONTRIBUTING.md b/packages/azure/CONTRIBUTING.md similarity index 100% rename from packages/mistralai_azure/CONTRIBUTING.md rename to packages/azure/CONTRIBUTING.md diff --git a/packages/azure/README.md b/packages/azure/README.md new file mode 100644 index 00000000..f1f865f6 --- /dev/null +++ b/packages/azure/README.md @@ -0,0 +1,464 @@ +# Mistral on Azure Python Client + +## SDK Installation + +PIP +```bash +pip install mistralai +``` + +UV +```bash +uv add mistralai +``` + +**Prerequisites** + +Before you begin, ensure you have `AZURE_ENDPOINT` and an `AZURE_API_KEY`. To obtain these, you will need to deploy Mistral on Azure AI. +See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/). + + +## SDK Example Usage + +### Create Chat Completions + +This example shows how to create chat completions. + +The SDK automatically injects the `api-version` query parameter. + +```python +# Synchronous Example +from mistralai.azure.client import MistralAzure +import os + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +# The SDK automatically injects api-version as a query parameter +s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, +) + +res = s.chat.complete( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model=AZURE_MODEL, +) + +if res is not None: + # handle response + print(res.choices[0].message.content) +``` + +
+ +The same SDK client can also be used to make asynchronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +import os +from mistralai.azure.client import MistralAzure + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +async def main(): + # The SDK automatically injects api-version as a query parameter + s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, + ) + res = await s.chat.complete_async( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model=AZURE_MODEL, + ) + if res is not None: + # handle response + print(res.choices[0].message.content) + +asyncio.run(main()) +``` + + + +## Available Resources and Operations + +### [chat](docs/sdks/chat/README.md) + +* [stream](docs/sdks/chat/README.md#stream) - Stream chat completion +* [complete](docs/sdks/chat/README.md#complete) - Chat Completion + + + +## Server-sent event streaming + +[Server-sent events][mdn-sse] are used to stream content from certain +operations. These operations will expose the stream as [Generator][generator] that +can be consumed using a simple `for` loop. The loop will +terminate when the server no longer has any events to send and closes the +underlying connection. + +```python +from mistralai.azure.client import MistralAzure +import os + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +# The SDK automatically injects api-version as a query parameter +s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model=AZURE_MODEL, +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + +[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events +[generator]: https://wiki.python.org/moin/Generators + + + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: +```python +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.utils import BackoffStrategy, RetryConfig +import os + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +# The SDK automatically injects api-version as a query parameter +s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model=AZURE_MODEL, + retries=RetryConfig( + "backoff", + BackoffStrategy(1, 50, 1.1, 100), + False + ), +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: +```python +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.utils import BackoffStrategy, RetryConfig +import os + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ["AZURE_API_VERSION"] + +# The SDK automatically injects api-version as a query parameter +s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, + retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model=AZURE_MODEL, +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + + + +## Error Handling + +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. + +| Error Object | Status Code | Content Type | +| -------------------------- | ----------- | ---------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4xx-5xx | */* | + +### Example + +```python +from mistralai.azure.client import MistralAzure +from mistralai.azure.client import models +import os + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +# The SDK automatically injects api-version as a query parameter +s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, +) + +res = None +try: + res = s.chat.complete( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model=AZURE_MODEL, + ) + +except models.HTTPValidationError as e: + # handle exception + raise(e) +except models.SDKError as e: + # handle exception + raise(e) + +if res is not None: + # handle response + pass + +``` + + + +## Server Selection + +### Override Server URL Per-Client + +For Azure, you must provide your Azure AI Foundry endpoint via `server_url`. The SDK automatically injects the `api-version` query parameter: +```python +from mistralai.azure.client import MistralAzure +import os + +s = MistralAzure( + api_key=os.environ["AZURE_API_KEY"], + server_url=os.environ["AZURE_ENDPOINT"], + api_version=os.environ.get("AZURE_API_VERSION", "2024-05-01-preview"), +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model=os.environ["AZURE_MODEL"], +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + + + +## Custom HTTP Client + +The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. +Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocols ensuring that the client has the necessary methods to make API calls. +This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. + +For example, you could specify a header for every request that this SDK makes as follows: +```python +from mistralai.azure.client import MistralAzure +import httpx +import os + +http_client = httpx.Client(headers={"x-custom-header": "someValue"}) +s = MistralAzure( + api_key=os.environ["AZURE_API_KEY"], + server_url=os.environ["AZURE_ENDPOINT"], + api_version=os.environ.get("AZURE_API_VERSION", "2024-05-01-preview"), + client=http_client, +) +``` + +or you could wrap the client with your own custom logic: +```python +from typing import Any, Optional, Union +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.httpclient import AsyncHttpClient +import httpx + +class CustomClient(AsyncHttpClient): + client: AsyncHttpClient + + def __init__(self, client: AsyncHttpClient): + self.client = client + + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + request.headers["Client-Level-Header"] = "added by client" + + return await self.client.send( + request, stream=stream, auth=auth, follow_redirects=follow_redirects + ) + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + return self.client.build_request( + method, + url, + content=content, + data=data, + files=files, + json=json, + params=params, + headers=headers, + cookies=cookies, + timeout=timeout, + extensions=extensions, + ) + +s = MistralAzure( + api_key="", + server_url="", + async_client=CustomClient(httpx.AsyncClient()), +) +``` + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| --------- | ---- | ----------- | +| `api_key` | http | HTTP Bearer | + +To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. You must also provide `server_url` pointing to your Azure AI Foundry endpoint. The SDK automatically injects the `api-version` query parameter: +```python +from mistralai.azure.client import MistralAzure +import os + +s = MistralAzure( + api_key=os.environ["AZURE_API_KEY"], + server_url=os.environ["AZURE_ENDPOINT"], + api_version=os.environ.get("AZURE_API_VERSION", "2024-05-01-preview"), +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model=os.environ["AZURE_MODEL"], +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + + + + +# Development + +## Contributions + +While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. +We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. diff --git a/packages/azure/RELEASES.md b/packages/azure/RELEASES.md new file mode 100644 index 00000000..6844bc64 --- /dev/null +++ b/packages/azure/RELEASES.md @@ -0,0 +1,41 @@ + + +## 2026-01-12 15:30:32 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.606.10 (2.687.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.7.0] packages/mistralai_azure +### Releases +- [PyPI v1.7.0] https://pypi.org/project/mistralai_azure/1.7.0 - packages/mistralai_azure + +## 2026-02-25 17:39:51 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0b1] packages/azure +### Releases +- [PyPI v2.0.0b1] https://pypi.org/project/mistralai-azure/2.0.0b1 - packages/azure + +## 2026-03-02 13:15:00 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0rc1] packages/azure +### Releases +- [PyPI v2.0.0rc1] https://pypi.org/project/mistralai-azure/2.0.0rc1 - packages/azure + +## 2026-03-09 19:35:33 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0] packages/azure +### Releases +- [PyPI v2.0.0] https://pypi.org/project/mistralai-azure/2.0.0 - packages/azure \ No newline at end of file diff --git a/packages/azure/USAGE.md b/packages/azure/USAGE.md new file mode 100644 index 00000000..f2641e8f --- /dev/null +++ b/packages/azure/USAGE.md @@ -0,0 +1,70 @@ + +### Create Chat Completions + +This example shows how to create chat completions. + +The SDK automatically injects the `api-version` query parameter. + +```python +# Synchronous Example +from mistralai.azure.client import MistralAzure +import os + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +# The SDK automatically injects api-version as a query parameter +s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, +) + +res = s.chat.complete(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, +], model=AZURE_MODEL) + +if res is not None: + # handle response + print(res.choices[0].message.content) +``` + +
+ +The same SDK client can also be used to make asynchronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +import os +from mistralai.azure.client import MistralAzure + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +async def main(): + # The SDK automatically injects api-version as a query parameter + s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, + ) + res = await s.chat.complete_async(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], model=AZURE_MODEL) + if res is not None: + # handle response + print(res.choices[0].message.content) + +asyncio.run(main()) +``` + diff --git a/packages/mistralai_azure/docs/models/httpvalidationerror.md b/packages/azure/docs/errors/httpvalidationerror.md similarity index 100% rename from packages/mistralai_azure/docs/models/httpvalidationerror.md rename to packages/azure/docs/errors/httpvalidationerror.md diff --git a/packages/mistralai_azure/docs/models/arguments.md b/packages/azure/docs/models/arguments.md similarity index 100% rename from packages/mistralai_azure/docs/models/arguments.md rename to packages/azure/docs/models/arguments.md diff --git a/packages/azure/docs/models/assistantmessage.md b/packages/azure/docs/models/assistantmessage.md new file mode 100644 index 00000000..9ef63837 --- /dev/null +++ b/packages/azure/docs/models/assistantmessage.md @@ -0,0 +1,11 @@ +# AssistantMessage + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `role` | *Optional[Literal["assistant"]]* | :heavy_minus_sign: | N/A | +| `content` | [OptionalNullable[models.AssistantMessageContent]](../models/assistantmessagecontent.md) | :heavy_minus_sign: | N/A | +| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | +| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/assistantmessagecontent.md b/packages/azure/docs/models/assistantmessagecontent.md similarity index 100% rename from packages/mistralai_azure/docs/models/assistantmessagecontent.md rename to packages/azure/docs/models/assistantmessagecontent.md diff --git a/packages/azure/docs/models/builtinconnectors.md b/packages/azure/docs/models/builtinconnectors.md new file mode 100644 index 00000000..f96f5044 --- /dev/null +++ b/packages/azure/docs/models/builtinconnectors.md @@ -0,0 +1,12 @@ +# BuiltInConnectors + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `WEB_SEARCH` | web_search | +| `WEB_SEARCH_PREMIUM` | web_search_premium | +| `CODE_INTERPRETER` | code_interpreter | +| `IMAGE_GENERATION` | image_generation | +| `DOCUMENT_LIBRARY` | document_library | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/chatcompletionchoice.md b/packages/azure/docs/models/chatcompletionchoice.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionchoice.md rename to packages/azure/docs/models/chatcompletionchoice.md diff --git a/packages/mistralai_azure/docs/models/chatcompletionchoicefinishreason.md b/packages/azure/docs/models/chatcompletionchoicefinishreason.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionchoicefinishreason.md rename to packages/azure/docs/models/chatcompletionchoicefinishreason.md diff --git a/packages/azure/docs/models/chatcompletionrequest.md b/packages/azure/docs/models/chatcompletionrequest.md new file mode 100644 index 00000000..f8715cd0 --- /dev/null +++ b/packages/azure/docs/models/chatcompletionrequest.md @@ -0,0 +1,26 @@ +# ChatCompletionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *Optional[str]* | :heavy_minus_sign: | The ID of the model to use for this request. | azureai | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [Optional[models.ChatCompletionRequestStop]](../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.ChatCompletionRequestMessage](../models/chatcompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | +| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file diff --git a/packages/azure/docs/models/chatcompletionrequestmessage.md b/packages/azure/docs/models/chatcompletionrequestmessage.md new file mode 100644 index 00000000..91e9e062 --- /dev/null +++ b/packages/azure/docs/models/chatcompletionrequestmessage.md @@ -0,0 +1,29 @@ +# ChatCompletionRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/packages/mistralai_gcp/docs/models/chatcompletionrequeststop.md b/packages/azure/docs/models/chatcompletionrequeststop.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionrequeststop.md rename to packages/azure/docs/models/chatcompletionrequeststop.md diff --git a/packages/azure/docs/models/chatcompletionrequesttoolchoice.md b/packages/azure/docs/models/chatcompletionrequesttoolchoice.md new file mode 100644 index 00000000..dc82a8ef --- /dev/null +++ b/packages/azure/docs/models/chatcompletionrequesttoolchoice.md @@ -0,0 +1,19 @@ +# ChatCompletionRequestToolChoice + +Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + + +## Supported Types + +### `models.ToolChoice` + +```python +value: models.ToolChoice = /* values here */ +``` + +### `models.ToolChoiceEnum` + +```python +value: models.ToolChoiceEnum = /* values here */ +``` + diff --git a/packages/mistralai_azure/docs/models/chatcompletionresponse.md b/packages/azure/docs/models/chatcompletionresponse.md similarity index 100% rename from packages/mistralai_azure/docs/models/chatcompletionresponse.md rename to packages/azure/docs/models/chatcompletionresponse.md diff --git a/packages/azure/docs/models/chatcompletionstreamrequest.md b/packages/azure/docs/models/chatcompletionstreamrequest.md new file mode 100644 index 00000000..cc82a8c7 --- /dev/null +++ b/packages/azure/docs/models/chatcompletionstreamrequest.md @@ -0,0 +1,26 @@ +# ChatCompletionStreamRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *Optional[str]* | :heavy_minus_sign: | The ID of the model to use for this request. | azureai | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [Optional[models.ChatCompletionStreamRequestStop]](../models/chatcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.ChatCompletionStreamRequestMessage](../models/chatcompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | +| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file diff --git a/packages/azure/docs/models/chatcompletionstreamrequestmessage.md b/packages/azure/docs/models/chatcompletionstreamrequestmessage.md new file mode 100644 index 00000000..2e4e93ac --- /dev/null +++ b/packages/azure/docs/models/chatcompletionstreamrequestmessage.md @@ -0,0 +1,29 @@ +# ChatCompletionStreamRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/packages/azure/docs/models/chatcompletionstreamrequeststop.md b/packages/azure/docs/models/chatcompletionstreamrequeststop.md new file mode 100644 index 00000000..a48460a9 --- /dev/null +++ b/packages/azure/docs/models/chatcompletionstreamrequeststop.md @@ -0,0 +1,19 @@ +# ChatCompletionStreamRequestStop + +Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/packages/azure/docs/models/chatcompletionstreamrequesttoolchoice.md b/packages/azure/docs/models/chatcompletionstreamrequesttoolchoice.md new file mode 100644 index 00000000..43f3ca38 --- /dev/null +++ b/packages/azure/docs/models/chatcompletionstreamrequesttoolchoice.md @@ -0,0 +1,19 @@ +# ChatCompletionStreamRequestToolChoice + +Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + + +## Supported Types + +### `models.ToolChoice` + +```python +value: models.ToolChoice = /* values here */ +``` + +### `models.ToolChoiceEnum` + +```python +value: models.ToolChoiceEnum = /* values here */ +``` + diff --git a/packages/mistralai_azure/docs/models/completionchunk.md b/packages/azure/docs/models/completionchunk.md similarity index 100% rename from packages/mistralai_azure/docs/models/completionchunk.md rename to packages/azure/docs/models/completionchunk.md diff --git a/packages/mistralai_azure/docs/models/completionevent.md b/packages/azure/docs/models/completionevent.md similarity index 100% rename from packages/mistralai_azure/docs/models/completionevent.md rename to packages/azure/docs/models/completionevent.md diff --git a/packages/azure/docs/models/completionresponsestreamchoice.md b/packages/azure/docs/models/completionresponsestreamchoice.md new file mode 100644 index 00000000..1532c25b --- /dev/null +++ b/packages/azure/docs/models/completionresponsestreamchoice.md @@ -0,0 +1,10 @@ +# CompletionResponseStreamChoice + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `index` | *int* | :heavy_check_mark: | N/A | +| `delta` | [models.DeltaMessage](../models/deltamessage.md) | :heavy_check_mark: | N/A | +| `finish_reason` | [Nullable[models.CompletionResponseStreamChoiceFinishReason]](../models/completionresponsestreamchoicefinishreason.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md b/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md new file mode 100644 index 00000000..0fece473 --- /dev/null +++ b/packages/azure/docs/models/completionresponsestreamchoicefinishreason.md @@ -0,0 +1,11 @@ +# CompletionResponseStreamChoiceFinishReason + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `STOP` | stop | +| `LENGTH` | length | +| `ERROR` | error | +| `TOOL_CALLS` | tool_calls | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/contentchunk.md b/packages/azure/docs/models/contentchunk.md similarity index 100% rename from packages/mistralai_azure/docs/models/contentchunk.md rename to packages/azure/docs/models/contentchunk.md diff --git a/packages/azure/docs/models/context.md b/packages/azure/docs/models/context.md new file mode 100644 index 00000000..107f1bd4 --- /dev/null +++ b/packages/azure/docs/models/context.md @@ -0,0 +1,7 @@ +# Context + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/packages/azure/docs/models/deltamessage.md b/packages/azure/docs/models/deltamessage.md new file mode 100644 index 00000000..e0ee575f --- /dev/null +++ b/packages/azure/docs/models/deltamessage.md @@ -0,0 +1,10 @@ +# DeltaMessage + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `content` | [OptionalNullable[models.DeltaMessageContent]](../models/deltamessagecontent.md) | :heavy_minus_sign: | N/A | +| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/deltamessagecontent.md b/packages/azure/docs/models/deltamessagecontent.md new file mode 100644 index 00000000..8142772d --- /dev/null +++ b/packages/azure/docs/models/deltamessagecontent.md @@ -0,0 +1,17 @@ +# DeltaMessageContent + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[models.ContentChunk]` + +```python +value: List[models.ContentChunk] = /* values here */ +``` + diff --git a/packages/mistralai_azure/docs/models/document.md b/packages/azure/docs/models/document.md similarity index 100% rename from packages/mistralai_azure/docs/models/document.md rename to packages/azure/docs/models/document.md diff --git a/packages/azure/docs/models/documenturlchunk.md b/packages/azure/docs/models/documenturlchunk.md new file mode 100644 index 00000000..9dbfbe50 --- /dev/null +++ b/packages/azure/docs/models/documenturlchunk.md @@ -0,0 +1,10 @@ +# DocumentURLChunk + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `type` | *Optional[Literal["document_url"]]* | :heavy_minus_sign: | N/A | +| `document_url` | *str* | :heavy_check_mark: | N/A | +| `document_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The filename of the document | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/filechunk.md b/packages/azure/docs/models/filechunk.md similarity index 100% rename from packages/mistralai_azure/docs/models/filechunk.md rename to packages/azure/docs/models/filechunk.md diff --git a/packages/azure/docs/models/format_.md b/packages/azure/docs/models/format_.md new file mode 100644 index 00000000..97d286a4 --- /dev/null +++ b/packages/azure/docs/models/format_.md @@ -0,0 +1,11 @@ +# Format + +Format of the table + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `MARKDOWN` | markdown | +| `HTML` | html | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/function.md b/packages/azure/docs/models/function.md similarity index 100% rename from packages/mistralai_azure/docs/models/function.md rename to packages/azure/docs/models/function.md diff --git a/packages/mistralai_azure/docs/models/functioncall.md b/packages/azure/docs/models/functioncall.md similarity index 100% rename from packages/mistralai_azure/docs/models/functioncall.md rename to packages/azure/docs/models/functioncall.md diff --git a/packages/mistralai_azure/docs/models/functionname.md b/packages/azure/docs/models/functionname.md similarity index 100% rename from packages/mistralai_azure/docs/models/functionname.md rename to packages/azure/docs/models/functionname.md diff --git a/packages/azure/docs/models/imagedetail.md b/packages/azure/docs/models/imagedetail.md new file mode 100644 index 00000000..1e5ba3fd --- /dev/null +++ b/packages/azure/docs/models/imagedetail.md @@ -0,0 +1,10 @@ +# ImageDetail + + +## Values + +| Name | Value | +| ------ | ------ | +| `LOW` | low | +| `AUTO` | auto | +| `HIGH` | high | \ No newline at end of file diff --git a/packages/azure/docs/models/imageurl.md b/packages/azure/docs/models/imageurl.md new file mode 100644 index 00000000..6358e0ac --- /dev/null +++ b/packages/azure/docs/models/imageurl.md @@ -0,0 +1,9 @@ +# ImageURL + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `url` | *str* | :heavy_check_mark: | N/A | +| `detail` | [OptionalNullable[models.ImageDetail]](../models/imagedetail.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/imageurlchunk.md b/packages/azure/docs/models/imageurlchunk.md new file mode 100644 index 00000000..db0c53d2 --- /dev/null +++ b/packages/azure/docs/models/imageurlchunk.md @@ -0,0 +1,11 @@ +# ImageURLChunk + +{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `type` | *Optional[Literal["image_url"]]* | :heavy_minus_sign: | N/A | +| `image_url` | [models.ImageURLUnion](../models/imageurlunion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/imageurlunion.md b/packages/azure/docs/models/imageurlunion.md new file mode 100644 index 00000000..db97130f --- /dev/null +++ b/packages/azure/docs/models/imageurlunion.md @@ -0,0 +1,17 @@ +# ImageURLUnion + + +## Supported Types + +### `models.ImageURL` + +```python +value: models.ImageURL = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/packages/mistralai_azure/docs/models/jsonschema.md b/packages/azure/docs/models/jsonschema.md similarity index 100% rename from packages/mistralai_azure/docs/models/jsonschema.md rename to packages/azure/docs/models/jsonschema.md diff --git a/packages/mistralai_azure/docs/models/loc.md b/packages/azure/docs/models/loc.md similarity index 100% rename from packages/mistralai_azure/docs/models/loc.md rename to packages/azure/docs/models/loc.md diff --git a/packages/azure/docs/models/mistralpromptmode.md b/packages/azure/docs/models/mistralpromptmode.md new file mode 100644 index 00000000..c3409d03 --- /dev/null +++ b/packages/azure/docs/models/mistralpromptmode.md @@ -0,0 +1,12 @@ +# MistralPromptMode + +Available options to the prompt_mode argument on the chat completion endpoint. +Values represent high-level intent. Assignment to actual SPs is handled internally. +System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REASONING` | reasoning | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/ocrimageobject.md b/packages/azure/docs/models/ocrimageobject.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrimageobject.md rename to packages/azure/docs/models/ocrimageobject.md diff --git a/packages/mistralai_azure/docs/models/ocrpagedimensions.md b/packages/azure/docs/models/ocrpagedimensions.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrpagedimensions.md rename to packages/azure/docs/models/ocrpagedimensions.md diff --git a/packages/azure/docs/models/ocrpageobject.md b/packages/azure/docs/models/ocrpageobject.md new file mode 100644 index 00000000..02473d44 --- /dev/null +++ b/packages/azure/docs/models/ocrpageobject.md @@ -0,0 +1,15 @@ +# OCRPageObject + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `index` | *int* | :heavy_check_mark: | The page index in a pdf document starting from 0 | +| `markdown` | *str* | :heavy_check_mark: | The markdown string response of the page | +| `images` | List[[models.OCRImageObject](../models/ocrimageobject.md)] | :heavy_check_mark: | List of all extracted images in the page | +| `tables` | List[[models.OCRTableObject](../models/ocrtableobject.md)] | :heavy_minus_sign: | List of all extracted tables in the page | +| `hyperlinks` | List[*str*] | :heavy_minus_sign: | List of all hyperlinks in the page | +| `header` | *OptionalNullable[str]* | :heavy_minus_sign: | Header of the page | +| `footer` | *OptionalNullable[str]* | :heavy_minus_sign: | Footer of the page | +| `dimensions` | [Nullable[models.OCRPageDimensions]](../models/ocrpagedimensions.md) | :heavy_check_mark: | The dimensions of the PDF Page's screenshot image | \ No newline at end of file diff --git a/packages/azure/docs/models/ocrrequest.md b/packages/azure/docs/models/ocrrequest.md new file mode 100644 index 00000000..2d26c19f --- /dev/null +++ b/packages/azure/docs/models/ocrrequest.md @@ -0,0 +1,20 @@ +# OCRRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *Nullable[str]* | :heavy_check_mark: | N/A | | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `document` | [models.Document](../models/document.md) | :heavy_check_mark: | Document to run OCR on | | +| `pages` | List[*int*] | :heavy_minus_sign: | Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 | | +| `include_image_base64` | *OptionalNullable[bool]* | :heavy_minus_sign: | Include image URLs in response | | +| `image_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | Max images to extract | | +| `image_min_size` | *OptionalNullable[int]* | :heavy_minus_sign: | Minimum height and width of image to extract | | +| `bbox_annotation_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `document_annotation_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `document_annotation_prompt` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided. | | +| `table_format` | [OptionalNullable[models.TableFormat]](../models/tableformat.md) | :heavy_minus_sign: | N/A | | +| `extract_header` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `extract_footer` | *Optional[bool]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/ocrresponse.md b/packages/azure/docs/models/ocrresponse.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrresponse.md rename to packages/azure/docs/models/ocrresponse.md diff --git a/packages/azure/docs/models/ocrtableobject.md b/packages/azure/docs/models/ocrtableobject.md new file mode 100644 index 00000000..4e27697c --- /dev/null +++ b/packages/azure/docs/models/ocrtableobject.md @@ -0,0 +1,10 @@ +# OCRTableObject + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Table ID for extracted table in a page | +| `content` | *str* | :heavy_check_mark: | Content of the table in the given format | +| `format_` | [models.Format](../models/format_.md) | :heavy_check_mark: | Format of the table | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/ocrusageinfo.md b/packages/azure/docs/models/ocrusageinfo.md similarity index 100% rename from packages/mistralai_azure/docs/models/ocrusageinfo.md rename to packages/azure/docs/models/ocrusageinfo.md diff --git a/packages/azure/docs/models/prediction.md b/packages/azure/docs/models/prediction.md new file mode 100644 index 00000000..fae3c1ca --- /dev/null +++ b/packages/azure/docs/models/prediction.md @@ -0,0 +1,11 @@ +# Prediction + +Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `type` | *Optional[Literal["content"]]* | :heavy_minus_sign: | N/A | +| `content` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/referencechunk.md b/packages/azure/docs/models/referencechunk.md new file mode 100644 index 00000000..d847e248 --- /dev/null +++ b/packages/azure/docs/models/referencechunk.md @@ -0,0 +1,9 @@ +# ReferenceChunk + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `type` | *Optional[Literal["reference"]]* | :heavy_minus_sign: | N/A | +| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/responseformat.md b/packages/azure/docs/models/responseformat.md new file mode 100644 index 00000000..5cab22f2 --- /dev/null +++ b/packages/azure/docs/models/responseformat.md @@ -0,0 +1,11 @@ +# ResponseFormat + +Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | [Optional[models.ResponseFormats]](../models/responseformats.md) | :heavy_minus_sign: | N/A | +| `json_schema` | [OptionalNullable[models.JSONSchema]](../models/jsonschema.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/responseformats.md b/packages/azure/docs/models/responseformats.md new file mode 100644 index 00000000..2f5f1e55 --- /dev/null +++ b/packages/azure/docs/models/responseformats.md @@ -0,0 +1,10 @@ +# ResponseFormats + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `TEXT` | text | +| `JSON_OBJECT` | json_object | +| `JSON_SCHEMA` | json_schema | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/security.md b/packages/azure/docs/models/security.md similarity index 100% rename from packages/mistralai_azure/docs/models/security.md rename to packages/azure/docs/models/security.md diff --git a/packages/azure/docs/models/systemmessage.md b/packages/azure/docs/models/systemmessage.md new file mode 100644 index 00000000..10bda10f --- /dev/null +++ b/packages/azure/docs/models/systemmessage.md @@ -0,0 +1,9 @@ +# SystemMessage + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `role` | *Literal["system"]* | :heavy_check_mark: | N/A | +| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/systemmessagecontent.md b/packages/azure/docs/models/systemmessagecontent.md new file mode 100644 index 00000000..0c87baf3 --- /dev/null +++ b/packages/azure/docs/models/systemmessagecontent.md @@ -0,0 +1,17 @@ +# SystemMessageContent + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[models.SystemMessageContentChunks]` + +```python +value: List[models.SystemMessageContentChunks] = /* values here */ +``` + diff --git a/packages/azure/docs/models/systemmessagecontentchunks.md b/packages/azure/docs/models/systemmessagecontentchunks.md new file mode 100644 index 00000000..40030c17 --- /dev/null +++ b/packages/azure/docs/models/systemmessagecontentchunks.md @@ -0,0 +1,17 @@ +# SystemMessageContentChunks + + +## Supported Types + +### `models.TextChunk` + +```python +value: models.TextChunk = /* values here */ +``` + +### `models.ThinkChunk` + +```python +value: models.ThinkChunk = /* values here */ +``` + diff --git a/packages/azure/docs/models/tableformat.md b/packages/azure/docs/models/tableformat.md new file mode 100644 index 00000000..54f029b8 --- /dev/null +++ b/packages/azure/docs/models/tableformat.md @@ -0,0 +1,9 @@ +# TableFormat + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `MARKDOWN` | markdown | +| `HTML` | html | \ No newline at end of file diff --git a/packages/azure/docs/models/textchunk.md b/packages/azure/docs/models/textchunk.md new file mode 100644 index 00000000..b266619d --- /dev/null +++ b/packages/azure/docs/models/textchunk.md @@ -0,0 +1,9 @@ +# TextChunk + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *Literal["text"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/models/thinkchunk.md b/packages/azure/docs/models/thinkchunk.md new file mode 100644 index 00000000..b07f598e --- /dev/null +++ b/packages/azure/docs/models/thinkchunk.md @@ -0,0 +1,10 @@ +# ThinkChunk + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `type` | *Literal["thinking"]* | :heavy_check_mark: | N/A | +| `thinking` | List[[models.Thinking](../models/thinking.md)] | :heavy_check_mark: | N/A | +| `closed` | *Optional[bool]* | :heavy_minus_sign: | Whether the thinking chunk is closed or not. Currently only used for prefixing. | \ No newline at end of file diff --git a/packages/azure/docs/models/thinking.md b/packages/azure/docs/models/thinking.md new file mode 100644 index 00000000..d9e51d7d --- /dev/null +++ b/packages/azure/docs/models/thinking.md @@ -0,0 +1,23 @@ +# Thinking + + +## Supported Types + +### `models.TextChunk` + +```python +value: models.TextChunk = /* values here */ +``` + +### `models.ToolReferenceChunk` + +```python +value: models.ToolReferenceChunk = /* values here */ +``` + +### `models.ReferenceChunk` + +```python +value: models.ReferenceChunk = /* values here */ +``` + diff --git a/packages/mistralai_azure/docs/models/tool.md b/packages/azure/docs/models/tool.md similarity index 100% rename from packages/mistralai_azure/docs/models/tool.md rename to packages/azure/docs/models/tool.md diff --git a/packages/mistralai_azure/docs/models/toolcall.md b/packages/azure/docs/models/toolcall.md similarity index 100% rename from packages/mistralai_azure/docs/models/toolcall.md rename to packages/azure/docs/models/toolcall.md diff --git a/packages/mistralai_azure/docs/models/toolchoice.md b/packages/azure/docs/models/toolchoice.md similarity index 100% rename from packages/mistralai_azure/docs/models/toolchoice.md rename to packages/azure/docs/models/toolchoice.md diff --git a/packages/mistralai_azure/docs/models/toolchoiceenum.md b/packages/azure/docs/models/toolchoiceenum.md similarity index 100% rename from packages/mistralai_azure/docs/models/toolchoiceenum.md rename to packages/azure/docs/models/toolchoiceenum.md diff --git a/packages/azure/docs/models/toolmessage.md b/packages/azure/docs/models/toolmessage.md new file mode 100644 index 00000000..7201481e --- /dev/null +++ b/packages/azure/docs/models/toolmessage.md @@ -0,0 +1,11 @@ +# ToolMessage + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `role` | *Literal["tool"]* | :heavy_check_mark: | N/A | +| `content` | [Nullable[models.ToolMessageContent]](../models/toolmessagecontent.md) | :heavy_check_mark: | N/A | +| `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/toolmessagecontent.md b/packages/azure/docs/models/toolmessagecontent.md similarity index 100% rename from packages/mistralai_azure/docs/models/toolmessagecontent.md rename to packages/azure/docs/models/toolmessagecontent.md diff --git a/packages/azure/docs/models/toolreferencechunk.md b/packages/azure/docs/models/toolreferencechunk.md new file mode 100644 index 00000000..9fc10399 --- /dev/null +++ b/packages/azure/docs/models/toolreferencechunk.md @@ -0,0 +1,13 @@ +# ToolReferenceChunk + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `type` | *Optional[Literal["tool_reference"]]* | :heavy_minus_sign: | N/A | +| `tool` | [models.ToolUnion](../models/toolunion.md) | :heavy_check_mark: | N/A | +| `title` | *str* | :heavy_check_mark: | N/A | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `favicon` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/tooltypes.md b/packages/azure/docs/models/tooltypes.md similarity index 100% rename from docs/models/tooltypes.md rename to packages/azure/docs/models/tooltypes.md diff --git a/packages/azure/docs/models/toolunion.md b/packages/azure/docs/models/toolunion.md new file mode 100644 index 00000000..2dcb3dee --- /dev/null +++ b/packages/azure/docs/models/toolunion.md @@ -0,0 +1,17 @@ +# ToolUnion + + +## Supported Types + +### `models.BuiltInConnectors` + +```python +value: models.BuiltInConnectors = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/packages/mistralai_azure/docs/models/usageinfo.md b/packages/azure/docs/models/usageinfo.md similarity index 100% rename from packages/mistralai_azure/docs/models/usageinfo.md rename to packages/azure/docs/models/usageinfo.md diff --git a/packages/azure/docs/models/usermessage.md b/packages/azure/docs/models/usermessage.md new file mode 100644 index 00000000..e7a932ed --- /dev/null +++ b/packages/azure/docs/models/usermessage.md @@ -0,0 +1,9 @@ +# UserMessage + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `role` | *Literal["user"]* | :heavy_check_mark: | N/A | +| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/usermessagecontent.md b/packages/azure/docs/models/usermessagecontent.md similarity index 100% rename from packages/mistralai_azure/docs/models/usermessagecontent.md rename to packages/azure/docs/models/usermessagecontent.md diff --git a/packages/mistralai_azure/docs/models/utils/retryconfig.md b/packages/azure/docs/models/utils/retryconfig.md similarity index 100% rename from packages/mistralai_azure/docs/models/utils/retryconfig.md rename to packages/azure/docs/models/utils/retryconfig.md diff --git a/packages/azure/docs/models/validationerror.md b/packages/azure/docs/models/validationerror.md new file mode 100644 index 00000000..5bcea5b5 --- /dev/null +++ b/packages/azure/docs/models/validationerror.md @@ -0,0 +1,12 @@ +# ValidationError + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `loc` | List[[models.Loc](../models/loc.md)] | :heavy_check_mark: | N/A | +| `msg` | *str* | :heavy_check_mark: | N/A | +| `type` | *str* | :heavy_check_mark: | N/A | +| `input` | *Optional[Any]* | :heavy_minus_sign: | N/A | +| `ctx` | [Optional[models.Context]](../models/context.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/azure/docs/sdks/chat/README.md b/packages/azure/docs/sdks/chat/README.md new file mode 100644 index 00000000..88735d97 --- /dev/null +++ b/packages/azure/docs/sdks/chat/README.md @@ -0,0 +1,141 @@ +# Chat +(*chat*) + +## Overview + +Chat Completion API. + +### Available Operations + +* [stream](#stream) - Stream chat completion +* [complete](#complete) - Chat Completion + +## stream + +Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + +### Example Usage + +```python +from mistralai.azure.client import MistralAzure +import os + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +# The SDK automatically injects api-version as a query parameter +s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, +) + +res = s.chat.stream(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, +], model=AZURE_MODEL) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------- | ----------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `messages` | List[models.Messages] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | {
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
} | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the model to use for this request. | azureai | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [Optional[models.Stop]](../../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | +| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | +| `tool_choice` | [Optional[models.ToolChoice]](../../models/toolchoice.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + + +### Response + +**Union[Generator[models.CompletionEvent, None, None], AsyncGenerator[models.CompletionEvent, None]]** +### Errors + +| Error Object | Status Code | Content Type | +| --------------- | ----------- | ------------ | +| models.SDKError | 4xx-5xx | */* | + +## complete + +Chat Completion + +### Example Usage + +```python +from mistralai.azure.client import MistralAzure +import os + +AZURE_API_KEY = os.environ["AZURE_API_KEY"] +AZURE_ENDPOINT = os.environ["AZURE_ENDPOINT"] +AZURE_MODEL = os.environ["AZURE_MODEL"] +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +# The SDK automatically injects api-version as a query parameter +s = MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_ENDPOINT, + api_version=AZURE_API_VERSION, +) + +res = s.chat.complete(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, +], model=AZURE_MODEL) + +if res is not None: + # handle response + print(res.choices[0].message.content) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------- | --------------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `messages` | List[models.ChatCompletionRequestMessages] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | {
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
} | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the model to use for this request. | azureai | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [Optional[models.ChatCompletionRequestStop]](../../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | +| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | +| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | +| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + + +### Response + +**[models.ChatCompletionResponse](../../models/chatcompletionresponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | ----------- | ---------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/packages/mistralai_azure/docs/sdks/mistralazure/README.md b/packages/azure/docs/sdks/mistralazure/README.md similarity index 100% rename from packages/mistralai_azure/docs/sdks/mistralazure/README.md rename to packages/azure/docs/sdks/mistralazure/README.md diff --git a/packages/mistralai_azure/py.typed b/packages/azure/py.typed similarity index 100% rename from packages/mistralai_azure/py.typed rename to packages/azure/py.typed diff --git a/packages/azure/pylintrc b/packages/azure/pylintrc new file mode 100644 index 00000000..0391ac11 --- /dev/null +++ b/packages/azure/pylintrc @@ -0,0 +1,664 @@ +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Clear in-memory caches upon conclusion of linting. Useful if running pylint +# in a server-like mode. +clear-cache-post-run=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist= + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold under which the program will exit with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS + +# Add files or directories matching the regular expressions patterns to the +# ignore-list. The regex matches against paths and can be in Posix or Windows +# format. Because '\\' represents the directory delimiter on Windows systems, +# it can't be used as an escape character. +ignore-paths= + +# Files or directories matching the regular expression patterns are skipped. +# The regex matches against base names, not paths. The default value ignores +# Emacs file locks +ignore-patterns=^\.# + +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. +ignored-modules= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs=1 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.10 + +# Discover python modules and packages in the file system subtree. +recursive=no + +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots=src + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +#argument-rgx= + +# Naming style matching correct attribute names. +#attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +attr-rgx=[^\W\d][^\W]*|__.*__$ + +# Bad variable names which should always be refused, separated by a comma. +bad-names= + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +#class-attribute-rgx= + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _, + e, + id, + n + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +typealias-rgx=.* + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +#variable-rgx= + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + asyncSetUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= + +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=12 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=25 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=builtins.BaseException,builtins.Exception + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow explicit reexports by alias from a package __init__. +allow-reexport-from-package=no + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=raw-checker-failed, + bad-inline-option, + locally-disabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + use-implicit-booleaness-not-comparison-to-string, + use-implicit-booleaness-not-comparison-to-zero, + use-symbolic-message-instead, + trailing-whitespace, + line-too-long, + missing-class-docstring, + missing-module-docstring, + missing-function-docstring, + too-many-instance-attributes, + wrong-import-order, + too-many-arguments, + broad-exception-raised, + too-few-public-methods, + too-many-branches, + duplicate-code, + trailing-newlines, + too-many-public-methods, + too-many-locals, + too-many-lines, + using-constant-test, + too-many-statements, + cyclic-import, + too-many-nested-blocks, + too-many-boolean-expressions, + no-else-raise, + bare-except, + broad-exception-caught, + fixme, + relative-beyond-top-level, + consider-using-with, + wildcard-import, + unused-wildcard-import, + too-many-return-statements, + redefined-builtin + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[METHOD_ARGS] + +# List of qualified names (i.e., library.method) which require a timeout +# parameter e.g. 'requests.api.get,requests.api.post' +timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= + +# Set the output format. Available formats are: text, parseable, colorized, +# json2 (improved json format), json (old json format) and msvs (visual +# studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes + + +[SIMILARITIES] + +# Comments are removed from the similarity computation +ignore-comments=yes + +# Docstrings are removed from the similarity computation +ignore-docstrings=yes + +# Imports are removed from the similarity computation +ignore-imports=yes + +# Signatures are removed from the similarity computation +ignore-signatures=yes + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. No available dictionaries : You need to install +# both the python package and the system dependency for enchant to work. +spelling-dict= + +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins=id,object,input,dir + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/packages/azure/pyproject.toml b/packages/azure/pyproject.toml new file mode 100644 index 00000000..334767bd --- /dev/null +++ b/packages/azure/pyproject.toml @@ -0,0 +1,65 @@ +[project] +name = "mistralai-azure" +version = "2.0.0" +description = "Python Client SDK for the Mistral AI API in Azure." +authors = [{ name = "Mistral" }] +requires-python = ">=3.10" +readme = "README-PYPI.md" +dependencies = [ + "httpcore >=1.0.9", + "httpx >=0.28.1", + "pydantic >=2.11.2", +] + +[dependency-groups] +dev = [ + "mypy==1.15.0", + "pylint==3.2.3", + "pyright>=1.1.401,<2", + "pytest>=8.2.2,<9", + "pytest-asyncio>=0.23.7,<0.24", +] + +[tool.setuptools.package-data] +"*" = ["py.typed", "src/mistralai/azure/client/py.typed"] + +[tool.hatch.build.targets.sdist] +include = ["src/mistralai"] + +[tool.hatch.build.targets.sdist.force-include] +"py.typed" = "py.typed" +"src/mistralai/azure/client/py.typed" = "src/mistralai/azure/client/py.typed" + +[tool.hatch.build.targets.wheel] +include = ["src/mistralai"] + +[tool.hatch.build.targets.wheel.sources] +"src" = "" + +[virtualenvs] +in-project = true + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.pytest.ini_options] +pythonpath = ["src"] + +[tool.mypy] +disable_error_code = "misc" +namespace_packages = true +explicit_package_bases = true +mypy_path = "src" + +[[tool.mypy.overrides]] +module = "typing_inspect" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "jsonpath" +ignore_missing_imports = true + +[tool.pyright] +venvPath = "." +venv = ".venv" diff --git a/packages/azure/scripts/prepare_readme.py b/packages/azure/scripts/prepare_readme.py new file mode 100644 index 00000000..a628b6b4 --- /dev/null +++ b/packages/azure/scripts/prepare_readme.py @@ -0,0 +1,51 @@ +import re +import shutil +import sys + +GITHUB_URL = "https://github.com/mistralai/client-python.git" +BRANCH = "main" +REPO_SUBDIR = "packages/azure" +LINK_PATTERN = re.compile(r"(\[[^\]]+\]\()((?![a-zA-Z][a-zA-Z0-9+.-]*:|#)[^\)]+)(\))") + + +def _build_base_url(repo_url: str, branch: str, repo_subdir: str) -> str: + normalized = repo_url[:-4] if repo_url.endswith(".git") else repo_url + subdir = repo_subdir.strip("/") + if subdir: + subdir = f"{subdir}/" + return f"{normalized}/blob/{branch}/{subdir}" + + +def _normalize_relative_path(path: str) -> str: + if path.startswith("./"): + path = path[2:] + elif path.startswith("/"): + path = path[1:] + return path + + +def _rewrite_relative_links(contents: str, base_url: str) -> str: + return LINK_PATTERN.sub( + lambda m: f"{m.group(1)}{base_url}{_normalize_relative_path(m.group(2))}{m.group(3)}", + contents, + ) + + +try: + with open("README.md", "r", encoding="utf-8") as fh: + readme_contents = fh.read() + + base_url = _build_base_url(GITHUB_URL, BRANCH, REPO_SUBDIR) + readme_contents = _rewrite_relative_links(readme_contents, base_url) + + with open("README-PYPI.md", "w", encoding="utf-8") as fh: + fh.write(readme_contents) +except Exception as e: + try: + print("Failed to rewrite README.md to README-PYPI.md, copying original instead") + print(e) + shutil.copyfile("README.md", "README-PYPI.md") + except Exception as ie: + print("Failed to copy README.md to README-PYPI.md") + print(ie) + sys.exit(1) diff --git a/packages/azure/scripts/publish.sh b/packages/azure/scripts/publish.sh new file mode 100755 index 00000000..c35748f3 --- /dev/null +++ b/packages/azure/scripts/publish.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +uv run python scripts/prepare_readme.py + +uv build +uv publish --token $PYPI_TOKEN diff --git a/packages/azure/src/mistralai/azure/client/__init__.py b/packages/azure/src/mistralai/azure/client/__init__.py new file mode 100644 index 00000000..833c68cd --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/__init__.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._version import ( + __title__, + __version__, + __openapi_doc_version__, + __gen_version__, + __user_agent__, +) +from .sdk import * +from .sdkconfiguration import * + + +VERSION: str = __version__ +OPENAPI_DOC_VERSION = __openapi_doc_version__ +SPEAKEASY_GENERATOR_VERSION = __gen_version__ +USER_AGENT = __user_agent__ diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/__init__.py b/packages/azure/src/mistralai/azure/client/_hooks/__init__.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/_hooks/__init__.py rename to packages/azure/src/mistralai/azure/client/_hooks/__init__.py diff --git a/packages/azure/src/mistralai/azure/client/_hooks/registration.py b/packages/azure/src/mistralai/azure/client/_hooks/registration.py new file mode 100644 index 00000000..d5a49cc3 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/_hooks/registration.py @@ -0,0 +1,12 @@ +from .types import Hooks + + +# This file is only ever generated once on the first generation and then is free to be modified. +# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them +# in this file or in separate files in the hooks folder. + + +def init_hooks(_hooks: Hooks) -> None: + """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook + with an instance of a hook that implements that specific Hook interface + Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance""" diff --git a/packages/azure/src/mistralai/azure/client/_hooks/sdkhooks.py b/packages/azure/src/mistralai/azure/client/_hooks/sdkhooks.py new file mode 100644 index 00000000..2080681b --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/_hooks/sdkhooks.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from .types import ( + SDKInitHook, + BeforeRequestContext, + BeforeRequestHook, + AfterSuccessContext, + AfterSuccessHook, + AfterErrorContext, + AfterErrorHook, + Hooks, +) +from .registration import init_hooks +from typing import List, Optional, Tuple +from mistralai.azure.client.httpclient import HttpClient + + +class SDKHooks(Hooks): + def __init__(self) -> None: + self.sdk_init_hooks: List[SDKInitHook] = [] + self.before_request_hooks: List[BeforeRequestHook] = [] + self.after_success_hooks: List[AfterSuccessHook] = [] + self.after_error_hooks: List[AfterErrorHook] = [] + init_hooks(self) + + def register_sdk_init_hook(self, hook: SDKInitHook) -> None: + self.sdk_init_hooks.append(hook) + + def register_before_request_hook(self, hook: BeforeRequestHook) -> None: + self.before_request_hooks.append(hook) + + def register_after_success_hook(self, hook: AfterSuccessHook) -> None: + self.after_success_hooks.append(hook) + + def register_after_error_hook(self, hook: AfterErrorHook) -> None: + self.after_error_hooks.append(hook) + + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: + for hook in self.sdk_init_hooks: + base_url, client = hook.sdk_init(base_url, client) + return base_url, client + + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> httpx.Request: + for hook in self.before_request_hooks: + out = hook.before_request(hook_ctx, request) + if isinstance(out, Exception): + raise out + request = out + + return request + + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> httpx.Response: + for hook in self.after_success_hooks: + out = hook.after_success(hook_ctx, response) + if isinstance(out, Exception): + raise out + response = out + return response + + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: + for hook in self.after_error_hooks: + result = hook.after_error(hook_ctx, response, error) + if isinstance(result, Exception): + raise result + response, error = result + return response, error diff --git a/packages/azure/src/mistralai/azure/client/_hooks/types.py b/packages/azure/src/mistralai/azure/client/_hooks/types.py new file mode 100644 index 00000000..3e4e3955 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/_hooks/types.py @@ -0,0 +1,113 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from abc import ABC, abstractmethod +import httpx +from mistralai.azure.client.httpclient import HttpClient +from mistralai.azure.client.sdkconfiguration import SDKConfiguration +from typing import Any, Callable, List, Optional, Tuple, Union + + +class HookContext: + config: SDKConfiguration + base_url: str + operation_id: str + oauth2_scopes: Optional[List[str]] = None + security_source: Optional[Union[Any, Callable[[], Any]]] = None + + def __init__( + self, + config: SDKConfiguration, + base_url: str, + operation_id: str, + oauth2_scopes: Optional[List[str]], + security_source: Optional[Union[Any, Callable[[], Any]]], + ): + self.config = config + self.base_url = base_url + self.operation_id = operation_id + self.oauth2_scopes = oauth2_scopes + self.security_source = security_source + + +class BeforeRequestContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class AfterSuccessContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class AfterErrorContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class SDKInitHook(ABC): + @abstractmethod + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: + pass + + +class BeforeRequestHook(ABC): + @abstractmethod + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> Union[httpx.Request, Exception]: + pass + + +class AfterSuccessHook(ABC): + @abstractmethod + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> Union[httpx.Response, Exception]: + pass + + +class AfterErrorHook(ABC): + @abstractmethod + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: + pass + + +class Hooks(ABC): + @abstractmethod + def register_sdk_init_hook(self, hook: SDKInitHook): + pass + + @abstractmethod + def register_before_request_hook(self, hook: BeforeRequestHook): + pass + + @abstractmethod + def register_after_success_hook(self, hook: AfterSuccessHook): + pass + + @abstractmethod + def register_after_error_hook(self, hook: AfterErrorHook): + pass diff --git a/packages/azure/src/mistralai/azure/client/_version.py b/packages/azure/src/mistralai/azure/client/_version.py new file mode 100644 index 00000000..8923c29d --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/_version.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import importlib.metadata + +__title__: str = "mistralai-azure" +__version__: str = "2.0.0" +__openapi_doc_version__: str = "1.0.0" +__gen_version__: str = "2.841.0" +__user_agent__: str = "speakeasy-sdk/python 2.0.0 2.841.0 1.0.0 mistralai-azure" + +try: + if __package__ is not None: + __version__ = importlib.metadata.version(__package__) +except importlib.metadata.PackageNotFoundError: + pass diff --git a/packages/azure/src/mistralai/azure/client/basesdk.py b/packages/azure/src/mistralai/azure/client/basesdk.py new file mode 100644 index 00000000..0d4d9a44 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/basesdk.py @@ -0,0 +1,384 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .sdkconfiguration import SDKConfiguration +import httpx +from mistralai.azure.client import errors, utils +from mistralai.azure.client._hooks import ( + AfterErrorContext, + AfterSuccessContext, + BeforeRequestContext, +) +from mistralai.azure.client.utils import ( + RetryConfig, + SerializedRequestBody, + get_body_content, + run_sync_in_thread, +) +from typing import Callable, List, Mapping, Optional, Tuple +from urllib.parse import parse_qs, urlparse + + +class BaseSDK: + sdk_configuration: SDKConfiguration + parent_ref: Optional[object] = None + """ + Reference to the root SDK instance, if any. This will prevent it from + being garbage collected while there are active streams. + """ + + def __init__( + self, + sdk_config: SDKConfiguration, + parent_ref: Optional[object] = None, + ) -> None: + self.sdk_configuration = sdk_config + self.parent_ref = parent_ref + + def _get_url(self, base_url, url_variables): + sdk_url, sdk_variables = self.sdk_configuration.get_server_details() + + if base_url is None: + base_url = sdk_url + + if url_variables is None: + url_variables = sdk_variables + + return utils.template_url(base_url, url_variables) + + def _build_request_async( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + ) -> httpx.Request: + client = self.sdk_configuration.async_client + return self._build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + http_headers, + allow_empty_value, + ) + + def _build_request( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + ) -> httpx.Request: + client = self.sdk_configuration.client + return self._build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + http_headers, + allow_empty_value, + ) + + def _build_request_with_client( + self, + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + ) -> httpx.Request: + query_params = {} + + url = url_override + if url is None: + url = utils.generate_url( + self._get_url(base_url, url_variables), + path, + request if request_has_path_params else None, + _globals if request_has_path_params else None, + ) + + query_params = utils.get_query_params( + request if request_has_query_params else None, + _globals if request_has_query_params else None, + allow_empty_value, + ) + else: + # Pick up the query parameter from the override so they can be + # preserved when building the request later on (necessary as of + # httpx 0.28). + parsed_override = urlparse(str(url_override)) + query_params = parse_qs(parsed_override.query, keep_blank_values=True) + + headers = utils.get_headers(request, _globals) + headers["Accept"] = accept_header_value + headers[user_agent_header] = self.sdk_configuration.user_agent + + if security is not None: + if callable(security): + security = security() + + if security is not None: + security_headers, security_query_params = utils.get_security(security) + headers = {**headers, **security_headers} + query_params = {**query_params, **security_query_params} + + serialized_request_body = SerializedRequestBody() + if get_serialized_body is not None: + rb = get_serialized_body() + if request_body_required and rb is None: + raise ValueError("request body is required") + + if rb is not None: + serialized_request_body = rb + + if ( + serialized_request_body.media_type is not None + and serialized_request_body.media_type + not in ( + "multipart/form-data", + "multipart/mixed", + ) + ): + headers["content-type"] = serialized_request_body.media_type + + if http_headers is not None: + for header, value in http_headers.items(): + headers[header] = value + + timeout = timeout_ms / 1000 if timeout_ms is not None else None + + return client.build_request( + method, + url, + params=query_params, + content=serialized_request_body.content, + data=serialized_request_body.data, + files=serialized_request_body.files, + headers=headers, + timeout=timeout, + ) + + def do_request( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.client + logger = self.sdk_configuration.debug_logger + + hooks = self.sdk_configuration.__dict__["_hooks"] + + def do(): + http_res = None + try: + req = hooks.before_request(BeforeRequestContext(hook_ctx), request) + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + + if client is None: + raise ValueError("client is required") + + http_res = client.send(req, stream=stream) + except Exception as e: + _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.NoResponseError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = hooks.after_error( + AfterErrorContext(hook_ctx), http_res, None + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred", http_res) + + return http_res + + if retry_config is not None: + http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) + else: + http_res = do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) + + return http_res + + async def do_request_async( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.async_client + logger = self.sdk_configuration.debug_logger + + hooks = self.sdk_configuration.__dict__["_hooks"] + + async def do(): + http_res = None + try: + req = await run_sync_in_thread( + hooks.before_request, BeforeRequestContext(hook_ctx), request + ) + + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + + if client is None: + raise ValueError("client is required") + + http_res = await client.send(req, stream=stream) + except Exception as e: + _, e = await run_sync_in_thread( + hooks.after_error, AfterErrorContext(hook_ctx), None, e + ) + + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.NoResponseError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = await run_sync_in_thread( + hooks.after_error, AfterErrorContext(hook_ctx), http_res, None + ) + + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred", http_res) + + return http_res + + if retry_config is not None: + http_res = await utils.retry_async( + do, utils.Retries(retry_config[0], retry_config[1]) + ) + else: + http_res = await do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = await run_sync_in_thread( + hooks.after_success, AfterSuccessContext(hook_ctx), http_res + ) + + return http_res diff --git a/packages/azure/src/mistralai/azure/client/chat.py b/packages/azure/src/mistralai/azure/client/chat.py new file mode 100644 index 00000000..1051f952 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/chat.py @@ -0,0 +1,713 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from mistralai.azure.client import errors, models, utils +from mistralai.azure.client._hooks import HookContext +from mistralai.azure.client.types import OptionalNullable, UNSET +from mistralai.azure.client.utils import eventstreaming +from mistralai.azure.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class Chat(BaseSDK): + r"""Chat Completion API.""" + + def stream( + self, + *, + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], + model: Optional[str] = "azureai", + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = None, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: Optional[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[List[models.Tool], List[models.ToolTypedDict]] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionStreamRequestToolChoice, + models.ChatCompletionStreamRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + safe_prompt: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.CompletionEvent]: + r"""Stream chat completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param model: The ID of the model to use for this request. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param safe_prompt: Whether to inject a safety prompt before all conversations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + prompt_mode=prompt_mode, + safe_prompt=safe_prompt, + ) + + req = self._build_request( + method="POST", + path="/chat/completions#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_chat", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def stream_async( + self, + *, + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], + model: Optional[str] = "azureai", + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = None, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: Optional[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[List[models.Tool], List[models.ToolTypedDict]] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionStreamRequestToolChoice, + models.ChatCompletionStreamRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + safe_prompt: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: + r"""Stream chat completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param model: The ID of the model to use for this request. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param safe_prompt: Whether to inject a safety prompt before all conversations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + prompt_mode=prompt_mode, + safe_prompt=safe_prompt, + ) + + req = self._build_request_async( + method="POST", + path="/chat/completions#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_chat", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + def complete( + self, + *, + messages: Union[ + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], + ], + model: Optional[str] = "azureai", + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = None, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: Optional[ + Union[ + models.ChatCompletionRequestStop, + models.ChatCompletionRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[List[models.Tool], List[models.ToolTypedDict]] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionRequestToolChoice, + models.ChatCompletionRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + safe_prompt: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionResponse: + r"""Chat Completion + + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param model: The ID of the model to use for this request. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param safe_prompt: Whether to inject a safety prompt before all conversations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + prompt_mode=prompt_mode, + safe_prompt=safe_prompt, + ) + + req = self._build_request( + method="POST", + path="/chat/completions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="chat_completion_v1_chat_completions_post", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def complete_async( + self, + *, + messages: Union[ + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], + ], + model: Optional[str] = "azureai", + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = None, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: Optional[ + Union[ + models.ChatCompletionRequestStop, + models.ChatCompletionRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[List[models.Tool], List[models.ToolTypedDict]] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionRequestToolChoice, + models.ChatCompletionRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + safe_prompt: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionResponse: + r"""Chat Completion + + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param model: The ID of the model to use for this request. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param safe_prompt: Whether to inject a safety prompt before all conversations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + prompt_mode=prompt_mode, + safe_prompt=safe_prompt, + ) + + req = self._build_request_async( + method="POST", + path="/chat/completions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="chat_completion_v1_chat_completions_post", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/packages/azure/src/mistralai/azure/client/errors/__init__.py b/packages/azure/src/mistralai/azure/client/errors/__init__.py new file mode 100644 index 00000000..79e2712c --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/errors/__init__.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .mistralazureerror import MistralAzureError +from typing import Any, TYPE_CHECKING + +from mistralai.azure.client.utils.dynamic_imports import lazy_getattr, lazy_dir + +if TYPE_CHECKING: + from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData + from .no_response_error import NoResponseError + from .responsevalidationerror import ResponseValidationError + from .sdkerror import SDKError + +__all__ = [ + "HTTPValidationError", + "HTTPValidationErrorData", + "MistralAzureError", + "NoResponseError", + "ResponseValidationError", + "SDKError", +] + +_dynamic_imports: dict[str, str] = { + "HTTPValidationError": ".httpvalidationerror", + "HTTPValidationErrorData": ".httpvalidationerror", + "NoResponseError": ".no_response_error", + "ResponseValidationError": ".responsevalidationerror", + "SDKError": ".sdkerror", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/packages/azure/src/mistralai/azure/client/errors/httpvalidationerror.py b/packages/azure/src/mistralai/azure/client/errors/httpvalidationerror.py new file mode 100644 index 00000000..b4f2691e --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/errors/httpvalidationerror.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from mistralai.azure.client.errors import MistralAzureError +from mistralai.azure.client.models import validationerror as models_validationerror +from mistralai.azure.client.types import BaseModel +from typing import List, Optional + + +class HTTPValidationErrorData(BaseModel): + detail: Optional[List[models_validationerror.ValidationError]] = None + + +@dataclass(unsafe_hash=True) +class HTTPValidationError(MistralAzureError): + data: HTTPValidationErrorData = field(hash=False) + + def __init__( + self, + data: HTTPValidationErrorData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/packages/azure/src/mistralai/azure/client/errors/mistralazureerror.py b/packages/azure/src/mistralai/azure/client/errors/mistralazureerror.py new file mode 100644 index 00000000..c5bf1752 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/errors/mistralazureerror.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional +from dataclasses import dataclass, field + + +@dataclass(unsafe_hash=True) +class MistralAzureError(Exception): + """The base class for all HTTP error responses.""" + + message: str + status_code: int + body: str + headers: httpx.Headers = field(hash=False) + raw_response: httpx.Response = field(hash=False) + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + object.__setattr__(self, "message", message) + object.__setattr__(self, "status_code", raw_response.status_code) + object.__setattr__( + self, "body", body if body is not None else raw_response.text + ) + object.__setattr__(self, "headers", raw_response.headers) + object.__setattr__(self, "raw_response", raw_response) + + def __str__(self): + return self.message diff --git a/packages/azure/src/mistralai/azure/client/errors/no_response_error.py b/packages/azure/src/mistralai/azure/client/errors/no_response_error.py new file mode 100644 index 00000000..1deab64b --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/errors/no_response_error.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from dataclasses import dataclass + + +@dataclass(unsafe_hash=True) +class NoResponseError(Exception): + """Error raised when no HTTP response is received from the server.""" + + message: str + + def __init__(self, message: str = "No response received"): + object.__setattr__(self, "message", message) + super().__init__(message) + + def __str__(self): + return self.message diff --git a/packages/azure/src/mistralai/azure/client/errors/responsevalidationerror.py b/packages/azure/src/mistralai/azure/client/errors/responsevalidationerror.py new file mode 100644 index 00000000..02397334 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/errors/responsevalidationerror.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional +from dataclasses import dataclass + +from mistralai.azure.client.errors import MistralAzureError + + +@dataclass(unsafe_hash=True) +class ResponseValidationError(MistralAzureError): + """Error raised when there is a type mismatch between the response data and the expected Pydantic model.""" + + def __init__( + self, + message: str, + raw_response: httpx.Response, + cause: Exception, + body: Optional[str] = None, + ): + message = f"{message}: {cause}" + super().__init__(message, raw_response, body) + + @property + def cause(self): + """Normally the Pydantic ValidationError""" + return self.__cause__ diff --git a/packages/azure/src/mistralai/azure/client/errors/sdkerror.py b/packages/azure/src/mistralai/azure/client/errors/sdkerror.py new file mode 100644 index 00000000..c4f3616c --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/errors/sdkerror.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional +from dataclasses import dataclass + +from mistralai.azure.client.errors import MistralAzureError + +MAX_MESSAGE_LEN = 10_000 + + +@dataclass(unsafe_hash=True) +class SDKError(MistralAzureError): + """The fallback error class if no more specific error class is matched.""" + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + body_display = body or raw_response.text or '""' + + if message: + message += ": " + message += f"Status {raw_response.status_code}" + + headers = raw_response.headers + content_type = headers.get("content-type", '""') + if content_type != "application/json": + if " " in content_type: + content_type = f'"{content_type}"' + message += f" Content-Type {content_type}" + + if len(body_display) > MAX_MESSAGE_LEN: + truncated = body_display[:MAX_MESSAGE_LEN] + remaining = len(body_display) - MAX_MESSAGE_LEN + body_display = f"{truncated}...and {remaining} more chars" + + message += f". Body: {body_display}" + message = message.strip() + + super().__init__(message, raw_response, body) diff --git a/packages/azure/src/mistralai/azure/client/httpclient.py b/packages/azure/src/mistralai/azure/client/httpclient.py new file mode 100644 index 00000000..89560b56 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/httpclient.py @@ -0,0 +1,125 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +# pyright: reportReturnType = false +import asyncio +from typing_extensions import Protocol, runtime_checkable +import httpx +from typing import Any, Optional, Union + + +@runtime_checkable +class HttpClient(Protocol): + def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + def close(self) -> None: + pass + + +@runtime_checkable +class AsyncHttpClient(Protocol): + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + async def aclose(self) -> None: + pass + + +class ClientOwner(Protocol): + client: Union[HttpClient, None] + async_client: Union[AsyncHttpClient, None] + + +def close_clients( + owner: ClientOwner, + sync_client: Union[HttpClient, None], + sync_client_supplied: bool, + async_client: Union[AsyncHttpClient, None], + async_client_supplied: bool, +) -> None: + """ + A finalizer function that is meant to be used with weakref.finalize to close + httpx clients used by an SDK so that underlying resources can be garbage + collected. + """ + + # Unset the client/async_client properties so there are no more references + # to them from the owning SDK instance and they can be reaped. + owner.client = None + owner.async_client = None + if sync_client is not None and not sync_client_supplied: + try: + sync_client.close() + except Exception: + pass + + if async_client is not None and not async_client_supplied: + try: + loop = asyncio.get_running_loop() + asyncio.run_coroutine_threadsafe(async_client.aclose(), loop) + except RuntimeError: + try: + asyncio.run(async_client.aclose()) + except RuntimeError: + # best effort + pass diff --git a/packages/azure/src/mistralai/azure/client/models/__init__.py b/packages/azure/src/mistralai/azure/client/models/__init__.py new file mode 100644 index 00000000..79c5df32 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/__init__.py @@ -0,0 +1,413 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, TYPE_CHECKING + +from mistralai.azure.client.utils.dynamic_imports import lazy_getattr, lazy_dir + +if TYPE_CHECKING: + from .assistantmessage import ( + AssistantMessage, + AssistantMessageContent, + AssistantMessageContentTypedDict, + AssistantMessageTypedDict, + ) + from .builtinconnectors import BuiltInConnectors + from .chatcompletionchoice import ( + ChatCompletionChoice, + ChatCompletionChoiceFinishReason, + ChatCompletionChoiceTypedDict, + ) + from .chatcompletionrequest import ( + ChatCompletionRequest, + ChatCompletionRequestMessage, + ChatCompletionRequestMessageTypedDict, + ChatCompletionRequestStop, + ChatCompletionRequestStopTypedDict, + ChatCompletionRequestToolChoice, + ChatCompletionRequestToolChoiceTypedDict, + ChatCompletionRequestTypedDict, + ) + from .chatcompletionresponse import ( + ChatCompletionResponse, + ChatCompletionResponseTypedDict, + ) + from .chatcompletionstreamrequest import ( + ChatCompletionStreamRequest, + ChatCompletionStreamRequestMessage, + ChatCompletionStreamRequestMessageTypedDict, + ChatCompletionStreamRequestStop, + ChatCompletionStreamRequestStopTypedDict, + ChatCompletionStreamRequestToolChoice, + ChatCompletionStreamRequestToolChoiceTypedDict, + ChatCompletionStreamRequestTypedDict, + ) + from .completionchunk import CompletionChunk, CompletionChunkTypedDict + from .completionevent import CompletionEvent, CompletionEventTypedDict + from .completionresponsestreamchoice import ( + CompletionResponseStreamChoice, + CompletionResponseStreamChoiceFinishReason, + CompletionResponseStreamChoiceTypedDict, + ) + from .contentchunk import ContentChunk, ContentChunkTypedDict, UnknownContentChunk + from .deltamessage import ( + DeltaMessage, + DeltaMessageContent, + DeltaMessageContentTypedDict, + DeltaMessageTypedDict, + ) + from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict + from .filechunk import FileChunk, FileChunkTypedDict + from .function import Function, FunctionTypedDict + from .functioncall import ( + Arguments, + ArgumentsTypedDict, + FunctionCall, + FunctionCallTypedDict, + ) + from .functionname import FunctionName, FunctionNameTypedDict + from .imagedetail import ImageDetail + from .imageurl import ImageURL, ImageURLTypedDict + from .imageurlchunk import ( + ImageURLChunk, + ImageURLChunkTypedDict, + ImageURLUnion, + ImageURLUnionTypedDict, + ) + from .jsonschema import JSONSchema, JSONSchemaTypedDict + from .mistralpromptmode import MistralPromptMode + from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict + from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict + from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict + from .ocrrequest import ( + Document, + DocumentTypedDict, + OCRRequest, + OCRRequestTypedDict, + TableFormat, + ) + from .ocrresponse import OCRResponse, OCRResponseTypedDict + from .ocrtableobject import Format, OCRTableObject, OCRTableObjectTypedDict + from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict + from .prediction import Prediction, PredictionTypedDict + from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict + from .responseformat import ResponseFormat, ResponseFormatTypedDict + from .responseformats import ResponseFormats + from .security import Security, SecurityTypedDict + from .systemmessage import ( + SystemMessage, + SystemMessageContent, + SystemMessageContentTypedDict, + SystemMessageTypedDict, + ) + from .systemmessagecontentchunks import ( + SystemMessageContentChunks, + SystemMessageContentChunksTypedDict, + ) + from .textchunk import TextChunk, TextChunkTypedDict + from .thinkchunk import ThinkChunk, ThinkChunkTypedDict, Thinking, ThinkingTypedDict + from .tool import Tool, ToolTypedDict + from .toolcall import ToolCall, ToolCallTypedDict + from .toolchoice import ToolChoice, ToolChoiceTypedDict + from .toolchoiceenum import ToolChoiceEnum + from .toolmessage import ( + ToolMessage, + ToolMessageContent, + ToolMessageContentTypedDict, + ToolMessageTypedDict, + ) + from .toolreferencechunk import ( + ToolReferenceChunk, + ToolReferenceChunkTypedDict, + ToolUnion, + ToolUnionTypedDict, + ) + from .tooltypes import ToolTypes + from .usageinfo import UsageInfo, UsageInfoTypedDict + from .usermessage import ( + UserMessage, + UserMessageContent, + UserMessageContentTypedDict, + UserMessageTypedDict, + ) + from .validationerror import ( + Context, + ContextTypedDict, + Loc, + LocTypedDict, + ValidationError, + ValidationErrorTypedDict, + ) + +__all__ = [ + "Arguments", + "ArgumentsTypedDict", + "AssistantMessage", + "AssistantMessageContent", + "AssistantMessageContentTypedDict", + "AssistantMessageTypedDict", + "BuiltInConnectors", + "ChatCompletionChoice", + "ChatCompletionChoiceFinishReason", + "ChatCompletionChoiceTypedDict", + "ChatCompletionRequest", + "ChatCompletionRequestMessage", + "ChatCompletionRequestMessageTypedDict", + "ChatCompletionRequestStop", + "ChatCompletionRequestStopTypedDict", + "ChatCompletionRequestToolChoice", + "ChatCompletionRequestToolChoiceTypedDict", + "ChatCompletionRequestTypedDict", + "ChatCompletionResponse", + "ChatCompletionResponseTypedDict", + "ChatCompletionStreamRequest", + "ChatCompletionStreamRequestMessage", + "ChatCompletionStreamRequestMessageTypedDict", + "ChatCompletionStreamRequestStop", + "ChatCompletionStreamRequestStopTypedDict", + "ChatCompletionStreamRequestToolChoice", + "ChatCompletionStreamRequestToolChoiceTypedDict", + "ChatCompletionStreamRequestTypedDict", + "CompletionChunk", + "CompletionChunkTypedDict", + "CompletionEvent", + "CompletionEventTypedDict", + "CompletionResponseStreamChoice", + "CompletionResponseStreamChoiceFinishReason", + "CompletionResponseStreamChoiceTypedDict", + "ContentChunk", + "ContentChunkTypedDict", + "Context", + "ContextTypedDict", + "DeltaMessage", + "DeltaMessageContent", + "DeltaMessageContentTypedDict", + "DeltaMessageTypedDict", + "Document", + "DocumentTypedDict", + "DocumentURLChunk", + "DocumentURLChunkTypedDict", + "FileChunk", + "FileChunkTypedDict", + "Format", + "Function", + "FunctionCall", + "FunctionCallTypedDict", + "FunctionName", + "FunctionNameTypedDict", + "FunctionTypedDict", + "ImageDetail", + "ImageURL", + "ImageURLChunk", + "ImageURLChunkTypedDict", + "ImageURLTypedDict", + "ImageURLUnion", + "ImageURLUnionTypedDict", + "JSONSchema", + "JSONSchemaTypedDict", + "Loc", + "LocTypedDict", + "MistralPromptMode", + "OCRImageObject", + "OCRImageObjectTypedDict", + "OCRPageDimensions", + "OCRPageDimensionsTypedDict", + "OCRPageObject", + "OCRPageObjectTypedDict", + "OCRRequest", + "OCRRequestTypedDict", + "OCRResponse", + "OCRResponseTypedDict", + "OCRTableObject", + "OCRTableObjectTypedDict", + "OCRUsageInfo", + "OCRUsageInfoTypedDict", + "Prediction", + "PredictionTypedDict", + "ReferenceChunk", + "ReferenceChunkTypedDict", + "ResponseFormat", + "ResponseFormatTypedDict", + "ResponseFormats", + "Security", + "SecurityTypedDict", + "SystemMessage", + "SystemMessageContent", + "SystemMessageContentChunks", + "SystemMessageContentChunksTypedDict", + "SystemMessageContentTypedDict", + "SystemMessageTypedDict", + "TableFormat", + "TextChunk", + "TextChunkTypedDict", + "ThinkChunk", + "ThinkChunkTypedDict", + "Thinking", + "ThinkingTypedDict", + "Tool", + "ToolCall", + "ToolCallTypedDict", + "ToolChoice", + "ToolChoiceEnum", + "ToolChoiceTypedDict", + "ToolMessage", + "ToolMessageContent", + "ToolMessageContentTypedDict", + "ToolMessageTypedDict", + "ToolReferenceChunk", + "ToolReferenceChunkTypedDict", + "ToolTypedDict", + "ToolTypes", + "ToolUnion", + "ToolUnionTypedDict", + "UnknownContentChunk", + "UsageInfo", + "UsageInfoTypedDict", + "UserMessage", + "UserMessageContent", + "UserMessageContentTypedDict", + "UserMessageTypedDict", + "ValidationError", + "ValidationErrorTypedDict", +] + +_dynamic_imports: dict[str, str] = { + "AssistantMessage": ".assistantmessage", + "AssistantMessageContent": ".assistantmessage", + "AssistantMessageContentTypedDict": ".assistantmessage", + "AssistantMessageTypedDict": ".assistantmessage", + "BuiltInConnectors": ".builtinconnectors", + "ChatCompletionChoice": ".chatcompletionchoice", + "ChatCompletionChoiceFinishReason": ".chatcompletionchoice", + "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", + "ChatCompletionRequest": ".chatcompletionrequest", + "ChatCompletionRequestMessage": ".chatcompletionrequest", + "ChatCompletionRequestMessageTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestStop": ".chatcompletionrequest", + "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestToolChoice": ".chatcompletionrequest", + "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestTypedDict": ".chatcompletionrequest", + "ChatCompletionResponse": ".chatcompletionresponse", + "ChatCompletionResponseTypedDict": ".chatcompletionresponse", + "ChatCompletionStreamRequest": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessage": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessageTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", + "CompletionChunk": ".completionchunk", + "CompletionChunkTypedDict": ".completionchunk", + "CompletionEvent": ".completionevent", + "CompletionEventTypedDict": ".completionevent", + "CompletionResponseStreamChoice": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceFinishReason": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", + "ContentChunk": ".contentchunk", + "ContentChunkTypedDict": ".contentchunk", + "UnknownContentChunk": ".contentchunk", + "DeltaMessage": ".deltamessage", + "DeltaMessageContent": ".deltamessage", + "DeltaMessageContentTypedDict": ".deltamessage", + "DeltaMessageTypedDict": ".deltamessage", + "DocumentURLChunk": ".documenturlchunk", + "DocumentURLChunkTypedDict": ".documenturlchunk", + "FileChunk": ".filechunk", + "FileChunkTypedDict": ".filechunk", + "Function": ".function", + "FunctionTypedDict": ".function", + "Arguments": ".functioncall", + "ArgumentsTypedDict": ".functioncall", + "FunctionCall": ".functioncall", + "FunctionCallTypedDict": ".functioncall", + "FunctionName": ".functionname", + "FunctionNameTypedDict": ".functionname", + "ImageDetail": ".imagedetail", + "ImageURL": ".imageurl", + "ImageURLTypedDict": ".imageurl", + "ImageURLChunk": ".imageurlchunk", + "ImageURLChunkTypedDict": ".imageurlchunk", + "ImageURLUnion": ".imageurlchunk", + "ImageURLUnionTypedDict": ".imageurlchunk", + "JSONSchema": ".jsonschema", + "JSONSchemaTypedDict": ".jsonschema", + "MistralPromptMode": ".mistralpromptmode", + "OCRImageObject": ".ocrimageobject", + "OCRImageObjectTypedDict": ".ocrimageobject", + "OCRPageDimensions": ".ocrpagedimensions", + "OCRPageDimensionsTypedDict": ".ocrpagedimensions", + "OCRPageObject": ".ocrpageobject", + "OCRPageObjectTypedDict": ".ocrpageobject", + "Document": ".ocrrequest", + "DocumentTypedDict": ".ocrrequest", + "OCRRequest": ".ocrrequest", + "OCRRequestTypedDict": ".ocrrequest", + "TableFormat": ".ocrrequest", + "OCRResponse": ".ocrresponse", + "OCRResponseTypedDict": ".ocrresponse", + "Format": ".ocrtableobject", + "OCRTableObject": ".ocrtableobject", + "OCRTableObjectTypedDict": ".ocrtableobject", + "OCRUsageInfo": ".ocrusageinfo", + "OCRUsageInfoTypedDict": ".ocrusageinfo", + "Prediction": ".prediction", + "PredictionTypedDict": ".prediction", + "ReferenceChunk": ".referencechunk", + "ReferenceChunkTypedDict": ".referencechunk", + "ResponseFormat": ".responseformat", + "ResponseFormatTypedDict": ".responseformat", + "ResponseFormats": ".responseformats", + "Security": ".security", + "SecurityTypedDict": ".security", + "SystemMessage": ".systemmessage", + "SystemMessageContent": ".systemmessage", + "SystemMessageContentTypedDict": ".systemmessage", + "SystemMessageTypedDict": ".systemmessage", + "SystemMessageContentChunks": ".systemmessagecontentchunks", + "SystemMessageContentChunksTypedDict": ".systemmessagecontentchunks", + "TextChunk": ".textchunk", + "TextChunkTypedDict": ".textchunk", + "ThinkChunk": ".thinkchunk", + "ThinkChunkTypedDict": ".thinkchunk", + "Thinking": ".thinkchunk", + "ThinkingTypedDict": ".thinkchunk", + "Tool": ".tool", + "ToolTypedDict": ".tool", + "ToolCall": ".toolcall", + "ToolCallTypedDict": ".toolcall", + "ToolChoice": ".toolchoice", + "ToolChoiceTypedDict": ".toolchoice", + "ToolChoiceEnum": ".toolchoiceenum", + "ToolMessage": ".toolmessage", + "ToolMessageContent": ".toolmessage", + "ToolMessageContentTypedDict": ".toolmessage", + "ToolMessageTypedDict": ".toolmessage", + "ToolReferenceChunk": ".toolreferencechunk", + "ToolReferenceChunkTypedDict": ".toolreferencechunk", + "ToolUnion": ".toolreferencechunk", + "ToolUnionTypedDict": ".toolreferencechunk", + "ToolTypes": ".tooltypes", + "UsageInfo": ".usageinfo", + "UsageInfoTypedDict": ".usageinfo", + "UserMessage": ".usermessage", + "UserMessageContent": ".usermessage", + "UserMessageContentTypedDict": ".usermessage", + "UserMessageTypedDict": ".usermessage", + "Context": ".validationerror", + "ContextTypedDict": ".validationerror", + "Loc": ".validationerror", + "LocTypedDict": ".validationerror", + "ValidationError": ".validationerror", + "ValidationErrorTypedDict": ".validationerror", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/packages/azure/src/mistralai/azure/client/models/assistantmessage.py b/packages/azure/src/mistralai/azure/client/models/assistantmessage.py new file mode 100644 index 00000000..e9ae6e82 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/assistantmessage.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from .toolcall import ToolCall, ToolCallTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AssistantMessageContentTypedDict = TypeAliasType( + "AssistantMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +AssistantMessageContent = TypeAliasType( + "AssistantMessageContent", Union[str, List[ContentChunk]] +) + + +class AssistantMessageTypedDict(TypedDict): + role: Literal["assistant"] + content: NotRequired[Nullable[AssistantMessageContentTypedDict]] + tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] + prefix: NotRequired[bool] + r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" + + +class AssistantMessage(BaseModel): + role: Annotated[ + Annotated[ + Optional[Literal["assistant"]], AfterValidator(validate_const("assistant")) + ], + pydantic.Field(alias="role"), + ] = "assistant" + + content: OptionalNullable[AssistantMessageContent] = UNSET + + tool_calls: OptionalNullable[List[ToolCall]] = UNSET + + prefix: Optional[bool] = False + r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["role", "content", "tool_calls", "prefix"]) + nullable_fields = set(["content", "tool_calls"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + AssistantMessage.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/models/builtinconnectors.py b/packages/azure/src/mistralai/azure/client/models/builtinconnectors.py similarity index 100% rename from src/mistralai/models/builtinconnectors.py rename to packages/azure/src/mistralai/azure/client/models/builtinconnectors.py diff --git a/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py new file mode 100644 index 00000000..67b5ba69 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionchoice.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from mistralai.azure.client.types import BaseModel, UnrecognizedStr +from typing import Literal, Union +from typing_extensions import TypedDict + + +ChatCompletionChoiceFinishReason = Union[ + Literal[ + "stop", + "length", + "model_length", + "error", + "tool_calls", + ], + UnrecognizedStr, +] + + +class ChatCompletionChoiceTypedDict(TypedDict): + index: int + message: AssistantMessageTypedDict + finish_reason: ChatCompletionChoiceFinishReason + + +class ChatCompletionChoice(BaseModel): + index: int + + message: AssistantMessage + + finish_reason: ChatCompletionChoiceFinishReason diff --git a/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py new file mode 100644 index 00000000..edd0fdc7 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionrequest.py @@ -0,0 +1,225 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .mistralpromptmode import MistralPromptMode +from .prediction import Prediction, PredictionTypedDict +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .tool import Tool, ToolTypedDict +from .toolchoice import ToolChoice, ToolChoiceTypedDict +from .toolchoiceenum import ToolChoiceEnum +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.azure.client.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ChatCompletionRequestStopTypedDict = TypeAliasType( + "ChatCompletionRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionRequestStop = TypeAliasType( + "ChatCompletionRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionRequestMessageTypedDict = TypeAliasType( + "ChatCompletionRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +ChatCompletionRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +ChatCompletionRequestToolChoiceTypedDict = TypeAliasType( + "ChatCompletionRequestToolChoiceTypedDict", + Union[ToolChoiceTypedDict, ToolChoiceEnum], +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +ChatCompletionRequestToolChoice = TypeAliasType( + "ChatCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +class ChatCompletionRequestTypedDict(TypedDict): + messages: List[ChatCompletionRequestMessageTypedDict] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + model: NotRequired[str] + r"""The ID of the model to use for this request.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[float] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + stop: NotRequired[ChatCompletionRequestStopTypedDict] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + response_format: NotRequired[ResponseFormatTypedDict] + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + tools: NotRequired[Nullable[List[ToolTypedDict]]] + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + tool_choice: NotRequired[ChatCompletionRequestToolChoiceTypedDict] + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + presence_penalty: NotRequired[float] + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + frequency_penalty: NotRequired[float] + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + n: NotRequired[Nullable[int]] + r"""Number of completions to return for each request, input tokens are only billed once.""" + prediction: NotRequired[PredictionTypedDict] + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + parallel_tool_calls: NotRequired[bool] + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + prompt_mode: NotRequired[Nullable[MistralPromptMode]] + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + safe_prompt: NotRequired[bool] + r"""Whether to inject a safety prompt before all conversations.""" + + +class ChatCompletionRequest(BaseModel): + messages: List[ChatCompletionRequestMessage] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + + model: Optional[str] = "azureai" + r"""The ID of the model to use for this request.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: Optional[float] = None + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = False + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + + stop: Optional[ChatCompletionRequestStop] = None + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + response_format: Optional[ResponseFormat] = None + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + tools: OptionalNullable[List[Tool]] = UNSET + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + + tool_choice: Optional[ChatCompletionRequestToolChoice] = None + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + presence_penalty: Optional[float] = None + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + + frequency_penalty: Optional[float] = None + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + + n: OptionalNullable[int] = UNSET + r"""Number of completions to return for each request, input tokens are only billed once.""" + + prediction: Optional[Prediction] = None + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + parallel_tool_calls: Optional[bool] = None + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + + prompt_mode: OptionalNullable[MistralPromptMode] = UNSET + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + safe_prompt: Optional[bool] = None + r"""Whether to inject a safety prompt before all conversations.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "model", + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "response_format", + "tools", + "tool_choice", + "presence_penalty", + "frequency_penalty", + "n", + "prediction", + "parallel_tool_calls", + "prompt_mode", + "safe_prompt", + ] + ) + nullable_fields = set( + [ + "temperature", + "max_tokens", + "random_seed", + "metadata", + "tools", + "n", + "prompt_mode", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/chatcompletionresponse.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionresponse.py new file mode 100644 index 00000000..d41f9c6f --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionresponse.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.azure.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ChatCompletionResponseTypedDict(TypedDict): + id: str + object: str + model: str + usage: UsageInfoTypedDict + created: int + choices: List[ChatCompletionChoiceTypedDict] + + +class ChatCompletionResponse(BaseModel): + id: str + + object: str + + model: str + + usage: UsageInfo + + created: int + + choices: List[ChatCompletionChoice] diff --git a/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py b/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py new file mode 100644 index 00000000..2edfbed9 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/chatcompletionstreamrequest.py @@ -0,0 +1,223 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .mistralpromptmode import MistralPromptMode +from .prediction import Prediction, PredictionTypedDict +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .tool import Tool, ToolTypedDict +from .toolchoice import ToolChoice, ToolChoiceTypedDict +from .toolchoiceenum import ToolChoiceEnum +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.azure.client.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ChatCompletionStreamRequestStopTypedDict = TypeAliasType( + "ChatCompletionStreamRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionStreamRequestStop = TypeAliasType( + "ChatCompletionStreamRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionStreamRequestMessageTypedDict = TypeAliasType( + "ChatCompletionStreamRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +ChatCompletionStreamRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +ChatCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( + "ChatCompletionStreamRequestToolChoiceTypedDict", + Union[ToolChoiceTypedDict, ToolChoiceEnum], +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +ChatCompletionStreamRequestToolChoice = TypeAliasType( + "ChatCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +class ChatCompletionStreamRequestTypedDict(TypedDict): + messages: List[ChatCompletionStreamRequestMessageTypedDict] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + model: NotRequired[str] + r"""The ID of the model to use for this request.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[float] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + stop: NotRequired[ChatCompletionStreamRequestStopTypedDict] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + response_format: NotRequired[ResponseFormatTypedDict] + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + tools: NotRequired[Nullable[List[ToolTypedDict]]] + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + tool_choice: NotRequired[ChatCompletionStreamRequestToolChoiceTypedDict] + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + presence_penalty: NotRequired[float] + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + frequency_penalty: NotRequired[float] + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + n: NotRequired[Nullable[int]] + r"""Number of completions to return for each request, input tokens are only billed once.""" + prediction: NotRequired[PredictionTypedDict] + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + parallel_tool_calls: NotRequired[bool] + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + prompt_mode: NotRequired[Nullable[MistralPromptMode]] + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + safe_prompt: NotRequired[bool] + r"""Whether to inject a safety prompt before all conversations.""" + + +class ChatCompletionStreamRequest(BaseModel): + messages: List[ChatCompletionStreamRequestMessage] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + + model: Optional[str] = "azureai" + r"""The ID of the model to use for this request.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: Optional[float] = None + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = True + + stop: Optional[ChatCompletionStreamRequestStop] = None + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + response_format: Optional[ResponseFormat] = None + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + tools: OptionalNullable[List[Tool]] = UNSET + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + + tool_choice: Optional[ChatCompletionStreamRequestToolChoice] = None + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + presence_penalty: Optional[float] = None + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + + frequency_penalty: Optional[float] = None + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + + n: OptionalNullable[int] = UNSET + r"""Number of completions to return for each request, input tokens are only billed once.""" + + prediction: Optional[Prediction] = None + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + parallel_tool_calls: Optional[bool] = None + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + + prompt_mode: OptionalNullable[MistralPromptMode] = UNSET + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + safe_prompt: Optional[bool] = None + r"""Whether to inject a safety prompt before all conversations.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "model", + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "response_format", + "tools", + "tool_choice", + "presence_penalty", + "frequency_penalty", + "n", + "prediction", + "parallel_tool_calls", + "prompt_mode", + "safe_prompt", + ] + ) + nullable_fields = set( + [ + "temperature", + "max_tokens", + "random_seed", + "metadata", + "tools", + "n", + "prompt_mode", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/completionchunk.py b/packages/azure/src/mistralai/azure/client/models/completionchunk.py new file mode 100644 index 00000000..0e64bbc8 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/completionchunk.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .completionresponsestreamchoice import ( + CompletionResponseStreamChoice, + CompletionResponseStreamChoiceTypedDict, +) +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class CompletionChunkTypedDict(TypedDict): + id: str + model: str + choices: List[CompletionResponseStreamChoiceTypedDict] + object: NotRequired[str] + created: NotRequired[int] + usage: NotRequired[UsageInfoTypedDict] + + +class CompletionChunk(BaseModel): + id: str + + model: str + + choices: List[CompletionResponseStreamChoice] + + object: Optional[str] = None + + created: Optional[int] = None + + usage: Optional[UsageInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "created", "usage"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/completionevent.py b/packages/azure/src/mistralai/azure/client/models/completionevent.py new file mode 100644 index 00000000..c4b27287 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/completionevent.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .completionchunk import CompletionChunk, CompletionChunkTypedDict +from mistralai.azure.client.types import BaseModel +from typing_extensions import TypedDict + + +class CompletionEventTypedDict(TypedDict): + data: CompletionChunkTypedDict + + +class CompletionEvent(BaseModel): + data: CompletionChunk diff --git a/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py b/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py new file mode 100644 index 00000000..20a27140 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/completionresponsestreamchoice.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .deltamessage import DeltaMessage, DeltaMessageTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import Literal, Union +from typing_extensions import TypedDict + + +CompletionResponseStreamChoiceFinishReason = Union[ + Literal[ + "stop", + "length", + "error", + "tool_calls", + ], + UnrecognizedStr, +] + + +class CompletionResponseStreamChoiceTypedDict(TypedDict): + index: int + delta: DeltaMessageTypedDict + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] + + +class CompletionResponseStreamChoice(BaseModel): + index: int + + delta: DeltaMessage + + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/contentchunk.py b/packages/azure/src/mistralai/azure/client/models/contentchunk.py new file mode 100644 index 00000000..17efcc7d --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/contentchunk.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict +from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict +from .textchunk import TextChunk, TextChunkTypedDict +from functools import partial +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +ContentChunkTypedDict = TypeAliasType( + "ContentChunkTypedDict", + Union[TextChunkTypedDict, ImageURLChunkTypedDict, ReferenceChunkTypedDict], +) + + +class UnknownContentChunk(BaseModel): + r"""A ContentChunk variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_CONTENT_CHUNK_VARIANTS: dict[str, Any] = { + "image_url": ImageURLChunk, + "text": TextChunk, + "reference": ReferenceChunk, +} + + +ContentChunk = Annotated[ + Union[ImageURLChunk, TextChunk, ReferenceChunk, UnknownContentChunk], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_CONTENT_CHUNK_VARIANTS, + unknown_cls=UnknownContentChunk, + union_name="ContentChunk", + ) + ), +] diff --git a/packages/azure/src/mistralai/azure/client/models/deltamessage.py b/packages/azure/src/mistralai/azure/client/models/deltamessage.py new file mode 100644 index 00000000..567e772f --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/deltamessage.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from .toolcall import ToolCall, ToolCallTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +DeltaMessageContentTypedDict = TypeAliasType( + "DeltaMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +DeltaMessageContent = TypeAliasType( + "DeltaMessageContent", Union[str, List[ContentChunk]] +) + + +class DeltaMessageTypedDict(TypedDict): + role: NotRequired[Nullable[str]] + content: NotRequired[Nullable[DeltaMessageContentTypedDict]] + tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] + + +class DeltaMessage(BaseModel): + role: OptionalNullable[str] = UNSET + + content: OptionalNullable[DeltaMessageContent] = UNSET + + tool_calls: OptionalNullable[List[ToolCall]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["role", "content", "tool_calls"]) + nullable_fields = set(["role", "content", "tool_calls"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py b/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py new file mode 100644 index 00000000..2dea8005 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/documenturlchunk.py @@ -0,0 +1,69 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DocumentURLChunkTypedDict(TypedDict): + document_url: str + type: Literal["document_url"] + document_name: NotRequired[Nullable[str]] + r"""The filename of the document""" + + +class DocumentURLChunk(BaseModel): + document_url: str + + type: Annotated[ + Annotated[ + Optional[Literal["document_url"]], + AfterValidator(validate_const("document_url")), + ], + pydantic.Field(alias="type"), + ] = "document_url" + + document_name: OptionalNullable[str] = UNSET + r"""The filename of the document""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "document_name"]) + nullable_fields = set(["document_name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + DocumentURLChunk.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/filechunk.py b/packages/azure/src/mistralai/azure/client/models/filechunk.py new file mode 100644 index 00000000..6baa0cba --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/filechunk.py @@ -0,0 +1,46 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class FileChunkTypedDict(TypedDict): + file_id: str + type: Literal["file"] + + +class FileChunk(BaseModel): + file_id: str + + type: Annotated[ + Annotated[Optional[Literal["file"]], AfterValidator(validate_const("file"))], + pydantic.Field(alias="type"), + ] = "file" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + FileChunk.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/function.py b/packages/azure/src/mistralai/azure/client/models/function.py new file mode 100644 index 00000000..055d3657 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/function.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class FunctionTypedDict(TypedDict): + name: str + parameters: Dict[str, Any] + description: NotRequired[str] + strict: NotRequired[bool] + + +class Function(BaseModel): + name: str + + parameters: Dict[str, Any] + + description: Optional[str] = None + + strict: Optional[bool] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "strict"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/functioncall.py b/packages/azure/src/mistralai/azure/client/models/functioncall.py new file mode 100644 index 00000000..d476792c --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/functioncall.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel +from typing import Any, Dict, Union +from typing_extensions import TypeAliasType, TypedDict + + +ArgumentsTypedDict = TypeAliasType("ArgumentsTypedDict", Union[Dict[str, Any], str]) + + +Arguments = TypeAliasType("Arguments", Union[Dict[str, Any], str]) + + +class FunctionCallTypedDict(TypedDict): + name: str + arguments: ArgumentsTypedDict + + +class FunctionCall(BaseModel): + name: str + + arguments: Arguments diff --git a/packages/azure/src/mistralai/azure/client/models/functionname.py b/packages/azure/src/mistralai/azure/client/models/functionname.py new file mode 100644 index 00000000..839e0d55 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/functionname.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel +from typing_extensions import TypedDict + + +class FunctionNameTypedDict(TypedDict): + r"""this restriction of `Function` is used to select a specific function to call""" + + name: str + + +class FunctionName(BaseModel): + r"""this restriction of `Function` is used to select a specific function to call""" + + name: str diff --git a/packages/azure/src/mistralai/azure/client/models/imagedetail.py b/packages/azure/src/mistralai/azure/client/models/imagedetail.py new file mode 100644 index 00000000..2d074cee --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/imagedetail.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import UnrecognizedStr +from typing import Literal, Union + + +ImageDetail = Union[ + Literal[ + "low", + "auto", + "high", + ], + UnrecognizedStr, +] diff --git a/packages/azure/src/mistralai/azure/client/models/imageurl.py b/packages/azure/src/mistralai/azure/client/models/imageurl.py new file mode 100644 index 00000000..bcb4fe43 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/imageurl.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imagedetail import ImageDetail +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ImageURLTypedDict(TypedDict): + url: str + detail: NotRequired[Nullable[ImageDetail]] + + +class ImageURL(BaseModel): + url: str + + detail: OptionalNullable[ImageDetail] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["detail"]) + nullable_fields = set(["detail"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py b/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py new file mode 100644 index 00000000..7213c498 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/imageurlchunk.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imageurl import ImageURL, ImageURLTypedDict +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ImageURLUnionTypedDict = TypeAliasType( + "ImageURLUnionTypedDict", Union[ImageURLTypedDict, str] +) + + +ImageURLUnion = TypeAliasType("ImageURLUnion", Union[ImageURL, str]) + + +class ImageURLChunkTypedDict(TypedDict): + r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + + image_url: ImageURLUnionTypedDict + type: Literal["image_url"] + + +class ImageURLChunk(BaseModel): + r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + + image_url: ImageURLUnion + + type: Annotated[ + Annotated[ + Optional[Literal["image_url"]], AfterValidator(validate_const("image_url")) + ], + pydantic.Field(alias="type"), + ] = "image_url" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ImageURLChunk.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/jsonschema.py b/packages/azure/src/mistralai/azure/client/models/jsonschema.py new file mode 100644 index 00000000..99f2fb89 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/jsonschema.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JSONSchemaTypedDict(TypedDict): + name: str + schema_definition: Dict[str, Any] + description: NotRequired[Nullable[str]] + strict: NotRequired[bool] + + +class JSONSchema(BaseModel): + name: str + + schema_definition: Annotated[Dict[str, Any], pydantic.Field(alias="schema")] + + description: OptionalNullable[str] = UNSET + + strict: Optional[bool] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "strict"]) + nullable_fields = set(["description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + JSONSchema.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/mistralpromptmode.py b/packages/azure/src/mistralai/azure/client/models/mistralpromptmode.py new file mode 100644 index 00000000..26e7adbd --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/mistralpromptmode.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import UnrecognizedStr +from typing import Literal, Union + + +MistralPromptMode = Union[Literal["reasoning",], UnrecognizedStr] +r"""Available options to the prompt_mode argument on the chat completion endpoint. +Values represent high-level intent. Assignment to actual SPs is handled internally. +System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc. +""" diff --git a/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py b/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py new file mode 100644 index 00000000..a23515b3 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrimageobject.py @@ -0,0 +1,86 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class OCRImageObjectTypedDict(TypedDict): + id: str + r"""Image ID for extracted image in a page""" + top_left_x: Nullable[int] + r"""X coordinate of top-left corner of the extracted image""" + top_left_y: Nullable[int] + r"""Y coordinate of top-left corner of the extracted image""" + bottom_right_x: Nullable[int] + r"""X coordinate of bottom-right corner of the extracted image""" + bottom_right_y: Nullable[int] + r"""Y coordinate of bottom-right corner of the extracted image""" + image_base64: NotRequired[Nullable[str]] + r"""Base64 string of the extracted image""" + image_annotation: NotRequired[Nullable[str]] + r"""Annotation of the extracted image in json str""" + + +class OCRImageObject(BaseModel): + id: str + r"""Image ID for extracted image in a page""" + + top_left_x: Nullable[int] + r"""X coordinate of top-left corner of the extracted image""" + + top_left_y: Nullable[int] + r"""Y coordinate of top-left corner of the extracted image""" + + bottom_right_x: Nullable[int] + r"""X coordinate of bottom-right corner of the extracted image""" + + bottom_right_y: Nullable[int] + r"""Y coordinate of bottom-right corner of the extracted image""" + + image_base64: OptionalNullable[str] = UNSET + r"""Base64 string of the extracted image""" + + image_annotation: OptionalNullable[str] = UNSET + r"""Annotation of the extracted image in json str""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["image_base64", "image_annotation"]) + nullable_fields = set( + [ + "top_left_x", + "top_left_y", + "bottom_right_x", + "bottom_right_y", + "image_base64", + "image_annotation", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/ocrpagedimensions.py b/packages/azure/src/mistralai/azure/client/models/ocrpagedimensions.py new file mode 100644 index 00000000..12858da9 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrpagedimensions.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel +from typing_extensions import TypedDict + + +class OCRPageDimensionsTypedDict(TypedDict): + dpi: int + r"""Dots per inch of the page-image""" + height: int + r"""Height of the image in pixels""" + width: int + r"""Width of the image in pixels""" + + +class OCRPageDimensions(BaseModel): + dpi: int + r"""Dots per inch of the page-image""" + + height: int + r"""Height of the image in pixels""" + + width: int + r"""Width of the image in pixels""" diff --git a/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py b/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py new file mode 100644 index 00000000..434c8988 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrpageobject.py @@ -0,0 +1,86 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict +from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict +from .ocrtableobject import OCRTableObject, OCRTableObjectTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class OCRPageObjectTypedDict(TypedDict): + index: int + r"""The page index in a pdf document starting from 0""" + markdown: str + r"""The markdown string response of the page""" + images: List[OCRImageObjectTypedDict] + r"""List of all extracted images in the page""" + dimensions: Nullable[OCRPageDimensionsTypedDict] + r"""The dimensions of the PDF Page's screenshot image""" + tables: NotRequired[List[OCRTableObjectTypedDict]] + r"""List of all extracted tables in the page""" + hyperlinks: NotRequired[List[str]] + r"""List of all hyperlinks in the page""" + header: NotRequired[Nullable[str]] + r"""Header of the page""" + footer: NotRequired[Nullable[str]] + r"""Footer of the page""" + + +class OCRPageObject(BaseModel): + index: int + r"""The page index in a pdf document starting from 0""" + + markdown: str + r"""The markdown string response of the page""" + + images: List[OCRImageObject] + r"""List of all extracted images in the page""" + + dimensions: Nullable[OCRPageDimensions] + r"""The dimensions of the PDF Page's screenshot image""" + + tables: Optional[List[OCRTableObject]] = None + r"""List of all extracted tables in the page""" + + hyperlinks: Optional[List[str]] = None + r"""List of all hyperlinks in the page""" + + header: OptionalNullable[str] = UNSET + r"""Header of the page""" + + footer: OptionalNullable[str] = UNSET + r"""Footer of the page""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tables", "hyperlinks", "header", "footer"]) + nullable_fields = set(["header", "footer", "dimensions"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/ocrrequest.py b/packages/azure/src/mistralai/azure/client/models/ocrrequest.py new file mode 100644 index 00000000..a2cd3415 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrrequest.py @@ -0,0 +1,145 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict +from .filechunk import FileChunk, FileChunkTypedDict +from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +DocumentTypedDict = TypeAliasType( + "DocumentTypedDict", + Union[FileChunkTypedDict, ImageURLChunkTypedDict, DocumentURLChunkTypedDict], +) +r"""Document to run OCR on""" + + +Document = TypeAliasType("Document", Union[FileChunk, ImageURLChunk, DocumentURLChunk]) +r"""Document to run OCR on""" + + +TableFormat = Literal[ + "markdown", + "html", +] + + +class OCRRequestTypedDict(TypedDict): + model: Nullable[str] + document: DocumentTypedDict + r"""Document to run OCR on""" + id: NotRequired[str] + pages: NotRequired[Nullable[List[int]]] + r"""Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0""" + include_image_base64: NotRequired[Nullable[bool]] + r"""Include image URLs in response""" + image_limit: NotRequired[Nullable[int]] + r"""Max images to extract""" + image_min_size: NotRequired[Nullable[int]] + r"""Minimum height and width of image to extract""" + bbox_annotation_format: NotRequired[Nullable[ResponseFormatTypedDict]] + r"""Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field""" + document_annotation_format: NotRequired[Nullable[ResponseFormatTypedDict]] + r"""Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field""" + document_annotation_prompt: NotRequired[Nullable[str]] + r"""Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided.""" + table_format: NotRequired[Nullable[TableFormat]] + extract_header: NotRequired[bool] + extract_footer: NotRequired[bool] + + +class OCRRequest(BaseModel): + model: Nullable[str] + + document: Document + r"""Document to run OCR on""" + + id: Optional[str] = None + + pages: OptionalNullable[List[int]] = UNSET + r"""Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0""" + + include_image_base64: OptionalNullable[bool] = UNSET + r"""Include image URLs in response""" + + image_limit: OptionalNullable[int] = UNSET + r"""Max images to extract""" + + image_min_size: OptionalNullable[int] = UNSET + r"""Minimum height and width of image to extract""" + + bbox_annotation_format: OptionalNullable[ResponseFormat] = UNSET + r"""Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field""" + + document_annotation_format: OptionalNullable[ResponseFormat] = UNSET + r"""Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field""" + + document_annotation_prompt: OptionalNullable[str] = UNSET + r"""Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided.""" + + table_format: OptionalNullable[TableFormat] = UNSET + + extract_header: Optional[bool] = None + + extract_footer: Optional[bool] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "id", + "pages", + "include_image_base64", + "image_limit", + "image_min_size", + "bbox_annotation_format", + "document_annotation_format", + "document_annotation_prompt", + "table_format", + "extract_header", + "extract_footer", + ] + ) + nullable_fields = set( + [ + "model", + "pages", + "include_image_base64", + "image_limit", + "image_min_size", + "bbox_annotation_format", + "document_annotation_format", + "document_annotation_prompt", + "table_format", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/ocrresponse.py b/packages/azure/src/mistralai/azure/client/models/ocrresponse.py new file mode 100644 index 00000000..3dc09fd7 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrresponse.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict +from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class OCRResponseTypedDict(TypedDict): + pages: List[OCRPageObjectTypedDict] + r"""List of OCR info for pages.""" + model: str + r"""The model used to generate the OCR.""" + usage_info: OCRUsageInfoTypedDict + document_annotation: NotRequired[Nullable[str]] + r"""Formatted response in the request_format if provided in json str""" + + +class OCRResponse(BaseModel): + pages: List[OCRPageObject] + r"""List of OCR info for pages.""" + + model: str + r"""The model used to generate the OCR.""" + + usage_info: OCRUsageInfo + + document_annotation: OptionalNullable[str] = UNSET + r"""Formatted response in the request_format if provided in json str""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["document_annotation"]) + nullable_fields = set(["document_annotation"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py b/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py new file mode 100644 index 00000000..f1de5428 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrtableobject.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel, UnrecognizedStr +import pydantic +from typing import Literal, Union +from typing_extensions import Annotated, TypedDict + + +Format = Union[ + Literal[ + "markdown", + "html", + ], + UnrecognizedStr, +] +r"""Format of the table""" + + +class OCRTableObjectTypedDict(TypedDict): + id: str + r"""Table ID for extracted table in a page""" + content: str + r"""Content of the table in the given format""" + format_: Format + r"""Format of the table""" + + +class OCRTableObject(BaseModel): + id: str + r"""Table ID for extracted table in a page""" + + content: str + r"""Content of the table in the given format""" + + format_: Annotated[Format, pydantic.Field(alias="format")] + r"""Format of the table""" + + +try: + OCRTableObject.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py b/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py new file mode 100644 index 00000000..f63315d2 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/ocrusageinfo.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class OCRUsageInfoTypedDict(TypedDict): + pages_processed: int + r"""Number of pages processed""" + doc_size_bytes: NotRequired[Nullable[int]] + r"""Document size in bytes""" + + +class OCRUsageInfo(BaseModel): + pages_processed: int + r"""Number of pages processed""" + + doc_size_bytes: OptionalNullable[int] = UNSET + r"""Document size in bytes""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["doc_size_bytes"]) + nullable_fields = set(["doc_size_bytes"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/prediction.py b/packages/azure/src/mistralai/azure/client/models/prediction.py new file mode 100644 index 00000000..1fa1d782 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/prediction.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PredictionTypedDict(TypedDict): + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + type: Literal["content"] + content: NotRequired[str] + + +class Prediction(BaseModel): + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + type: Annotated[ + Annotated[ + Optional[Literal["content"]], AfterValidator(validate_const("content")) + ], + pydantic.Field(alias="type"), + ] = "content" + + content: Optional[str] = "" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "content"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + Prediction.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/referencechunk.py b/packages/azure/src/mistralai/azure/client/models/referencechunk.py new file mode 100644 index 00000000..f7af9bf9 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/referencechunk.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ReferenceChunkTypedDict(TypedDict): + reference_ids: List[int] + type: Literal["reference"] + + +class ReferenceChunk(BaseModel): + reference_ids: List[int] + + type: Annotated[ + Annotated[ + Optional[Literal["reference"]], AfterValidator(validate_const("reference")) + ], + pydantic.Field(alias="type"), + ] = "reference" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ReferenceChunk.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/responseformat.py b/packages/azure/src/mistralai/azure/client/models/responseformat.py new file mode 100644 index 00000000..20fd2b86 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/responseformat.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .jsonschema import JSONSchema, JSONSchemaTypedDict +from .responseformats import ResponseFormats +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ResponseFormatTypedDict(TypedDict): + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + type: NotRequired[ResponseFormats] + json_schema: NotRequired[Nullable[JSONSchemaTypedDict]] + + +class ResponseFormat(BaseModel): + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + type: Optional[ResponseFormats] = None + + json_schema: OptionalNullable[JSONSchema] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "json_schema"]) + nullable_fields = set(["json_schema"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/responseformats.py b/packages/azure/src/mistralai/azure/client/models/responseformats.py new file mode 100644 index 00000000..cbf83ce7 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/responseformats.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ResponseFormats = Literal[ + "text", + "json_object", + "json_schema", +] diff --git a/packages/azure/src/mistralai/azure/client/models/security.py b/packages/azure/src/mistralai/azure/client/models/security.py new file mode 100644 index 00000000..9b83ba98 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/security.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import FieldMetadata, SecurityMetadata +from typing_extensions import Annotated, TypedDict + + +class SecurityTypedDict(TypedDict): + api_key: str + + +class Security(BaseModel): + api_key: Annotated[ + str, + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="http", + sub_type="bearer", + field_name="Authorization", + ) + ), + ] diff --git a/packages/azure/src/mistralai/azure/client/models/systemmessage.py b/packages/azure/src/mistralai/azure/client/models/systemmessage.py new file mode 100644 index 00000000..d4bd0044 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/systemmessage.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .systemmessagecontentchunks import ( + SystemMessageContentChunks, + SystemMessageContentChunksTypedDict, +) +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +SystemMessageContentTypedDict = TypeAliasType( + "SystemMessageContentTypedDict", + Union[str, List[SystemMessageContentChunksTypedDict]], +) + + +SystemMessageContent = TypeAliasType( + "SystemMessageContent", Union[str, List[SystemMessageContentChunks]] +) + + +class SystemMessageTypedDict(TypedDict): + content: SystemMessageContentTypedDict + role: Literal["system"] + + +class SystemMessage(BaseModel): + content: SystemMessageContent + + role: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="role"), + ] = "system" + + +try: + SystemMessage.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/systemmessagecontentchunks.py b/packages/azure/src/mistralai/azure/client/models/systemmessagecontentchunks.py new file mode 100644 index 00000000..8de71c90 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/systemmessagecontentchunks.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .textchunk import TextChunk, TextChunkTypedDict +from .thinkchunk import ThinkChunk, ThinkChunkTypedDict +from pydantic import Field +from typing import Union +from typing_extensions import Annotated, TypeAliasType + + +SystemMessageContentChunksTypedDict = TypeAliasType( + "SystemMessageContentChunksTypedDict", + Union[TextChunkTypedDict, ThinkChunkTypedDict], +) + + +SystemMessageContentChunks = Annotated[ + Union[TextChunk, ThinkChunk], Field(discriminator="type") +] diff --git a/packages/azure/src/mistralai/azure/client/models/textchunk.py b/packages/azure/src/mistralai/azure/client/models/textchunk.py new file mode 100644 index 00000000..92951485 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/textchunk.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class TextChunkTypedDict(TypedDict): + text: str + type: Literal["text"] + + +class TextChunk(BaseModel): + text: str + + type: Annotated[ + Annotated[Literal["text"], AfterValidator(validate_const("text"))], + pydantic.Field(alias="type"), + ] = "text" + + +try: + TextChunk.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/thinkchunk.py b/packages/azure/src/mistralai/azure/client/models/thinkchunk.py new file mode 100644 index 00000000..ec8e7f95 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/thinkchunk.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict +from .textchunk import TextChunk, TextChunkTypedDict +from .toolreferencechunk import ToolReferenceChunk, ToolReferenceChunkTypedDict +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ThinkingTypedDict = TypeAliasType( + "ThinkingTypedDict", + Union[TextChunkTypedDict, ReferenceChunkTypedDict, ToolReferenceChunkTypedDict], +) + + +Thinking = TypeAliasType( + "Thinking", Union[TextChunk, ReferenceChunk, ToolReferenceChunk] +) + + +class ThinkChunkTypedDict(TypedDict): + thinking: List[ThinkingTypedDict] + type: Literal["thinking"] + closed: NotRequired[bool] + r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" + + +class ThinkChunk(BaseModel): + thinking: List[Thinking] + + type: Annotated[ + Annotated[Literal["thinking"], AfterValidator(validate_const("thinking"))], + pydantic.Field(alias="type"), + ] = "thinking" + + closed: Optional[bool] = None + r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["closed"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ThinkChunk.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/tool.py b/packages/azure/src/mistralai/azure/client/models/tool.py new file mode 100644 index 00000000..87329bdb --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/tool.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .function import Function, FunctionTypedDict +from .tooltypes import ToolTypes +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ToolTypedDict(TypedDict): + function: FunctionTypedDict + type: NotRequired[ToolTypes] + + +class Tool(BaseModel): + function: Function + + type: Optional[ToolTypes] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/toolcall.py b/packages/azure/src/mistralai/azure/client/models/toolcall.py new file mode 100644 index 00000000..ada1ea65 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/toolcall.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .functioncall import FunctionCall, FunctionCallTypedDict +from .tooltypes import ToolTypes +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ToolCallTypedDict(TypedDict): + function: FunctionCallTypedDict + id: NotRequired[str] + type: NotRequired[ToolTypes] + index: NotRequired[int] + + +class ToolCall(BaseModel): + function: FunctionCall + + id: Optional[str] = "null" + + type: Optional[ToolTypes] = None + + index: Optional[int] = 0 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id", "type", "index"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/toolchoice.py b/packages/azure/src/mistralai/azure/client/models/toolchoice.py new file mode 100644 index 00000000..ddb9e141 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/toolchoice.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .functionname import FunctionName, FunctionNameTypedDict +from .tooltypes import ToolTypes +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ToolChoiceTypedDict(TypedDict): + r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" + + function: FunctionNameTypedDict + r"""this restriction of `Function` is used to select a specific function to call""" + type: NotRequired[ToolTypes] + + +class ToolChoice(BaseModel): + r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" + + function: FunctionName + r"""this restriction of `Function` is used to select a specific function to call""" + + type: Optional[ToolTypes] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/toolchoiceenum.py b/packages/azure/src/mistralai/azure/client/models/toolchoiceenum.py new file mode 100644 index 00000000..01f6f677 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/toolchoiceenum.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ToolChoiceEnum = Literal[ + "auto", + "none", + "any", + "required", +] diff --git a/packages/azure/src/mistralai/azure/client/models/toolmessage.py b/packages/azure/src/mistralai/azure/client/models/toolmessage.py new file mode 100644 index 00000000..670210de --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/toolmessage.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolMessageContentTypedDict = TypeAliasType( + "ToolMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]]) + + +class ToolMessageTypedDict(TypedDict): + content: Nullable[ToolMessageContentTypedDict] + role: Literal["tool"] + tool_call_id: NotRequired[Nullable[str]] + name: NotRequired[Nullable[str]] + + +class ToolMessage(BaseModel): + content: Nullable[ToolMessageContent] + + role: Annotated[ + Annotated[Literal["tool"], AfterValidator(validate_const("tool"))], + pydantic.Field(alias="role"), + ] = "tool" + + tool_call_id: OptionalNullable[str] = UNSET + + name: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_call_id", "name"]) + nullable_fields = set(["content", "tool_call_id", "name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolMessage.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/toolreferencechunk.py b/packages/azure/src/mistralai/azure/client/models/toolreferencechunk.py new file mode 100644 index 00000000..c9db878f --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/toolreferencechunk.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .builtinconnectors import BuiltInConnectors +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolUnionTypedDict = TypeAliasType("ToolUnionTypedDict", Union[BuiltInConnectors, str]) + + +ToolUnion = TypeAliasType("ToolUnion", Union[BuiltInConnectors, str]) + + +class ToolReferenceChunkTypedDict(TypedDict): + tool: ToolUnionTypedDict + title: str + type: Literal["tool_reference"] + url: NotRequired[Nullable[str]] + favicon: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + + +class ToolReferenceChunk(BaseModel): + tool: ToolUnion + + title: str + + type: Annotated[ + Annotated[ + Optional[Literal["tool_reference"]], + AfterValidator(validate_const("tool_reference")), + ], + pydantic.Field(alias="type"), + ] = "tool_reference" + + url: OptionalNullable[str] = UNSET + + favicon: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "url", "favicon", "description"]) + nullable_fields = set(["url", "favicon", "description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolReferenceChunk.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/tooltypes.py b/packages/azure/src/mistralai/azure/client/models/tooltypes.py new file mode 100644 index 00000000..1cce7446 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/tooltypes.py @@ -0,0 +1,8 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import UnrecognizedStr +from typing import Literal, Union + + +ToolTypes = Union[Literal["function",], UnrecognizedStr] diff --git a/packages/azure/src/mistralai/azure/client/models/usageinfo.py b/packages/azure/src/mistralai/azure/client/models/usageinfo.py new file mode 100644 index 00000000..0f04c87c --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/usageinfo.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class UsageInfoTypedDict(TypedDict): + prompt_tokens: NotRequired[int] + completion_tokens: NotRequired[int] + total_tokens: NotRequired[int] + prompt_audio_seconds: NotRequired[Nullable[int]] + + +class UsageInfo(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + prompt_tokens: Optional[int] = 0 + + completion_tokens: Optional[int] = 0 + + total_tokens: Optional[int] = 0 + + prompt_audio_seconds: OptionalNullable[int] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "prompt_tokens", + "completion_tokens", + "total_tokens", + "prompt_audio_seconds", + ] + ) + nullable_fields = set(["prompt_audio_seconds"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/packages/azure/src/mistralai/azure/client/models/usermessage.py b/packages/azure/src/mistralai/azure/client/models/usermessage.py new file mode 100644 index 00000000..549b01ca --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/usermessage.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from mistralai.azure.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.azure.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +UserMessageContentTypedDict = TypeAliasType( + "UserMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]]) + + +class UserMessageTypedDict(TypedDict): + content: Nullable[UserMessageContentTypedDict] + role: Literal["user"] + + +class UserMessage(BaseModel): + content: Nullable[UserMessageContent] + + role: Annotated[ + Annotated[Literal["user"], AfterValidator(validate_const("user"))], + pydantic.Field(alias="role"), + ] = "user" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + m[k] = val + + return m + + +try: + UserMessage.model_rebuild() +except NameError: + pass diff --git a/packages/azure/src/mistralai/azure/client/models/validationerror.py b/packages/azure/src/mistralai/azure/client/models/validationerror.py new file mode 100644 index 00000000..f0169e18 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/models/validationerror.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.azure.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int]) + + +Loc = TypeAliasType("Loc", Union[str, int]) + + +class ContextTypedDict(TypedDict): + pass + + +class Context(BaseModel): + pass + + +class ValidationErrorTypedDict(TypedDict): + loc: List[LocTypedDict] + msg: str + type: str + input: NotRequired[Any] + ctx: NotRequired[ContextTypedDict] + + +class ValidationError(BaseModel): + loc: List[Loc] + + msg: str + + type: str + + input: Optional[Any] = None + + ctx: Optional[Context] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input", "ctx"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/azure/src/mistralai/azure/client/ocr.py b/packages/azure/src/mistralai/azure/client/ocr.py new file mode 100644 index 00000000..b9270f6a --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/ocr.py @@ -0,0 +1,276 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from mistralai.azure.client import errors, models, utils +from mistralai.azure.client._hooks import HookContext +from mistralai.azure.client.types import Nullable, OptionalNullable, UNSET +from mistralai.azure.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, List, Mapping, Optional, Union + + +class Ocr(BaseSDK): + def process( + self, + *, + model: Nullable[str], + document: Union[models.Document, models.DocumentTypedDict], + id: Optional[str] = None, + pages: OptionalNullable[List[int]] = UNSET, + include_image_base64: OptionalNullable[bool] = UNSET, + image_limit: OptionalNullable[int] = UNSET, + image_min_size: OptionalNullable[int] = UNSET, + bbox_annotation_format: OptionalNullable[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = UNSET, + document_annotation_format: OptionalNullable[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = UNSET, + document_annotation_prompt: OptionalNullable[str] = UNSET, + table_format: OptionalNullable[models.TableFormat] = UNSET, + extract_header: Optional[bool] = None, + extract_footer: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.OCRResponse: + r"""OCR + + :param model: + :param document: Document to run OCR on + :param id: + :param pages: Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 + :param include_image_base64: Include image URLs in response + :param image_limit: Max images to extract + :param image_min_size: Minimum height and width of image to extract + :param bbox_annotation_format: Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field + :param document_annotation_format: Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field + :param document_annotation_prompt: Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided. + :param table_format: + :param extract_header: + :param extract_footer: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.OCRRequest( + model=model, + id=id, + document=utils.get_pydantic_model(document, models.Document), + pages=pages, + include_image_base64=include_image_base64, + image_limit=image_limit, + image_min_size=image_min_size, + bbox_annotation_format=utils.get_pydantic_model( + bbox_annotation_format, OptionalNullable[models.ResponseFormat] + ), + document_annotation_format=utils.get_pydantic_model( + document_annotation_format, OptionalNullable[models.ResponseFormat] + ), + document_annotation_prompt=document_annotation_prompt, + table_format=table_format, + extract_header=extract_header, + extract_footer=extract_footer, + ) + + req = self._build_request( + method="POST", + path="/ocr", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.OCRRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="ocr_v1_ocr_post", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.OCRResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def process_async( + self, + *, + model: Nullable[str], + document: Union[models.Document, models.DocumentTypedDict], + id: Optional[str] = None, + pages: OptionalNullable[List[int]] = UNSET, + include_image_base64: OptionalNullable[bool] = UNSET, + image_limit: OptionalNullable[int] = UNSET, + image_min_size: OptionalNullable[int] = UNSET, + bbox_annotation_format: OptionalNullable[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = UNSET, + document_annotation_format: OptionalNullable[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = UNSET, + document_annotation_prompt: OptionalNullable[str] = UNSET, + table_format: OptionalNullable[models.TableFormat] = UNSET, + extract_header: Optional[bool] = None, + extract_footer: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.OCRResponse: + r"""OCR + + :param model: + :param document: Document to run OCR on + :param id: + :param pages: Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 + :param include_image_base64: Include image URLs in response + :param image_limit: Max images to extract + :param image_min_size: Minimum height and width of image to extract + :param bbox_annotation_format: Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field + :param document_annotation_format: Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field + :param document_annotation_prompt: Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided. + :param table_format: + :param extract_header: + :param extract_footer: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.OCRRequest( + model=model, + id=id, + document=utils.get_pydantic_model(document, models.Document), + pages=pages, + include_image_base64=include_image_base64, + image_limit=image_limit, + image_min_size=image_min_size, + bbox_annotation_format=utils.get_pydantic_model( + bbox_annotation_format, OptionalNullable[models.ResponseFormat] + ), + document_annotation_format=utils.get_pydantic_model( + document_annotation_format, OptionalNullable[models.ResponseFormat] + ), + document_annotation_prompt=document_annotation_prompt, + table_format=table_format, + extract_header=extract_header, + extract_footer=extract_footer, + ) + + req = self._build_request_async( + method="POST", + path="/ocr", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.OCRRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="ocr_v1_ocr_post", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.OCRResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/packages/mistralai_azure/src/mistralai_azure/py.typed b/packages/azure/src/mistralai/azure/client/py.typed similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/py.typed rename to packages/azure/src/mistralai/azure/client/py.typed diff --git a/packages/azure/src/mistralai/azure/client/sdk.py b/packages/azure/src/mistralai/azure/client/sdk.py new file mode 100644 index 00000000..3203463e --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/sdk.py @@ -0,0 +1,215 @@ +from .basesdk import BaseSDK +from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients +from .sdkconfiguration import SDKConfiguration +from .utils.logger import Logger, get_default_logger +from .utils.retries import RetryConfig +import httpx +import importlib +import logging +from mistralai.azure.client import models, utils +from mistralai.azure.client._hooks import SDKHooks +from mistralai.azure.client.types import OptionalNullable, UNSET +import sys +from typing import Callable, Dict, Optional, TYPE_CHECKING, Union, cast +import warnings +import weakref + +logger = logging.getLogger(__name__) + +if TYPE_CHECKING: + from mistralai.azure.client.chat import Chat + from mistralai.azure.client.ocr import Ocr + + +class MistralAzure(BaseSDK): + r"""Mistral AI API: Dora OpenAPI schema + + Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. + """ + + chat: "Chat" + r"""Chat Completion API.""" + ocr: "Ocr" + _sub_sdk_map = { + "chat": ("mistralai.azure.client.chat", "Chat"), + "ocr": ("mistralai.azure.client.ocr", "Ocr"), + } + + def __init__( + self, + api_key: Union[str, Callable[[], str]], + server: Optional[str] = None, + server_url: Optional[str] = None, + url_params: Optional[Dict[str, str]] = None, + client: Optional[HttpClient] = None, + async_client: Optional[AsyncHttpClient] = None, + retry_config: OptionalNullable[RetryConfig] = UNSET, + timeout_ms: Optional[int] = None, + debug_logger: Optional[Logger] = None, + api_version: str = "2024-05-01-preview", + ) -> None: + r"""Instantiates the SDK configuring it with the provided parameters. + + :param api_key: The api_key required for authentication + :param server: The server by name to use for all methods + :param server_url: The server URL to use for all methods + :param url_params: Parameters to optionally template the server URL with + :param client: The HTTP client to use for all synchronous methods + :param async_client: The Async HTTP client to use for all asynchronous methods + :param retry_config: The retry configuration to use for all supported methods + :param timeout_ms: Optional request timeout applied to each operation in milliseconds + :param api_version: Azure API version to use (injected as query param) + """ + client_supplied = True + if client is None: + client = httpx.Client( + follow_redirects=True, + params={"api-version": api_version}, + ) + client_supplied = False + elif api_version != "2024-05-01-preview": + warnings.warn( + "api_version is ignored when a custom client is provided. " + "Set the api-version query parameter on your httpx.Client directly.", + stacklevel=2, + ) + + assert issubclass( + type(client), HttpClient + ), "The provided client must implement the HttpClient protocol." + + async_client_supplied = True + if async_client is None: + async_client = httpx.AsyncClient( + follow_redirects=True, + params={"api-version": api_version}, + ) + async_client_supplied = False + elif api_version != "2024-05-01-preview": + warnings.warn( + "api_version is ignored when a custom async_client is provided. " + "Set the api-version query parameter on your httpx.AsyncClient directly.", + stacklevel=2, + ) + + if debug_logger is None: + debug_logger = get_default_logger() + + assert issubclass( + type(async_client), AsyncHttpClient + ), "The provided async_client must implement the AsyncHttpClient protocol." + + security: Union[models.Security, Callable[[], models.Security]] + if callable(api_key): + + def get_security() -> models.Security: + return models.Security(api_key=api_key()) + + security = get_security + else: + security = models.Security(api_key=api_key) + + if server_url is not None: + if url_params is not None: + server_url = utils.template_url(server_url, url_params) + + BaseSDK.__init__( + self, + SDKConfiguration( + client=client, + client_supplied=client_supplied, + async_client=async_client, + async_client_supplied=async_client_supplied, + security=security, + server_url=server_url, + server=server, + retry_config=retry_config, + timeout_ms=timeout_ms, + debug_logger=debug_logger, + ), + parent_ref=self, + ) + + hooks = SDKHooks() + self.sdk_configuration.__dict__["_hooks"] = hooks + + current_server_url, *_ = self.sdk_configuration.get_server_details() + server_url, self.sdk_configuration.client = hooks.sdk_init( + current_server_url, client + ) + if current_server_url != server_url: + self.sdk_configuration.server_url = server_url + + weakref.finalize( + self, + close_clients, + cast(ClientOwner, self.sdk_configuration), + self.sdk_configuration.client, + self.sdk_configuration.client_supplied, + self.sdk_configuration.async_client, + self.sdk_configuration.async_client_supplied, + ) + + def dynamic_import(self, modname, retries=3): + last_exc: Optional[Exception] = None + for attempt in range(retries): + try: + return importlib.import_module(modname) + except (KeyError, ImportError, ModuleNotFoundError) as e: + last_exc = e + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise ImportError( + f"Failed to import module '{modname}' after {retries} attempts" + ) from last_exc + + def __getattr__(self, name: str): + if name in self._sub_sdk_map: + module_path, class_name = self._sub_sdk_map[name] + try: + module = self.dynamic_import(module_path) + klass = getattr(module, class_name) + instance = klass(self.sdk_configuration, parent_ref=self) + setattr(self, name, instance) + return instance + except ImportError as e: + raise AttributeError( + f"Failed to import module {module_path} for attribute {name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}" + ) from e + + raise AttributeError( + f"'{type(self).__name__}' object has no attribute '{name}'" + ) + + def __dir__(self): + default_attrs = list(super().__dir__()) + lazy_attrs = list(self._sub_sdk_map.keys()) + return sorted(list(set(default_attrs + lazy_attrs))) + + def __enter__(self): + return self + + async def __aenter__(self): + return self + + def __exit__(self, _exc_type, _exc_val, _exc_tb): + if ( + self.sdk_configuration.client is not None + and not self.sdk_configuration.client_supplied + ): + self.sdk_configuration.client.close() + self.sdk_configuration.client = None + + async def __aexit__(self, _exc_type, _exc_val, _exc_tb): + if ( + self.sdk_configuration.async_client is not None + and not self.sdk_configuration.async_client_supplied + ): + await self.sdk_configuration.async_client.aclose() + self.sdk_configuration.async_client = None diff --git a/packages/azure/src/mistralai/azure/client/sdkconfiguration.py b/packages/azure/src/mistralai/azure/client/sdkconfiguration.py new file mode 100644 index 00000000..919225f9 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/sdkconfiguration.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._version import ( + __gen_version__, + __openapi_doc_version__, + __user_agent__, + __version__, +) +from .httpclient import AsyncHttpClient, HttpClient +from .utils import Logger, RetryConfig, remove_suffix +from dataclasses import dataclass +from mistralai.azure.client import models +from mistralai.azure.client.types import OptionalNullable, UNSET +from pydantic import Field +from typing import Callable, Dict, Optional, Tuple, Union + + +SERVER_EU = "eu" +r"""EU Production server""" +SERVERS = { + SERVER_EU: "https://api.mistral.ai", +} +"""Contains the list of servers available to the SDK""" + + +@dataclass +class SDKConfiguration: + client: Union[HttpClient, None] + client_supplied: bool + async_client: Union[AsyncHttpClient, None] + async_client_supplied: bool + debug_logger: Logger + security: Optional[Union[models.Security, Callable[[], models.Security]]] = None + server_url: Optional[str] = "" + server: Optional[str] = "" + language: str = "python" + openapi_doc_version: str = __openapi_doc_version__ + sdk_version: str = __version__ + gen_version: str = __gen_version__ + user_agent: str = __user_agent__ + retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) + timeout_ms: Optional[int] = None + + def get_server_details(self) -> Tuple[str, Dict[str, str]]: + if self.server_url is not None and self.server_url: + return remove_suffix(self.server_url, "/"), {} + if not self.server: + self.server = SERVER_EU + + if self.server not in SERVERS: + raise ValueError(f'Invalid server "{self.server}"') + + return SERVERS[self.server], {} diff --git a/packages/mistralai_azure/src/mistralai_azure/types/__init__.py b/packages/azure/src/mistralai/azure/client/types/__init__.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/types/__init__.py rename to packages/azure/src/mistralai/azure/client/types/__init__.py diff --git a/packages/azure/src/mistralai/azure/client/types/basemodel.py b/packages/azure/src/mistralai/azure/client/types/basemodel.py new file mode 100644 index 00000000..a9a640a1 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/types/basemodel.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from pydantic import ConfigDict, model_serializer +from pydantic import BaseModel as PydanticBaseModel +from pydantic_core import core_schema +from typing import TYPE_CHECKING, Any, Literal, Optional, TypeVar, Union +from typing_extensions import TypeAliasType, TypeAlias + + +class BaseModel(PydanticBaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() + ) + + +class Unset(BaseModel): + @model_serializer(mode="plain") + def serialize_model(self): + return UNSET_SENTINEL + + def __bool__(self) -> Literal[False]: + return False + + +UNSET = Unset() +UNSET_SENTINEL = "~?~unset~?~sentinel~?~" + + +T = TypeVar("T") +if TYPE_CHECKING: + Nullable: TypeAlias = Union[T, None] + OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] +else: + Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) + OptionalNullable = TypeAliasType( + "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) + ) + + +class UnrecognizedStr(str): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema: + # Make UnrecognizedStr only work in lax mode, not strict mode + # This makes it a "fallback" option when more specific types (like Literals) don't match + def validate_lax(v: Any) -> 'UnrecognizedStr': + if isinstance(v, cls): + return v + return cls(str(v)) + + # Use lax_or_strict_schema where strict always fails + # This forces Pydantic to prefer other union members in strict mode + # and only fall back to UnrecognizedStr in lax mode + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema([ + core_schema.str_schema(), + core_schema.no_info_plain_validator_function(validate_lax) + ]), + strict_schema=core_schema.none_schema(), # Always fails in strict mode + ) + + +class UnrecognizedInt(int): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema: + # Make UnrecognizedInt only work in lax mode, not strict mode + # This makes it a "fallback" option when more specific types (like Literals) don't match + def validate_lax(v: Any) -> 'UnrecognizedInt': + if isinstance(v, cls): + return v + return cls(int(v)) + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema([ + core_schema.int_schema(), + core_schema.no_info_plain_validator_function(validate_lax) + ]), + strict_schema=core_schema.none_schema(), # Always fails in strict mode + ) diff --git a/packages/azure/src/mistralai/azure/client/utils/__init__.py b/packages/azure/src/mistralai/azure/client/utils/__init__.py new file mode 100644 index 00000000..b488c2df --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/__init__.py @@ -0,0 +1,178 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, TYPE_CHECKING, Callable, TypeVar +import asyncio + +from .dynamic_imports import lazy_getattr, lazy_dir + +_T = TypeVar("_T") + + +async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T: + """Run a synchronous function in a thread pool to avoid blocking the event loop.""" + return await asyncio.to_thread(func, *args) + + +if TYPE_CHECKING: + from .annotations import get_discriminator + from .datetimes import parse_datetime + from .enums import OpenEnumMeta + from .unions import parse_open_union + from .headers import get_headers, get_response_headers + from .metadata import ( + FieldMetadata, + find_metadata, + FormMetadata, + HeaderMetadata, + MultipartFormMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, + SecurityMetadata, + ) + from .queryparams import get_query_params + from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig + from .requestbodies import serialize_request_body, SerializedRequestBody + from .security import get_security + from .serializers import ( + get_pydantic_model, + marshal_json, + unmarshal, + unmarshal_json, + serialize_decimal, + serialize_float, + serialize_int, + stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, + validate_decimal, + validate_float, + validate_int, + ) + from .url import generate_url, template_url, remove_suffix + from .values import ( + get_global_from_env, + match_content_type, + match_status_codes, + match_response, + cast_partial, + ) + from .logger import Logger, get_body_content, get_default_logger + +__all__ = [ + "BackoffStrategy", + "FieldMetadata", + "find_metadata", + "FormMetadata", + "generate_url", + "get_body_content", + "get_default_logger", + "get_discriminator", + "parse_datetime", + "get_global_from_env", + "get_headers", + "get_pydantic_model", + "get_query_params", + "get_response_headers", + "get_security", + "HeaderMetadata", + "Logger", + "marshal_json", + "match_content_type", + "match_status_codes", + "match_response", + "MultipartFormMetadata", + "OpenEnumMeta", + "parse_open_union", + "PathParamMetadata", + "QueryParamMetadata", + "remove_suffix", + "Retries", + "retry", + "retry_async", + "RetryConfig", + "RequestMetadata", + "SecurityMetadata", + "serialize_decimal", + "serialize_float", + "serialize_int", + "serialize_request_body", + "SerializedRequestBody", + "stream_to_text", + "stream_to_text_async", + "stream_to_bytes", + "stream_to_bytes_async", + "template_url", + "unmarshal", + "unmarshal_json", + "validate_decimal", + "validate_const", + "validate_float", + "validate_int", + "cast_partial", +] + +_dynamic_imports: dict[str, str] = { + "BackoffStrategy": ".retries", + "FieldMetadata": ".metadata", + "find_metadata": ".metadata", + "FormMetadata": ".metadata", + "generate_url": ".url", + "get_body_content": ".logger", + "get_default_logger": ".logger", + "get_discriminator": ".annotations", + "parse_datetime": ".datetimes", + "get_global_from_env": ".values", + "get_headers": ".headers", + "get_pydantic_model": ".serializers", + "get_query_params": ".queryparams", + "get_response_headers": ".headers", + "get_security": ".security", + "HeaderMetadata": ".metadata", + "Logger": ".logger", + "marshal_json": ".serializers", + "match_content_type": ".values", + "match_status_codes": ".values", + "match_response": ".values", + "MultipartFormMetadata": ".metadata", + "OpenEnumMeta": ".enums", + "parse_open_union": ".unions", + "PathParamMetadata": ".metadata", + "QueryParamMetadata": ".metadata", + "remove_suffix": ".url", + "Retries": ".retries", + "retry": ".retries", + "retry_async": ".retries", + "RetryConfig": ".retries", + "RequestMetadata": ".metadata", + "SecurityMetadata": ".metadata", + "serialize_decimal": ".serializers", + "serialize_float": ".serializers", + "serialize_int": ".serializers", + "serialize_request_body": ".requestbodies", + "SerializedRequestBody": ".requestbodies", + "stream_to_text": ".serializers", + "stream_to_text_async": ".serializers", + "stream_to_bytes": ".serializers", + "stream_to_bytes_async": ".serializers", + "template_url": ".url", + "unmarshal": ".serializers", + "unmarshal_json": ".serializers", + "validate_decimal": ".serializers", + "validate_const": ".serializers", + "validate_float": ".serializers", + "validate_int": ".serializers", + "cast_partial": ".values", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/packages/azure/src/mistralai/azure/client/utils/annotations.py b/packages/azure/src/mistralai/azure/client/utils/annotations.py new file mode 100644 index 00000000..12e0aa4f --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/annotations.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from enum import Enum +from typing import Any, Optional + + +def get_discriminator(model: Any, fieldname: str, key: str) -> str: + """ + Recursively search for the discriminator attribute in a model. + + Args: + model (Any): The model to search within. + fieldname (str): The name of the field to search for. + key (str): The key to search for in dictionaries. + + Returns: + str: The name of the discriminator attribute. + + Raises: + ValueError: If the discriminator attribute is not found. + """ + upper_fieldname = fieldname.upper() + + def get_field_discriminator(field: Any) -> Optional[str]: + """Search for the discriminator attribute in a given field.""" + + if isinstance(field, dict): + if key in field: + return f"{field[key]}" + + if hasattr(field, fieldname): + attr = getattr(field, fieldname) + if isinstance(attr, Enum): + return f"{attr.value}" + return f"{attr}" + + if hasattr(field, upper_fieldname): + attr = getattr(field, upper_fieldname) + if isinstance(attr, Enum): + return f"{attr.value}" + return f"{attr}" + + return None + + def search_nested_discriminator(obj: Any) -> Optional[str]: + """Recursively search for discriminator in nested structures.""" + # First try direct field lookup + discriminator = get_field_discriminator(obj) + if discriminator is not None: + return discriminator + + # If it's a dict, search in nested values + if isinstance(obj, dict): + for value in obj.values(): + if isinstance(value, list): + # Search in list items + for item in value: + nested_discriminator = search_nested_discriminator(item) + if nested_discriminator is not None: + return nested_discriminator + elif isinstance(value, dict): + # Search in nested dict + nested_discriminator = search_nested_discriminator(value) + if nested_discriminator is not None: + return nested_discriminator + + return None + + if isinstance(model, list): + for field in model: + discriminator = search_nested_discriminator(field) + if discriminator is not None: + return discriminator + + discriminator = search_nested_discriminator(model) + if discriminator is not None: + return discriminator + + raise ValueError(f"Could not find discriminator field {fieldname} in {model}") diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/datetimes.py b/packages/azure/src/mistralai/azure/client/utils/datetimes.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/datetimes.py rename to packages/azure/src/mistralai/azure/client/utils/datetimes.py diff --git a/packages/azure/src/mistralai/azure/client/utils/dynamic_imports.py b/packages/azure/src/mistralai/azure/client/utils/dynamic_imports.py new file mode 100644 index 00000000..673edf82 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/dynamic_imports.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from importlib import import_module +import builtins +import sys + + +def dynamic_import(package, modname, retries=3): + """Import a module relative to package, retrying on KeyError from half-initialized modules.""" + for attempt in range(retries): + try: + return import_module(modname, package) + except KeyError: + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + +def lazy_getattr(attr_name, *, package, dynamic_imports, sub_packages=None): + """Module-level __getattr__ that lazily loads from a dynamic_imports mapping. + + Args: + attr_name: The attribute being looked up. + package: The caller's __package__ (for relative imports). + dynamic_imports: Dict mapping attribute names to relative module paths. + sub_packages: Optional list of subpackage names to lazy-load. + """ + module_name = dynamic_imports.get(attr_name) + if module_name is not None: + try: + module = dynamic_import(package, module_name) + return getattr(module, attr_name) + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + if sub_packages and attr_name in sub_packages: + return import_module(f".{attr_name}", package) + + raise AttributeError(f"module '{package}' has no attribute '{attr_name}'") + + +def lazy_dir(*, dynamic_imports, sub_packages=None): + """Module-level __dir__ that lists lazily-loadable attributes.""" + lazy_attrs = builtins.list(dynamic_imports.keys()) + if sub_packages: + lazy_attrs.extend(sub_packages) + return builtins.sorted(lazy_attrs) diff --git a/packages/azure/src/mistralai/azure/client/utils/enums.py b/packages/azure/src/mistralai/azure/client/utils/enums.py new file mode 100644 index 00000000..3324e1bc --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/enums.py @@ -0,0 +1,134 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import enum +import sys +from typing import Any + +from pydantic_core import core_schema + + +class OpenEnumMeta(enum.EnumMeta): + # The __call__ method `boundary` kwarg was added in 3.11 and must be present + # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 + # pylint: disable=unexpected-keyword-arg + # The __call__ method `values` varg must be named for pyright. + # pylint: disable=keyword-arg-before-vararg + + if sys.version_info >= (3, 11): + def __call__( + cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + except ValueError: + return value + else: + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value + + def __new__(mcs, name, bases, namespace, **kwargs): + cls = super().__new__(mcs, name, bases, namespace, **kwargs) + + # Add __get_pydantic_core_schema__ to make open enums work correctly + # in union discrimination. In strict mode (used by Pydantic for unions), + # only known enum values match. In lax mode, unknown values are accepted. + def __get_pydantic_core_schema__( + cls_inner: Any, _source_type: Any, _handler: Any + ) -> core_schema.CoreSchema: + # Create a validator that only accepts known enum values (for strict mode) + def validate_strict(v: Any) -> Any: + if isinstance(v, cls_inner): + return v + # Use the parent EnumMeta's __call__ which raises ValueError for unknown values + return enum.EnumMeta.__call__(cls_inner, v) + + # Create a lax validator that accepts unknown values + def validate_lax(v: Any) -> Any: + if isinstance(v, cls_inner): + return v + try: + return enum.EnumMeta.__call__(cls_inner, v) + except ValueError: + # Return the raw value for unknown enum values + return v + + # Determine the base type schema (str or int) + is_int_enum = False + for base in cls_inner.__mro__: + if base is int: + is_int_enum = True + break + if base is str: + break + + base_schema = ( + core_schema.int_schema() + if is_int_enum + else core_schema.str_schema() + ) + + # Use lax_or_strict_schema: + # - strict mode: only known enum values match (raises ValueError for unknown) + # - lax mode: accept any value, return enum member or raw value + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema( + [base_schema, core_schema.no_info_plain_validator_function(validate_lax)] + ), + strict_schema=core_schema.chain_schema( + [base_schema, core_schema.no_info_plain_validator_function(validate_strict)] + ), + ) + + setattr(cls, "__get_pydantic_core_schema__", classmethod(__get_pydantic_core_schema__)) + return cls diff --git a/packages/azure/src/mistralai/azure/client/utils/eventstreaming.py b/packages/azure/src/mistralai/azure/client/utils/eventstreaming.py new file mode 100644 index 00000000..f2052fc2 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/eventstreaming.py @@ -0,0 +1,280 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import re +import json +from dataclasses import dataclass, asdict +from typing import ( + Any, + Callable, + Generic, + TypeVar, + Optional, + Generator, + AsyncGenerator, + Tuple, +) +import httpx + +T = TypeVar("T") + + +class EventStream(Generic[T]): + # Holds a reference to the SDK client to avoid it being garbage collected + # and cause termination of the underlying httpx client. + client_ref: Optional[object] + response: httpx.Response + generator: Generator[T, None, None] + _closed: bool + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + client_ref: Optional[object] = None, + ): + self.response = response + self.generator = stream_events(response, decoder, sentinel) + self.client_ref = client_ref + self._closed = False + + def __iter__(self): + return self + + def __next__(self): + if self._closed: + raise StopIteration + return next(self.generator) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self._closed = True + self.response.close() + + +class EventStreamAsync(Generic[T]): + # Holds a reference to the SDK client to avoid it being garbage collected + # and cause termination of the underlying httpx client. + client_ref: Optional[object] + response: httpx.Response + generator: AsyncGenerator[T, None] + _closed: bool + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + client_ref: Optional[object] = None, + ): + self.response = response + self.generator = stream_events_async(response, decoder, sentinel) + self.client_ref = client_ref + self._closed = False + + def __aiter__(self): + return self + + async def __anext__(self): + if self._closed: + raise StopAsyncIteration + return await self.generator.__anext__() + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + self._closed = True + await self.response.aclose() + + +@dataclass +class ServerEvent: + id: Optional[str] = None + event: Optional[str] = None + data: Any = None + retry: Optional[int] = None + + +MESSAGE_BOUNDARIES = [ + b"\r\n\r\n", + b"\r\n\r", + b"\r\n\n", + b"\r\r\n", + b"\n\r\n", + b"\r\r", + b"\n\r", + b"\n\n", +] + +UTF8_BOM = b"\xef\xbb\xbf" + + +async def stream_events_async( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> AsyncGenerator[T, None]: + buffer = bytearray() + position = 0 + event_id: Optional[str] = None + async for chunk in response.aiter_bytes(): + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard, event_id = _parse_event( + raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + ) + if event is not None: + yield event + if discard: + await response.aclose() + return + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard, _ = _parse_event( + raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + ) + if event is not None: + yield event + + +def stream_events( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> Generator[T, None, None]: + buffer = bytearray() + position = 0 + event_id: Optional[str] = None + for chunk in response.iter_bytes(): + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard, event_id = _parse_event( + raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + ) + if event is not None: + yield event + if discard: + response.close() + return + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard, _ = _parse_event( + raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + ) + if event is not None: + yield event + + +def _parse_event( + *, + raw: bytearray, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + event_id: Optional[str] = None, +) -> Tuple[Optional[T], bool, Optional[str]]: + block = raw.decode() + lines = re.split(r"\r?\n|\r", block) + publish = False + event = ServerEvent() + data = "" + for line in lines: + if not line: + continue + + delim = line.find(":") + if delim == 0: + continue + + field = line + value = "" + if delim > 0: + field = line[0:delim] + value = line[delim + 1 :] if delim < len(line) - 1 else "" + if len(value) and value[0] == " ": + value = value[1:] + + if field == "event": + event.event = value + publish = True + elif field == "data": + data += value + "\n" + publish = True + elif field == "id": + publish = True + if "\x00" not in value: + event_id = value + elif field == "retry": + if value.isdigit(): + event.retry = int(value) + publish = True + + event.id = event_id + + if sentinel and data == f"{sentinel}\n": + return None, True, event_id + + if data: + data = data[:-1] + try: + event.data = json.loads(data) + except json.JSONDecodeError: + event.data = data + + out = None + if publish: + out_dict = { + k: v + for k, v in asdict(event).items() + if v is not None or (k == "data" and data) + } + out = decoder(json.dumps(out_dict)) + + return out, False, event_id + + +def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): + if len(sequence) > (len(buffer) - position): + return None + + for i, seq in enumerate(sequence): + if buffer[position + i] != seq: + return None + + return sequence diff --git a/packages/azure/src/mistralai/azure/client/utils/forms.py b/packages/azure/src/mistralai/azure/client/utils/forms.py new file mode 100644 index 00000000..1e550bd5 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/forms.py @@ -0,0 +1,234 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .serializers import marshal_json + +from .metadata import ( + FormMetadata, + MultipartFormMetadata, + find_field_metadata, +) +from .values import _is_set, _val_to_string + + +def _populate_form( + field_name: str, + explode: bool, + obj: Any, + delimiter: str, + form: Dict[str, List[str]], +): + if not _is_set(obj): + return form + + if isinstance(obj, BaseModel): + items = [] + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_field_name = obj_field.alias if obj_field.alias is not None else name + if obj_field_name == "": + continue + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + form[obj_field_name] = [_val_to_string(val)] + else: + items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, Dict): + items = [] + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + form[key] = [_val_to_string(value)] + else: + items.append(f"{key}{delimiter}{_val_to_string(value)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + if explode: + if not field_name in form: + form[field_name] = [] + form[field_name].append(_val_to_string(value)) + else: + items.append(_val_to_string(value)) + + if len(items) > 0: + form[field_name] = [delimiter.join([str(item) for item in items])] + else: + form[field_name] = [_val_to_string(obj)] + + return form + + +def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: + """Extract file name, content, and content type from a file object.""" + file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields + + file_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(file_obj, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(file_obj, file_field_name, None) + else: + file_name = getattr(file_obj, file_field_name) + + if file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + return file_name, content, content_type + + +def serialize_multipart_form( + media_type: str, request: Any +) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: + form: Dict[str, Any] = {} + files: List[Tuple[str, Any]] = [] + + if not isinstance(request, BaseModel): + raise TypeError("invalid request body type") + + request_fields: Dict[str, FieldInfo] = request.__class__.model_fields + request_field_types = get_type_hints(request.__class__) + + for name in request_fields: + field = request_fields[name] + + val = getattr(request, name) + if not _is_set(val): + continue + + field_metadata = find_field_metadata(field, MultipartFormMetadata) + if not field_metadata: + continue + + f_name = field.alias if field.alias else name + + if field_metadata.file: + if isinstance(val, List): + # Handle array of files + array_field_name = f_name + for file_obj in val: + if not _is_set(file_obj): + continue + + file_name, content, content_type = _extract_file_properties( + file_obj + ) + + if content_type is not None: + files.append( + (array_field_name, (file_name, content, content_type)) + ) + else: + files.append((array_field_name, (file_name, content))) + else: + # Handle single file + file_name, content, content_type = _extract_file_properties(val) + + if content_type is not None: + files.append((f_name, (file_name, content, content_type))) + else: + files.append((f_name, (file_name, content))) + elif field_metadata.json: + files.append( + ( + f_name, + ( + None, + marshal_json(val, request_field_types[name]), + "application/json", + ), + ) + ) + else: + if isinstance(val, List): + values = [] + + for value in val: + if not _is_set(value): + continue + values.append(_val_to_string(value)) + + array_field_name = f_name + form[array_field_name] = values + else: + form[f_name] = _val_to_string(val) + return media_type, form, files + + +def serialize_form_data(data: Any) -> Dict[str, Any]: + form: Dict[str, List[str]] = {} + + if isinstance(data, BaseModel): + data_fields: Dict[str, FieldInfo] = data.__class__.model_fields + data_field_types = get_type_hints(data.__class__) + for name in data_fields: + field = data_fields[name] + + val = getattr(data, name) + if not _is_set(val): + continue + + metadata = find_field_metadata(field, FormMetadata) + if metadata is None: + continue + + f_name = field.alias if field.alias is not None else name + + if metadata.json: + form[f_name] = [marshal_json(val, data_field_types[name])] + else: + if metadata.style == "form": + _populate_form( + f_name, + metadata.explode, + val, + ",", + form, + ) + else: + raise ValueError(f"Invalid form style for field {name}") + elif isinstance(data, Dict): + for key, value in data.items(): + if _is_set(value): + form[key] = [_val_to_string(value)] + else: + raise TypeError(f"Invalid request body type {type(data)} for form data") + + return form diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/headers.py b/packages/azure/src/mistralai/azure/client/utils/headers.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/headers.py rename to packages/azure/src/mistralai/azure/client/utils/headers.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/logger.py b/packages/azure/src/mistralai/azure/client/utils/logger.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/logger.py rename to packages/azure/src/mistralai/azure/client/utils/logger.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/metadata.py b/packages/azure/src/mistralai/azure/client/utils/metadata.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/metadata.py rename to packages/azure/src/mistralai/azure/client/utils/metadata.py diff --git a/packages/azure/src/mistralai/azure/client/utils/queryparams.py b/packages/azure/src/mistralai/azure/client/utils/queryparams.py new file mode 100644 index 00000000..c04e0db8 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/queryparams.py @@ -0,0 +1,217 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, +) + +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + QueryParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) +from .forms import _populate_form + + +def get_query_params( + query_params: Any, + gbls: Optional[Any] = None, + allow_empty_value: Optional[List[str]] = None, +) -> Dict[str, List[str]]: + params: Dict[str, List[str]] = {} + + globals_already_populated = _populate_query_params(query_params, gbls, params, [], allow_empty_value) + if _is_set(gbls): + _populate_query_params(gbls, None, params, globals_already_populated, allow_empty_value) + + return params + + +def _populate_query_params( + query_params: Any, + gbls: Any, + query_param_values: Dict[str, List[str]], + skip_fields: List[str], + allow_empty_value: Optional[List[str]] = None, +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(query_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields + param_field_types = get_type_hints(query_params.__class__) + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + + metadata = find_field_metadata(field, QueryParamMetadata) + if not metadata: + continue + + value = getattr(query_params, name) if _is_set(query_params) else None + + value, global_found = _populate_from_globals( + name, value, QueryParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + f_name = field.alias if field.alias is not None else name + + allow_empty_set = set(allow_empty_value or []) + should_include_empty = f_name in allow_empty_set and ( + value is None or value == [] or value == "" + ) + + if should_include_empty: + query_param_values[f_name] = [""] + continue + + serialization = metadata.serialization + if serialization is not None: + serialized_parms = _get_serialized_params( + metadata, f_name, value, param_field_types[name] + ) + for key, value in serialized_parms.items(): + if key in query_param_values: + query_param_values[key].extend(value) + else: + query_param_values[key] = [value] + else: + style = metadata.style + if style == "deepObject": + _populate_deep_object_query_params(f_name, value, query_param_values) + elif style == "form": + _populate_delimited_query_params( + metadata, f_name, value, ",", query_param_values + ) + elif style == "pipeDelimited": + _populate_delimited_query_params( + metadata, f_name, value, "|", query_param_values + ) + else: + raise NotImplementedError( + f"query param style {style} not yet supported" + ) + + return globals_already_populated + + +def _populate_deep_object_query_params( + field_name: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj): + return + + if isinstance(obj, BaseModel): + _populate_deep_object_query_params_basemodel(field_name, obj, params) + elif isinstance(obj, Dict): + _populate_deep_object_query_params_dict(field_name, obj, params) + + +def _populate_deep_object_query_params_basemodel( + prior_params_key: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj) or not isinstance(obj, BaseModel): + return + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + + f_name = obj_field.alias if obj_field.alias is not None else name + + params_key = f"{prior_params_key}[{f_name}]" + + obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) + if not _is_set(obj_param_metadata): + continue + + obj_val = getattr(obj, name) + if not _is_set(obj_val): + continue + + if isinstance(obj_val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, obj_val, params) + elif isinstance(obj_val, Dict): + _populate_deep_object_query_params_dict(params_key, obj_val, params) + elif isinstance(obj_val, List): + _populate_deep_object_query_params_list(params_key, obj_val, params) + else: + params[params_key] = [_val_to_string(obj_val)] + + +def _populate_deep_object_query_params_dict( + prior_params_key: str, + value: Dict, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for key, val in value.items(): + if not _is_set(val): + continue + + params_key = f"{prior_params_key}[{key}]" + + if isinstance(val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, val, params) + elif isinstance(val, Dict): + _populate_deep_object_query_params_dict(params_key, val, params) + elif isinstance(val, List): + _populate_deep_object_query_params_list(params_key, val, params) + else: + params[params_key] = [_val_to_string(val)] + + +def _populate_deep_object_query_params_list( + params_key: str, + value: List, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for val in value: + if not _is_set(val): + continue + + if params.get(params_key) is None: + params[params_key] = [] + + params[params_key].append(_val_to_string(val)) + + +def _populate_delimited_query_params( + metadata: QueryParamMetadata, + field_name: str, + obj: Any, + delimiter: str, + query_param_values: Dict[str, List[str]], +): + _populate_form( + field_name, + metadata.explode, + obj, + delimiter, + query_param_values, + ) diff --git a/packages/azure/src/mistralai/azure/client/utils/requestbodies.py b/packages/azure/src/mistralai/azure/client/utils/requestbodies.py new file mode 100644 index 00000000..1de32b6d --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/requestbodies.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import io +from dataclasses import dataclass +import re +from typing import ( + Any, + Optional, +) + +from .forms import serialize_form_data, serialize_multipart_form + +from .serializers import marshal_json + +SERIALIZATION_METHOD_TO_CONTENT_TYPE = { + "json": "application/json", + "form": "application/x-www-form-urlencoded", + "multipart": "multipart/form-data", + "raw": "application/octet-stream", + "string": "text/plain", +} + + +@dataclass +class SerializedRequestBody: + media_type: Optional[str] = None + content: Optional[Any] = None + data: Optional[Any] = None + files: Optional[Any] = None + + +def serialize_request_body( + request_body: Any, + nullable: bool, + optional: bool, + serialization_method: str, + request_body_type, +) -> Optional[SerializedRequestBody]: + if request_body is None: + if not nullable and optional: + return None + + media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] + + serialized_request_body = SerializedRequestBody(media_type) + + if re.match(r"^(application|text)\/([^+]+\+)*json.*", media_type) is not None: + serialized_request_body.content = marshal_json(request_body, request_body_type) + elif re.match(r"^multipart\/.*", media_type) is not None: + ( + serialized_request_body.media_type, + serialized_request_body.data, + serialized_request_body.files, + ) = serialize_multipart_form(media_type, request_body) + elif re.match(r"^application\/x-www-form-urlencoded.*", media_type) is not None: + serialized_request_body.data = serialize_form_data(request_body) + elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): + serialized_request_body.content = request_body + elif isinstance(request_body, str): + serialized_request_body.content = request_body + else: + raise TypeError( + f"invalid request body type {type(request_body)} for mediaType {media_type}" + ) + + return serialized_request_body diff --git a/packages/azure/src/mistralai/azure/client/utils/retries.py b/packages/azure/src/mistralai/azure/client/utils/retries.py new file mode 100644 index 00000000..af07d4e9 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/retries.py @@ -0,0 +1,271 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import asyncio +import random +import time +from datetime import datetime +from email.utils import parsedate_to_datetime +from typing import List, Optional + +import httpx + + +class BackoffStrategy: + initial_interval: int + max_interval: int + exponent: float + max_elapsed_time: int + + def __init__( + self, + initial_interval: int, + max_interval: int, + exponent: float, + max_elapsed_time: int, + ): + self.initial_interval = initial_interval + self.max_interval = max_interval + self.exponent = exponent + self.max_elapsed_time = max_elapsed_time + + +class RetryConfig: + strategy: str + backoff: BackoffStrategy + retry_connection_errors: bool + + def __init__( + self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool + ): + self.strategy = strategy + self.backoff = backoff + self.retry_connection_errors = retry_connection_errors + + +class Retries: + config: RetryConfig + status_codes: List[str] + + def __init__(self, config: RetryConfig, status_codes: List[str]): + self.config = config + self.status_codes = status_codes + + +class TemporaryError(Exception): + response: httpx.Response + retry_after: Optional[int] + + def __init__(self, response: httpx.Response): + self.response = response + self.retry_after = _parse_retry_after_header(response) + + +class PermanentError(Exception): + inner: Exception + + def __init__(self, inner: Exception): + self.inner = inner + + +def _parse_retry_after_header(response: httpx.Response) -> Optional[int]: + """Parse Retry-After header from response. + + Returns: + Retry interval in milliseconds, or None if header is missing or invalid. + """ + retry_after_header = response.headers.get("retry-after") + if not retry_after_header: + return None + + try: + seconds = float(retry_after_header) + return round(seconds * 1000) + except ValueError: + pass + + try: + retry_date = parsedate_to_datetime(retry_after_header) + delta = (retry_date - datetime.now(retry_date.tzinfo)).total_seconds() + return round(max(0, delta) * 1000) + except (ValueError, TypeError): + pass + + return None + + +def _get_sleep_interval( + exception: Exception, + initial_interval: int, + max_interval: int, + exponent: float, + retries: int, +) -> float: + """Get sleep interval for retry with exponential backoff. + + Args: + exception: The exception that triggered the retry. + initial_interval: Initial retry interval in milliseconds. + max_interval: Maximum retry interval in milliseconds. + exponent: Base for exponential backoff calculation. + retries: Current retry attempt count. + + Returns: + Sleep interval in seconds. + """ + if ( + isinstance(exception, TemporaryError) + and exception.retry_after is not None + and exception.retry_after > 0 + ): + return exception.retry_after / 1000 + + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + return min(sleep, max_interval / 1000) + + +def retry(func, retries: Retries): + if retries.config.strategy == "backoff": + + def do_request() -> httpx.Response: + res: httpx.Response + try: + res = func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except (httpx.NetworkError, httpx.TimeoutException) as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return retry_with_backoff( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return func() + + +async def retry_async(func, retries: Retries): + if retries.config.strategy == "backoff": + + async def do_request() -> httpx.Response: + res: httpx.Response + try: + res = await func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except (httpx.NetworkError, httpx.TimeoutException) as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return await retry_with_backoff_async( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return await func() + + +def retry_with_backoff( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + + sleep = _get_sleep_interval( + exception, initial_interval, max_interval, exponent, retries + ) + time.sleep(sleep) + retries += 1 + + +async def retry_with_backoff_async( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return await func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + + sleep = _get_sleep_interval( + exception, initial_interval, max_interval, exponent, retries + ) + await asyncio.sleep(sleep) + retries += 1 diff --git a/packages/azure/src/mistralai/azure/client/utils/security.py b/packages/azure/src/mistralai/azure/client/utils/security.py new file mode 100644 index 00000000..17996bd5 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/security.py @@ -0,0 +1,176 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import base64 +from typing import ( + Any, + Dict, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + SecurityMetadata, + find_field_metadata, +) + + +def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: + headers: Dict[str, str] = {} + query_params: Dict[str, List[str]] = {} + + if security is None: + return headers, query_params + + if not isinstance(security, BaseModel): + raise TypeError("security must be a pydantic model") + + sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields + for name in sec_fields: + sec_field = sec_fields[name] + + value = getattr(security, name) + if value is None: + continue + + metadata = find_field_metadata(sec_field, SecurityMetadata) + if metadata is None: + continue + if metadata.option: + _parse_security_option(headers, query_params, value) + return headers, query_params + if metadata.scheme: + # Special case for basic auth or custom auth which could be a flattened model + if metadata.sub_type in ["basic", "custom"] and not isinstance( + value, BaseModel + ): + _parse_security_scheme(headers, query_params, metadata, name, security) + else: + _parse_security_scheme(headers, query_params, metadata, name, value) + + return headers, query_params + + +def _parse_security_option( + headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any +): + if not isinstance(option, BaseModel): + raise TypeError("security option must be a pydantic model") + + opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields + for name in opt_fields: + opt_field = opt_fields[name] + + metadata = find_field_metadata(opt_field, SecurityMetadata) + if metadata is None or not metadata.scheme: + continue + _parse_security_scheme( + headers, query_params, metadata, name, getattr(option, name) + ) + + +def _parse_security_scheme( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + field_name: str, + scheme: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + if isinstance(scheme, BaseModel): + if scheme_type == "http": + if sub_type == "basic": + _parse_basic_auth_scheme(headers, scheme) + return + if sub_type == "custom": + return + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + value = getattr(scheme, name) + + _parse_security_scheme_value( + headers, query_params, scheme_metadata, metadata, name, value + ) + else: + _parse_security_scheme_value( + headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme + ) + + +def _parse_security_scheme_value( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + security_metadata: SecurityMetadata, + field_name: str, + value: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + header_name = security_metadata.get_field_name(field_name) + + if scheme_type == "apiKey": + if sub_type == "header": + headers[header_name] = value + elif sub_type == "query": + query_params[header_name] = [value] + else: + raise ValueError("sub type {sub_type} not supported") + elif scheme_type == "openIdConnect": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "oauth2": + if sub_type != "client_credentials": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "http": + if sub_type == "bearer": + headers[header_name] = _apply_bearer(value) + elif sub_type == "basic": + headers[header_name] = value + elif sub_type == "custom": + return + else: + raise ValueError("sub type {sub_type} not supported") + else: + raise ValueError("scheme type {scheme_type} not supported") + + +def _apply_bearer(token: str) -> str: + return token.lower().startswith("bearer ") and token or f"Bearer {token}" + + +def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): + username = "" + password = "" + + if not isinstance(scheme, BaseModel): + raise TypeError("basic auth scheme must be a pydantic model") + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + field_name = metadata.field_name + value = getattr(scheme, name) + + if field_name == "username": + username = value + if field_name == "password": + password = value + + data = f"{username}:{password}".encode() + headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/packages/azure/src/mistralai/azure/client/utils/serializers.py b/packages/azure/src/mistralai/azure/client/utils/serializers.py new file mode 100644 index 00000000..14321eb4 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/serializers.py @@ -0,0 +1,229 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from decimal import Decimal +import functools +import json +import typing +from typing import Any, Dict, List, Tuple, Union, get_args +import typing_extensions +from typing_extensions import get_origin + +import httpx +from pydantic import ConfigDict, create_model +from pydantic_core import from_json + +from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset + + +def serialize_decimal(as_str: bool): + def serialize(d): + # Optional[T] is a Union[T, None] + if is_union(type(d)) and type(None) in get_args(type(d)) and d is None: + return None + if isinstance(d, Unset): + return d + + if not isinstance(d, Decimal): + raise ValueError("Expected Decimal object") + + return str(d) if as_str else float(d) + + return serialize + + +def validate_decimal(d): + if d is None: + return None + + if isinstance(d, (Decimal, Unset)): + return d + + if not isinstance(d, (str, int, float)): + raise ValueError("Expected string, int or float") + + return Decimal(str(d)) + + +def serialize_float(as_str: bool): + def serialize(f): + # Optional[T] is a Union[T, None] + if is_union(type(f)) and type(None) in get_args(type(f)) and f is None: + return None + if isinstance(f, Unset): + return f + + if not isinstance(f, float): + raise ValueError("Expected float") + + return str(f) if as_str else f + + return serialize + + +def validate_float(f): + if f is None: + return None + + if isinstance(f, (float, Unset)): + return f + + if not isinstance(f, str): + raise ValueError("Expected string") + + return float(f) + + +def serialize_int(as_str: bool): + def serialize(i): + # Optional[T] is a Union[T, None] + if is_union(type(i)) and type(None) in get_args(type(i)) and i is None: + return None + if isinstance(i, Unset): + return i + + if not isinstance(i, int): + raise ValueError("Expected int") + + return str(i) if as_str else i + + return serialize + + +def validate_int(b): + if b is None: + return None + + if isinstance(b, (int, Unset)): + return b + + if not isinstance(b, str): + raise ValueError("Expected string") + + return int(b) + + +def validate_const(v): + def validate(c): + # Optional[T] is a Union[T, None] + if is_union(type(c)) and type(None) in get_args(type(c)) and c is None: + return None + + if v != c: + raise ValueError(f"Expected {v}") + + return c + + return validate + + +def unmarshal_json(raw, typ: Any) -> Any: + return unmarshal(from_json(raw), typ) + + +def unmarshal(val, typ: Any) -> Any: + unmarshaller = create_model( + "Unmarshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = unmarshaller(body=val) + + # pyright: ignore[reportAttributeAccessIssue] + return m.body # type: ignore + + +def marshal_json(val, typ): + if is_nullable(typ) and val is None: + return "null" + + marshaller = create_model( + "Marshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = marshaller(body=val) + + d = m.model_dump(by_alias=True, mode="json", exclude_none=True) + + if len(d) == 0: + return "" + + return json.dumps(d[next(iter(d))], separators=(",", ":")) + + +def is_nullable(field): + origin = get_origin(field) + if origin is Nullable or origin is OptionalNullable: + return True + + if not origin is Union or type(None) not in get_args(field): + return False + + for arg in get_args(field): + if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: + return True + + return False + + +def is_union(obj: object) -> bool: + """ + Returns True if the given object is a typing.Union or typing_extensions.Union. + """ + return any( + obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union") + ) + + +def stream_to_text(stream: httpx.Response) -> str: + return "".join(stream.iter_text()) + + +async def stream_to_text_async(stream: httpx.Response) -> str: + return "".join([chunk async for chunk in stream.aiter_text()]) + + +def stream_to_bytes(stream: httpx.Response) -> bytes: + return stream.content + + +async def stream_to_bytes_async(stream: httpx.Response) -> bytes: + return await stream.aread() + + +def get_pydantic_model(data: Any, typ: Any) -> Any: + if not _contains_pydantic_model(data): + return unmarshal(data, typ) + + return data + + +def _contains_pydantic_model(data: Any) -> bool: + if isinstance(data, BaseModel): + return True + if isinstance(data, List): + return any(_contains_pydantic_model(item) for item in data) + if isinstance(data, Dict): + return any(_contains_pydantic_model(value) for value in data.values()) + + return False + + +@functools.cache +def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: + """ + Get typing objects by name from typing and typing_extensions. + Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types + """ + result = tuple( + getattr(module, name) + for module in (typing, typing_extensions) + if hasattr(module, name) + ) + if not result: + raise ValueError( + f"Neither typing nor typing_extensions has an object called {name!r}" + ) + return result diff --git a/packages/azure/src/mistralai/azure/client/utils/unions.py b/packages/azure/src/mistralai/azure/client/utils/unions.py new file mode 100644 index 00000000..a227f4e8 --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/unions.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any + +from pydantic import BaseModel, TypeAdapter + + +def parse_open_union( + v: Any, + *, + disc_key: str, + variants: dict[str, Any], + unknown_cls: type, + union_name: str, +) -> Any: + """Parse an open discriminated union value with forward-compatibility. + + Known discriminator values are dispatched to their variant types. + Unknown discriminator values produce an instance of the fallback class, + preserving the raw payload for inspection. + """ + if isinstance(v, BaseModel): + return v + if not isinstance(v, dict) or disc_key not in v: + raise ValueError(f"{union_name}: expected object with '{disc_key}' field") + disc = v[disc_key] + variant_cls = variants.get(disc) + if variant_cls is not None: + if isinstance(variant_cls, type) and issubclass(variant_cls, BaseModel): + return variant_cls.model_validate(v) + return TypeAdapter(variant_cls).validate_python(v) + return unknown_cls(raw=v) diff --git a/packages/azure/src/mistralai/azure/client/utils/unmarshal_json_response.py b/packages/azure/src/mistralai/azure/client/utils/unmarshal_json_response.py new file mode 100644 index 00000000..fe0c9b8e --- /dev/null +++ b/packages/azure/src/mistralai/azure/client/utils/unmarshal_json_response.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, Optional, Type, TypeVar, overload + +import httpx + +from .serializers import unmarshal_json +from mistralai.azure.client import errors + +T = TypeVar("T") + + +@overload +def unmarshal_json_response( + typ: Type[T], http_res: httpx.Response, body: Optional[str] = None +) -> T: ... + + +@overload +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: ... + + +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: + if body is None: + body = http_res.text + try: + return unmarshal_json(body, typ) + except Exception as e: + raise errors.ResponseValidationError( + "Response validation failed", + http_res, + e, + body, + ) from e diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/url.py b/packages/azure/src/mistralai/azure/client/utils/url.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/url.py rename to packages/azure/src/mistralai/azure/client/utils/url.py diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/values.py b/packages/azure/src/mistralai/azure/client/utils/values.py similarity index 100% rename from packages/mistralai_azure/src/mistralai_azure/utils/values.py rename to packages/azure/src/mistralai/azure/client/utils/values.py diff --git a/packages/azure/uv.lock b/packages/azure/uv.lock new file mode 100644 index 00000000..ac8a5de9 --- /dev/null +++ b/packages/azure/uv.lock @@ -0,0 +1,482 @@ +version = 1 +revision = 3 +requires-python = ">=3.10" +resolution-markers = [ + "python_full_version >= '3.12'", + "python_full_version == '3.11.*'", + "python_full_version < '3.11'", +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "anyio" +version = "4.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "idna" }, + { name = "sniffio" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e6/e3/c4c8d473d6780ef1853d630d581f70d655b4f8d7553c6997958c283039a2/anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94", size = 163930, upload-time = "2024-05-26T22:02:15.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7b/a2/10639a79341f6c019dedc95bd48a4928eed9f1d1197f4c04f546fc7ae0ff/anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7", size = 86780, upload-time = "2024-05-26T22:02:13.671Z" }, +] + +[[package]] +name = "astroid" +version = "3.2.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/53/1067e1113ecaf58312357f2cd93063674924119d80d173adc3f6f2387aa2/astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a", size = 397576, upload-time = "2024-07-20T12:57:43.26Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/80/96/b32bbbb46170a1c8b8b1f28c794202e25cfe743565e9d3469b8eb1e0cc05/astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25", size = 276348, upload-time = "2024-07-20T12:57:40.886Z" }, +] + +[[package]] +name = "certifi" +version = "2024.7.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c2/02/a95f2b11e207f68bc64d7aae9666fed2e2b3f307748d5123dffb72a1bbea/certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b", size = 164065, upload-time = "2024-07-04T01:36:11.653Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1c/d5/c84e1a17bf61d4df64ca866a1c9a913874b4e9bdc131ec689a0ad013fb36/certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90", size = 162960, upload-time = "2024-07-04T01:36:09.038Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "dill" +version = "0.3.8" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/17/4d/ac7ffa80c69ea1df30a8aa11b3578692a5118e7cd1aa157e3ef73b092d15/dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca", size = 184847, upload-time = "2024-01-27T23:42:16.145Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c9/7a/cef76fd8438a42f96db64ddaa85280485a9c395e7df3db8158cfec1eee34/dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7", size = 116252, upload-time = "2024-01-27T23:42:14.239Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.2.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/09/35/2495c4ac46b980e4ca1f6ad6db102322ef3ad2410b79fdde159a4b0f3b92/exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc", size = 28883, upload-time = "2024-07-12T22:26:00.161Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b", size = 16453, upload-time = "2024-07-12T22:25:58.476Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "idna" +version = "3.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/21/ed/f86a79a07470cb07819390452f178b3bef1d375f2ec021ecfc709fc7cf07/idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc", size = 189575, upload-time = "2024-04-11T03:34:43.276Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0", size = 66836, upload-time = "2024-04-11T03:34:41.447Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646, upload-time = "2023-01-07T11:08:11.254Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892, upload-time = "2023-01-07T11:08:09.864Z" }, +] + +[[package]] +name = "isort" +version = "5.13.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/87/f9/c1eb8635a24e87ade2efce21e3ce8cd6b8630bb685ddc9cdaca1349b2eb5/isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109", size = 175303, upload-time = "2023-12-13T20:37:26.124Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/b3/8def84f539e7d2289a02f0524b944b15d7c75dab7628bedf1c4f0992029c/isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6", size = 92310, upload-time = "2023-12-13T20:37:23.244Z" }, +] + +[[package]] +name = "mccabe" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e7/ff/0ffefdcac38932a54d2b5eed4e0ba8a408f215002cd178ad1df0f2806ff8/mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", size = 9658, upload-time = "2022-01-24T01:14:51.113Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e", size = 7350, upload-time = "2022-01-24T01:14:49.62Z" }, +] + +[[package]] +name = "mistralai-azure" +version = "2.0.0" +source = { editable = "." } +dependencies = [ + { name = "httpcore" }, + { name = "httpx" }, + { name = "pydantic" }, +] + +[package.dev-dependencies] +dev = [ + { name = "mypy" }, + { name = "pylint" }, + { name = "pyright" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, +] + +[package.metadata] +requires-dist = [ + { name = "httpcore", specifier = ">=1.0.9" }, + { name = "httpx", specifier = ">=0.28.1" }, + { name = "pydantic", specifier = ">=2.11.2" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "mypy", specifier = "==1.15.0" }, + { name = "pylint", specifier = "==3.2.3" }, + { name = "pyright", specifier = ">=1.1.401,<2" }, + { name = "pytest", specifier = ">=8.2.2,<9" }, + { name = "pytest-asyncio", specifier = ">=0.23.7,<0.24" }, +] + +[[package]] +name = "mypy" +version = "1.15.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mypy-extensions" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ce/43/d5e49a86afa64bd3839ea0d5b9c7103487007d728e1293f52525d6d5486a/mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43", size = 3239717, upload-time = "2025-02-05T03:50:34.655Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/68/f8/65a7ce8d0e09b6329ad0c8d40330d100ea343bd4dd04c4f8ae26462d0a17/mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13", size = 10738433, upload-time = "2025-02-05T03:49:29.145Z" }, + { url = "https://files.pythonhosted.org/packages/b4/95/9c0ecb8eacfe048583706249439ff52105b3f552ea9c4024166c03224270/mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559", size = 9861472, upload-time = "2025-02-05T03:49:16.986Z" }, + { url = "https://files.pythonhosted.org/packages/84/09/9ec95e982e282e20c0d5407bc65031dfd0f0f8ecc66b69538296e06fcbee/mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b", size = 11611424, upload-time = "2025-02-05T03:49:46.908Z" }, + { url = "https://files.pythonhosted.org/packages/78/13/f7d14e55865036a1e6a0a69580c240f43bc1f37407fe9235c0d4ef25ffb0/mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3", size = 12365450, upload-time = "2025-02-05T03:50:05.89Z" }, + { url = "https://files.pythonhosted.org/packages/48/e1/301a73852d40c241e915ac6d7bcd7fedd47d519246db2d7b86b9d7e7a0cb/mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b", size = 12551765, upload-time = "2025-02-05T03:49:33.56Z" }, + { url = "https://files.pythonhosted.org/packages/77/ba/c37bc323ae5fe7f3f15a28e06ab012cd0b7552886118943e90b15af31195/mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828", size = 9274701, upload-time = "2025-02-05T03:49:38.981Z" }, + { url = "https://files.pythonhosted.org/packages/03/bc/f6339726c627bd7ca1ce0fa56c9ae2d0144604a319e0e339bdadafbbb599/mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f", size = 10662338, upload-time = "2025-02-05T03:50:17.287Z" }, + { url = "https://files.pythonhosted.org/packages/e2/90/8dcf506ca1a09b0d17555cc00cd69aee402c203911410136cd716559efe7/mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5", size = 9787540, upload-time = "2025-02-05T03:49:51.21Z" }, + { url = "https://files.pythonhosted.org/packages/05/05/a10f9479681e5da09ef2f9426f650d7b550d4bafbef683b69aad1ba87457/mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e", size = 11538051, upload-time = "2025-02-05T03:50:20.885Z" }, + { url = "https://files.pythonhosted.org/packages/e9/9a/1f7d18b30edd57441a6411fcbc0c6869448d1a4bacbaee60656ac0fc29c8/mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c", size = 12286751, upload-time = "2025-02-05T03:49:42.408Z" }, + { url = "https://files.pythonhosted.org/packages/72/af/19ff499b6f1dafcaf56f9881f7a965ac2f474f69f6f618b5175b044299f5/mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f", size = 12421783, upload-time = "2025-02-05T03:49:07.707Z" }, + { url = "https://files.pythonhosted.org/packages/96/39/11b57431a1f686c1aed54bf794870efe0f6aeca11aca281a0bd87a5ad42c/mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f", size = 9265618, upload-time = "2025-02-05T03:49:54.581Z" }, + { url = "https://files.pythonhosted.org/packages/98/3a/03c74331c5eb8bd025734e04c9840532226775c47a2c39b56a0c8d4f128d/mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd", size = 10793981, upload-time = "2025-02-05T03:50:28.25Z" }, + { url = "https://files.pythonhosted.org/packages/f0/1a/41759b18f2cfd568848a37c89030aeb03534411eef981df621d8fad08a1d/mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f", size = 9749175, upload-time = "2025-02-05T03:50:13.411Z" }, + { url = "https://files.pythonhosted.org/packages/12/7e/873481abf1ef112c582db832740f4c11b2bfa510e829d6da29b0ab8c3f9c/mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464", size = 11455675, upload-time = "2025-02-05T03:50:31.421Z" }, + { url = "https://files.pythonhosted.org/packages/b3/d0/92ae4cde706923a2d3f2d6c39629134063ff64b9dedca9c1388363da072d/mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee", size = 12410020, upload-time = "2025-02-05T03:48:48.705Z" }, + { url = "https://files.pythonhosted.org/packages/46/8b/df49974b337cce35f828ba6fda228152d6db45fed4c86ba56ffe442434fd/mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e", size = 12498582, upload-time = "2025-02-05T03:49:03.628Z" }, + { url = "https://files.pythonhosted.org/packages/13/50/da5203fcf6c53044a0b699939f31075c45ae8a4cadf538a9069b165c1050/mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22", size = 9366614, upload-time = "2025-02-05T03:50:00.313Z" }, + { url = "https://files.pythonhosted.org/packages/6a/9b/fd2e05d6ffff24d912f150b87db9e364fa8282045c875654ce7e32fffa66/mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445", size = 10788592, upload-time = "2025-02-05T03:48:55.789Z" }, + { url = "https://files.pythonhosted.org/packages/74/37/b246d711c28a03ead1fd906bbc7106659aed7c089d55fe40dd58db812628/mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d", size = 9753611, upload-time = "2025-02-05T03:48:44.581Z" }, + { url = "https://files.pythonhosted.org/packages/a6/ac/395808a92e10cfdac8003c3de9a2ab6dc7cde6c0d2a4df3df1b815ffd067/mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5", size = 11438443, upload-time = "2025-02-05T03:49:25.514Z" }, + { url = "https://files.pythonhosted.org/packages/d2/8b/801aa06445d2de3895f59e476f38f3f8d610ef5d6908245f07d002676cbf/mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036", size = 12402541, upload-time = "2025-02-05T03:49:57.623Z" }, + { url = "https://files.pythonhosted.org/packages/c7/67/5a4268782eb77344cc613a4cf23540928e41f018a9a1ec4c6882baf20ab8/mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357", size = 12494348, upload-time = "2025-02-05T03:48:52.361Z" }, + { url = "https://files.pythonhosted.org/packages/83/3e/57bb447f7bbbfaabf1712d96f9df142624a386d98fb026a761532526057e/mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf", size = 9373648, upload-time = "2025-02-05T03:49:11.395Z" }, + { url = "https://files.pythonhosted.org/packages/09/4e/a7d65c7322c510de2c409ff3828b03354a7c43f5a8ed458a7a131b41c7b9/mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e", size = 2221777, upload-time = "2025-02-05T03:50:08.348Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/98/a4/1ab47638b92648243faf97a5aeb6ea83059cc3624972ab6b8d2316078d3f/mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782", size = 4433, upload-time = "2023-02-04T12:11:27.157Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695, upload-time = "2023-02-04T12:11:25.002Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, +] + +[[package]] +name = "packaging" +version = "24.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/51/65/50db4dda066951078f0a96cf12f4b9ada6e4b811516bf0262c0f4f7064d4/packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002", size = 148788, upload-time = "2024-06-09T23:19:24.956Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124", size = 53985, upload-time = "2024-06-09T23:19:21.909Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.2.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f5/52/0763d1d976d5c262df53ddda8d8d4719eedf9594d046f117c25a27261a19/platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3", size = 20916, upload-time = "2024-05-15T03:18:23.372Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/68/13/2aa1f0e1364feb2c9ef45302f387ac0bd81484e9c9a4c5688a322fbdfd08/platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee", size = 18146, upload-time = "2024-05-15T03:18:21.209Z" }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955, upload-time = "2024-04-20T21:34:42.531Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556, upload-time = "2024-04-20T21:34:40.434Z" }, +] + +[[package]] +name = "pydantic" +version = "2.11.7" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/00/dd/4325abf92c39ba8623b5af936ddb36ffcfe0beae70405d456ab1fb2f5b8c/pydantic-2.11.7.tar.gz", hash = "sha256:d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db", size = 788350, upload-time = "2025-06-14T08:33:17.137Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6a/c0/ec2b1c8712ca690e5d61979dee872603e92b8a32f94cc1b72d53beab008a/pydantic-2.11.7-py3-none-any.whl", hash = "sha256:dde5df002701f6de26248661f6835bbe296a47bf73990135c7d07ce741b9623b", size = 444782, upload-time = "2025-06-14T08:33:14.905Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.33.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ad/88/5f2260bdfae97aabf98f1778d43f69574390ad787afb646292a638c923d4/pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc", size = 435195, upload-time = "2025-04-23T18:33:52.104Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/92/b31726561b5dae176c2d2c2dc43a9c5bfba5d32f96f8b4c0a600dd492447/pydantic_core-2.33.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8", size = 2028817, upload-time = "2025-04-23T18:30:43.919Z" }, + { url = "https://files.pythonhosted.org/packages/a3/44/3f0b95fafdaca04a483c4e685fe437c6891001bf3ce8b2fded82b9ea3aa1/pydantic_core-2.33.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d", size = 1861357, upload-time = "2025-04-23T18:30:46.372Z" }, + { url = "https://files.pythonhosted.org/packages/30/97/e8f13b55766234caae05372826e8e4b3b96e7b248be3157f53237682e43c/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d", size = 1898011, upload-time = "2025-04-23T18:30:47.591Z" }, + { url = "https://files.pythonhosted.org/packages/9b/a3/99c48cf7bafc991cc3ee66fd544c0aae8dc907b752f1dad2d79b1b5a471f/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572", size = 1982730, upload-time = "2025-04-23T18:30:49.328Z" }, + { url = "https://files.pythonhosted.org/packages/de/8e/a5b882ec4307010a840fb8b58bd9bf65d1840c92eae7534c7441709bf54b/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02", size = 2136178, upload-time = "2025-04-23T18:30:50.907Z" }, + { url = "https://files.pythonhosted.org/packages/e4/bb/71e35fc3ed05af6834e890edb75968e2802fe98778971ab5cba20a162315/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b", size = 2736462, upload-time = "2025-04-23T18:30:52.083Z" }, + { url = "https://files.pythonhosted.org/packages/31/0d/c8f7593e6bc7066289bbc366f2235701dcbebcd1ff0ef8e64f6f239fb47d/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2", size = 2005652, upload-time = "2025-04-23T18:30:53.389Z" }, + { url = "https://files.pythonhosted.org/packages/d2/7a/996d8bd75f3eda405e3dd219ff5ff0a283cd8e34add39d8ef9157e722867/pydantic_core-2.33.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a", size = 2113306, upload-time = "2025-04-23T18:30:54.661Z" }, + { url = "https://files.pythonhosted.org/packages/ff/84/daf2a6fb2db40ffda6578a7e8c5a6e9c8affb251a05c233ae37098118788/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac", size = 2073720, upload-time = "2025-04-23T18:30:56.11Z" }, + { url = "https://files.pythonhosted.org/packages/77/fb/2258da019f4825128445ae79456a5499c032b55849dbd5bed78c95ccf163/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a", size = 2244915, upload-time = "2025-04-23T18:30:57.501Z" }, + { url = "https://files.pythonhosted.org/packages/d8/7a/925ff73756031289468326e355b6fa8316960d0d65f8b5d6b3a3e7866de7/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b", size = 2241884, upload-time = "2025-04-23T18:30:58.867Z" }, + { url = "https://files.pythonhosted.org/packages/0b/b0/249ee6d2646f1cdadcb813805fe76265745c4010cf20a8eba7b0e639d9b2/pydantic_core-2.33.2-cp310-cp310-win32.whl", hash = "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22", size = 1910496, upload-time = "2025-04-23T18:31:00.078Z" }, + { url = "https://files.pythonhosted.org/packages/66/ff/172ba8f12a42d4b552917aa65d1f2328990d3ccfc01d5b7c943ec084299f/pydantic_core-2.33.2-cp310-cp310-win_amd64.whl", hash = "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640", size = 1955019, upload-time = "2025-04-23T18:31:01.335Z" }, + { url = "https://files.pythonhosted.org/packages/3f/8d/71db63483d518cbbf290261a1fc2839d17ff89fce7089e08cad07ccfce67/pydantic_core-2.33.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7", size = 2028584, upload-time = "2025-04-23T18:31:03.106Z" }, + { url = "https://files.pythonhosted.org/packages/24/2f/3cfa7244ae292dd850989f328722d2aef313f74ffc471184dc509e1e4e5a/pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246", size = 1855071, upload-time = "2025-04-23T18:31:04.621Z" }, + { url = "https://files.pythonhosted.org/packages/b3/d3/4ae42d33f5e3f50dd467761304be2fa0a9417fbf09735bc2cce003480f2a/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f", size = 1897823, upload-time = "2025-04-23T18:31:06.377Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f3/aa5976e8352b7695ff808599794b1fba2a9ae2ee954a3426855935799488/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc", size = 1983792, upload-time = "2025-04-23T18:31:07.93Z" }, + { url = "https://files.pythonhosted.org/packages/d5/7a/cda9b5a23c552037717f2b2a5257e9b2bfe45e687386df9591eff7b46d28/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de", size = 2136338, upload-time = "2025-04-23T18:31:09.283Z" }, + { url = "https://files.pythonhosted.org/packages/2b/9f/b8f9ec8dd1417eb9da784e91e1667d58a2a4a7b7b34cf4af765ef663a7e5/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a", size = 2730998, upload-time = "2025-04-23T18:31:11.7Z" }, + { url = "https://files.pythonhosted.org/packages/47/bc/cd720e078576bdb8255d5032c5d63ee5c0bf4b7173dd955185a1d658c456/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef", size = 2003200, upload-time = "2025-04-23T18:31:13.536Z" }, + { url = "https://files.pythonhosted.org/packages/ca/22/3602b895ee2cd29d11a2b349372446ae9727c32e78a94b3d588a40fdf187/pydantic_core-2.33.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e", size = 2113890, upload-time = "2025-04-23T18:31:15.011Z" }, + { url = "https://files.pythonhosted.org/packages/ff/e6/e3c5908c03cf00d629eb38393a98fccc38ee0ce8ecce32f69fc7d7b558a7/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d", size = 2073359, upload-time = "2025-04-23T18:31:16.393Z" }, + { url = "https://files.pythonhosted.org/packages/12/e7/6a36a07c59ebefc8777d1ffdaf5ae71b06b21952582e4b07eba88a421c79/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30", size = 2245883, upload-time = "2025-04-23T18:31:17.892Z" }, + { url = "https://files.pythonhosted.org/packages/16/3f/59b3187aaa6cc0c1e6616e8045b284de2b6a87b027cce2ffcea073adf1d2/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf", size = 2241074, upload-time = "2025-04-23T18:31:19.205Z" }, + { url = "https://files.pythonhosted.org/packages/e0/ed/55532bb88f674d5d8f67ab121a2a13c385df382de2a1677f30ad385f7438/pydantic_core-2.33.2-cp311-cp311-win32.whl", hash = "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51", size = 1910538, upload-time = "2025-04-23T18:31:20.541Z" }, + { url = "https://files.pythonhosted.org/packages/fe/1b/25b7cccd4519c0b23c2dd636ad39d381abf113085ce4f7bec2b0dc755eb1/pydantic_core-2.33.2-cp311-cp311-win_amd64.whl", hash = "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab", size = 1952909, upload-time = "2025-04-23T18:31:22.371Z" }, + { url = "https://files.pythonhosted.org/packages/49/a9/d809358e49126438055884c4366a1f6227f0f84f635a9014e2deb9b9de54/pydantic_core-2.33.2-cp311-cp311-win_arm64.whl", hash = "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65", size = 1897786, upload-time = "2025-04-23T18:31:24.161Z" }, + { url = "https://files.pythonhosted.org/packages/18/8a/2b41c97f554ec8c71f2a8a5f85cb56a8b0956addfe8b0efb5b3d77e8bdc3/pydantic_core-2.33.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc", size = 2009000, upload-time = "2025-04-23T18:31:25.863Z" }, + { url = "https://files.pythonhosted.org/packages/a1/02/6224312aacb3c8ecbaa959897af57181fb6cf3a3d7917fd44d0f2917e6f2/pydantic_core-2.33.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7", size = 1847996, upload-time = "2025-04-23T18:31:27.341Z" }, + { url = "https://files.pythonhosted.org/packages/d6/46/6dcdf084a523dbe0a0be59d054734b86a981726f221f4562aed313dbcb49/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025", size = 1880957, upload-time = "2025-04-23T18:31:28.956Z" }, + { url = "https://files.pythonhosted.org/packages/ec/6b/1ec2c03837ac00886ba8160ce041ce4e325b41d06a034adbef11339ae422/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011", size = 1964199, upload-time = "2025-04-23T18:31:31.025Z" }, + { url = "https://files.pythonhosted.org/packages/2d/1d/6bf34d6adb9debd9136bd197ca72642203ce9aaaa85cfcbfcf20f9696e83/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f", size = 2120296, upload-time = "2025-04-23T18:31:32.514Z" }, + { url = "https://files.pythonhosted.org/packages/e0/94/2bd0aaf5a591e974b32a9f7123f16637776c304471a0ab33cf263cf5591a/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88", size = 2676109, upload-time = "2025-04-23T18:31:33.958Z" }, + { url = "https://files.pythonhosted.org/packages/f9/41/4b043778cf9c4285d59742281a769eac371b9e47e35f98ad321349cc5d61/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1", size = 2002028, upload-time = "2025-04-23T18:31:39.095Z" }, + { url = "https://files.pythonhosted.org/packages/cb/d5/7bb781bf2748ce3d03af04d5c969fa1308880e1dca35a9bd94e1a96a922e/pydantic_core-2.33.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b", size = 2100044, upload-time = "2025-04-23T18:31:41.034Z" }, + { url = "https://files.pythonhosted.org/packages/fe/36/def5e53e1eb0ad896785702a5bbfd25eed546cdcf4087ad285021a90ed53/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1", size = 2058881, upload-time = "2025-04-23T18:31:42.757Z" }, + { url = "https://files.pythonhosted.org/packages/01/6c/57f8d70b2ee57fc3dc8b9610315949837fa8c11d86927b9bb044f8705419/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6", size = 2227034, upload-time = "2025-04-23T18:31:44.304Z" }, + { url = "https://files.pythonhosted.org/packages/27/b9/9c17f0396a82b3d5cbea4c24d742083422639e7bb1d5bf600e12cb176a13/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea", size = 2234187, upload-time = "2025-04-23T18:31:45.891Z" }, + { url = "https://files.pythonhosted.org/packages/b0/6a/adf5734ffd52bf86d865093ad70b2ce543415e0e356f6cacabbc0d9ad910/pydantic_core-2.33.2-cp312-cp312-win32.whl", hash = "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290", size = 1892628, upload-time = "2025-04-23T18:31:47.819Z" }, + { url = "https://files.pythonhosted.org/packages/43/e4/5479fecb3606c1368d496a825d8411e126133c41224c1e7238be58b87d7e/pydantic_core-2.33.2-cp312-cp312-win_amd64.whl", hash = "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2", size = 1955866, upload-time = "2025-04-23T18:31:49.635Z" }, + { url = "https://files.pythonhosted.org/packages/0d/24/8b11e8b3e2be9dd82df4b11408a67c61bb4dc4f8e11b5b0fc888b38118b5/pydantic_core-2.33.2-cp312-cp312-win_arm64.whl", hash = "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab", size = 1888894, upload-time = "2025-04-23T18:31:51.609Z" }, + { url = "https://files.pythonhosted.org/packages/46/8c/99040727b41f56616573a28771b1bfa08a3d3fe74d3d513f01251f79f172/pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f", size = 2015688, upload-time = "2025-04-23T18:31:53.175Z" }, + { url = "https://files.pythonhosted.org/packages/3a/cc/5999d1eb705a6cefc31f0b4a90e9f7fc400539b1a1030529700cc1b51838/pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6", size = 1844808, upload-time = "2025-04-23T18:31:54.79Z" }, + { url = "https://files.pythonhosted.org/packages/6f/5e/a0a7b8885c98889a18b6e376f344da1ef323d270b44edf8174d6bce4d622/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef", size = 1885580, upload-time = "2025-04-23T18:31:57.393Z" }, + { url = "https://files.pythonhosted.org/packages/3b/2a/953581f343c7d11a304581156618c3f592435523dd9d79865903272c256a/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a", size = 1973859, upload-time = "2025-04-23T18:31:59.065Z" }, + { url = "https://files.pythonhosted.org/packages/e6/55/f1a813904771c03a3f97f676c62cca0c0a4138654107c1b61f19c644868b/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916", size = 2120810, upload-time = "2025-04-23T18:32:00.78Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c3/053389835a996e18853ba107a63caae0b9deb4a276c6b472931ea9ae6e48/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a", size = 2676498, upload-time = "2025-04-23T18:32:02.418Z" }, + { url = "https://files.pythonhosted.org/packages/eb/3c/f4abd740877a35abade05e437245b192f9d0ffb48bbbbd708df33d3cda37/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d", size = 2000611, upload-time = "2025-04-23T18:32:04.152Z" }, + { url = "https://files.pythonhosted.org/packages/59/a7/63ef2fed1837d1121a894d0ce88439fe3e3b3e48c7543b2a4479eb99c2bd/pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56", size = 2107924, upload-time = "2025-04-23T18:32:06.129Z" }, + { url = "https://files.pythonhosted.org/packages/04/8f/2551964ef045669801675f1cfc3b0d74147f4901c3ffa42be2ddb1f0efc4/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5", size = 2063196, upload-time = "2025-04-23T18:32:08.178Z" }, + { url = "https://files.pythonhosted.org/packages/26/bd/d9602777e77fc6dbb0c7db9ad356e9a985825547dce5ad1d30ee04903918/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e", size = 2236389, upload-time = "2025-04-23T18:32:10.242Z" }, + { url = "https://files.pythonhosted.org/packages/42/db/0e950daa7e2230423ab342ae918a794964b053bec24ba8af013fc7c94846/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162", size = 2239223, upload-time = "2025-04-23T18:32:12.382Z" }, + { url = "https://files.pythonhosted.org/packages/58/4d/4f937099c545a8a17eb52cb67fe0447fd9a373b348ccfa9a87f141eeb00f/pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849", size = 1900473, upload-time = "2025-04-23T18:32:14.034Z" }, + { url = "https://files.pythonhosted.org/packages/a0/75/4a0a9bac998d78d889def5e4ef2b065acba8cae8c93696906c3a91f310ca/pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9", size = 1955269, upload-time = "2025-04-23T18:32:15.783Z" }, + { url = "https://files.pythonhosted.org/packages/f9/86/1beda0576969592f1497b4ce8e7bc8cbdf614c352426271b1b10d5f0aa64/pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9", size = 1893921, upload-time = "2025-04-23T18:32:18.473Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7d/e09391c2eebeab681df2b74bfe6c43422fffede8dc74187b2b0bf6fd7571/pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac", size = 1806162, upload-time = "2025-04-23T18:32:20.188Z" }, + { url = "https://files.pythonhosted.org/packages/f1/3d/847b6b1fed9f8ed3bb95a9ad04fbd0b212e832d4f0f50ff4d9ee5a9f15cf/pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5", size = 1981560, upload-time = "2025-04-23T18:32:22.354Z" }, + { url = "https://files.pythonhosted.org/packages/6f/9a/e73262f6c6656262b5fdd723ad90f518f579b7bc8622e43a942eec53c938/pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9", size = 1935777, upload-time = "2025-04-23T18:32:25.088Z" }, + { url = "https://files.pythonhosted.org/packages/30/68/373d55e58b7e83ce371691f6eaa7175e3a24b956c44628eb25d7da007917/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa", size = 2023982, upload-time = "2025-04-23T18:32:53.14Z" }, + { url = "https://files.pythonhosted.org/packages/a4/16/145f54ac08c96a63d8ed6442f9dec17b2773d19920b627b18d4f10a061ea/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29", size = 1858412, upload-time = "2025-04-23T18:32:55.52Z" }, + { url = "https://files.pythonhosted.org/packages/41/b1/c6dc6c3e2de4516c0bb2c46f6a373b91b5660312342a0cf5826e38ad82fa/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d", size = 1892749, upload-time = "2025-04-23T18:32:57.546Z" }, + { url = "https://files.pythonhosted.org/packages/12/73/8cd57e20afba760b21b742106f9dbdfa6697f1570b189c7457a1af4cd8a0/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e", size = 2067527, upload-time = "2025-04-23T18:32:59.771Z" }, + { url = "https://files.pythonhosted.org/packages/e3/d5/0bb5d988cc019b3cba4a78f2d4b3854427fc47ee8ec8e9eaabf787da239c/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c", size = 2108225, upload-time = "2025-04-23T18:33:04.51Z" }, + { url = "https://files.pythonhosted.org/packages/f1/c5/00c02d1571913d496aabf146106ad8239dc132485ee22efe08085084ff7c/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec", size = 2069490, upload-time = "2025-04-23T18:33:06.391Z" }, + { url = "https://files.pythonhosted.org/packages/22/a8/dccc38768274d3ed3a59b5d06f59ccb845778687652daa71df0cab4040d7/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052", size = 2237525, upload-time = "2025-04-23T18:33:08.44Z" }, + { url = "https://files.pythonhosted.org/packages/d4/e7/4f98c0b125dda7cf7ccd14ba936218397b44f50a56dd8c16a3091df116c3/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c", size = 2238446, upload-time = "2025-04-23T18:33:10.313Z" }, + { url = "https://files.pythonhosted.org/packages/ce/91/2ec36480fdb0b783cd9ef6795753c1dea13882f2e68e73bce76ae8c21e6a/pydantic_core-2.33.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808", size = 2066678, upload-time = "2025-04-23T18:33:12.224Z" }, + { url = "https://files.pythonhosted.org/packages/7b/27/d4ae6487d73948d6f20dddcd94be4ea43e74349b56eba82e9bdee2d7494c/pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8", size = 2025200, upload-time = "2025-04-23T18:33:14.199Z" }, + { url = "https://files.pythonhosted.org/packages/f1/b8/b3cb95375f05d33801024079b9392a5ab45267a63400bf1866e7ce0f0de4/pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593", size = 1859123, upload-time = "2025-04-23T18:33:16.555Z" }, + { url = "https://files.pythonhosted.org/packages/05/bc/0d0b5adeda59a261cd30a1235a445bf55c7e46ae44aea28f7bd6ed46e091/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612", size = 1892852, upload-time = "2025-04-23T18:33:18.513Z" }, + { url = "https://files.pythonhosted.org/packages/3e/11/d37bdebbda2e449cb3f519f6ce950927b56d62f0b84fd9cb9e372a26a3d5/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7", size = 2067484, upload-time = "2025-04-23T18:33:20.475Z" }, + { url = "https://files.pythonhosted.org/packages/8c/55/1f95f0a05ce72ecb02a8a8a1c3be0579bbc29b1d5ab68f1378b7bebc5057/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e", size = 2108896, upload-time = "2025-04-23T18:33:22.501Z" }, + { url = "https://files.pythonhosted.org/packages/53/89/2b2de6c81fa131f423246a9109d7b2a375e83968ad0800d6e57d0574629b/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8", size = 2069475, upload-time = "2025-04-23T18:33:24.528Z" }, + { url = "https://files.pythonhosted.org/packages/b8/e9/1f7efbe20d0b2b10f6718944b5d8ece9152390904f29a78e68d4e7961159/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf", size = 2239013, upload-time = "2025-04-23T18:33:26.621Z" }, + { url = "https://files.pythonhosted.org/packages/3c/b2/5309c905a93811524a49b4e031e9851a6b00ff0fb668794472ea7746b448/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb", size = 2238715, upload-time = "2025-04-23T18:33:28.656Z" }, + { url = "https://files.pythonhosted.org/packages/32/56/8a7ca5d2cd2cda1d245d34b1c9a942920a718082ae8e54e5f3e5a58b7add/pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1", size = 2066757, upload-time = "2025-04-23T18:33:30.645Z" }, +] + +[[package]] +name = "pylint" +version = "3.2.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "astroid" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "dill" }, + { name = "isort" }, + { name = "mccabe" }, + { name = "platformdirs" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "tomlkit" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9a/e9/60280b14cc1012794120345ce378504cf17409e38cd88f455dc24e0ad6b5/pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60", size = 1506739, upload-time = "2024-06-06T14:19:17.955Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/d3/d346f779cbc9384d8b805a7557b5f2b8ee9f842bffebec9fc6364d6ae183/pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8", size = 519244, upload-time = "2024-06-06T14:19:13.228Z" }, +] + +[[package]] +name = "pyright" +version = "1.1.408" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nodeenv" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/74/b2/5db700e52554b8f025faa9c3c624c59f1f6c8841ba81ab97641b54322f16/pyright-1.1.408.tar.gz", hash = "sha256:f28f2321f96852fa50b5829ea492f6adb0e6954568d1caa3f3af3a5f555eb684", size = 4400578, upload-time = "2026-01-08T08:07:38.795Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/82/a2c93e32800940d9573fb28c346772a14778b84ba7524e691b324620ab89/pyright-1.1.408-py3-none-any.whl", hash = "sha256:090b32865f4fdb1e0e6cd82bf5618480d48eecd2eb2e70f960982a3d9a4c17c1", size = 6399144, upload-time = "2026-01-08T08:07:37.082Z" }, +] + +[[package]] +name = "pytest" +version = "8.3.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b4/8c/9862305bdcd6020bc7b45b1b5e7397a6caf1a33d3025b9a003b39075ffb2/pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce", size = 1439314, upload-time = "2024-07-25T10:40:00.159Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0f/f9/cf155cf32ca7d6fa3601bc4c5dd19086af4b320b706919d48a4c79081cf9/pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5", size = 341802, upload-time = "2024-07-25T10:39:57.834Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "0.23.8" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/de/b4/0b378b7bf26a8ae161c3890c0b48a91a04106c5713ce81b4b080ea2f4f18/pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3", size = 46920, upload-time = "2024-07-17T17:39:34.617Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ee/82/62e2d63639ecb0fbe8a7ee59ef0bc69a4669ec50f6d3459f74ad4e4189a2/pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2", size = 17663, upload-time = "2024-07-17T17:39:32.478Z" }, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372, upload-time = "2024-02-25T23:20:04.057Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" }, +] + +[[package]] +name = "tomli" +version = "2.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3/tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f", size = 15164, upload-time = "2022-02-08T10:54:04.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", size = 12757, upload-time = "2022-02-08T10:54:02.017Z" }, +] + +[[package]] +name = "tomlkit" +version = "0.13.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4b/34/f5f4fbc6b329c948a90468dd423aaa3c3bfc1e07d5a76deec269110f2f6e/tomlkit-0.13.0.tar.gz", hash = "sha256:08ad192699734149f5b97b45f1f18dad7eb1b6d16bc72ad0c2335772650d7b72", size = 191792, upload-time = "2024-07-10T09:25:56.381Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fd/7c/b753bf603852cab0a660da6e81f4ea5d2ca0f0b2b4870766d7aa9bceb7a2/tomlkit-0.13.0-py3-none-any.whl", hash = "sha256:7075d3042d03b80f603482d69bf0c8f345c2b30e41699fd8883227f89972b264", size = 37770, upload-time = "2024-07-10T09:25:54.676Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321, upload-time = "2024-06-07T18:52:15.995Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438, upload-time = "2024-06-07T18:52:13.582Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/82/5c/e6082df02e215b846b4b8c0b887a64d7d08ffaba30605502639d44c06b82/typing_inspection-0.4.0.tar.gz", hash = "sha256:9765c87de36671694a67904bf2c96e395be9c6439bb6c87b5142569dcdd65122", size = 76222, upload-time = "2025-02-25T17:27:59.638Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/31/08/aa4fdfb71f7de5176385bd9e90852eaf6b5d622735020ad600f2bab54385/typing_inspection-0.4.0-py3-none-any.whl", hash = "sha256:50e72559fcd2a6367a19f7a7e610e6afcb9fac940c650290eed893d61386832f", size = 14125, upload-time = "2025-02-25T17:27:57.754Z" }, +] diff --git a/packages/gcp/.genignore b/packages/gcp/.genignore new file mode 100644 index 00000000..ac1791db --- /dev/null +++ b/packages/gcp/.genignore @@ -0,0 +1,7 @@ +pyproject.toml +src/mistralai/gcp/client/sdk.py +src/mistralai/gcp/client/_hooks/registration.py +README.md +USAGE.md +docs/sdks/**/README.md +scripts/prepare_readme.py diff --git a/packages/mistralai_gcp/.gitattributes b/packages/gcp/.gitattributes similarity index 100% rename from packages/mistralai_gcp/.gitattributes rename to packages/gcp/.gitattributes diff --git a/packages/gcp/.gitignore b/packages/gcp/.gitignore new file mode 100644 index 00000000..b386de74 --- /dev/null +++ b/packages/gcp/.gitignore @@ -0,0 +1,15 @@ +.env +.env.local +**/__pycache__/ +**/.speakeasy/temp/ +**/.speakeasy/logs/ +.speakeasy/reports +README-PYPI.md +.venv/ +venv/ +src/*.egg-info/ +__pycache__/ +.pytest_cache/ +.python-version +.DS_Store +pyrightconfig.json diff --git a/packages/gcp/.speakeasy/gen.lock b/packages/gcp/.speakeasy/gen.lock new file mode 100644 index 00000000..08289d3a --- /dev/null +++ b/packages/gcp/.speakeasy/gen.lock @@ -0,0 +1,828 @@ +lockVersion: 2.0.0 +id: ec60f2d8-7869-45c1-918e-773d41a8cf74 +management: + docChecksum: 6f32cd54fc5f3d2a609ff3933cbf34b8 + docVersion: 1.0.0 + speakeasyVersion: 1.729.0 + generationVersion: 2.841.0 + releaseVersion: 2.0.0 + configChecksum: d208fbfc438189901f0d6546484d5f26 + repoURL: https://github.com/mistralai/client-python.git + repoSubDirectory: packages/gcp + installationURL: https://github.com/mistralai/client-python.git#subdirectory=packages/gcp + published: true +persistentEdits: + generation_id: 4c7dd269-a55c-4b55-a90a-e8fec97c6b98 + pristine_commit_hash: 81f2700802a475a353aad9d56a4a9845f061ce74 + pristine_tree_hash: 0984d2a0c850ed3ed1b0ca1e96672c03a46be7d5 +features: + python: + additionalDependencies: 1.0.0 + additionalProperties: 1.0.1 + configurableModuleName: 0.2.0 + constsAndDefaults: 1.0.7 + core: 6.0.12 + defaultEnabledRetries: 0.2.0 + enumUnions: 0.1.0 + envVarSecurityUsage: 0.3.2 + examples: 3.0.2 + flatRequests: 1.0.1 + globalSecurity: 3.0.5 + globalSecurityCallbacks: 1.0.0 + globalSecurityFlattening: 1.0.0 + globalServerURLs: 3.2.0 + includes: 3.0.0 + methodArguments: 1.0.2 + nameOverrides: 3.0.3 + nullables: 1.0.2 + openEnums: 1.0.4 + responseFormat: 1.1.0 + retries: 3.0.4 + sdkHooks: 1.2.1 + serverEvents: 1.0.13 + serverEventsSentinels: 0.1.0 + serverIDs: 3.0.0 + unions: 3.1.4 +trackedFiles: + .gitattributes: + id: 24139dae6567 + last_write_checksum: sha1:53134de3ada576f37c22276901e1b5b6d85cd2da + pristine_git_object: 4d75d59008e4d8609876d263419a9dc56c8d6f3a + .vscode/settings.json: + id: 89aa447020cd + last_write_checksum: sha1:f84632c81029fcdda8c3b0c768d02b836fc80526 + pristine_git_object: 8d79f0abb72526f1fb34a4c03e5bba612c6ba2ae + docs/errors/httpvalidationerror.md: + id: 7fe2e5327e07 + last_write_checksum: sha1:277a46811144643262651853dc6176d21b33573e + pristine_git_object: 712a148c3e2305dca4c702851865f9f8c8e674cc + docs/models/arguments.md: + id: 7ea5e33709a7 + last_write_checksum: sha1:09eea126210d7fd0353e60a76bf1dbed173f13ec + pristine_git_object: 2e54e27e0ca97bee87918b2ae38cc6c335669a79 + docs/models/assistantmessage.md: + id: 7e0218023943 + last_write_checksum: sha1:47d5cd1a1bef9e398c12c207f5b3d8486d94f359 + pristine_git_object: 9ef638379aee1198742743800e778409c47a9b9d + docs/models/assistantmessagecontent.md: + id: 9f1795bbe642 + last_write_checksum: sha1:1ce4066623a8d62d969e5ed3a088d73a9ba26643 + pristine_git_object: 047b7cf95f4db203bf2c501680b73ca0562a122d + docs/models/builtinconnectors.md: + id: 9d14e972f08a + last_write_checksum: sha1:1f32eb515e32c58685d0bdc15de09656194c508c + pristine_git_object: f96f50444aaa23ca291db2fd0dc69db0d9d149d9 + docs/models/chatcompletionchoice.md: + id: 0d15c59ab501 + last_write_checksum: sha1:a6274a39a4239e054816d08517bf8507cb5c4564 + pristine_git_object: deaa0ea073e1b6c21bd466c10db31db2464066f1 + docs/models/chatcompletionchoicefinishreason.md: + id: 225764da91d3 + last_write_checksum: sha1:b894d3408cb801e072c3c302a5676ff939d59284 + pristine_git_object: b2f15ecbe88328de95b4961ddb3940fd8a6ee64b + docs/models/chatcompletionrequest.md: + id: adffe90369d0 + last_write_checksum: sha1:6374e05aeb66d48137d657acaa89527df2db35c6 + pristine_git_object: 8dbd4a82ad1d7725b9a6ce56daea208ca01b9210 + docs/models/chatcompletionrequestmessage.md: + id: 3f5e170d418c + last_write_checksum: sha1:7921c5a508a9f88adc01caab34e26182b8035607 + pristine_git_object: 91e9e062d0ef0cb69235c4ae4516548733ce28a9 + docs/models/chatcompletionrequeststop.md: + id: fcaf5bbea451 + last_write_checksum: sha1:71a25f84f0d88c7acf72e801ced6159546201851 + pristine_git_object: 749296d420c0671d2a1d6d22483b51f577a86485 + docs/models/chatcompletionrequesttoolchoice.md: + id: b97041b2f15b + last_write_checksum: sha1:7ad7eb133f70e07d0d6a9def36aadd08b35cf861 + pristine_git_object: dc82a8ef91e7bfd44f1d2d9d9a4ef61b6e76cc34 + docs/models/chatcompletionresponse.md: + id: 7c53b24681b9 + last_write_checksum: sha1:a56581c0846638cfe6df26d3045fb4f874ccd931 + pristine_git_object: a0465ffbfc5558628953e03fbc53b80bbdc8649b + docs/models/chatcompletionstreamrequest.md: + id: cf8f29558a68 + last_write_checksum: sha1:e23cf88a5a9b0c99e68d06a8450b8bfb9aee33a2 + pristine_git_object: db76b6c81a71607f94c212a542fe30e082053a90 + docs/models/chatcompletionstreamrequestmessage.md: + id: 053a98476cd2 + last_write_checksum: sha1:8270692463fab1243d9de4bbef7162daa64e52c5 + pristine_git_object: 2e4e93acca8983a3ea27b391d4606518946e13fe + docs/models/chatcompletionstreamrequeststop.md: + id: d0e89a4dca78 + last_write_checksum: sha1:a889e9580fa94bda7c848682d6ba501b7f5c0f41 + pristine_git_object: a48460a92ac47fec1de2188ba46b238229736d32 + docs/models/chatcompletionstreamrequesttoolchoice.md: + id: 210d5e5b1413 + last_write_checksum: sha1:0543164caf3f4fb2bef3061dbd1a5e6b34b17ae9 + pristine_git_object: 43f3ca3809bf1a2a040e2ad7c19a2b22db0b73f8 + docs/models/completionchunk.md: + id: 60cb30423c60 + last_write_checksum: sha1:61b976fe2e71236cf7941ee1635decc31bd304b2 + pristine_git_object: 7f8ab5e631e2c6d1d9830325e591a7e434b83a35 + docs/models/completionevent.md: + id: e57cd17cb9dc + last_write_checksum: sha1:4f59c67af0b11c77b80d2b9c7aca36484d2be219 + pristine_git_object: 7a66e8fee2bb0f1c58166177653893bb05b98f1d + docs/models/completionresponsestreamchoice.md: + id: d56824d615a6 + last_write_checksum: sha1:0296a490df009dbfd04893fdebcc88dd6102a872 + pristine_git_object: 1532c25b8fc065d486f52d4610a7f757e5340875 + docs/models/completionresponsestreamchoicefinishreason.md: + id: 5f1fbfc90b8e + last_write_checksum: sha1:20824b4a223cbd3658b32440973a7d47dcd108b9 + pristine_git_object: 0fece473297227c75db4e7ded63417a2f117cac0 + docs/models/contentchunk.md: + id: d2d3a32080cd + last_write_checksum: sha1:5839a26cdc412b78caad7fb59df97bdcea57be6d + pristine_git_object: 22023e8b19692df969693b7a14f8cf6e0143859f + docs/models/context.md: + id: e8f2f9e54b8e + last_write_checksum: sha1:4c14b386f9f89d98f4dd9487ab030f10478c0e63 + pristine_git_object: 107f1bd428b1f39b36f75e5a10532bc462967ce5 + docs/models/deltamessage.md: + id: 6c5ed6b60968 + last_write_checksum: sha1:00052476b9b2474dbc149f18dd18c71c86d0fc74 + pristine_git_object: e0ee575f3fce7c312114ce8c5390efc5c4854952 + docs/models/deltamessagecontent.md: + id: 7307bedc8733 + last_write_checksum: sha1:a1211b8cb576ad1358e68983680ee326c3920a5e + pristine_git_object: 8142772d7ea33ad8a75cf9cf822564ba3f630de2 + docs/models/fimcompletionrequest.md: + id: b44677ecc293 + last_write_checksum: sha1:24bcb54d39b3fabd487549a27b4c0a65dd5ffe50 + pristine_git_object: fde0b625c29340e8dce1eb3026ce644b1885e53a + docs/models/fimcompletionrequeststop.md: + id: ea5475297a83 + last_write_checksum: sha1:a6cdb4bda01ac58016a71f35da48a5d10df11623 + pristine_git_object: a0dbb00a82a03acc8b62b81d7597722a6ca46118 + docs/models/fimcompletionresponse.md: + id: 050d62ba2fac + last_write_checksum: sha1:a6101a69e83b7a5bcf96ec77ba1cab8748f734f4 + pristine_git_object: cd62d0349503fd8b13582d0ba47ab9cff40f6b28 + docs/models/fimcompletionstreamrequest.md: + id: c881d7e27637 + last_write_checksum: sha1:f8755bc554dd44568c42eb5b6dde04db464647ab + pristine_git_object: ba62d854f030390418597cbd8febae0e1ce27ea8 + docs/models/fimcompletionstreamrequeststop.md: + id: c97a11b764e9 + last_write_checksum: sha1:958d5087050fdeb128745884ebcf565b4fdc3886 + pristine_git_object: 5a9e2ff020d4939f7fd42c0673ea7bdd16cca99d + docs/models/function.md: + id: 416a80fba031 + last_write_checksum: sha1:a9485076d430a7753558461ce87bf42d09e34511 + pristine_git_object: b2bdb3fe82520ea79d0cf1a10ee41c844f90b859 + docs/models/functioncall.md: + id: a78cd1d7f605 + last_write_checksum: sha1:65bf78744b8531cdefb6a288f1af5cbf9d9e2395 + pristine_git_object: 7ccd90dca4868db9b6e178712f95d375210013c8 + docs/models/functionname.md: + id: 4b3bd62c0f26 + last_write_checksum: sha1:754fe32bdffe53c1057b302702f5516f4e551cfb + pristine_git_object: 87d7b4852de629015166605b273deb9341202dc0 + docs/models/imagedetail.md: + id: f8217529b496 + last_write_checksum: sha1:fdf19ac9459f64616240955cb81a84ef03e775c8 + pristine_git_object: 1e5ba3fd405a14e5e2872cc85504584dca19b726 + docs/models/imageurl.md: + id: e75dd23cec1d + last_write_checksum: sha1:a5cf621ce58a9cc7c96afa7de53367eac7b4cb0b + pristine_git_object: 6358e0acb2dea4816203413842243704ca955783 + docs/models/imageurlchunk.md: + id: 4407097bfff3 + last_write_checksum: sha1:30b72826963e22cadf76ac0b7604288dbc4fb943 + pristine_git_object: a84dac32b99390e3fd0559714ca43795742192c6 + docs/models/imageurlunion.md: + id: 9d3c691a9db0 + last_write_checksum: sha1:4e32bcd7d44746d2ddbfafbef96152bb2bdb2a15 + pristine_git_object: db97130f26199dcb354ecb7469d09530b035daa2 + docs/models/jsonschema.md: + id: a6b15ed6fac8 + last_write_checksum: sha1:523465666ad3c292252b3fe60f345c7ffb29053f + pristine_git_object: 7ff7c070353c58290416aff5b01d1dfc43905269 + docs/models/loc.md: + id: b071d5a509cc + last_write_checksum: sha1:09a04749333ab50ae806c3ac6adcaa90d54df0f1 + pristine_git_object: d6094ac2c6e0326c039dad2f6b89158694ef6aa7 + docs/models/mistralpromptmode.md: + id: d17d5db4d3b6 + last_write_checksum: sha1:abcb7205c5086169c7d9449d15ac142448a7d258 + pristine_git_object: c3409d03b9646e21a3793372d06dcae6fef95463 + docs/models/prediction.md: + id: 3c70b2262201 + last_write_checksum: sha1:ca8a77219e6113f2358a5363e935288d90df0725 + pristine_git_object: fae3c1ca4ba2c2ddb3b7de401ecdc8d56dcc7740 + docs/models/referencechunk.md: + id: 07895f9debfd + last_write_checksum: sha1:4384049375a2566c7567599f97ce1ec19e9f6276 + pristine_git_object: d847e24845a399c7ca93d54701832fb65e01b3ab + docs/models/responseformat.md: + id: 50a1e4140614 + last_write_checksum: sha1:e877b2e81470ef5eec5675dfb91a47e74d5d3add + pristine_git_object: 5cab22f2bf1c412699f6a7ed18ef801ecbc3ee4b + docs/models/responseformats.md: + id: cf1f250b82db + last_write_checksum: sha1:105e1f9181913104b554051838cbdd0f728aa2c4 + pristine_git_object: 2f5f1e5511b048323fee18a0ffdd506fe2b3d56f + docs/models/security.md: + id: 452e4d4eb67a + last_write_checksum: sha1:ce2871b49c1632d50e22d0b1ebe4999021d52313 + pristine_git_object: c698674c513f5b20c04f629e50154e67977275f7 + docs/models/systemmessage.md: + id: fdb7963e1cdf + last_write_checksum: sha1:c7603c5ce77ba2bcbda9eff65eeafdb1e9ecbec7 + pristine_git_object: 10bda10f921fb5d66c1606ff18e654b4e78ab197 + docs/models/systemmessagecontent.md: + id: 94a56febaeda + last_write_checksum: sha1:6cb10b4b860b4204df57a29c650c85c826395aeb + pristine_git_object: 0c87baf3c2fade64a2738a9a4b3ce19647e5dc9a + docs/models/systemmessagecontentchunks.md: + id: cea1c19e9d7a + last_write_checksum: sha1:986aec0f8098158515bbccd0c22e0b3d4151bb32 + pristine_git_object: 40030c170746d9953d25b979ab7e6f522018e230 + docs/models/textchunk.md: + id: 6cd12e0ef110 + last_write_checksum: sha1:aa448d4937c0c1cd562621f0a9080aa0dc6e4bd1 + pristine_git_object: b266619dcb57222ec343f373c43b2b5cef5b8b93 + docs/models/thinkchunk.md: + id: bca24d7153f6 + last_write_checksum: sha1:2b8ff7737fa7255673ca31da7cb2e6803fce9e02 + pristine_git_object: b07f598ebc5f0e9c041186c081dc98bc21104bdb + docs/models/thinking.md: + id: 07234f8dd364 + last_write_checksum: sha1:90c0b34284137712678b0671e9f4bfb319548cbf + pristine_git_object: d9e51d7dc93b24edd807b018393eab38143d46f4 + docs/models/tool.md: + id: 8966139dbeed + last_write_checksum: sha1:1725bf53fc9f1ca3f332322d91de24c9d58adc6a + pristine_git_object: fb661f72887271d5bb470e4edf025a32b00ade17 + docs/models/toolcall.md: + id: 80892ea1a051 + last_write_checksum: sha1:cb27b9d36cfe6227978c7a7a01b1349b6bac99d9 + pristine_git_object: 3819236b9f3eee2f6878818cfbbe2817e97f7de2 + docs/models/toolchoice.md: + id: "097076343426" + last_write_checksum: sha1:25b33b34da02c3b46349dc8b6223f9ae18370d16 + pristine_git_object: 373046bbbc834169293b4f4ae8b2e238f952ddde + docs/models/toolchoiceenum.md: + id: 15410de51ffc + last_write_checksum: sha1:ca0cf9bf128bebc8faedd9333cc6a56b30f58130 + pristine_git_object: 0be3d6c54b13a8bf30773398a2c12e0d30d3ae58 + docs/models/toolmessage.md: + id: 0553747c37a1 + last_write_checksum: sha1:ac61e644ba7c6da607cb479eafd1db78d8e8012e + pristine_git_object: 7201481e61e269b238887deec30c03f7e16c53d7 + docs/models/toolmessagecontent.md: + id: f0522d2d3c93 + last_write_checksum: sha1:783769c0200baa1b6751327aa3e009fa83da72ee + pristine_git_object: 5c76091fbd2c8e0d768921fab19c7b761df73411 + docs/models/toolreferencechunk.md: + id: 10414b39b7b3 + last_write_checksum: sha1:a0e93881de5ecaf765300d45a18ab21dcffe54f9 + pristine_git_object: 9fc10399fe4ce9eb3b5e87a6bc609643d6a2cb3a + docs/models/tooltypes.md: + id: adb50fe63ea2 + last_write_checksum: sha1:f224c3d8732450b9c969b3e04027b7df7892694c + pristine_git_object: 84e49253c9b9bd1bd314e2a126106404cbb52f16 + docs/models/toolunion.md: + id: ad708b0ce4e0 + last_write_checksum: sha1:61909a56240c784e05f13dff8d9787272e1aa8bc + pristine_git_object: 2dcb3deec9f05d1e578c485a47a8ddd10b375f48 + docs/models/usageinfo.md: + id: ec6fe65028a9 + last_write_checksum: sha1:cf71fb9676d870eba7c4d10a69636e1db4054adc + pristine_git_object: f5204ac94a4d6191839031c66c5a9bc0124a1f35 + docs/models/usermessage.md: + id: ed66d7a0f80b + last_write_checksum: sha1:f0ed7d9cb7264f1d9e4a9190772df3f15e25346c + pristine_git_object: e7a932ed71496fa7cc358388c650d25f166f27a4 + docs/models/usermessagecontent.md: + id: 52c072c851e8 + last_write_checksum: sha1:1de02bcf7082768ebe1bb912fdbebbec5a577b5a + pristine_git_object: 8350f9e8f8996c136093e38760990f62fd01f8cf + docs/models/utils/retryconfig.md: + id: 4343ac43161c + last_write_checksum: sha1:562c0f21e308ad10c27f85f75704c15592c6929d + pristine_git_object: 69dd549ec7f5f885101d08dd502e25748183aebf + docs/models/validationerror.md: + id: 304bdf06ef8b + last_write_checksum: sha1:1f297f34069668f6107f2c0389606efe413ff5a8 + pristine_git_object: 5bcea5b5d12e72222720af2c014d64ec4bdfee4a + py.typed: + id: 258c3ed47ae4 + last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 + pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 + pylintrc: + id: 7ce8b9f946e6 + last_write_checksum: sha1:8f871a5aac4b10bff724c9d91b8d7496eb1fbdde + pristine_git_object: 0391ac11bdc5526b697b69d047d568a611ce87d0 + scripts/prepare_readme.py: + id: e0c5957a6035 + last_write_checksum: sha1:eb988bc0e00ed4bb14e9a3572845af14f06c9b42 + pristine_git_object: ae27b555c05c3c9f35d84e8bbe6a7c9f80cf94b2 + scripts/publish.sh: + id: fe273b08f514 + last_write_checksum: sha1:b290b25b36dca3d5eb1a2e66a2e1bcf2e7326cf3 + pristine_git_object: c35748f360329c2bc370e9b189f49b1a360b2c48 + src/mistralai/gcp/client/__init__.py: + id: 4f63decd432e + last_write_checksum: sha1:da077c0bdfcef64a4a5aea91a17292f72fa2b088 + pristine_git_object: 833c68cd526fe34aab2b7e7c45f974f7f4b9e120 + src/mistralai/gcp/client/_hooks/__init__.py: + id: adcb191838d1 + last_write_checksum: sha1:e3111289afd28ad557c21d9e2f918caabfb7037d + pristine_git_object: 2ee66cdd592fe41731c24ddd407c8ca31c50aec1 + src/mistralai/gcp/client/_hooks/sdkhooks.py: + id: 7e23394c3f65 + last_write_checksum: sha1:4a03a16da35168f25ed0cccfdb0d4c4d86bbe242 + pristine_git_object: 2af4deeda8055f4c57c0c7f00a7b79033435cf34 + src/mistralai/gcp/client/_hooks/types.py: + id: 4f37fd18bfd9 + last_write_checksum: sha1:2b295cc28d5fa2c79495510c8b97a1ea60f993e0 + pristine_git_object: ea95bed210db9180824efddfb1b3e47f5bf96489 + src/mistralai/gcp/client/_version.py: + id: f87319e32c7b + last_write_checksum: sha1:2c22a5ebb7568968607db20612021af35240f714 + pristine_git_object: 377c9836b5f8bdf65e87ba375232422114af2966 + src/mistralai/gcp/client/basesdk.py: + id: 4d594572857b + last_write_checksum: sha1:d8ef9e2f4fa97d402eb9f5472ceb80fb39693991 + pristine_git_object: b3edcb0aca1882d0cbe4d499cfba9cb5464c5b58 + src/mistralai/gcp/client/chat.py: + id: 4c41f05f786e + last_write_checksum: sha1:60b2697e2ecfb62eebed910007e62ab1df565eec + pristine_git_object: 925d69eda2fdac458045cc12327ca72997e07600 + src/mistralai/gcp/client/errors/__init__.py: + id: c51c8ed21629 + last_write_checksum: sha1:29f08ad600a712ff572843a250839ef92efac19b + pristine_git_object: 00c8ee0031486b5416bb6745397c463e1a5dbba6 + src/mistralai/gcp/client/errors/httpvalidationerror.py: + id: b0e25f1c36bd + last_write_checksum: sha1:c863914ed6704ee6c3ad99a77d8b1e742de069d0 + pristine_git_object: 598068197b9ed7e7756de01325f7967a719e46ea + src/mistralai/gcp/client/errors/mistralgcperror.py: + id: 9a9cad8f5d36 + last_write_checksum: sha1:7267c829a842a94c5b84ac248a1610ce45f3db4e + pristine_git_object: 9de91bf2a4abf8b0d0922eb6062fe2ab817a8aee + src/mistralai/gcp/client/errors/no_response_error.py: + id: 2d3e5fe56122 + last_write_checksum: sha1:7f326424a7d5ae1bcd5c89a0d6b3dbda9138942f + pristine_git_object: 1deab64bc43e1e65bf3c412d326a4032ce342366 + src/mistralai/gcp/client/errors/responsevalidationerror.py: + id: 98f7bac284be + last_write_checksum: sha1:1b835d2ce8754b22d5fa269077d7a2eec11d7f29 + pristine_git_object: e8bd83c19b0629bb0ddf7a240e9b8371cb33fff3 + src/mistralai/gcp/client/errors/sdkerror.py: + id: c53aee73c8e1 + last_write_checksum: sha1:080933e9f354b675988a132813f23e55f9e5db74 + pristine_git_object: 6980924626fa5fbf67fb62a30fd23d5883dbe650 + src/mistralai/gcp/client/fim.py: + id: 13d2d208e0ef + last_write_checksum: sha1:1027165887446ce0764ad542ca52f61b460c71b8 + pristine_git_object: 4202102ae5218784a10ee93ada5a0643d23a1d0c + src/mistralai/gcp/client/httpclient.py: + id: a53dd7be6a4c + last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 + pristine_git_object: 89560b566073785535643e694c112bedbd3db13d + src/mistralai/gcp/client/models/__init__.py: + id: d9e976d01972 + last_write_checksum: sha1:9ba03a47ef26bb6d64366ec4a2b466a6d417aa82 + pristine_git_object: e42ed4bb30a39afd1d63dc2f9918e86981f2bf94 + src/mistralai/gcp/client/models/assistantmessage.py: + id: d39c4bdd289e + last_write_checksum: sha1:c813783bcbeec4e40f12e007d1dde4aed8ec71cf + pristine_git_object: 702ac4708abb95fc18d138500b8353715c2dbc98 + src/mistralai/gcp/client/models/builtinconnectors.py: + id: 7bbec8f3c9c7 + last_write_checksum: sha1:4e94744e3854d4cdc9d1272e4f1d9371f9829a5f + pristine_git_object: 6a3b2476d54096722eb3e7a271629d108028bd35 + src/mistralai/gcp/client/models/chatcompletionchoice.py: + id: 8e65b56f3e6d + last_write_checksum: sha1:e6d1382e9f880b866130d900fd866997aaf80e45 + pristine_git_object: ae5a2fbf38afbd86233dcaa8aa1c8441f5ed9eba + src/mistralai/gcp/client/models/chatcompletionrequest.py: + id: 4694a31c0003 + last_write_checksum: sha1:80fcbbcde773c22c93cf2db63beef2cfe3777497 + pristine_git_object: 8229c5bb13ded84039f3d8ddb95ac0a9c184e1bd + src/mistralai/gcp/client/models/chatcompletionresponse.py: + id: dd9e4796fca9 + last_write_checksum: sha1:76d7257583389ff5021e320a8f9a45a6deb07c7c + pristine_git_object: 317c4d84e378c14294d58c5aefd8c55ffe28754a + src/mistralai/gcp/client/models/chatcompletionstreamrequest.py: + id: 7294862af8ea + last_write_checksum: sha1:899210f881bdbe0a0d94e29fe7044fabbccc578c + pristine_git_object: 3c228d2e7edf08c36f310e190a8dedc7b4958459 + src/mistralai/gcp/client/models/completionchunk.py: + id: 6b9ed8c30877 + last_write_checksum: sha1:f1f091e94e3c1c1aefd3c3bb60c8de8236ab0ead + pristine_git_object: a0b1ae2fa3109a2c2b76bbc483b691d88dc9a15c + src/mistralai/gcp/client/models/completionevent.py: + id: 3f55c4b8fc75 + last_write_checksum: sha1:66665d921fd27df6ef0efce996a5446e49b989d8 + pristine_git_object: bb1550093ce9adcb9bcd0548b69796e82f4f260b + src/mistralai/gcp/client/models/completionresponsestreamchoice.py: + id: ad9b98ca7e1c + last_write_checksum: sha1:c4f9d733461bdb9a0d6c96e82212de7dddc04ffe + pristine_git_object: e58d4c88009ed3696d2a3a57f3796d8fb067019d + src/mistralai/gcp/client/models/contentchunk.py: + id: 8714d3bf2698 + last_write_checksum: sha1:acab1b53b1d324544c6aa6c4126a3fb5265278d2 + pristine_git_object: 18d481505e17d2125e380d796b0c406b0e66d601 + src/mistralai/gcp/client/models/deltamessage.py: + id: 404fc85f1a4c + last_write_checksum: sha1:982c2d15a570c7f4d5e1c3b012db46ea3bac609b + pristine_git_object: 63e6a7f3e50c138f235f5a36277aa8668f85cef1 + src/mistralai/gcp/client/models/fimcompletionrequest.py: + id: 5b79e2595d31 + last_write_checksum: sha1:80a2e3d5e10c240869cd96c41936d714cf8bf801 + pristine_git_object: e460f76c59315c22c75194936f1f3b232331f83c + src/mistralai/gcp/client/models/fimcompletionresponse.py: + id: 402f602d29b8 + last_write_checksum: sha1:cfe26848c7b14d6e374b7944d7ad44df822990b0 + pristine_git_object: 5b80da3f03e4e99dfca971a53af1cf6472c889bb + src/mistralai/gcp/client/models/fimcompletionstreamrequest.py: + id: 31190cf25070 + last_write_checksum: sha1:a95ab8c20b2fdff48102f08258a556af9f382ffa + pristine_git_object: fffc305499e578f77e42fb7992b59e933ae0ae7c + src/mistralai/gcp/client/models/function.py: + id: 2285a899b32e + last_write_checksum: sha1:6439f7f781174ae56b2b02ccbb4d02b08d8d5a03 + pristine_git_object: 439e831355444e0f9e82d23636651201f0db4bfc + src/mistralai/gcp/client/models/functioncall.py: + id: 17bb51f08e5f + last_write_checksum: sha1:b5fe2f061ea5f47057ee50011babc80de27e0ee6 + pristine_git_object: 0f1b24251ce728b3c2a0fb9e9ca94f90a9c3b7be + src/mistralai/gcp/client/models/functionname.py: + id: 313a6001145f + last_write_checksum: sha1:fe1eefaed314efa788bd15beb63bf6b81abb307e + pristine_git_object: 585b9e39762e49356823e211ad86f701bca389b8 + src/mistralai/gcp/client/models/imagedetail.py: + id: a28b2f3e2cb5 + last_write_checksum: sha1:a4874529961952019eaa86a2fa0989626f537a4c + pristine_git_object: 68ed76080716eb1424b13f182479f57e51a4fabf + src/mistralai/gcp/client/models/imageurl.py: + id: 4e330f3eae74 + last_write_checksum: sha1:6c0bee7d7c765fb2611131c7d270041671b428b8 + pristine_git_object: 903d0a1a45eeb7c5e8cde80f624b6e039de1f4cc + src/mistralai/gcp/client/models/imageurlchunk.py: + id: e68a4a393e9b + last_write_checksum: sha1:eae1d0e69a90b2f7513492e4cd0ed68d647f0b5d + pristine_git_object: 4bec0eec882c1eeee8a80f663ff7d686ca677ea0 + src/mistralai/gcp/client/models/jsonschema.py: + id: 39c6e7d412a0 + last_write_checksum: sha1:19b34a5e3f5c00d1a1b96f91a6e02f5ad12240c7 + pristine_git_object: 684ac09f0460bef1f26bf0030b79bbc7141ab99b + src/mistralai/gcp/client/models/mistralpromptmode.py: + id: 8be4a4a683e4 + last_write_checksum: sha1:c958567e95490abf3941fde69be69733e8afb90e + pristine_git_object: c765e4f1a0b86735255771231377f13d62f3d7a6 + src/mistralai/gcp/client/models/prediction.py: + id: 7a5463285bc8 + last_write_checksum: sha1:67c4a9b06d3e98552409a26960e0afd64f829b53 + pristine_git_object: 2e325289fd6c2a987ad270fd808f7b9a3f423440 + src/mistralai/gcp/client/models/referencechunk.py: + id: 523e477f8725 + last_write_checksum: sha1:aade1dc05c2a2672630eb17626e4f49367d6bfe6 + pristine_git_object: 261c4755641093a38f97b17dce3a387623e69ead + src/mistralai/gcp/client/models/responseformat.py: + id: 06774bb65b42 + last_write_checksum: sha1:7e64de46ef34718003cf0d198868a193f2122178 + pristine_git_object: f3aa9930e0f8a009dac628300d66c6209a538031 + src/mistralai/gcp/client/models/responseformats.py: + id: 18112ad0f6db + last_write_checksum: sha1:a212e85d286b5b49219f57d071a2232ff8b5263b + pristine_git_object: cbf83ce7b54ff8634f741334831807bfb5c98991 + src/mistralai/gcp/client/models/security.py: + id: 7e13bda8273b + last_write_checksum: sha1:7086e929823d4eefe80cc279b605adfc8bbb08aa + pristine_git_object: 10a469b54d5e03873fb7d7d98627f2376c93d484 + src/mistralai/gcp/client/models/systemmessage.py: + id: 6537664d2d1b + last_write_checksum: sha1:779cb07cfd63ebe9eec496177cf1a8f5c077e417 + pristine_git_object: b3795c4bf4e97853979e0042cf4bd151d60ef974 + src/mistralai/gcp/client/models/systemmessagecontentchunks.py: + id: e120a6469c89 + last_write_checksum: sha1:d1f96498cbb540b91425e70ffa33892ff4d1c8cd + pristine_git_object: 8de71c909eda2ed0166a6be8f8ee029956e5766b + src/mistralai/gcp/client/models/textchunk.py: + id: a134f120d4dc + last_write_checksum: sha1:1ccc7d232136d6278d670542d192f36f46862df1 + pristine_git_object: 690322725c0f852a005d08c5b722c41709868b22 + src/mistralai/gcp/client/models/thinkchunk.py: + id: 59a1d1ef2020 + last_write_checksum: sha1:f2f07f8bf1094cff718fb0f3ef760890c54e4003 + pristine_git_object: d534fc1ecc2a127d9ac9ac3d7a7aba7156faf7c2 + src/mistralai/gcp/client/models/tool.py: + id: 4b27d45e56ad + last_write_checksum: sha1:cb0d879a55218fd7753bdd005be8a155982feb8f + pristine_git_object: 670aa81f8767e7c079105cf5995225168b4d6eb6 + src/mistralai/gcp/client/models/toolcall.py: + id: e6c25869a579 + last_write_checksum: sha1:f88e69a8e352025ca4b6897f6c16e1f7e4cd7264 + pristine_git_object: 3ea8e283c8f695bcc1fbc734b0074d37c2efeac8 + src/mistralai/gcp/client/models/toolchoice.py: + id: cb13a9f64c92 + last_write_checksum: sha1:71be72b1aae19aef1f8a461c89b71ad6daa009b7 + pristine_git_object: 6e795fd72792f740c8aa5b4da7d1f516018f2c2e + src/mistralai/gcp/client/models/toolchoiceenum.py: + id: d62e9c92d93c + last_write_checksum: sha1:3dbba9a58c5569aafe115f3f7713a52b01ad8620 + pristine_git_object: 01f6f677b379f9e3c99db9d1ad248cb0033a2804 + src/mistralai/gcp/client/models/toolmessage.py: + id: b3774786c2e9 + last_write_checksum: sha1:3d414da8132467d1472ebe485802ffc78eb6f7e4 + pristine_git_object: ce160391f37ce3568daf2877f8dc1aa0f3694821 + src/mistralai/gcp/client/models/toolreferencechunk.py: + id: 16363389756d + last_write_checksum: sha1:42abb2395ed4aa06831723288ce3d20f53f38da7 + pristine_git_object: 0a2a7fa3b80417ac2462126c4fae1e9f777df534 + src/mistralai/gcp/client/models/tooltypes.py: + id: 5926c64f5229 + last_write_checksum: sha1:ffd576511eed9f823c3d67df9fc5574d8d53c54b + pristine_git_object: fd1aa13d7b8c5d9bdb0922e04b8bd653ff843f60 + src/mistralai/gcp/client/models/usageinfo.py: + id: 3aab1af66cff + last_write_checksum: sha1:c0c949ac48ed35efe1e8fbf820b8e390edd9c3ce + pristine_git_object: cb6feb6e8d173d39b828d8f5b38af75173b4f7f2 + src/mistralai/gcp/client/models/usermessage.py: + id: 9cfa7260463e + last_write_checksum: sha1:780984241b84a7dfe1f6ad6eccace1204bfec8bd + pristine_git_object: e237e900421a9e65fd15aede29ade0e510b189f6 + src/mistralai/gcp/client/models/validationerror.py: + id: 6b4f4910ea9c + last_write_checksum: sha1:1fd1ffba68b202465f3a0269d7099b4fee5c85c9 + pristine_git_object: 3ff872c15f6380c3a7f9dc9be1b80be159f752ba + src/mistralai/gcp/client/py.typed: + id: 98b8ab80ab0d + last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 + pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 + src/mistralai/gcp/client/sdkconfiguration.py: + id: 57be0f79ea1e + last_write_checksum: sha1:0c5905e7c6092f57c15ee4318a85c0985bcc1ccf + pristine_git_object: d56a634f688f6697ba84962381084dc2d0836ac9 + src/mistralai/gcp/client/types/__init__.py: + id: f7ef15ac2ba1 + last_write_checksum: sha1:140ebdd01a46f92ffc710c52c958c4eba3cf68ed + pristine_git_object: fc76fe0c5505e29859b5d2bb707d48fd27661b8c + src/mistralai/gcp/client/types/basemodel.py: + id: 24babf758c19 + last_write_checksum: sha1:10d84aedeb9d35edfdadf2c3020caa1d24d8b584 + pristine_git_object: a9a640a1a7048736383f96c67c6290c86bf536ee + src/mistralai/gcp/client/utils/__init__.py: + id: a30c8ff6dcff + last_write_checksum: sha1:3ad22a588864c93bd3a16605f669955b5f3b8053 + pristine_git_object: b488c2df1390b22be3050eee72832a91c76d5385 + src/mistralai/gcp/client/utils/annotations.py: + id: 9b2cd4ffc6e9 + last_write_checksum: sha1:a4824ad65f730303e4e1e3ec1febf87b4eb46dbc + pristine_git_object: 12e0aa4f1151bb52474cc02e88397329b90703f6 + src/mistralai/gcp/client/utils/datetimes.py: + id: dd1f0f91ea9d + last_write_checksum: sha1:c721e4123000e7dc61ec52b28a739439d9e17341 + pristine_git_object: a6c52cd61bbe2d459046c940ce5e8c469f2f0664 + src/mistralai/gcp/client/utils/dynamic_imports.py: + id: 0091051cb000 + last_write_checksum: sha1:a1940c63feb8eddfd8026de53384baf5056d5dcc + pristine_git_object: 673edf82a97d0fea7295625d3e092ea369a36b79 + src/mistralai/gcp/client/utils/enums.py: + id: 2341407d5443 + last_write_checksum: sha1:bc8c3c1285ae09ba8a094ee5c3d9c7f41fa1284d + pristine_git_object: 3324e1bc2668c54c4d5f5a1a845675319757a828 + src/mistralai/gcp/client/utils/eventstreaming.py: + id: bb66f0c3e0dc + last_write_checksum: sha1:ffa870a25a7e4e2015bfd7a467ccd3aa1de97f0e + pristine_git_object: f2052fc22d9fd6c663ba3dce019fe234ca37108b + src/mistralai/gcp/client/utils/forms.py: + id: ebf34781d6bd + last_write_checksum: sha1:0ca31459b99f761fcc6d0557a0a38daac4ad50f4 + pristine_git_object: 1e550bd5c2c35d977ddc10f49d77c23cb12c158d + src/mistralai/gcp/client/utils/headers.py: + id: 4c369582903e + last_write_checksum: sha1:7c6df233ee006332b566a8afa9ce9a245941d935 + pristine_git_object: 37864cbbbc40d1a47112bbfdd3ba79568fc8818a + src/mistralai/gcp/client/utils/logger.py: + id: 082d86b60820 + last_write_checksum: sha1:f3fdb154a3f09b8cc43d74c7e9c02f899f8086e4 + pristine_git_object: b661aff65d38b77d035149699aea09b2785d2fc6 + src/mistralai/gcp/client/utils/metadata.py: + id: ff0e832b8b9c + last_write_checksum: sha1:c6a560bd0c63ab158582f34dadb69433ea73b3d4 + pristine_git_object: 173b3e5ce658675c2f504222a56b3daaaa68107d + src/mistralai/gcp/client/utils/queryparams.py: + id: 133b8408e73e + last_write_checksum: sha1:b94c3f314fd3da0d1d215afc2731f48748e2aa59 + pristine_git_object: c04e0db82b68eca041f2cb2614d748fbac80fd41 + src/mistralai/gcp/client/utils/requestbodies.py: + id: 1be13a660954 + last_write_checksum: sha1:41e2d2d2d3ecc394c8122ca4d4b85e1c3e03f054 + pristine_git_object: 1de32b6d26f46590232f398fdba6ce0072f1659c + src/mistralai/gcp/client/utils/retries.py: + id: 542ebd75b79b + last_write_checksum: sha1:471372f5c5d1dd5583239c9cf3c75f1b636e5d87 + pristine_git_object: af07d4e941007af4213c5ec9047ef8a2fca04e5e + src/mistralai/gcp/client/utils/security.py: + id: 5273152365f4 + last_write_checksum: sha1:435dd8b180cefcd733e635b9fa45512da091d9c0 + pristine_git_object: 17996bd54b8624009802fbbdf30bcb4225b8dfed + src/mistralai/gcp/client/utils/serializers.py: + id: a7836e553d41 + last_write_checksum: sha1:ce1d8d7f500a9ccba0aeca5057cee9c271f4dfd7 + pristine_git_object: 14321eb479de81d0d9580ec8291e0ff91bf29e57 + src/mistralai/gcp/client/utils/unions.py: + id: 8abba1cf1b6d + last_write_checksum: sha1:6e38049f323e0b5fb4bd0e88ab51ec447197ccb0 + pristine_git_object: a227f4e87be22fce682fcae5813b71835199ec5e + src/mistralai/gcp/client/utils/unmarshal_json_response.py: + id: d972d22cf934 + last_write_checksum: sha1:5c75fb4ee04ae80a350ceb96abf4e1fdb255ee6c + pristine_git_object: ead3e5a00171b3a97af5112b6cd9ece698ce74f5 + src/mistralai/gcp/client/utils/url.py: + id: 0d311bbcb8f8 + last_write_checksum: sha1:6479961baa90432ca25626f8e40a7bbc32e73b41 + pristine_git_object: c78ccbae426ce6d385709d97ce0b1c2813ea2418 + src/mistralai/gcp/client/utils/values.py: + id: 328207e9ae81 + last_write_checksum: sha1:acaa178a7c41ddd000f58cc691e4632d925b2553 + pristine_git_object: dae01a44384ac3bc13ae07453a053bf6c898ebe3 +examples: + stream_chat: + speakeasy-default-stream-chat: + requestBody: + application/json: {"model": "mistral-large-latest", "stream": true, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} + responses: + "422": + application/json: {} + chat_completion_v1_chat_completions_post: + speakeasy-default-chat-completion-v1-chat-completions-post: + requestBody: + application/json: {"model": "mistral-large-latest", "stream": false, "messages": [{"role": "user", "content": "Who is the best French painter? Answer in one short sentence."}], "response_format": {"type": "text"}} + responses: + "200": + application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} + "422": + application/json: {} + stream_fim: + speakeasy-default-stream-fim: + requestBody: + application/json: {"model": "codestral-latest", "top_p": 1, "stream": true, "prompt": "def", "suffix": "return a+b"} + responses: + "422": + application/json: {} + fim_completion_v1_fim_completions_post: + userExample: + requestBody: + application/json: {"model": "codestral-latest", "top_p": 1, "stream": false, "prompt": "def", "suffix": "return a+b"} + responses: + "200": + application/json: {"id": "447e3e0d457e42e98248b5d2ef52a2a3", "object": "chat.completion", "model": "codestral-2508", "usage": {"prompt_tokens": 8, "completion_tokens": 91, "total_tokens": 99}, "created": 1759496862, "choices": [{"index": 0, "message": {"role": "assistant", "content": "add_numbers(a: int, b: int) -> int:\n \"\"\"\n You are given two integers `a` and `b`. Your task is to write a function that\n returns the sum of these two integers. The function should be implemented in a\n way that it can handle very large integers (up to 10^18). As a reminder, your\n code has to be in python\n \"\"\"\n", "tool_calls": null, "prefix": false}, "finish_reason": "stop"}]} +examplesVersion: 1.0.2 +generatedTests: {} +releaseNotes: "## Python SDK Changes:\n* `mistral_gcp.chat.stream()`: \n * `request.messages[].union(system).content.union(Array)[].union(thinking).thinking[].union(ToolReferenceChunk)` **Added**\n * `error.detail[]` **Changed**\n* `mistral_gcp.chat.complete()`: \n * `request.messages[].union(system).content.union(Array)[].union(thinking).thinking[].union(ToolReferenceChunk)` **Added**\n * `error.detail[]` **Changed**\n* `mistral_gcp.fim.stream()`: `error.detail[]` **Changed**\n* `mistral_gcp.fim.complete()`: `error.detail[]` **Changed**\n" +generatedFiles: + - .gitattributes + - .vscode/settings.json + - docs/models/arguments.md + - docs/models/assistantmessage.md + - docs/models/assistantmessagecontent.md + - docs/models/assistantmessagerole.md + - docs/models/chatcompletionchoice.md + - docs/models/chatcompletionchoicefinishreason.md + - docs/models/chatcompletionrequest.md + - docs/models/chatcompletionrequestmessages.md + - docs/models/chatcompletionrequeststop.md + - docs/models/chatcompletionrequesttoolchoice.md + - docs/models/chatcompletionresponse.md + - docs/models/chatcompletionstreamrequest.md + - docs/models/chatcompletionstreamrequesttoolchoice.md + - docs/models/completionchunk.md + - docs/models/completionevent.md + - docs/models/completionresponsestreamchoice.md + - docs/models/content.md + - docs/models/contentchunk.md + - docs/models/deltamessage.md + - docs/models/fimcompletionrequest.md + - docs/models/fimcompletionrequeststop.md + - docs/models/fimcompletionresponse.md + - docs/models/fimcompletionstreamrequest.md + - docs/models/fimcompletionstreamrequeststop.md + - docs/models/finishreason.md + - docs/models/function.md + - docs/models/functioncall.md + - docs/models/functionname.md + - docs/models/httpvalidationerror.md + - docs/models/imageurl.md + - docs/models/imageurlchunk.md + - docs/models/imageurlchunkimageurl.md + - docs/models/imageurlchunktype.md + - docs/models/jsonschema.md + - docs/models/loc.md + - docs/models/messages.md + - docs/models/mistralpromptmode.md + - docs/models/prediction.md + - docs/models/referencechunk.md + - docs/models/referencechunktype.md + - docs/models/responseformat.md + - docs/models/responseformats.md + - docs/models/role.md + - docs/models/security.md + - docs/models/stop.md + - docs/models/systemmessage.md + - docs/models/systemmessagecontent.md + - docs/models/systemmessagecontentchunks.md + - docs/models/textchunk.md + - docs/models/thinkchunk.md + - docs/models/thinkchunktype.md + - docs/models/thinking.md + - docs/models/tool.md + - docs/models/toolcall.md + - docs/models/toolchoice.md + - docs/models/toolchoiceenum.md + - docs/models/toolmessage.md + - docs/models/toolmessagecontent.md + - docs/models/toolmessagerole.md + - docs/models/tooltypes.md + - docs/models/type.md + - docs/models/usageinfo.md + - docs/models/usermessage.md + - docs/models/usermessagecontent.md + - docs/models/usermessagerole.md + - docs/models/utils/retryconfig.md + - docs/models/validationerror.md + - py.typed + - pylintrc + - scripts/prepare_readme.py + - scripts/publish.sh + - src/mistralai_gcp/__init__.py + - src/mistralai_gcp/_hooks/__init__.py + - src/mistralai_gcp/_hooks/sdkhooks.py + - src/mistralai_gcp/_hooks/types.py + - src/mistralai_gcp/_version.py + - src/mistralai_gcp/basesdk.py + - src/mistralai_gcp/chat.py + - src/mistralai_gcp/fim.py + - src/mistralai_gcp/httpclient.py + - src/mistralai_gcp/models/__init__.py + - src/mistralai_gcp/models/assistantmessage.py + - src/mistralai_gcp/models/chatcompletionchoice.py + - src/mistralai_gcp/models/chatcompletionrequest.py + - src/mistralai_gcp/models/chatcompletionresponse.py + - src/mistralai_gcp/models/chatcompletionstreamrequest.py + - src/mistralai_gcp/models/completionchunk.py + - src/mistralai_gcp/models/completionevent.py + - src/mistralai_gcp/models/completionresponsestreamchoice.py + - src/mistralai_gcp/models/contentchunk.py + - src/mistralai_gcp/models/deltamessage.py + - src/mistralai_gcp/models/fimcompletionrequest.py + - src/mistralai_gcp/models/fimcompletionresponse.py + - src/mistralai_gcp/models/fimcompletionstreamrequest.py + - src/mistralai_gcp/models/function.py + - src/mistralai_gcp/models/functioncall.py + - src/mistralai_gcp/models/functionname.py + - src/mistralai_gcp/models/httpvalidationerror.py + - src/mistralai_gcp/models/imageurl.py + - src/mistralai_gcp/models/imageurlchunk.py + - src/mistralai_gcp/models/jsonschema.py + - src/mistralai_gcp/models/mistralgcperror.py + - src/mistralai_gcp/models/mistralpromptmode.py + - src/mistralai_gcp/models/no_response_error.py + - src/mistralai_gcp/models/prediction.py + - src/mistralai_gcp/models/referencechunk.py + - src/mistralai_gcp/models/responseformat.py + - src/mistralai_gcp/models/responseformats.py + - src/mistralai_gcp/models/responsevalidationerror.py + - src/mistralai_gcp/models/sdkerror.py + - src/mistralai_gcp/models/security.py + - src/mistralai_gcp/models/systemmessage.py + - src/mistralai_gcp/models/systemmessagecontentchunks.py + - src/mistralai_gcp/models/textchunk.py + - src/mistralai_gcp/models/thinkchunk.py + - src/mistralai_gcp/models/tool.py + - src/mistralai_gcp/models/toolcall.py + - src/mistralai_gcp/models/toolchoice.py + - src/mistralai_gcp/models/toolchoiceenum.py + - src/mistralai_gcp/models/toolmessage.py + - src/mistralai_gcp/models/tooltypes.py + - src/mistralai_gcp/models/usageinfo.py + - src/mistralai_gcp/models/usermessage.py + - src/mistralai_gcp/models/validationerror.py + - src/mistralai_gcp/py.typed + - src/mistralai_gcp/sdkconfiguration.py + - src/mistralai_gcp/types/__init__.py + - src/mistralai_gcp/types/basemodel.py + - src/mistralai_gcp/utils/__init__.py + - src/mistralai_gcp/utils/annotations.py + - src/mistralai_gcp/utils/datetimes.py + - src/mistralai_gcp/utils/enums.py + - src/mistralai_gcp/utils/eventstreaming.py + - src/mistralai_gcp/utils/forms.py + - src/mistralai_gcp/utils/headers.py + - src/mistralai_gcp/utils/logger.py + - src/mistralai_gcp/utils/metadata.py + - src/mistralai_gcp/utils/queryparams.py + - src/mistralai_gcp/utils/requestbodies.py + - src/mistralai_gcp/utils/retries.py + - src/mistralai_gcp/utils/security.py + - src/mistralai_gcp/utils/serializers.py + - src/mistralai_gcp/utils/unmarshal_json_response.py + - src/mistralai_gcp/utils/url.py + - src/mistralai_gcp/utils/values.py diff --git a/packages/gcp/.speakeasy/gen.yaml b/packages/gcp/.speakeasy/gen.yaml new file mode 100644 index 00000000..27793130 --- /dev/null +++ b/packages/gcp/.speakeasy/gen.yaml @@ -0,0 +1,88 @@ +configVersion: 2.0.0 +generation: + sdkClassName: MistralGCP + maintainOpenAPIOrder: true + usageSnippets: + optionalPropertyRendering: withExample + sdkInitStyle: constructor + useClassNamesForArrayFields: true + fixes: + nameResolutionDec2023: true + nameResolutionFeb2025: true + parameterOrderingFeb2024: true + requestResponseComponentNamesFeb2024: true + securityFeb2025: true + sharedErrorComponentsApr2025: true + sharedNestedComponentsJan2026: true + nameOverrideFeb2026: true + methodSignaturesApr2024: true + auth: + oAuth2ClientCredentialsEnabled: true + oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + schemas: + allOfMergeStrategy: shallowMerge + requestBodyFieldName: "" + versioningStrategy: automatic + persistentEdits: {} + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false +python: + version: 2.0.0 + additionalDependencies: + dev: + pytest: ^8.2.2 + pytest-asyncio: ^0.23.7 + main: {} + allowedRedefinedBuiltins: + - id + - object + - input + - dir + asyncMode: both + authors: + - Mistral + baseErrorName: MistralGCPError + clientServerStatusCodesAsErrors: true + constFieldCasing: normal + defaultErrorName: SDKError + description: Python Client SDK for the Mistral AI API in GCP. + enableCustomCodeRegions: false + enumFormat: union + fixFlags: + asyncPaginationSep2025: true + conflictResistantModelImportsFeb2026: true + responseRequiredSep2024: true + flatAdditionalProperties: true + flattenGlobalSecurity: true + flattenRequests: true + flatteningOrder: parameters-first + forwardCompatibleEnumsByDefault: true + forwardCompatibleUnionsByDefault: tagged-only + imports: + option: openapi + paths: + callbacks: "" + errors: errors + operations: "" + shared: "" + webhooks: "" + inferUnionDiscriminators: true + inputModelSuffix: input + license: "" + maxMethodParams: 999 + methodArguments: infer-optional-args + moduleName: mistralai.gcp.client + multipartArrayFormat: standard + outputModelSuffix: output + packageManager: uv + packageName: mistralai-gcp + preApplyUnionDiscriminators: true + pytestFilterWarnings: [] + pytestTimeout: 0 + responseFormat: flat + sseFlatResponse: false + templateVersion: v2 + useAsyncHooks: false diff --git a/packages/mistralai_gcp/CONTRIBUTING.md b/packages/gcp/CONTRIBUTING.md similarity index 100% rename from packages/mistralai_gcp/CONTRIBUTING.md rename to packages/gcp/CONTRIBUTING.md diff --git a/packages/gcp/README.md b/packages/gcp/README.md new file mode 100644 index 00000000..8a26cf2c --- /dev/null +++ b/packages/gcp/README.md @@ -0,0 +1,428 @@ +# Mistral on GCP Python Client + + +**Prerequisites** + +Before you begin, you will need to create a Google Cloud project and enable the Mistral API. To do this, follow the instructions [here](https://docs.mistral.ai/deployment/cloud/vertex/). + +To run this locally you will also need to ensure you are authenticated with Google Cloud. You can do this by running + +```bash +gcloud auth application-default login +``` + +## SDK Installation + +Install the extras dependencies specific to Google Cloud: + +```bash +pip install mistralai[gcp] +``` + + +## SDK Example Usage + +### Create Chat Completions + +This example shows how to create chat completions. + +The SDK automatically: +- Detects credentials via `google.auth.default()` +- Auto-refreshes tokens when they expire +- Builds the Vertex AI URL from `project_id` and `region` + +```python +# Synchronous Example +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected from credentials + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.chat.complete(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, +], model="mistral-small-2503") + +if res is not None: + # handle response + print(res.choices[0].message.content) +``` + +
+ +The same SDK client can also be used to make asynchronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +import os +from mistralai.gcp.client import MistralGCP + +async def main(): + # The SDK auto-detects credentials and builds the Vertex AI URL + s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected + region=os.environ.get("GCP_REGION", "us-central1"), + ) + res = await s.chat.complete_async(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], model="mistral-small-2503") + if res is not None: + # handle response + print(res.choices[0].message.content) + +asyncio.run(main()) +``` + + + +## Available Resources and Operations + +### [chat](docs/sdks/chat/README.md) + +* [stream](docs/sdks/chat/README.md#stream) - Stream chat completion +* [complete](docs/sdks/chat/README.md#complete) - Chat Completion + +### [fim](docs/sdks/fim/README.md) + +* [stream](docs/sdks/fim/README.md#stream) - Stream fim completion +* [complete](docs/sdks/fim/README.md#complete) - Fim Completion + + + +## Server-sent event streaming + +[Server-sent events][mdn-sse] are used to stream content from certain +operations. These operations will expose the stream as [Generator][generator] that +can be consumed using a simple `for` loop. The loop will +terminate when the server no longer has any events to send and closes the +underlying connection. + +```python +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.chat.stream(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, +], model="mistral-small-2503") + +if res is not None: + for event in res: + # handle event + print(event) + +``` + +[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events +[generator]: https://wiki.python.org/moin/Generators + + + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: +```python +import os +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.utils import BackoffStrategy, RetryConfig + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model="mistral-small-2503", + retries=RetryConfig( + "backoff", + BackoffStrategy(1, 50, 1.1, 100), + False + ) +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: +```python +import os +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.utils import BackoffStrategy, RetryConfig + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), + region=os.environ.get("GCP_REGION", "us-central1"), + retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model="mistral-small-2503", +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + + + +## Error Handling + +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. + +| Error Object | Status Code | Content Type | +| -------------------------- | ----------- | ---------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4xx-5xx | */* | + +### Example + +```python +import os +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client import models + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = None +try: + res = s.chat.complete( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model="mistral-small-2503", + ) + +except models.HTTPValidationError as e: + # handle exception + raise(e) +except models.SDKError as e: + # handle exception + raise(e) + +if res is not None: + # handle response + pass + +``` + + + +## Server Selection + +### Override Server URL Per-Client + +The SDK automatically constructs the Vertex AI endpoint from `project_id` and `region`: +```python +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model="mistral-small-2503", +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + + + +## Custom HTTP Client + +The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. +Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocols ensuring that the client has the necessary methods to make API calls. +This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. + +For example, you could specify a header for every request that this SDK makes as follows: +```python +import os +from mistralai.gcp.client import MistralGCP +import httpx + +http_client = httpx.Client(headers={"x-custom-header": "someValue"}) +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), + region="us-central1", + client=http_client, +) +``` + +or you could wrap the client with your own custom logic: +```python +from typing import Any, Optional, Union +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.httpclient import AsyncHttpClient +import httpx + +class CustomClient(AsyncHttpClient): + client: AsyncHttpClient + + def __init__(self, client: AsyncHttpClient): + self.client = client + + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + request.headers["Client-Level-Header"] = "added by client" + + return await self.client.send( + request, stream=stream, auth=auth, follow_redirects=follow_redirects + ) + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + return self.client.build_request( + method, + url, + content=content, + data=data, + files=files, + json=json, + params=params, + headers=headers, + cookies=cookies, + timeout=timeout, + extensions=extensions, + ) + +s = MistralGCP( + project_id="", + region="us-central1", + async_client=CustomClient(httpx.AsyncClient()), +) +``` + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| --------- | ---- | ----------- | +| `api_key` | http | HTTP Bearer | + +The SDK automatically handles GCP authentication via `google.auth.default()`. Tokens are auto-refreshed when they expire. For example: +```python +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.chat.stream( + messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], + model="mistral-small-2503", +) + +if res is not None: + for event in res: + # handle event + print(event) + +``` + + + + +# Development + +## Contributions + +While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. +We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. diff --git a/packages/gcp/RELEASES.md b/packages/gcp/RELEASES.md new file mode 100644 index 00000000..30d3e580 --- /dev/null +++ b/packages/gcp/RELEASES.md @@ -0,0 +1,41 @@ + + +## 2026-01-12 16:00:24 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.606.10 (2.687.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.7.0] packages/mistralai_gcp +### Releases +- [PyPI v1.7.0] https://pypi.org/project/mistralai-gcp/1.7.0 - packages/mistralai_gcp + +## 2026-02-25 17:36:50 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0b1] packages/gcp +### Releases +- [PyPI v2.0.0b1] https://pypi.org/project/mistralai-gcp/2.0.0b1 - packages/gcp + +## 2026-03-02 12:45:41 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0rc1] packages/gcp +### Releases +- [PyPI v2.0.0rc1] https://pypi.org/project/mistralai-gcp/2.0.0rc1 - packages/gcp + +## 2026-03-09 19:30:40 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.729.0 (2.841.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v2.0.0] packages/gcp +### Releases +- [PyPI v2.0.0] https://pypi.org/project/mistralai-gcp/2.0.0 - packages/gcp \ No newline at end of file diff --git a/packages/gcp/USAGE.md b/packages/gcp/USAGE.md new file mode 100644 index 00000000..6ca6bdcd --- /dev/null +++ b/packages/gcp/USAGE.md @@ -0,0 +1,61 @@ + +### Create Chat Completions + +This example shows how to create chat completions. + +The SDK automatically: +- Detects credentials via `google.auth.default()` +- Auto-refreshes tokens when they expire +- Builds the Vertex AI URL from `project_id` and `region` + +```python +# Synchronous Example +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected from credentials + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.chat.complete(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, +], model="mistral-small-2503") + +if res is not None: + # handle response + print(res.choices[0].message.content) +``` + +
+ +The same SDK client can also be used to make asynchronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +import os +from mistralai.gcp.client import MistralGCP + +async def main(): + # The SDK auto-detects credentials and builds the Vertex AI URL + s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected + region=os.environ.get("GCP_REGION", "us-central1"), + ) + res = await s.chat.complete_async(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, + ], model="mistral-small-2503") + if res is not None: + # handle response + print(res.choices[0].message.content) + +asyncio.run(main()) +``` + diff --git a/packages/mistralai_gcp/docs/models/httpvalidationerror.md b/packages/gcp/docs/errors/httpvalidationerror.md similarity index 100% rename from packages/mistralai_gcp/docs/models/httpvalidationerror.md rename to packages/gcp/docs/errors/httpvalidationerror.md diff --git a/packages/mistralai_gcp/docs/models/arguments.md b/packages/gcp/docs/models/arguments.md similarity index 100% rename from packages/mistralai_gcp/docs/models/arguments.md rename to packages/gcp/docs/models/arguments.md diff --git a/packages/gcp/docs/models/assistantmessage.md b/packages/gcp/docs/models/assistantmessage.md new file mode 100644 index 00000000..9ef63837 --- /dev/null +++ b/packages/gcp/docs/models/assistantmessage.md @@ -0,0 +1,11 @@ +# AssistantMessage + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `role` | *Optional[Literal["assistant"]]* | :heavy_minus_sign: | N/A | +| `content` | [OptionalNullable[models.AssistantMessageContent]](../models/assistantmessagecontent.md) | :heavy_minus_sign: | N/A | +| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | +| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/assistantmessagecontent.md b/packages/gcp/docs/models/assistantmessagecontent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/assistantmessagecontent.md rename to packages/gcp/docs/models/assistantmessagecontent.md diff --git a/packages/gcp/docs/models/builtinconnectors.md b/packages/gcp/docs/models/builtinconnectors.md new file mode 100644 index 00000000..f96f5044 --- /dev/null +++ b/packages/gcp/docs/models/builtinconnectors.md @@ -0,0 +1,12 @@ +# BuiltInConnectors + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `WEB_SEARCH` | web_search | +| `WEB_SEARCH_PREMIUM` | web_search_premium | +| `CODE_INTERPRETER` | code_interpreter | +| `IMAGE_GENERATION` | image_generation | +| `DOCUMENT_LIBRARY` | document_library | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/chatcompletionchoice.md b/packages/gcp/docs/models/chatcompletionchoice.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionchoice.md rename to packages/gcp/docs/models/chatcompletionchoice.md diff --git a/packages/mistralai_gcp/docs/models/chatcompletionchoicefinishreason.md b/packages/gcp/docs/models/chatcompletionchoicefinishreason.md similarity index 100% rename from packages/mistralai_gcp/docs/models/chatcompletionchoicefinishreason.md rename to packages/gcp/docs/models/chatcompletionchoicefinishreason.md diff --git a/packages/gcp/docs/models/chatcompletionrequest.md b/packages/gcp/docs/models/chatcompletionrequest.md new file mode 100644 index 00000000..78cce437 --- /dev/null +++ b/packages/gcp/docs/models/chatcompletionrequest.md @@ -0,0 +1,25 @@ +# ChatCompletionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](https://docs.mistral.ai/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](https://docs.mistral.ai/models) for model descriptions. | mistral-large-latest | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [Optional[models.ChatCompletionRequestStop]](../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.ChatCompletionRequestMessage](../models/chatcompletionrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | +| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | \ No newline at end of file diff --git a/packages/gcp/docs/models/chatcompletionrequestmessage.md b/packages/gcp/docs/models/chatcompletionrequestmessage.md new file mode 100644 index 00000000..91e9e062 --- /dev/null +++ b/packages/gcp/docs/models/chatcompletionrequestmessage.md @@ -0,0 +1,29 @@ +# ChatCompletionRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/packages/gcp/docs/models/chatcompletionrequeststop.md b/packages/gcp/docs/models/chatcompletionrequeststop.md new file mode 100644 index 00000000..749296d4 --- /dev/null +++ b/packages/gcp/docs/models/chatcompletionrequeststop.md @@ -0,0 +1,19 @@ +# ChatCompletionRequestStop + +Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/packages/gcp/docs/models/chatcompletionrequesttoolchoice.md b/packages/gcp/docs/models/chatcompletionrequesttoolchoice.md new file mode 100644 index 00000000..dc82a8ef --- /dev/null +++ b/packages/gcp/docs/models/chatcompletionrequesttoolchoice.md @@ -0,0 +1,19 @@ +# ChatCompletionRequestToolChoice + +Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + + +## Supported Types + +### `models.ToolChoice` + +```python +value: models.ToolChoice = /* values here */ +``` + +### `models.ToolChoiceEnum` + +```python +value: models.ToolChoiceEnum = /* values here */ +``` + diff --git a/packages/mistralai_gcp/docs/models/chatcompletionresponse.md b/packages/gcp/docs/models/chatcompletionresponse.md similarity index 93% rename from packages/mistralai_gcp/docs/models/chatcompletionresponse.md rename to packages/gcp/docs/models/chatcompletionresponse.md index ad376158..a0465ffb 100644 --- a/packages/mistralai_gcp/docs/models/chatcompletionresponse.md +++ b/packages/gcp/docs/models/chatcompletionresponse.md @@ -9,5 +9,5 @@ | `object` | *str* | :heavy_check_mark: | N/A | chat.completion | | `model` | *str* | :heavy_check_mark: | N/A | mistral-small-latest | | `usage` | [models.UsageInfo](../models/usageinfo.md) | :heavy_check_mark: | N/A | | -| `created` | *Optional[int]* | :heavy_minus_sign: | N/A | 1702256327 | -| `choices` | List[[models.ChatCompletionChoice](../models/chatcompletionchoice.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `created` | *int* | :heavy_check_mark: | N/A | 1702256327 | +| `choices` | List[[models.ChatCompletionChoice](../models/chatcompletionchoice.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/packages/gcp/docs/models/chatcompletionstreamrequest.md b/packages/gcp/docs/models/chatcompletionstreamrequest.md new file mode 100644 index 00000000..a26a85d7 --- /dev/null +++ b/packages/gcp/docs/models/chatcompletionstreamrequest.md @@ -0,0 +1,25 @@ +# ChatCompletionStreamRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](https://docs.mistral.ai/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](https://docs.mistral.ai/models) for model descriptions. | mistral-large-latest | +| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [Optional[models.ChatCompletionStreamRequestStop]](../models/chatcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `messages` | List[[models.ChatCompletionStreamRequestMessage](../models/chatcompletionstreamrequestmessage.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | +| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. | **Example 1:** {
"type": "text"
}
**Example 2:** {
"type": "json_object"
}
**Example 3:** {
"type": "json_schema",
"json_schema": {
"schema": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"authors": {
"items": {
"type": "string"
},
"title": "Authors",
"type": "array"
}
},
"required": [
"name",
"authors"
],
"title": "Book",
"type": "object",
"additionalProperties": false
},
"name": "book",
"strict": true
}
} | +| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. | | +| `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. | | +| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | +| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | +| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | +| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. | | +| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. | | +| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | \ No newline at end of file diff --git a/packages/gcp/docs/models/chatcompletionstreamrequestmessage.md b/packages/gcp/docs/models/chatcompletionstreamrequestmessage.md new file mode 100644 index 00000000..2e4e93ac --- /dev/null +++ b/packages/gcp/docs/models/chatcompletionstreamrequestmessage.md @@ -0,0 +1,29 @@ +# ChatCompletionStreamRequestMessage + + +## Supported Types + +### `models.AssistantMessage` + +```python +value: models.AssistantMessage = /* values here */ +``` + +### `models.SystemMessage` + +```python +value: models.SystemMessage = /* values here */ +``` + +### `models.ToolMessage` + +```python +value: models.ToolMessage = /* values here */ +``` + +### `models.UserMessage` + +```python +value: models.UserMessage = /* values here */ +``` + diff --git a/packages/gcp/docs/models/chatcompletionstreamrequeststop.md b/packages/gcp/docs/models/chatcompletionstreamrequeststop.md new file mode 100644 index 00000000..a48460a9 --- /dev/null +++ b/packages/gcp/docs/models/chatcompletionstreamrequeststop.md @@ -0,0 +1,19 @@ +# ChatCompletionStreamRequestStop + +Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[str]` + +```python +value: List[str] = /* values here */ +``` + diff --git a/packages/gcp/docs/models/chatcompletionstreamrequesttoolchoice.md b/packages/gcp/docs/models/chatcompletionstreamrequesttoolchoice.md new file mode 100644 index 00000000..43f3ca38 --- /dev/null +++ b/packages/gcp/docs/models/chatcompletionstreamrequesttoolchoice.md @@ -0,0 +1,19 @@ +# ChatCompletionStreamRequestToolChoice + +Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + + +## Supported Types + +### `models.ToolChoice` + +```python +value: models.ToolChoice = /* values here */ +``` + +### `models.ToolChoiceEnum` + +```python +value: models.ToolChoiceEnum = /* values here */ +``` + diff --git a/packages/mistralai_gcp/docs/models/completionchunk.md b/packages/gcp/docs/models/completionchunk.md similarity index 100% rename from packages/mistralai_gcp/docs/models/completionchunk.md rename to packages/gcp/docs/models/completionchunk.md index b8ae6a09..7f8ab5e6 100644 --- a/packages/mistralai_gcp/docs/models/completionchunk.md +++ b/packages/gcp/docs/models/completionchunk.md @@ -6,8 +6,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `id` | *str* | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | N/A | -| `choices` | List[[models.CompletionResponseStreamChoice](../models/completionresponsestreamchoice.md)] | :heavy_check_mark: | N/A | | `object` | *Optional[str]* | :heavy_minus_sign: | N/A | | `created` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `usage` | [Optional[models.UsageInfo]](../models/usageinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `model` | *str* | :heavy_check_mark: | N/A | +| `usage` | [Optional[models.UsageInfo]](../models/usageinfo.md) | :heavy_minus_sign: | N/A | +| `choices` | List[[models.CompletionResponseStreamChoice](../models/completionresponsestreamchoice.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/completionevent.md b/packages/gcp/docs/models/completionevent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/completionevent.md rename to packages/gcp/docs/models/completionevent.md diff --git a/packages/gcp/docs/models/completionresponsestreamchoice.md b/packages/gcp/docs/models/completionresponsestreamchoice.md new file mode 100644 index 00000000..1532c25b --- /dev/null +++ b/packages/gcp/docs/models/completionresponsestreamchoice.md @@ -0,0 +1,10 @@ +# CompletionResponseStreamChoice + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `index` | *int* | :heavy_check_mark: | N/A | +| `delta` | [models.DeltaMessage](../models/deltamessage.md) | :heavy_check_mark: | N/A | +| `finish_reason` | [Nullable[models.CompletionResponseStreamChoiceFinishReason]](../models/completionresponsestreamchoicefinishreason.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md b/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md new file mode 100644 index 00000000..0fece473 --- /dev/null +++ b/packages/gcp/docs/models/completionresponsestreamchoicefinishreason.md @@ -0,0 +1,11 @@ +# CompletionResponseStreamChoiceFinishReason + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `STOP` | stop | +| `LENGTH` | length | +| `ERROR` | error | +| `TOOL_CALLS` | tool_calls | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/contentchunk.md b/packages/gcp/docs/models/contentchunk.md similarity index 100% rename from packages/mistralai_gcp/docs/models/contentchunk.md rename to packages/gcp/docs/models/contentchunk.md diff --git a/packages/gcp/docs/models/context.md b/packages/gcp/docs/models/context.md new file mode 100644 index 00000000..107f1bd4 --- /dev/null +++ b/packages/gcp/docs/models/context.md @@ -0,0 +1,7 @@ +# Context + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/packages/gcp/docs/models/deltamessage.md b/packages/gcp/docs/models/deltamessage.md new file mode 100644 index 00000000..e0ee575f --- /dev/null +++ b/packages/gcp/docs/models/deltamessage.md @@ -0,0 +1,10 @@ +# DeltaMessage + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `content` | [OptionalNullable[models.DeltaMessageContent]](../models/deltamessagecontent.md) | :heavy_minus_sign: | N/A | +| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/deltamessagecontent.md b/packages/gcp/docs/models/deltamessagecontent.md new file mode 100644 index 00000000..8142772d --- /dev/null +++ b/packages/gcp/docs/models/deltamessagecontent.md @@ -0,0 +1,17 @@ +# DeltaMessageContent + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[models.ContentChunk]` + +```python +value: List[models.ContentChunk] = /* values here */ +``` + diff --git a/packages/mistralai_gcp/docs/models/fimcompletionrequest.md b/packages/gcp/docs/models/fimcompletionrequest.md similarity index 91% rename from packages/mistralai_gcp/docs/models/fimcompletionrequest.md rename to packages/gcp/docs/models/fimcompletionrequest.md index 7507b90c..fde0b625 100644 --- a/packages/mistralai_gcp/docs/models/fimcompletionrequest.md +++ b/packages/gcp/docs/models/fimcompletionrequest.md @@ -5,13 +5,14 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | -| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | +| `model` | *str* | :heavy_check_mark: | ID of the model with FIM to use. | codestral-latest | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | | `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | | `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | | `stop` | [Optional[models.FIMCompletionRequestStop]](../models/fimcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | | `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/fimcompletionrequeststop.md b/packages/gcp/docs/models/fimcompletionrequeststop.md similarity index 100% rename from packages/mistralai_gcp/docs/models/fimcompletionrequeststop.md rename to packages/gcp/docs/models/fimcompletionrequeststop.md diff --git a/packages/mistralai_gcp/docs/models/fimcompletionresponse.md b/packages/gcp/docs/models/fimcompletionresponse.md similarity index 93% rename from packages/mistralai_gcp/docs/models/fimcompletionresponse.md rename to packages/gcp/docs/models/fimcompletionresponse.md index da786a1f..cd62d034 100644 --- a/packages/mistralai_gcp/docs/models/fimcompletionresponse.md +++ b/packages/gcp/docs/models/fimcompletionresponse.md @@ -9,5 +9,5 @@ | `object` | *str* | :heavy_check_mark: | N/A | chat.completion | | `model` | *str* | :heavy_check_mark: | N/A | codestral-latest | | `usage` | [models.UsageInfo](../models/usageinfo.md) | :heavy_check_mark: | N/A | | -| `created` | *Optional[int]* | :heavy_minus_sign: | N/A | 1702256327 | -| `choices` | List[[models.ChatCompletionChoice](../models/chatcompletionchoice.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `created` | *int* | :heavy_check_mark: | N/A | 1702256327 | +| `choices` | List[[models.ChatCompletionChoice](../models/chatcompletionchoice.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/fimcompletionstreamrequest.md b/packages/gcp/docs/models/fimcompletionstreamrequest.md similarity index 91% rename from packages/mistralai_gcp/docs/models/fimcompletionstreamrequest.md rename to packages/gcp/docs/models/fimcompletionstreamrequest.md index 6cc439c7..ba62d854 100644 --- a/packages/mistralai_gcp/docs/models/fimcompletionstreamrequest.md +++ b/packages/gcp/docs/models/fimcompletionstreamrequest.md @@ -5,13 +5,14 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | -| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | +| `model` | *str* | :heavy_check_mark: | ID of the model with FIM to use. | codestral-latest | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | | `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | | `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | | `stop` | [Optional[models.FIMCompletionStreamRequestStop]](../models/fimcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | | `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | | +| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | | `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | | `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/fimcompletionstreamrequeststop.md b/packages/gcp/docs/models/fimcompletionstreamrequeststop.md similarity index 100% rename from packages/mistralai_gcp/docs/models/fimcompletionstreamrequeststop.md rename to packages/gcp/docs/models/fimcompletionstreamrequeststop.md diff --git a/packages/mistralai_gcp/docs/models/function.md b/packages/gcp/docs/models/function.md similarity index 100% rename from packages/mistralai_gcp/docs/models/function.md rename to packages/gcp/docs/models/function.md index a166b7bb..b2bdb3fe 100644 --- a/packages/mistralai_gcp/docs/models/function.md +++ b/packages/gcp/docs/models/function.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | | `name` | *str* | :heavy_check_mark: | N/A | -| `parameters` | Dict[str, *Any*] | :heavy_check_mark: | N/A | | `description` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `strict` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `strict` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `parameters` | Dict[str, *Any*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/functioncall.md b/packages/gcp/docs/models/functioncall.md similarity index 100% rename from packages/mistralai_gcp/docs/models/functioncall.md rename to packages/gcp/docs/models/functioncall.md diff --git a/packages/mistralai_gcp/docs/models/functionname.md b/packages/gcp/docs/models/functionname.md similarity index 100% rename from packages/mistralai_gcp/docs/models/functionname.md rename to packages/gcp/docs/models/functionname.md diff --git a/packages/gcp/docs/models/imagedetail.md b/packages/gcp/docs/models/imagedetail.md new file mode 100644 index 00000000..1e5ba3fd --- /dev/null +++ b/packages/gcp/docs/models/imagedetail.md @@ -0,0 +1,10 @@ +# ImageDetail + + +## Values + +| Name | Value | +| ------ | ------ | +| `LOW` | low | +| `AUTO` | auto | +| `HIGH` | high | \ No newline at end of file diff --git a/packages/gcp/docs/models/imageurl.md b/packages/gcp/docs/models/imageurl.md new file mode 100644 index 00000000..6358e0ac --- /dev/null +++ b/packages/gcp/docs/models/imageurl.md @@ -0,0 +1,9 @@ +# ImageURL + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `url` | *str* | :heavy_check_mark: | N/A | +| `detail` | [OptionalNullable[models.ImageDetail]](../models/imagedetail.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/imageurlchunk.md b/packages/gcp/docs/models/imageurlchunk.md new file mode 100644 index 00000000..a84dac32 --- /dev/null +++ b/packages/gcp/docs/models/imageurlchunk.md @@ -0,0 +1,11 @@ +# ImageURLChunk + +{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `type` | *Literal["image_url"]* | :heavy_check_mark: | N/A | +| `image_url` | [models.ImageURLUnion](../models/imageurlunion.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/imageurlunion.md b/packages/gcp/docs/models/imageurlunion.md new file mode 100644 index 00000000..db97130f --- /dev/null +++ b/packages/gcp/docs/models/imageurlunion.md @@ -0,0 +1,17 @@ +# ImageURLUnion + + +## Supported Types + +### `models.ImageURL` + +```python +value: models.ImageURL = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/packages/mistralai_gcp/docs/models/jsonschema.md b/packages/gcp/docs/models/jsonschema.md similarity index 100% rename from packages/mistralai_gcp/docs/models/jsonschema.md rename to packages/gcp/docs/models/jsonschema.md index ae387867..7ff7c070 100644 --- a/packages/mistralai_gcp/docs/models/jsonschema.md +++ b/packages/gcp/docs/models/jsonschema.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ----------------------- | ----------------------- | ----------------------- | ----------------------- | | `name` | *str* | :heavy_check_mark: | N/A | -| `schema_definition` | Dict[str, *Any*] | :heavy_check_mark: | N/A | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `schema_definition` | Dict[str, *Any*] | :heavy_check_mark: | N/A | | `strict` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/loc.md b/packages/gcp/docs/models/loc.md similarity index 100% rename from packages/mistralai_gcp/docs/models/loc.md rename to packages/gcp/docs/models/loc.md diff --git a/packages/gcp/docs/models/mistralpromptmode.md b/packages/gcp/docs/models/mistralpromptmode.md new file mode 100644 index 00000000..c3409d03 --- /dev/null +++ b/packages/gcp/docs/models/mistralpromptmode.md @@ -0,0 +1,12 @@ +# MistralPromptMode + +Available options to the prompt_mode argument on the chat completion endpoint. +Values represent high-level intent. Assignment to actual SPs is handled internally. +System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REASONING` | reasoning | \ No newline at end of file diff --git a/packages/gcp/docs/models/prediction.md b/packages/gcp/docs/models/prediction.md new file mode 100644 index 00000000..fae3c1ca --- /dev/null +++ b/packages/gcp/docs/models/prediction.md @@ -0,0 +1,11 @@ +# Prediction + +Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `type` | *Optional[Literal["content"]]* | :heavy_minus_sign: | N/A | +| `content` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/referencechunk.md b/packages/gcp/docs/models/referencechunk.md new file mode 100644 index 00000000..d847e248 --- /dev/null +++ b/packages/gcp/docs/models/referencechunk.md @@ -0,0 +1,9 @@ +# ReferenceChunk + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `type` | *Optional[Literal["reference"]]* | :heavy_minus_sign: | N/A | +| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/responseformat.md b/packages/gcp/docs/models/responseformat.md new file mode 100644 index 00000000..5cab22f2 --- /dev/null +++ b/packages/gcp/docs/models/responseformat.md @@ -0,0 +1,11 @@ +# ResponseFormat + +Specify the format that the model must output. By default it will use `{ "type": "text" }`. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ "type": "json_schema" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | [Optional[models.ResponseFormats]](../models/responseformats.md) | :heavy_minus_sign: | N/A | +| `json_schema` | [OptionalNullable[models.JSONSchema]](../models/jsonschema.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/responseformats.md b/packages/gcp/docs/models/responseformats.md new file mode 100644 index 00000000..2f5f1e55 --- /dev/null +++ b/packages/gcp/docs/models/responseformats.md @@ -0,0 +1,10 @@ +# ResponseFormats + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `TEXT` | text | +| `JSON_OBJECT` | json_object | +| `JSON_SCHEMA` | json_schema | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/security.md b/packages/gcp/docs/models/security.md similarity index 100% rename from packages/mistralai_gcp/docs/models/security.md rename to packages/gcp/docs/models/security.md diff --git a/packages/gcp/docs/models/systemmessage.md b/packages/gcp/docs/models/systemmessage.md new file mode 100644 index 00000000..10bda10f --- /dev/null +++ b/packages/gcp/docs/models/systemmessage.md @@ -0,0 +1,9 @@ +# SystemMessage + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `role` | *Literal["system"]* | :heavy_check_mark: | N/A | +| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/systemmessagecontent.md b/packages/gcp/docs/models/systemmessagecontent.md new file mode 100644 index 00000000..0c87baf3 --- /dev/null +++ b/packages/gcp/docs/models/systemmessagecontent.md @@ -0,0 +1,17 @@ +# SystemMessageContent + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[models.SystemMessageContentChunks]` + +```python +value: List[models.SystemMessageContentChunks] = /* values here */ +``` + diff --git a/packages/gcp/docs/models/systemmessagecontentchunks.md b/packages/gcp/docs/models/systemmessagecontentchunks.md new file mode 100644 index 00000000..40030c17 --- /dev/null +++ b/packages/gcp/docs/models/systemmessagecontentchunks.md @@ -0,0 +1,17 @@ +# SystemMessageContentChunks + + +## Supported Types + +### `models.TextChunk` + +```python +value: models.TextChunk = /* values here */ +``` + +### `models.ThinkChunk` + +```python +value: models.ThinkChunk = /* values here */ +``` + diff --git a/packages/gcp/docs/models/textchunk.md b/packages/gcp/docs/models/textchunk.md new file mode 100644 index 00000000..b266619d --- /dev/null +++ b/packages/gcp/docs/models/textchunk.md @@ -0,0 +1,9 @@ +# TextChunk + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *Literal["text"]* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/thinkchunk.md b/packages/gcp/docs/models/thinkchunk.md new file mode 100644 index 00000000..b07f598e --- /dev/null +++ b/packages/gcp/docs/models/thinkchunk.md @@ -0,0 +1,10 @@ +# ThinkChunk + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `type` | *Literal["thinking"]* | :heavy_check_mark: | N/A | +| `thinking` | List[[models.Thinking](../models/thinking.md)] | :heavy_check_mark: | N/A | +| `closed` | *Optional[bool]* | :heavy_minus_sign: | Whether the thinking chunk is closed or not. Currently only used for prefixing. | \ No newline at end of file diff --git a/packages/gcp/docs/models/thinking.md b/packages/gcp/docs/models/thinking.md new file mode 100644 index 00000000..d9e51d7d --- /dev/null +++ b/packages/gcp/docs/models/thinking.md @@ -0,0 +1,23 @@ +# Thinking + + +## Supported Types + +### `models.TextChunk` + +```python +value: models.TextChunk = /* values here */ +``` + +### `models.ToolReferenceChunk` + +```python +value: models.ToolReferenceChunk = /* values here */ +``` + +### `models.ReferenceChunk` + +```python +value: models.ReferenceChunk = /* values here */ +``` + diff --git a/packages/mistralai_gcp/docs/models/tool.md b/packages/gcp/docs/models/tool.md similarity index 100% rename from packages/mistralai_gcp/docs/models/tool.md rename to packages/gcp/docs/models/tool.md index 822f86f8..fb661f72 100644 --- a/packages/mistralai_gcp/docs/models/tool.md +++ b/packages/gcp/docs/models/tool.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | +| `function` | [models.Function](../models/function.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/toolcall.md b/packages/gcp/docs/models/toolcall.md similarity index 100% rename from packages/mistralai_gcp/docs/models/toolcall.md rename to packages/gcp/docs/models/toolcall.md index 574be1ea..3819236b 100644 --- a/packages/mistralai_gcp/docs/models/toolcall.md +++ b/packages/gcp/docs/models/toolcall.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `function` | [models.FunctionCall](../models/functioncall.md) | :heavy_check_mark: | N/A | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | +| `function` | [models.FunctionCall](../models/functioncall.md) | :heavy_check_mark: | N/A | | `index` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/toolchoice.md b/packages/gcp/docs/models/toolchoice.md similarity index 90% rename from packages/mistralai_gcp/docs/models/toolchoice.md rename to packages/gcp/docs/models/toolchoice.md index 792ebcd6..373046bb 100644 --- a/packages/mistralai_gcp/docs/models/toolchoice.md +++ b/packages/gcp/docs/models/toolchoice.md @@ -7,5 +7,5 @@ ToolChoice is either a ToolChoiceEnum or a ToolChoice | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `function` | [models.FunctionName](../models/functionname.md) | :heavy_check_mark: | this restriction of `Function` is used to select a specific function to call | -| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `type` | [Optional[models.ToolTypes]](../models/tooltypes.md) | :heavy_minus_sign: | N/A | +| `function` | [models.FunctionName](../models/functionname.md) | :heavy_check_mark: | this restriction of `Function` is used to select a specific function to call | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/toolchoiceenum.md b/packages/gcp/docs/models/toolchoiceenum.md similarity index 100% rename from packages/mistralai_gcp/docs/models/toolchoiceenum.md rename to packages/gcp/docs/models/toolchoiceenum.md diff --git a/packages/gcp/docs/models/toolmessage.md b/packages/gcp/docs/models/toolmessage.md new file mode 100644 index 00000000..7201481e --- /dev/null +++ b/packages/gcp/docs/models/toolmessage.md @@ -0,0 +1,11 @@ +# ToolMessage + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `role` | *Literal["tool"]* | :heavy_check_mark: | N/A | +| `content` | [Nullable[models.ToolMessageContent]](../models/toolmessagecontent.md) | :heavy_check_mark: | N/A | +| `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/toolmessagecontent.md b/packages/gcp/docs/models/toolmessagecontent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/toolmessagecontent.md rename to packages/gcp/docs/models/toolmessagecontent.md diff --git a/packages/gcp/docs/models/toolreferencechunk.md b/packages/gcp/docs/models/toolreferencechunk.md new file mode 100644 index 00000000..9fc10399 --- /dev/null +++ b/packages/gcp/docs/models/toolreferencechunk.md @@ -0,0 +1,13 @@ +# ToolReferenceChunk + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `type` | *Optional[Literal["tool_reference"]]* | :heavy_minus_sign: | N/A | +| `tool` | [models.ToolUnion](../models/toolunion.md) | :heavy_check_mark: | N/A | +| `title` | *str* | :heavy_check_mark: | N/A | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `favicon` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/tooltypes.md b/packages/gcp/docs/models/tooltypes.md similarity index 100% rename from packages/mistralai_azure/docs/models/tooltypes.md rename to packages/gcp/docs/models/tooltypes.md diff --git a/packages/gcp/docs/models/toolunion.md b/packages/gcp/docs/models/toolunion.md new file mode 100644 index 00000000..2dcb3dee --- /dev/null +++ b/packages/gcp/docs/models/toolunion.md @@ -0,0 +1,17 @@ +# ToolUnion + + +## Supported Types + +### `models.BuiltInConnectors` + +```python +value: models.BuiltInConnectors = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/packages/gcp/docs/models/usageinfo.md b/packages/gcp/docs/models/usageinfo.md new file mode 100644 index 00000000..f5204ac9 --- /dev/null +++ b/packages/gcp/docs/models/usageinfo.md @@ -0,0 +1,12 @@ +# UsageInfo + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `prompt_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `completion_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `total_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `prompt_audio_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/models/usermessage.md b/packages/gcp/docs/models/usermessage.md new file mode 100644 index 00000000..e7a932ed --- /dev/null +++ b/packages/gcp/docs/models/usermessage.md @@ -0,0 +1,9 @@ +# UserMessage + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `role` | *Literal["user"]* | :heavy_check_mark: | N/A | +| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/usermessagecontent.md b/packages/gcp/docs/models/usermessagecontent.md similarity index 100% rename from packages/mistralai_gcp/docs/models/usermessagecontent.md rename to packages/gcp/docs/models/usermessagecontent.md diff --git a/packages/mistralai_gcp/docs/models/utils/retryconfig.md b/packages/gcp/docs/models/utils/retryconfig.md similarity index 100% rename from packages/mistralai_gcp/docs/models/utils/retryconfig.md rename to packages/gcp/docs/models/utils/retryconfig.md diff --git a/packages/gcp/docs/models/validationerror.md b/packages/gcp/docs/models/validationerror.md new file mode 100644 index 00000000..5bcea5b5 --- /dev/null +++ b/packages/gcp/docs/models/validationerror.md @@ -0,0 +1,12 @@ +# ValidationError + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `loc` | List[[models.Loc](../models/loc.md)] | :heavy_check_mark: | N/A | +| `msg` | *str* | :heavy_check_mark: | N/A | +| `type` | *str* | :heavy_check_mark: | N/A | +| `input` | *Optional[Any]* | :heavy_minus_sign: | N/A | +| `ctx` | [Optional[models.Context]](../models/context.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/gcp/docs/sdks/chat/README.md b/packages/gcp/docs/sdks/chat/README.md new file mode 100644 index 00000000..ca80b3fd --- /dev/null +++ b/packages/gcp/docs/sdks/chat/README.md @@ -0,0 +1,127 @@ +# Chat +(*chat*) + +## Overview + +Chat Completion API. + +### Available Operations + +* [stream](#stream) - Stream chat completion +* [complete](#complete) - Chat Completion + +## stream + +Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + +### Example Usage + +```python +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected from credentials + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.chat.stream(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, +], model="mistral-small-2503") + +if res is not None: + for event in res: + # handle event + print(event) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------- | ----------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `messages` | List[models.Messages] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | {
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
} | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the model to use. You can use the [List Available Models](https://docs.mistral.ai/api#operation/listModels) API to see all of your available models, or see our [Model overview](https://docs.mistral.ai/models) for model descriptions. | mistral-small-latest | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [Optional[models.Stop]](../../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | +| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | +| `tool_choice` | [Optional[models.ToolChoice]](../../models/toolchoice.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + + +### Response + +**Union[Generator[models.CompletionEvent, None, None], AsyncGenerator[models.CompletionEvent, None]]** +### Errors + +| Error Object | Status Code | Content Type | +| --------------- | ----------- | ------------ | +| models.SDKError | 4xx-5xx | */* | + +## complete + +Chat Completion + +### Example Usage + +```python +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected from credentials + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.chat.complete(messages=[ + { + "role": "user", + "content": "Who is the best French painter? Answer in one short sentence.", + }, +], model="mistral-small-2503") + +if res is not None: + # handle response + print(res.choices[0].message.content) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------- | --------------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `messages` | List[models.ChatCompletionRequestMessages] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | {
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
} | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the model to use. You can use the [List Available Models](https://docs.mistral.ai/api#operation/listModels) API to see all of your available models, or see our [Model overview](https://docs.mistral.ai/models) for model descriptions. | mistral-small-latest | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [Optional[models.ChatCompletionRequestStop]](../../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | +| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | +| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + + +### Response + +**[models.ChatCompletionResponse](../../models/chatcompletionresponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | ----------- | ---------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/packages/gcp/docs/sdks/fim/README.md b/packages/gcp/docs/sdks/fim/README.md new file mode 100644 index 00000000..013f28dd --- /dev/null +++ b/packages/gcp/docs/sdks/fim/README.md @@ -0,0 +1,113 @@ +# Fim +(*fim*) + +## Overview + +Fill-in-the-middle API. + +### Available Operations + +* [stream](#stream) - Stream fim completion +* [complete](#complete) - Fim Completion + +## stream + +Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + +### Example Usage + +```python +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected from credentials + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.fim.stream(prompt="def", model="codestral-2", suffix="return a+b") + +if res is not None: + for event in res: + # handle event + print(event) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------- | ------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | +| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | +| `stop` | [Optional[models.FIMCompletionStreamRequestStop]](../../models/fimcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + + +### Response + +**Union[Generator[models.CompletionEvent, None, None], AsyncGenerator[models.CompletionEvent, None]]** +### Errors + +| Error Object | Status Code | Content Type | +| --------------- | ----------- | ------------ | +| models.SDKError | 4xx-5xx | */* | + +## complete + +FIM completion. + +### Example Usage + +```python +import os +from mistralai.gcp.client import MistralGCP + +# The SDK auto-detects credentials and builds the Vertex AI URL +s = MistralGCP( + project_id=os.environ.get("GCP_PROJECT_ID"), # Optional: auto-detected from credentials + region=os.environ.get("GCP_REGION", "us-central1"), +) + +res = s.fim.complete(prompt="def", model="codestral-2", suffix="return a+b") + +if res is not None: + # handle response + print(res.choices[0].message.content) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------- | ------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | +| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | +| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | +| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | +| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | +| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | +| `stop` | [Optional[models.FIMCompletionRequestStop]](../../models/fimcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | +| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + + +### Response + +**[models.FIMCompletionResponse](../../models/fimcompletionresponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------- | ----------- | ---------------- | +| models.HTTPValidationError | 422 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/packages/mistralai_gcp/docs/sdks/mistralgcp/README.md b/packages/gcp/docs/sdks/mistralgcp/README.md similarity index 100% rename from packages/mistralai_gcp/docs/sdks/mistralgcp/README.md rename to packages/gcp/docs/sdks/mistralgcp/README.md diff --git a/packages/mistralai_gcp/py.typed b/packages/gcp/py.typed similarity index 100% rename from packages/mistralai_gcp/py.typed rename to packages/gcp/py.typed diff --git a/packages/gcp/pylintrc b/packages/gcp/pylintrc new file mode 100644 index 00000000..0391ac11 --- /dev/null +++ b/packages/gcp/pylintrc @@ -0,0 +1,664 @@ +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Clear in-memory caches upon conclusion of linting. Useful if running pylint +# in a server-like mode. +clear-cache-post-run=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist= + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold under which the program will exit with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS + +# Add files or directories matching the regular expressions patterns to the +# ignore-list. The regex matches against paths and can be in Posix or Windows +# format. Because '\\' represents the directory delimiter on Windows systems, +# it can't be used as an escape character. +ignore-paths= + +# Files or directories matching the regular expression patterns are skipped. +# The regex matches against base names, not paths. The default value ignores +# Emacs file locks +ignore-patterns=^\.# + +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. +ignored-modules= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs=1 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.10 + +# Discover python modules and packages in the file system subtree. +recursive=no + +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots=src + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +#argument-rgx= + +# Naming style matching correct attribute names. +#attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +attr-rgx=[^\W\d][^\W]*|__.*__$ + +# Bad variable names which should always be refused, separated by a comma. +bad-names= + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +#class-attribute-rgx= + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _, + e, + id, + n + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +typealias-rgx=.* + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +#variable-rgx= + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + asyncSetUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= + +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=12 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=25 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=builtins.BaseException,builtins.Exception + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow explicit reexports by alias from a package __init__. +allow-reexport-from-package=no + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=raw-checker-failed, + bad-inline-option, + locally-disabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + use-implicit-booleaness-not-comparison-to-string, + use-implicit-booleaness-not-comparison-to-zero, + use-symbolic-message-instead, + trailing-whitespace, + line-too-long, + missing-class-docstring, + missing-module-docstring, + missing-function-docstring, + too-many-instance-attributes, + wrong-import-order, + too-many-arguments, + broad-exception-raised, + too-few-public-methods, + too-many-branches, + duplicate-code, + trailing-newlines, + too-many-public-methods, + too-many-locals, + too-many-lines, + using-constant-test, + too-many-statements, + cyclic-import, + too-many-nested-blocks, + too-many-boolean-expressions, + no-else-raise, + bare-except, + broad-exception-caught, + fixme, + relative-beyond-top-level, + consider-using-with, + wildcard-import, + unused-wildcard-import, + too-many-return-statements, + redefined-builtin + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[METHOD_ARGS] + +# List of qualified names (i.e., library.method) which require a timeout +# parameter e.g. 'requests.api.get,requests.api.post' +timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= + +# Set the output format. Available formats are: text, parseable, colorized, +# json2 (improved json format), json (old json format) and msvs (visual +# studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes + + +[SIMILARITIES] + +# Comments are removed from the similarity computation +ignore-comments=yes + +# Docstrings are removed from the similarity computation +ignore-docstrings=yes + +# Imports are removed from the similarity computation +ignore-imports=yes + +# Signatures are removed from the similarity computation +ignore-signatures=yes + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. No available dictionaries : You need to install +# both the python package and the system dependency for enchant to work. +spelling-dict= + +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins=id,object,input,dir + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/packages/gcp/pyproject.toml b/packages/gcp/pyproject.toml new file mode 100644 index 00000000..9a8969c1 --- /dev/null +++ b/packages/gcp/pyproject.toml @@ -0,0 +1,74 @@ +[project] +name = "mistralai-gcp" +version = "2.0.0" +description = "Python Client SDK for the Mistral AI API in GCP." +authors = [{ name = "Mistral" }] +requires-python = ">=3.10" +readme = "README-PYPI.md" +dependencies = [ + "eval-type-backport >=0.2.0", + "google-auth (>=2.31.0,<3.0.0)", + "httpx >=0.28.1", + "pydantic >=2.11.2", + "python-dateutil >=2.8.2", + "requests (>=2.32.3,<3.0.0)", + "typing-inspection >=0.4.0", +] + +[dependency-groups] +dev = [ + "mypy==1.15.0", + "pylint==3.2.3", + "pyright>=1.1.401,<2", + "pytest>=8.2.2,<9", + "pytest-asyncio>=0.23.7,<0.24", + "types-python-dateutil>=2.9.0.20240316,<3", +] + +[tool.setuptools.package-data] +"*" = ["py.typed", "src/mistralai/gcp/client/py.typed"] + +[tool.hatch.build.targets.sdist] +include = ["src/mistralai"] + +[tool.hatch.build.targets.sdist.force-include] +"py.typed" = "py.typed" +"src/mistralai/gcp/client/py.typed" = "src/mistralai/gcp/client/py.typed" + +[tool.hatch.build.targets.wheel] +include = ["src/mistralai"] + +[tool.hatch.build.targets.wheel.sources] +"src" = "" + +[virtualenvs] +in-project = true + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.pytest.ini_options] +pythonpath = ["src"] + +[tool.mypy] +disable_error_code = "misc" +namespace_packages = true +explicit_package_bases = true +mypy_path = "src" + +[[tool.mypy.overrides]] +module = "typing_inspect" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "jsonpath" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "google" +ignore_missing_imports = true + +[tool.pyright] +venvPath = "." +venv = ".venv" diff --git a/packages/gcp/scripts/prepare_readme.py b/packages/gcp/scripts/prepare_readme.py new file mode 100644 index 00000000..f73464c9 --- /dev/null +++ b/packages/gcp/scripts/prepare_readme.py @@ -0,0 +1,51 @@ +import re +import shutil +import sys + +GITHUB_URL = "https://github.com/mistralai/client-python.git" +BRANCH = "main" +REPO_SUBDIR = "packages/gcp" +LINK_PATTERN = re.compile(r"(\[[^\]]+\]\()((?![a-zA-Z][a-zA-Z0-9+.-]*:|#)[^\)]+)(\))") + + +def _build_base_url(repo_url: str, branch: str, repo_subdir: str) -> str: + normalized = repo_url[:-4] if repo_url.endswith(".git") else repo_url + subdir = repo_subdir.strip("/") + if subdir: + subdir = f"{subdir}/" + return f"{normalized}/blob/{branch}/{subdir}" + + +def _normalize_relative_path(path: str) -> str: + if path.startswith("./"): + path = path[2:] + elif path.startswith("/"): + path = path[1:] + return path + + +def _rewrite_relative_links(contents: str, base_url: str) -> str: + return LINK_PATTERN.sub( + lambda m: f"{m.group(1)}{base_url}{_normalize_relative_path(m.group(2))}{m.group(3)}", + contents, + ) + + +try: + with open("README.md", "r", encoding="utf-8") as fh: + readme_contents = fh.read() + + base_url = _build_base_url(GITHUB_URL, BRANCH, REPO_SUBDIR) + readme_contents = _rewrite_relative_links(readme_contents, base_url) + + with open("README-PYPI.md", "w", encoding="utf-8") as fh: + fh.write(readme_contents) +except Exception as e: + try: + print("Failed to rewrite README.md to README-PYPI.md, copying original instead") + print(e) + shutil.copyfile("README.md", "README-PYPI.md") + except Exception as ie: + print("Failed to copy README.md to README-PYPI.md") + print(ie) + sys.exit(1) diff --git a/packages/gcp/scripts/publish.sh b/packages/gcp/scripts/publish.sh new file mode 100755 index 00000000..c35748f3 --- /dev/null +++ b/packages/gcp/scripts/publish.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +uv run python scripts/prepare_readme.py + +uv build +uv publish --token $PYPI_TOKEN diff --git a/packages/gcp/src/mistralai/gcp/client/__init__.py b/packages/gcp/src/mistralai/gcp/client/__init__.py new file mode 100644 index 00000000..833c68cd --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/__init__.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._version import ( + __title__, + __version__, + __openapi_doc_version__, + __gen_version__, + __user_agent__, +) +from .sdk import * +from .sdkconfiguration import * + + +VERSION: str = __version__ +OPENAPI_DOC_VERSION = __openapi_doc_version__ +SPEAKEASY_GENERATOR_VERSION = __gen_version__ +USER_AGENT = __user_agent__ diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/__init__.py b/packages/gcp/src/mistralai/gcp/client/_hooks/__init__.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/_hooks/__init__.py rename to packages/gcp/src/mistralai/gcp/client/_hooks/__init__.py diff --git a/packages/gcp/src/mistralai/gcp/client/_hooks/registration.py b/packages/gcp/src/mistralai/gcp/client/_hooks/registration.py new file mode 100644 index 00000000..23d3283d --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/_hooks/registration.py @@ -0,0 +1,67 @@ +import json +import logging +from .types import BeforeRequestHook, BeforeRequestContext, Hooks +import httpx + +logger = logging.getLogger(__name__) + + +# This file is only ever generated once on the first generation and then is free to be modified. +# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them +# in this file or in separate files in the hooks folder. + + +class GCPVertexAIPathHook(BeforeRequestHook): + """Build full Vertex AI URL path from project_id, region, and model. + + Extracts model from request body and builds the Vertex AI URL dynamically. + """ + + def __init__(self, project_id: str, region: str): + self.project_id = project_id + self.region = region + + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> httpx.Request: + if not request.content: + return request + + try: + body = json.loads(request.content.decode("utf-8")) + except (UnicodeDecodeError, json.JSONDecodeError): + # Non-JSON body (e.g. multipart upload) — pass through unmodified + return request + + model = body.get("model") + if not model: + logger.warning( + "GCPVertexAIPathHook: request body has no 'model' field; " + "Vertex AI path will not be constructed. " + "Operation: %s", + hook_ctx.operation_id, + ) + return request + + is_streaming = "stream" in hook_ctx.operation_id.lower() + specifier = "streamRawPredict" if is_streaming else "rawPredict" + + path = ( + f"/v1/projects/{self.project_id}/locations/{self.region}/" + f"publishers/mistralai/models/{model}:{specifier}" + ) + + return httpx.Request( + method=request.method, + url=request.url.copy_with(path=path), + headers=request.headers, + content=request.content, + ) + + +def init_hooks(_hooks: Hooks) -> None: + """Initialize hooks. Called by SDKHooks.__init__. + + Note: GCPVertexAIPathHook requires project_id and region, so it is + registered separately in MistralGCP.__init__ after those values are known. + """ diff --git a/packages/gcp/src/mistralai/gcp/client/_hooks/sdkhooks.py b/packages/gcp/src/mistralai/gcp/client/_hooks/sdkhooks.py new file mode 100644 index 00000000..2af4deed --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/_hooks/sdkhooks.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from .types import ( + SDKInitHook, + BeforeRequestContext, + BeforeRequestHook, + AfterSuccessContext, + AfterSuccessHook, + AfterErrorContext, + AfterErrorHook, + Hooks, +) +from .registration import init_hooks +from typing import List, Optional, Tuple +from mistralai.gcp.client.httpclient import HttpClient + + +class SDKHooks(Hooks): + def __init__(self) -> None: + self.sdk_init_hooks: List[SDKInitHook] = [] + self.before_request_hooks: List[BeforeRequestHook] = [] + self.after_success_hooks: List[AfterSuccessHook] = [] + self.after_error_hooks: List[AfterErrorHook] = [] + init_hooks(self) + + def register_sdk_init_hook(self, hook: SDKInitHook) -> None: + self.sdk_init_hooks.append(hook) + + def register_before_request_hook(self, hook: BeforeRequestHook) -> None: + self.before_request_hooks.append(hook) + + def register_after_success_hook(self, hook: AfterSuccessHook) -> None: + self.after_success_hooks.append(hook) + + def register_after_error_hook(self, hook: AfterErrorHook) -> None: + self.after_error_hooks.append(hook) + + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: + for hook in self.sdk_init_hooks: + base_url, client = hook.sdk_init(base_url, client) + return base_url, client + + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> httpx.Request: + for hook in self.before_request_hooks: + out = hook.before_request(hook_ctx, request) + if isinstance(out, Exception): + raise out + request = out + + return request + + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> httpx.Response: + for hook in self.after_success_hooks: + out = hook.after_success(hook_ctx, response) + if isinstance(out, Exception): + raise out + response = out + return response + + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: + for hook in self.after_error_hooks: + result = hook.after_error(hook_ctx, response, error) + if isinstance(result, Exception): + raise result + response, error = result + return response, error diff --git a/packages/gcp/src/mistralai/gcp/client/_hooks/types.py b/packages/gcp/src/mistralai/gcp/client/_hooks/types.py new file mode 100644 index 00000000..ea95bed2 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/_hooks/types.py @@ -0,0 +1,113 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from abc import ABC, abstractmethod +import httpx +from mistralai.gcp.client.httpclient import HttpClient +from mistralai.gcp.client.sdkconfiguration import SDKConfiguration +from typing import Any, Callable, List, Optional, Tuple, Union + + +class HookContext: + config: SDKConfiguration + base_url: str + operation_id: str + oauth2_scopes: Optional[List[str]] = None + security_source: Optional[Union[Any, Callable[[], Any]]] = None + + def __init__( + self, + config: SDKConfiguration, + base_url: str, + operation_id: str, + oauth2_scopes: Optional[List[str]], + security_source: Optional[Union[Any, Callable[[], Any]]], + ): + self.config = config + self.base_url = base_url + self.operation_id = operation_id + self.oauth2_scopes = oauth2_scopes + self.security_source = security_source + + +class BeforeRequestContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class AfterSuccessContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class AfterErrorContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class SDKInitHook(ABC): + @abstractmethod + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: + pass + + +class BeforeRequestHook(ABC): + @abstractmethod + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> Union[httpx.Request, Exception]: + pass + + +class AfterSuccessHook(ABC): + @abstractmethod + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> Union[httpx.Response, Exception]: + pass + + +class AfterErrorHook(ABC): + @abstractmethod + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: + pass + + +class Hooks(ABC): + @abstractmethod + def register_sdk_init_hook(self, hook: SDKInitHook): + pass + + @abstractmethod + def register_before_request_hook(self, hook: BeforeRequestHook): + pass + + @abstractmethod + def register_after_success_hook(self, hook: AfterSuccessHook): + pass + + @abstractmethod + def register_after_error_hook(self, hook: AfterErrorHook): + pass diff --git a/packages/gcp/src/mistralai/gcp/client/_version.py b/packages/gcp/src/mistralai/gcp/client/_version.py new file mode 100644 index 00000000..377c9836 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/_version.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import importlib.metadata + +__title__: str = "mistralai-gcp" +__version__: str = "2.0.0" +__openapi_doc_version__: str = "1.0.0" +__gen_version__: str = "2.841.0" +__user_agent__: str = "speakeasy-sdk/python 2.0.0 2.841.0 1.0.0 mistralai-gcp" + +try: + if __package__ is not None: + __version__ = importlib.metadata.version(__package__) +except importlib.metadata.PackageNotFoundError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/basesdk.py b/packages/gcp/src/mistralai/gcp/client/basesdk.py new file mode 100644 index 00000000..b3edcb0a --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/basesdk.py @@ -0,0 +1,384 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .sdkconfiguration import SDKConfiguration +import httpx +from mistralai.gcp.client import errors, utils +from mistralai.gcp.client._hooks import ( + AfterErrorContext, + AfterSuccessContext, + BeforeRequestContext, +) +from mistralai.gcp.client.utils import ( + RetryConfig, + SerializedRequestBody, + get_body_content, + run_sync_in_thread, +) +from typing import Callable, List, Mapping, Optional, Tuple +from urllib.parse import parse_qs, urlparse + + +class BaseSDK: + sdk_configuration: SDKConfiguration + parent_ref: Optional[object] = None + """ + Reference to the root SDK instance, if any. This will prevent it from + being garbage collected while there are active streams. + """ + + def __init__( + self, + sdk_config: SDKConfiguration, + parent_ref: Optional[object] = None, + ) -> None: + self.sdk_configuration = sdk_config + self.parent_ref = parent_ref + + def _get_url(self, base_url, url_variables): + sdk_url, sdk_variables = self.sdk_configuration.get_server_details() + + if base_url is None: + base_url = sdk_url + + if url_variables is None: + url_variables = sdk_variables + + return utils.template_url(base_url, url_variables) + + def _build_request_async( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + ) -> httpx.Request: + client = self.sdk_configuration.async_client + return self._build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + http_headers, + allow_empty_value, + ) + + def _build_request( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + ) -> httpx.Request: + client = self.sdk_configuration.client + return self._build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + http_headers, + allow_empty_value, + ) + + def _build_request_with_client( + self, + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + ) -> httpx.Request: + query_params = {} + + url = url_override + if url is None: + url = utils.generate_url( + self._get_url(base_url, url_variables), + path, + request if request_has_path_params else None, + _globals if request_has_path_params else None, + ) + + query_params = utils.get_query_params( + request if request_has_query_params else None, + _globals if request_has_query_params else None, + allow_empty_value, + ) + else: + # Pick up the query parameter from the override so they can be + # preserved when building the request later on (necessary as of + # httpx 0.28). + parsed_override = urlparse(str(url_override)) + query_params = parse_qs(parsed_override.query, keep_blank_values=True) + + headers = utils.get_headers(request, _globals) + headers["Accept"] = accept_header_value + headers[user_agent_header] = self.sdk_configuration.user_agent + + if security is not None: + if callable(security): + security = security() + + if security is not None: + security_headers, security_query_params = utils.get_security(security) + headers = {**headers, **security_headers} + query_params = {**query_params, **security_query_params} + + serialized_request_body = SerializedRequestBody() + if get_serialized_body is not None: + rb = get_serialized_body() + if request_body_required and rb is None: + raise ValueError("request body is required") + + if rb is not None: + serialized_request_body = rb + + if ( + serialized_request_body.media_type is not None + and serialized_request_body.media_type + not in ( + "multipart/form-data", + "multipart/mixed", + ) + ): + headers["content-type"] = serialized_request_body.media_type + + if http_headers is not None: + for header, value in http_headers.items(): + headers[header] = value + + timeout = timeout_ms / 1000 if timeout_ms is not None else None + + return client.build_request( + method, + url, + params=query_params, + content=serialized_request_body.content, + data=serialized_request_body.data, + files=serialized_request_body.files, + headers=headers, + timeout=timeout, + ) + + def do_request( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.client + logger = self.sdk_configuration.debug_logger + + hooks = self.sdk_configuration.__dict__["_hooks"] + + def do(): + http_res = None + try: + req = hooks.before_request(BeforeRequestContext(hook_ctx), request) + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + + if client is None: + raise ValueError("client is required") + + http_res = client.send(req, stream=stream) + except Exception as e: + _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.NoResponseError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = hooks.after_error( + AfterErrorContext(hook_ctx), http_res, None + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred", http_res) + + return http_res + + if retry_config is not None: + http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) + else: + http_res = do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) + + return http_res + + async def do_request_async( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.async_client + logger = self.sdk_configuration.debug_logger + + hooks = self.sdk_configuration.__dict__["_hooks"] + + async def do(): + http_res = None + try: + req = await run_sync_in_thread( + hooks.before_request, BeforeRequestContext(hook_ctx), request + ) + + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + + if client is None: + raise ValueError("client is required") + + http_res = await client.send(req, stream=stream) + except Exception as e: + _, e = await run_sync_in_thread( + hooks.after_error, AfterErrorContext(hook_ctx), None, e + ) + + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.NoResponseError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = await run_sync_in_thread( + hooks.after_error, AfterErrorContext(hook_ctx), http_res, None + ) + + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred", http_res) + + return http_res + + if retry_config is not None: + http_res = await utils.retry_async( + do, utils.Retries(retry_config[0], retry_config[1]) + ) + else: + http_res = await do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = await run_sync_in_thread( + hooks.after_success, AfterSuccessContext(hook_ctx), http_res + ) + + return http_res diff --git a/packages/gcp/src/mistralai/gcp/client/chat.py b/packages/gcp/src/mistralai/gcp/client/chat.py new file mode 100644 index 00000000..925d69ed --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/chat.py @@ -0,0 +1,701 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from mistralai.gcp.client import errors, models, utils +from mistralai.gcp.client._hooks import HookContext +from mistralai.gcp.client.types import OptionalNullable, UNSET +from mistralai.gcp.client.utils import eventstreaming +from mistralai.gcp.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class Chat(BaseSDK): + r"""Chat Completion API.""" + + def stream( + self, + *, + model: str, + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = None, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: Optional[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[List[models.Tool], List[models.ToolTypedDict]] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionStreamRequestToolChoice, + models.ChatCompletionStreamRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.CompletionEvent]: + r"""Stream chat completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + prompt_mode=prompt_mode, + ) + + req = self._build_request( + method="POST", + path="/streamRawPredict", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_chat", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def stream_async( + self, + *, + model: str, + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = None, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: Optional[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[List[models.Tool], List[models.ToolTypedDict]] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionStreamRequestToolChoice, + models.ChatCompletionStreamRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: + r"""Stream chat completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + prompt_mode=prompt_mode, + ) + + req = self._build_request_async( + method="POST", + path="/streamRawPredict", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_chat", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + def complete( + self, + *, + model: str, + messages: Union[ + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], + ], + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = None, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: Optional[ + Union[ + models.ChatCompletionRequestStop, + models.ChatCompletionRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[List[models.Tool], List[models.ToolTypedDict]] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionRequestToolChoice, + models.ChatCompletionRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionResponse: + r"""Chat Completion + + :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + prompt_mode=prompt_mode, + ) + + req = self._build_request( + method="POST", + path="/rawPredict", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="chat_completion_v1_chat_completions_post", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def complete_async( + self, + *, + model: str, + messages: Union[ + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], + ], + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = None, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: Optional[ + Union[ + models.ChatCompletionRequestStop, + models.ChatCompletionRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[List[models.Tool], List[models.ToolTypedDict]] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionRequestToolChoice, + models.ChatCompletionRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: Optional[float] = None, + frequency_penalty: Optional[float] = None, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionResponse: + r"""Chat Completion + + :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + prompt_mode=prompt_mode, + ) + + req = self._build_request_async( + method="POST", + path="/rawPredict", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="chat_completion_v1_chat_completions_post", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/packages/gcp/src/mistralai/gcp/client/errors/__init__.py b/packages/gcp/src/mistralai/gcp/client/errors/__init__.py new file mode 100644 index 00000000..00c8ee00 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/errors/__init__.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .mistralgcperror import MistralGCPError +from typing import Any, TYPE_CHECKING + +from mistralai.gcp.client.utils.dynamic_imports import lazy_getattr, lazy_dir + +if TYPE_CHECKING: + from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData + from .no_response_error import NoResponseError + from .responsevalidationerror import ResponseValidationError + from .sdkerror import SDKError + +__all__ = [ + "HTTPValidationError", + "HTTPValidationErrorData", + "MistralGCPError", + "NoResponseError", + "ResponseValidationError", + "SDKError", +] + +_dynamic_imports: dict[str, str] = { + "HTTPValidationError": ".httpvalidationerror", + "HTTPValidationErrorData": ".httpvalidationerror", + "NoResponseError": ".no_response_error", + "ResponseValidationError": ".responsevalidationerror", + "SDKError": ".sdkerror", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/packages/gcp/src/mistralai/gcp/client/errors/httpvalidationerror.py b/packages/gcp/src/mistralai/gcp/client/errors/httpvalidationerror.py new file mode 100644 index 00000000..59806819 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/errors/httpvalidationerror.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from mistralai.gcp.client.errors import MistralGCPError +from mistralai.gcp.client.models import validationerror as models_validationerror +from mistralai.gcp.client.types import BaseModel +from typing import List, Optional + + +class HTTPValidationErrorData(BaseModel): + detail: Optional[List[models_validationerror.ValidationError]] = None + + +@dataclass(unsafe_hash=True) +class HTTPValidationError(MistralGCPError): + data: HTTPValidationErrorData = field(hash=False) + + def __init__( + self, + data: HTTPValidationErrorData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/packages/gcp/src/mistralai/gcp/client/errors/mistralgcperror.py b/packages/gcp/src/mistralai/gcp/client/errors/mistralgcperror.py new file mode 100644 index 00000000..9de91bf2 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/errors/mistralgcperror.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional +from dataclasses import dataclass, field + + +@dataclass(unsafe_hash=True) +class MistralGCPError(Exception): + """The base class for all HTTP error responses.""" + + message: str + status_code: int + body: str + headers: httpx.Headers = field(hash=False) + raw_response: httpx.Response = field(hash=False) + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + object.__setattr__(self, "message", message) + object.__setattr__(self, "status_code", raw_response.status_code) + object.__setattr__( + self, "body", body if body is not None else raw_response.text + ) + object.__setattr__(self, "headers", raw_response.headers) + object.__setattr__(self, "raw_response", raw_response) + + def __str__(self): + return self.message diff --git a/packages/gcp/src/mistralai/gcp/client/errors/no_response_error.py b/packages/gcp/src/mistralai/gcp/client/errors/no_response_error.py new file mode 100644 index 00000000..1deab64b --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/errors/no_response_error.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from dataclasses import dataclass + + +@dataclass(unsafe_hash=True) +class NoResponseError(Exception): + """Error raised when no HTTP response is received from the server.""" + + message: str + + def __init__(self, message: str = "No response received"): + object.__setattr__(self, "message", message) + super().__init__(message) + + def __str__(self): + return self.message diff --git a/packages/gcp/src/mistralai/gcp/client/errors/responsevalidationerror.py b/packages/gcp/src/mistralai/gcp/client/errors/responsevalidationerror.py new file mode 100644 index 00000000..e8bd83c1 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/errors/responsevalidationerror.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional +from dataclasses import dataclass + +from mistralai.gcp.client.errors import MistralGCPError + + +@dataclass(unsafe_hash=True) +class ResponseValidationError(MistralGCPError): + """Error raised when there is a type mismatch between the response data and the expected Pydantic model.""" + + def __init__( + self, + message: str, + raw_response: httpx.Response, + cause: Exception, + body: Optional[str] = None, + ): + message = f"{message}: {cause}" + super().__init__(message, raw_response, body) + + @property + def cause(self): + """Normally the Pydantic ValidationError""" + return self.__cause__ diff --git a/packages/gcp/src/mistralai/gcp/client/errors/sdkerror.py b/packages/gcp/src/mistralai/gcp/client/errors/sdkerror.py new file mode 100644 index 00000000..69809246 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/errors/sdkerror.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Optional +from dataclasses import dataclass + +from mistralai.gcp.client.errors import MistralGCPError + +MAX_MESSAGE_LEN = 10_000 + + +@dataclass(unsafe_hash=True) +class SDKError(MistralGCPError): + """The fallback error class if no more specific error class is matched.""" + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + body_display = body or raw_response.text or '""' + + if message: + message += ": " + message += f"Status {raw_response.status_code}" + + headers = raw_response.headers + content_type = headers.get("content-type", '""') + if content_type != "application/json": + if " " in content_type: + content_type = f'"{content_type}"' + message += f" Content-Type {content_type}" + + if len(body_display) > MAX_MESSAGE_LEN: + truncated = body_display[:MAX_MESSAGE_LEN] + remaining = len(body_display) - MAX_MESSAGE_LEN + body_display = f"{truncated}...and {remaining} more chars" + + message += f". Body: {body_display}" + message = message.strip() + + super().__init__(message, raw_response, body) diff --git a/packages/gcp/src/mistralai/gcp/client/fim.py b/packages/gcp/src/mistralai/gcp/client/fim.py new file mode 100644 index 00000000..4202102a --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/fim.py @@ -0,0 +1,533 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from mistralai.gcp.client import errors, models, utils +from mistralai.gcp.client._hooks import HookContext +from mistralai.gcp.client.types import OptionalNullable, UNSET +from mistralai.gcp.client.utils import eventstreaming +from mistralai.gcp.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, Mapping, Optional, Union + + +class Fim(BaseSDK): + r"""Fill-in-the-middle API.""" + + def stream( + self, + *, + model: str, + prompt: str, + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = 1, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: Optional[ + Union[ + models.FIMCompletionStreamRequestStop, + models.FIMCompletionStreamRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + min_tokens: OptionalNullable[int] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.CompletionEvent]: + r"""Stream fim completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param model: ID of the model with FIM to use. + :param prompt: The text/code to complete. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. + :param min_tokens: The minimum number of tokens to generate in the completion. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FIMCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + prompt=prompt, + suffix=suffix, + min_tokens=min_tokens, + ) + + req = self._build_request( + method="POST", + path="/streamRawPredict#fim", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.FIMCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_fim", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def stream_async( + self, + *, + model: str, + prompt: str, + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = 1, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: Optional[ + Union[ + models.FIMCompletionStreamRequestStop, + models.FIMCompletionStreamRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + min_tokens: OptionalNullable[int] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: + r"""Stream fim completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param model: ID of the model with FIM to use. + :param prompt: The text/code to complete. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. + :param min_tokens: The minimum number of tokens to generate in the completion. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FIMCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + prompt=prompt, + suffix=suffix, + min_tokens=min_tokens, + ) + + req = self._build_request_async( + method="POST", + path="/streamRawPredict#fim", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.FIMCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_fim", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + def complete( + self, + *, + model: str, + prompt: str, + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = 1, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: Optional[ + Union[ + models.FIMCompletionRequestStop, + models.FIMCompletionRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + min_tokens: OptionalNullable[int] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FIMCompletionResponse: + r"""Fim Completion + + FIM completion. + + :param model: ID of the model with FIM to use. + :param prompt: The text/code to complete. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. + :param min_tokens: The minimum number of tokens to generate in the completion. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FIMCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + prompt=prompt, + suffix=suffix, + min_tokens=min_tokens, + ) + + req = self._build_request( + method="POST", + path="/rawPredict#fim", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.FIMCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="fim_completion_v1_fim_completions_post", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.FIMCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def complete_async( + self, + *, + model: str, + prompt: str, + temperature: OptionalNullable[float] = UNSET, + top_p: Optional[float] = 1, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: Optional[ + Union[ + models.FIMCompletionRequestStop, + models.FIMCompletionRequestStopTypedDict, + ] + ] = None, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + min_tokens: OptionalNullable[int] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FIMCompletionResponse: + r"""Fim Completion + + FIM completion. + + :param model: ID of the model with FIM to use. + :param prompt: The text/code to complete. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. + :param min_tokens: The minimum number of tokens to generate in the completion. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FIMCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + prompt=prompt, + suffix=suffix, + min_tokens=min_tokens, + ) + + req = self._build_request_async( + method="POST", + path="/rawPredict#fim", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.FIMCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="fim_completion_v1_fim_completions_post", + oauth2_scopes=None, + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.FIMCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/packages/gcp/src/mistralai/gcp/client/httpclient.py b/packages/gcp/src/mistralai/gcp/client/httpclient.py new file mode 100644 index 00000000..89560b56 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/httpclient.py @@ -0,0 +1,125 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +# pyright: reportReturnType = false +import asyncio +from typing_extensions import Protocol, runtime_checkable +import httpx +from typing import Any, Optional, Union + + +@runtime_checkable +class HttpClient(Protocol): + def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + def close(self) -> None: + pass + + +@runtime_checkable +class AsyncHttpClient(Protocol): + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + async def aclose(self) -> None: + pass + + +class ClientOwner(Protocol): + client: Union[HttpClient, None] + async_client: Union[AsyncHttpClient, None] + + +def close_clients( + owner: ClientOwner, + sync_client: Union[HttpClient, None], + sync_client_supplied: bool, + async_client: Union[AsyncHttpClient, None], + async_client_supplied: bool, +) -> None: + """ + A finalizer function that is meant to be used with weakref.finalize to close + httpx clients used by an SDK so that underlying resources can be garbage + collected. + """ + + # Unset the client/async_client properties so there are no more references + # to them from the owning SDK instance and they can be reaped. + owner.client = None + owner.async_client = None + if sync_client is not None and not sync_client_supplied: + try: + sync_client.close() + except Exception: + pass + + if async_client is not None and not async_client_supplied: + try: + loop = asyncio.get_running_loop() + asyncio.run_coroutine_threadsafe(async_client.aclose(), loop) + except RuntimeError: + try: + asyncio.run(async_client.aclose()) + except RuntimeError: + # best effort + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/__init__.py b/packages/gcp/src/mistralai/gcp/client/models/__init__.py new file mode 100644 index 00000000..e42ed4bb --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/__init__.py @@ -0,0 +1,390 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, TYPE_CHECKING + +from mistralai.gcp.client.utils.dynamic_imports import lazy_getattr, lazy_dir + +if TYPE_CHECKING: + from .assistantmessage import ( + AssistantMessage, + AssistantMessageContent, + AssistantMessageContentTypedDict, + AssistantMessageTypedDict, + ) + from .builtinconnectors import BuiltInConnectors + from .chatcompletionchoice import ( + ChatCompletionChoice, + ChatCompletionChoiceFinishReason, + ChatCompletionChoiceTypedDict, + ) + from .chatcompletionrequest import ( + ChatCompletionRequest, + ChatCompletionRequestMessage, + ChatCompletionRequestMessageTypedDict, + ChatCompletionRequestStop, + ChatCompletionRequestStopTypedDict, + ChatCompletionRequestToolChoice, + ChatCompletionRequestToolChoiceTypedDict, + ChatCompletionRequestTypedDict, + ) + from .chatcompletionresponse import ( + ChatCompletionResponse, + ChatCompletionResponseTypedDict, + ) + from .chatcompletionstreamrequest import ( + ChatCompletionStreamRequest, + ChatCompletionStreamRequestMessage, + ChatCompletionStreamRequestMessageTypedDict, + ChatCompletionStreamRequestStop, + ChatCompletionStreamRequestStopTypedDict, + ChatCompletionStreamRequestToolChoice, + ChatCompletionStreamRequestToolChoiceTypedDict, + ChatCompletionStreamRequestTypedDict, + ) + from .completionchunk import CompletionChunk, CompletionChunkTypedDict + from .completionevent import CompletionEvent, CompletionEventTypedDict + from .completionresponsestreamchoice import ( + CompletionResponseStreamChoice, + CompletionResponseStreamChoiceFinishReason, + CompletionResponseStreamChoiceTypedDict, + ) + from .contentchunk import ContentChunk, ContentChunkTypedDict, UnknownContentChunk + from .deltamessage import ( + DeltaMessage, + DeltaMessageContent, + DeltaMessageContentTypedDict, + DeltaMessageTypedDict, + ) + from .fimcompletionrequest import ( + FIMCompletionRequest, + FIMCompletionRequestStop, + FIMCompletionRequestStopTypedDict, + FIMCompletionRequestTypedDict, + ) + from .fimcompletionresponse import ( + FIMCompletionResponse, + FIMCompletionResponseTypedDict, + ) + from .fimcompletionstreamrequest import ( + FIMCompletionStreamRequest, + FIMCompletionStreamRequestStop, + FIMCompletionStreamRequestStopTypedDict, + FIMCompletionStreamRequestTypedDict, + ) + from .function import Function, FunctionTypedDict + from .functioncall import ( + Arguments, + ArgumentsTypedDict, + FunctionCall, + FunctionCallTypedDict, + ) + from .functionname import FunctionName, FunctionNameTypedDict + from .imagedetail import ImageDetail + from .imageurl import ImageURL, ImageURLTypedDict + from .imageurlchunk import ( + ImageURLChunk, + ImageURLChunkTypedDict, + ImageURLUnion, + ImageURLUnionTypedDict, + ) + from .jsonschema import JSONSchema, JSONSchemaTypedDict + from .mistralpromptmode import MistralPromptMode + from .prediction import Prediction, PredictionTypedDict + from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict + from .responseformat import ResponseFormat, ResponseFormatTypedDict + from .responseformats import ResponseFormats + from .security import Security, SecurityTypedDict + from .systemmessage import ( + SystemMessage, + SystemMessageContent, + SystemMessageContentTypedDict, + SystemMessageTypedDict, + ) + from .systemmessagecontentchunks import ( + SystemMessageContentChunks, + SystemMessageContentChunksTypedDict, + ) + from .textchunk import TextChunk, TextChunkTypedDict + from .thinkchunk import ThinkChunk, ThinkChunkTypedDict, Thinking, ThinkingTypedDict + from .tool import Tool, ToolTypedDict + from .toolcall import ToolCall, ToolCallTypedDict + from .toolchoice import ToolChoice, ToolChoiceTypedDict + from .toolchoiceenum import ToolChoiceEnum + from .toolmessage import ( + ToolMessage, + ToolMessageContent, + ToolMessageContentTypedDict, + ToolMessageTypedDict, + ) + from .toolreferencechunk import ( + ToolReferenceChunk, + ToolReferenceChunkTypedDict, + ToolUnion, + ToolUnionTypedDict, + ) + from .tooltypes import ToolTypes + from .usageinfo import UsageInfo, UsageInfoTypedDict + from .usermessage import ( + UserMessage, + UserMessageContent, + UserMessageContentTypedDict, + UserMessageTypedDict, + ) + from .validationerror import ( + Context, + ContextTypedDict, + Loc, + LocTypedDict, + ValidationError, + ValidationErrorTypedDict, + ) + +__all__ = [ + "Arguments", + "ArgumentsTypedDict", + "AssistantMessage", + "AssistantMessageContent", + "AssistantMessageContentTypedDict", + "AssistantMessageTypedDict", + "BuiltInConnectors", + "ChatCompletionChoice", + "ChatCompletionChoiceFinishReason", + "ChatCompletionChoiceTypedDict", + "ChatCompletionRequest", + "ChatCompletionRequestMessage", + "ChatCompletionRequestMessageTypedDict", + "ChatCompletionRequestStop", + "ChatCompletionRequestStopTypedDict", + "ChatCompletionRequestToolChoice", + "ChatCompletionRequestToolChoiceTypedDict", + "ChatCompletionRequestTypedDict", + "ChatCompletionResponse", + "ChatCompletionResponseTypedDict", + "ChatCompletionStreamRequest", + "ChatCompletionStreamRequestMessage", + "ChatCompletionStreamRequestMessageTypedDict", + "ChatCompletionStreamRequestStop", + "ChatCompletionStreamRequestStopTypedDict", + "ChatCompletionStreamRequestToolChoice", + "ChatCompletionStreamRequestToolChoiceTypedDict", + "ChatCompletionStreamRequestTypedDict", + "CompletionChunk", + "CompletionChunkTypedDict", + "CompletionEvent", + "CompletionEventTypedDict", + "CompletionResponseStreamChoice", + "CompletionResponseStreamChoiceFinishReason", + "CompletionResponseStreamChoiceTypedDict", + "ContentChunk", + "ContentChunkTypedDict", + "Context", + "ContextTypedDict", + "DeltaMessage", + "DeltaMessageContent", + "DeltaMessageContentTypedDict", + "DeltaMessageTypedDict", + "FIMCompletionRequest", + "FIMCompletionRequestStop", + "FIMCompletionRequestStopTypedDict", + "FIMCompletionRequestTypedDict", + "FIMCompletionResponse", + "FIMCompletionResponseTypedDict", + "FIMCompletionStreamRequest", + "FIMCompletionStreamRequestStop", + "FIMCompletionStreamRequestStopTypedDict", + "FIMCompletionStreamRequestTypedDict", + "Function", + "FunctionCall", + "FunctionCallTypedDict", + "FunctionName", + "FunctionNameTypedDict", + "FunctionTypedDict", + "ImageDetail", + "ImageURL", + "ImageURLChunk", + "ImageURLChunkTypedDict", + "ImageURLTypedDict", + "ImageURLUnion", + "ImageURLUnionTypedDict", + "JSONSchema", + "JSONSchemaTypedDict", + "Loc", + "LocTypedDict", + "MistralPromptMode", + "Prediction", + "PredictionTypedDict", + "ReferenceChunk", + "ReferenceChunkTypedDict", + "ResponseFormat", + "ResponseFormatTypedDict", + "ResponseFormats", + "Security", + "SecurityTypedDict", + "SystemMessage", + "SystemMessageContent", + "SystemMessageContentChunks", + "SystemMessageContentChunksTypedDict", + "SystemMessageContentTypedDict", + "SystemMessageTypedDict", + "TextChunk", + "TextChunkTypedDict", + "ThinkChunk", + "ThinkChunkTypedDict", + "Thinking", + "ThinkingTypedDict", + "Tool", + "ToolCall", + "ToolCallTypedDict", + "ToolChoice", + "ToolChoiceEnum", + "ToolChoiceTypedDict", + "ToolMessage", + "ToolMessageContent", + "ToolMessageContentTypedDict", + "ToolMessageTypedDict", + "ToolReferenceChunk", + "ToolReferenceChunkTypedDict", + "ToolTypedDict", + "ToolTypes", + "ToolUnion", + "ToolUnionTypedDict", + "UnknownContentChunk", + "UsageInfo", + "UsageInfoTypedDict", + "UserMessage", + "UserMessageContent", + "UserMessageContentTypedDict", + "UserMessageTypedDict", + "ValidationError", + "ValidationErrorTypedDict", +] + +_dynamic_imports: dict[str, str] = { + "AssistantMessage": ".assistantmessage", + "AssistantMessageContent": ".assistantmessage", + "AssistantMessageContentTypedDict": ".assistantmessage", + "AssistantMessageTypedDict": ".assistantmessage", + "BuiltInConnectors": ".builtinconnectors", + "ChatCompletionChoice": ".chatcompletionchoice", + "ChatCompletionChoiceFinishReason": ".chatcompletionchoice", + "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", + "ChatCompletionRequest": ".chatcompletionrequest", + "ChatCompletionRequestMessage": ".chatcompletionrequest", + "ChatCompletionRequestMessageTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestStop": ".chatcompletionrequest", + "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestToolChoice": ".chatcompletionrequest", + "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestTypedDict": ".chatcompletionrequest", + "ChatCompletionResponse": ".chatcompletionresponse", + "ChatCompletionResponseTypedDict": ".chatcompletionresponse", + "ChatCompletionStreamRequest": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessage": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessageTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", + "CompletionChunk": ".completionchunk", + "CompletionChunkTypedDict": ".completionchunk", + "CompletionEvent": ".completionevent", + "CompletionEventTypedDict": ".completionevent", + "CompletionResponseStreamChoice": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceFinishReason": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", + "ContentChunk": ".contentchunk", + "ContentChunkTypedDict": ".contentchunk", + "UnknownContentChunk": ".contentchunk", + "DeltaMessage": ".deltamessage", + "DeltaMessageContent": ".deltamessage", + "DeltaMessageContentTypedDict": ".deltamessage", + "DeltaMessageTypedDict": ".deltamessage", + "FIMCompletionRequest": ".fimcompletionrequest", + "FIMCompletionRequestStop": ".fimcompletionrequest", + "FIMCompletionRequestStopTypedDict": ".fimcompletionrequest", + "FIMCompletionRequestTypedDict": ".fimcompletionrequest", + "FIMCompletionResponse": ".fimcompletionresponse", + "FIMCompletionResponseTypedDict": ".fimcompletionresponse", + "FIMCompletionStreamRequest": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestStop": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestStopTypedDict": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestTypedDict": ".fimcompletionstreamrequest", + "Function": ".function", + "FunctionTypedDict": ".function", + "Arguments": ".functioncall", + "ArgumentsTypedDict": ".functioncall", + "FunctionCall": ".functioncall", + "FunctionCallTypedDict": ".functioncall", + "FunctionName": ".functionname", + "FunctionNameTypedDict": ".functionname", + "ImageDetail": ".imagedetail", + "ImageURL": ".imageurl", + "ImageURLTypedDict": ".imageurl", + "ImageURLChunk": ".imageurlchunk", + "ImageURLChunkTypedDict": ".imageurlchunk", + "ImageURLUnion": ".imageurlchunk", + "ImageURLUnionTypedDict": ".imageurlchunk", + "JSONSchema": ".jsonschema", + "JSONSchemaTypedDict": ".jsonschema", + "MistralPromptMode": ".mistralpromptmode", + "Prediction": ".prediction", + "PredictionTypedDict": ".prediction", + "ReferenceChunk": ".referencechunk", + "ReferenceChunkTypedDict": ".referencechunk", + "ResponseFormat": ".responseformat", + "ResponseFormatTypedDict": ".responseformat", + "ResponseFormats": ".responseformats", + "Security": ".security", + "SecurityTypedDict": ".security", + "SystemMessage": ".systemmessage", + "SystemMessageContent": ".systemmessage", + "SystemMessageContentTypedDict": ".systemmessage", + "SystemMessageTypedDict": ".systemmessage", + "SystemMessageContentChunks": ".systemmessagecontentchunks", + "SystemMessageContentChunksTypedDict": ".systemmessagecontentchunks", + "TextChunk": ".textchunk", + "TextChunkTypedDict": ".textchunk", + "ThinkChunk": ".thinkchunk", + "ThinkChunkTypedDict": ".thinkchunk", + "Thinking": ".thinkchunk", + "ThinkingTypedDict": ".thinkchunk", + "Tool": ".tool", + "ToolTypedDict": ".tool", + "ToolCall": ".toolcall", + "ToolCallTypedDict": ".toolcall", + "ToolChoice": ".toolchoice", + "ToolChoiceTypedDict": ".toolchoice", + "ToolChoiceEnum": ".toolchoiceenum", + "ToolMessage": ".toolmessage", + "ToolMessageContent": ".toolmessage", + "ToolMessageContentTypedDict": ".toolmessage", + "ToolMessageTypedDict": ".toolmessage", + "ToolReferenceChunk": ".toolreferencechunk", + "ToolReferenceChunkTypedDict": ".toolreferencechunk", + "ToolUnion": ".toolreferencechunk", + "ToolUnionTypedDict": ".toolreferencechunk", + "ToolTypes": ".tooltypes", + "UsageInfo": ".usageinfo", + "UsageInfoTypedDict": ".usageinfo", + "UserMessage": ".usermessage", + "UserMessageContent": ".usermessage", + "UserMessageContentTypedDict": ".usermessage", + "UserMessageTypedDict": ".usermessage", + "Context": ".validationerror", + "ContextTypedDict": ".validationerror", + "Loc": ".validationerror", + "LocTypedDict": ".validationerror", + "ValidationError": ".validationerror", + "ValidationErrorTypedDict": ".validationerror", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py b/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py new file mode 100644 index 00000000..702ac470 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/assistantmessage.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from .toolcall import ToolCall, ToolCallTypedDict +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AssistantMessageContentTypedDict = TypeAliasType( + "AssistantMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +AssistantMessageContent = TypeAliasType( + "AssistantMessageContent", Union[str, List[ContentChunk]] +) + + +class AssistantMessageTypedDict(TypedDict): + role: Literal["assistant"] + content: NotRequired[Nullable[AssistantMessageContentTypedDict]] + tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] + prefix: NotRequired[bool] + r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" + + +class AssistantMessage(BaseModel): + role: Annotated[ + Annotated[ + Optional[Literal["assistant"]], AfterValidator(validate_const("assistant")) + ], + pydantic.Field(alias="role"), + ] = "assistant" + + content: OptionalNullable[AssistantMessageContent] = UNSET + + tool_calls: OptionalNullable[List[ToolCall]] = UNSET + + prefix: Optional[bool] = False + r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["role", "content", "tool_calls", "prefix"]) + nullable_fields = set(["content", "tool_calls"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + AssistantMessage.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/builtinconnectors.py b/packages/gcp/src/mistralai/gcp/client/models/builtinconnectors.py new file mode 100644 index 00000000..6a3b2476 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/builtinconnectors.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +BuiltInConnectors = Literal[ + "web_search", + "web_search_premium", + "code_interpreter", + "image_generation", + "document_library", +] diff --git a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py new file mode 100644 index 00000000..ae5a2fbf --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionchoice.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from mistralai.gcp.client.types import BaseModel, UnrecognizedStr +from typing import Literal, Union +from typing_extensions import TypedDict + + +ChatCompletionChoiceFinishReason = Union[ + Literal[ + "stop", + "length", + "model_length", + "error", + "tool_calls", + ], + UnrecognizedStr, +] + + +class ChatCompletionChoiceTypedDict(TypedDict): + index: int + message: AssistantMessageTypedDict + finish_reason: ChatCompletionChoiceFinishReason + + +class ChatCompletionChoice(BaseModel): + index: int + + message: AssistantMessage + + finish_reason: ChatCompletionChoiceFinishReason diff --git a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py new file mode 100644 index 00000000..8229c5bb --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionrequest.py @@ -0,0 +1,218 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .mistralpromptmode import MistralPromptMode +from .prediction import Prediction, PredictionTypedDict +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .tool import Tool, ToolTypedDict +from .toolchoice import ToolChoice, ToolChoiceTypedDict +from .toolchoiceenum import ToolChoiceEnum +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.gcp.client.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ChatCompletionRequestStopTypedDict = TypeAliasType( + "ChatCompletionRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionRequestStop = TypeAliasType( + "ChatCompletionRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionRequestMessageTypedDict = TypeAliasType( + "ChatCompletionRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +ChatCompletionRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +ChatCompletionRequestToolChoiceTypedDict = TypeAliasType( + "ChatCompletionRequestToolChoiceTypedDict", + Union[ToolChoiceTypedDict, ToolChoiceEnum], +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +ChatCompletionRequestToolChoice = TypeAliasType( + "ChatCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +class ChatCompletionRequestTypedDict(TypedDict): + model: str + r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" + messages: List[ChatCompletionRequestMessageTypedDict] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[float] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + stop: NotRequired[ChatCompletionRequestStopTypedDict] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + response_format: NotRequired[ResponseFormatTypedDict] + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + tools: NotRequired[Nullable[List[ToolTypedDict]]] + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + tool_choice: NotRequired[ChatCompletionRequestToolChoiceTypedDict] + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + presence_penalty: NotRequired[float] + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + frequency_penalty: NotRequired[float] + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + n: NotRequired[Nullable[int]] + r"""Number of completions to return for each request, input tokens are only billed once.""" + prediction: NotRequired[PredictionTypedDict] + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + parallel_tool_calls: NotRequired[bool] + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + prompt_mode: NotRequired[Nullable[MistralPromptMode]] + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + +class ChatCompletionRequest(BaseModel): + model: str + r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" + + messages: List[ChatCompletionRequestMessage] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: Optional[float] = None + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = False + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + + stop: Optional[ChatCompletionRequestStop] = None + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + response_format: Optional[ResponseFormat] = None + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + tools: OptionalNullable[List[Tool]] = UNSET + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + + tool_choice: Optional[ChatCompletionRequestToolChoice] = None + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + presence_penalty: Optional[float] = None + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + + frequency_penalty: Optional[float] = None + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + + n: OptionalNullable[int] = UNSET + r"""Number of completions to return for each request, input tokens are only billed once.""" + + prediction: Optional[Prediction] = None + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + parallel_tool_calls: Optional[bool] = None + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + + prompt_mode: OptionalNullable[MistralPromptMode] = UNSET + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "response_format", + "tools", + "tool_choice", + "presence_penalty", + "frequency_penalty", + "n", + "prediction", + "parallel_tool_calls", + "prompt_mode", + ] + ) + nullable_fields = set( + [ + "temperature", + "max_tokens", + "random_seed", + "metadata", + "tools", + "n", + "prompt_mode", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionresponse.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionresponse.py new file mode 100644 index 00000000..317c4d84 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionresponse.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.gcp.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ChatCompletionResponseTypedDict(TypedDict): + id: str + object: str + model: str + usage: UsageInfoTypedDict + created: int + choices: List[ChatCompletionChoiceTypedDict] + + +class ChatCompletionResponse(BaseModel): + id: str + + object: str + + model: str + + usage: UsageInfo + + created: int + + choices: List[ChatCompletionChoice] diff --git a/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py new file mode 100644 index 00000000..3c228d2e --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/chatcompletionstreamrequest.py @@ -0,0 +1,216 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .mistralpromptmode import MistralPromptMode +from .prediction import Prediction, PredictionTypedDict +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .tool import Tool, ToolTypedDict +from .toolchoice import ToolChoice, ToolChoiceTypedDict +from .toolchoiceenum import ToolChoiceEnum +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.gcp.client.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ChatCompletionStreamRequestStopTypedDict = TypeAliasType( + "ChatCompletionStreamRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionStreamRequestStop = TypeAliasType( + "ChatCompletionStreamRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionStreamRequestMessageTypedDict = TypeAliasType( + "ChatCompletionStreamRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +ChatCompletionStreamRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +ChatCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( + "ChatCompletionStreamRequestToolChoiceTypedDict", + Union[ToolChoiceTypedDict, ToolChoiceEnum], +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +ChatCompletionStreamRequestToolChoice = TypeAliasType( + "ChatCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +class ChatCompletionStreamRequestTypedDict(TypedDict): + model: str + r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" + messages: List[ChatCompletionStreamRequestMessageTypedDict] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[float] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + stop: NotRequired[ChatCompletionStreamRequestStopTypedDict] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + response_format: NotRequired[ResponseFormatTypedDict] + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + tools: NotRequired[Nullable[List[ToolTypedDict]]] + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + tool_choice: NotRequired[ChatCompletionStreamRequestToolChoiceTypedDict] + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + presence_penalty: NotRequired[float] + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + frequency_penalty: NotRequired[float] + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + n: NotRequired[Nullable[int]] + r"""Number of completions to return for each request, input tokens are only billed once.""" + prediction: NotRequired[PredictionTypedDict] + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + parallel_tool_calls: NotRequired[bool] + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + prompt_mode: NotRequired[Nullable[MistralPromptMode]] + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + +class ChatCompletionStreamRequest(BaseModel): + model: str + r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" + + messages: List[ChatCompletionStreamRequestMessage] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: Optional[float] = None + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = True + + stop: Optional[ChatCompletionStreamRequestStop] = None + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + response_format: Optional[ResponseFormat] = None + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + tools: OptionalNullable[List[Tool]] = UNSET + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + + tool_choice: Optional[ChatCompletionStreamRequestToolChoice] = None + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + presence_penalty: Optional[float] = None + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + + frequency_penalty: Optional[float] = None + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + + n: OptionalNullable[int] = UNSET + r"""Number of completions to return for each request, input tokens are only billed once.""" + + prediction: Optional[Prediction] = None + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + parallel_tool_calls: Optional[bool] = None + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + + prompt_mode: OptionalNullable[MistralPromptMode] = UNSET + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "response_format", + "tools", + "tool_choice", + "presence_penalty", + "frequency_penalty", + "n", + "prediction", + "parallel_tool_calls", + "prompt_mode", + ] + ) + nullable_fields = set( + [ + "temperature", + "max_tokens", + "random_seed", + "metadata", + "tools", + "n", + "prompt_mode", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py b/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py new file mode 100644 index 00000000..a0b1ae2f --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/completionchunk.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .completionresponsestreamchoice import ( + CompletionResponseStreamChoice, + CompletionResponseStreamChoiceTypedDict, +) +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class CompletionChunkTypedDict(TypedDict): + id: str + model: str + choices: List[CompletionResponseStreamChoiceTypedDict] + object: NotRequired[str] + created: NotRequired[int] + usage: NotRequired[UsageInfoTypedDict] + + +class CompletionChunk(BaseModel): + id: str + + model: str + + choices: List[CompletionResponseStreamChoice] + + object: Optional[str] = None + + created: Optional[int] = None + + usage: Optional[UsageInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "created", "usage"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/completionevent.py b/packages/gcp/src/mistralai/gcp/client/models/completionevent.py new file mode 100644 index 00000000..bb155009 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/completionevent.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .completionchunk import CompletionChunk, CompletionChunkTypedDict +from mistralai.gcp.client.types import BaseModel +from typing_extensions import TypedDict + + +class CompletionEventTypedDict(TypedDict): + data: CompletionChunkTypedDict + + +class CompletionEvent(BaseModel): + data: CompletionChunk diff --git a/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py b/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py new file mode 100644 index 00000000..e58d4c88 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/completionresponsestreamchoice.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .deltamessage import DeltaMessage, DeltaMessageTypedDict +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import Literal, Union +from typing_extensions import TypedDict + + +CompletionResponseStreamChoiceFinishReason = Union[ + Literal[ + "stop", + "length", + "error", + "tool_calls", + ], + UnrecognizedStr, +] + + +class CompletionResponseStreamChoiceTypedDict(TypedDict): + index: int + delta: DeltaMessageTypedDict + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] + + +class CompletionResponseStreamChoice(BaseModel): + index: int + + delta: DeltaMessage + + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/contentchunk.py b/packages/gcp/src/mistralai/gcp/client/models/contentchunk.py new file mode 100644 index 00000000..18d48150 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/contentchunk.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict +from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict +from .textchunk import TextChunk, TextChunkTypedDict +from functools import partial +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +ContentChunkTypedDict = TypeAliasType( + "ContentChunkTypedDict", + Union[TextChunkTypedDict, ImageURLChunkTypedDict, ReferenceChunkTypedDict], +) + + +class UnknownContentChunk(BaseModel): + r"""A ContentChunk variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_CONTENT_CHUNK_VARIANTS: dict[str, Any] = { + "image_url": ImageURLChunk, + "text": TextChunk, + "reference": ReferenceChunk, +} + + +ContentChunk = Annotated[ + Union[ImageURLChunk, TextChunk, ReferenceChunk, UnknownContentChunk], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_CONTENT_CHUNK_VARIANTS, + unknown_cls=UnknownContentChunk, + union_name="ContentChunk", + ) + ), +] diff --git a/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py b/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py new file mode 100644 index 00000000..63e6a7f3 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/deltamessage.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from .toolcall import ToolCall, ToolCallTypedDict +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +DeltaMessageContentTypedDict = TypeAliasType( + "DeltaMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +DeltaMessageContent = TypeAliasType( + "DeltaMessageContent", Union[str, List[ContentChunk]] +) + + +class DeltaMessageTypedDict(TypedDict): + role: NotRequired[Nullable[str]] + content: NotRequired[Nullable[DeltaMessageContentTypedDict]] + tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] + + +class DeltaMessage(BaseModel): + role: OptionalNullable[str] = UNSET + + content: OptionalNullable[DeltaMessageContent] = UNSET + + tool_calls: OptionalNullable[List[ToolCall]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["role", "content", "tool_calls"]) + nullable_fields = set(["role", "content", "tool_calls"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py new file mode 100644 index 00000000..e460f76c --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionrequest.py @@ -0,0 +1,129 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +FIMCompletionRequestStopTypedDict = TypeAliasType( + "FIMCompletionRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +FIMCompletionRequestStop = TypeAliasType( + "FIMCompletionRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +class FIMCompletionRequestTypedDict(TypedDict): + model: str + r"""ID of the model with FIM to use.""" + prompt: str + r"""The text/code to complete.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[float] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + stop: NotRequired[FIMCompletionRequestStopTypedDict] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + suffix: NotRequired[Nullable[str]] + r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" + min_tokens: NotRequired[Nullable[int]] + r"""The minimum number of tokens to generate in the completion.""" + + +class FIMCompletionRequest(BaseModel): + model: str + r"""ID of the model with FIM to use.""" + + prompt: str + r"""The text/code to complete.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: Optional[float] = 1 + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = False + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + + stop: Optional[FIMCompletionRequestStop] = None + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + suffix: OptionalNullable[str] = UNSET + r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" + + min_tokens: OptionalNullable[int] = UNSET + r"""The minimum number of tokens to generate in the completion.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "suffix", + "min_tokens", + ] + ) + nullable_fields = set( + [ + "temperature", + "max_tokens", + "random_seed", + "metadata", + "suffix", + "min_tokens", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/fimcompletionresponse.py b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionresponse.py new file mode 100644 index 00000000..5b80da3f --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionresponse.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.gcp.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class FIMCompletionResponseTypedDict(TypedDict): + id: str + object: str + model: str + usage: UsageInfoTypedDict + created: int + choices: List[ChatCompletionChoiceTypedDict] + + +class FIMCompletionResponse(BaseModel): + id: str + + object: str + + model: str + + usage: UsageInfo + + created: int + + choices: List[ChatCompletionChoice] diff --git a/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py new file mode 100644 index 00000000..fffc3054 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/fimcompletionstreamrequest.py @@ -0,0 +1,127 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +FIMCompletionStreamRequestStopTypedDict = TypeAliasType( + "FIMCompletionStreamRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +FIMCompletionStreamRequestStop = TypeAliasType( + "FIMCompletionStreamRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +class FIMCompletionStreamRequestTypedDict(TypedDict): + model: str + r"""ID of the model with FIM to use.""" + prompt: str + r"""The text/code to complete.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[float] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + stop: NotRequired[FIMCompletionStreamRequestStopTypedDict] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + suffix: NotRequired[Nullable[str]] + r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" + min_tokens: NotRequired[Nullable[int]] + r"""The minimum number of tokens to generate in the completion.""" + + +class FIMCompletionStreamRequest(BaseModel): + model: str + r"""ID of the model with FIM to use.""" + + prompt: str + r"""The text/code to complete.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: Optional[float] = 1 + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = True + + stop: Optional[FIMCompletionStreamRequestStop] = None + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + suffix: OptionalNullable[str] = UNSET + r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" + + min_tokens: OptionalNullable[int] = UNSET + r"""The minimum number of tokens to generate in the completion.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "suffix", + "min_tokens", + ] + ) + nullable_fields = set( + [ + "temperature", + "max_tokens", + "random_seed", + "metadata", + "suffix", + "min_tokens", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/function.py b/packages/gcp/src/mistralai/gcp/client/models/function.py new file mode 100644 index 00000000..439e8313 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/function.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class FunctionTypedDict(TypedDict): + name: str + parameters: Dict[str, Any] + description: NotRequired[str] + strict: NotRequired[bool] + + +class Function(BaseModel): + name: str + + parameters: Dict[str, Any] + + description: Optional[str] = None + + strict: Optional[bool] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "strict"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/functioncall.py b/packages/gcp/src/mistralai/gcp/client/models/functioncall.py new file mode 100644 index 00000000..0f1b2425 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/functioncall.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel +from typing import Any, Dict, Union +from typing_extensions import TypeAliasType, TypedDict + + +ArgumentsTypedDict = TypeAliasType("ArgumentsTypedDict", Union[Dict[str, Any], str]) + + +Arguments = TypeAliasType("Arguments", Union[Dict[str, Any], str]) + + +class FunctionCallTypedDict(TypedDict): + name: str + arguments: ArgumentsTypedDict + + +class FunctionCall(BaseModel): + name: str + + arguments: Arguments diff --git a/packages/gcp/src/mistralai/gcp/client/models/functionname.py b/packages/gcp/src/mistralai/gcp/client/models/functionname.py new file mode 100644 index 00000000..585b9e39 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/functionname.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel +from typing_extensions import TypedDict + + +class FunctionNameTypedDict(TypedDict): + r"""this restriction of `Function` is used to select a specific function to call""" + + name: str + + +class FunctionName(BaseModel): + r"""this restriction of `Function` is used to select a specific function to call""" + + name: str diff --git a/packages/gcp/src/mistralai/gcp/client/models/imagedetail.py b/packages/gcp/src/mistralai/gcp/client/models/imagedetail.py new file mode 100644 index 00000000..68ed7608 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/imagedetail.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import UnrecognizedStr +from typing import Literal, Union + + +ImageDetail = Union[ + Literal[ + "low", + "auto", + "high", + ], + UnrecognizedStr, +] diff --git a/packages/gcp/src/mistralai/gcp/client/models/imageurl.py b/packages/gcp/src/mistralai/gcp/client/models/imageurl.py new file mode 100644 index 00000000..903d0a1a --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/imageurl.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imagedetail import ImageDetail +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ImageURLTypedDict(TypedDict): + url: str + detail: NotRequired[Nullable[ImageDetail]] + + +class ImageURL(BaseModel): + url: str + + detail: OptionalNullable[ImageDetail] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["detail"]) + nullable_fields = set(["detail"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py b/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py new file mode 100644 index 00000000..4bec0eec --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/imageurlchunk.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imageurl import ImageURL, ImageURLTypedDict +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ImageURLUnionTypedDict = TypeAliasType( + "ImageURLUnionTypedDict", Union[ImageURLTypedDict, str] +) + + +ImageURLUnion = TypeAliasType("ImageURLUnion", Union[ImageURL, str]) + + +class ImageURLChunkTypedDict(TypedDict): + r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + + image_url: ImageURLUnionTypedDict + type: Literal["image_url"] + + +class ImageURLChunk(BaseModel): + r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" + + image_url: ImageURLUnion + + type: Annotated[ + Annotated[Literal["image_url"], AfterValidator(validate_const("image_url"))], + pydantic.Field(alias="type"), + ] = "image_url" + + +try: + ImageURLChunk.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py b/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py new file mode 100644 index 00000000..684ac09f --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/jsonschema.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JSONSchemaTypedDict(TypedDict): + name: str + schema_definition: Dict[str, Any] + description: NotRequired[Nullable[str]] + strict: NotRequired[bool] + + +class JSONSchema(BaseModel): + name: str + + schema_definition: Annotated[Dict[str, Any], pydantic.Field(alias="schema")] + + description: OptionalNullable[str] = UNSET + + strict: Optional[bool] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "strict"]) + nullable_fields = set(["description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + JSONSchema.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/mistralpromptmode.py b/packages/gcp/src/mistralai/gcp/client/models/mistralpromptmode.py new file mode 100644 index 00000000..c765e4f1 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/mistralpromptmode.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import UnrecognizedStr +from typing import Literal, Union + + +MistralPromptMode = Union[Literal["reasoning",], UnrecognizedStr] +r"""Available options to the prompt_mode argument on the chat completion endpoint. +Values represent high-level intent. Assignment to actual SPs is handled internally. +System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc. +""" diff --git a/packages/gcp/src/mistralai/gcp/client/models/prediction.py b/packages/gcp/src/mistralai/gcp/client/models/prediction.py new file mode 100644 index 00000000..2e325289 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/prediction.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PredictionTypedDict(TypedDict): + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + type: Literal["content"] + content: NotRequired[str] + + +class Prediction(BaseModel): + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + type: Annotated[ + Annotated[ + Optional[Literal["content"]], AfterValidator(validate_const("content")) + ], + pydantic.Field(alias="type"), + ] = "content" + + content: Optional[str] = "" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "content"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + Prediction.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py b/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py new file mode 100644 index 00000000..261c4755 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/referencechunk.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ReferenceChunkTypedDict(TypedDict): + reference_ids: List[int] + type: Literal["reference"] + + +class ReferenceChunk(BaseModel): + reference_ids: List[int] + + type: Annotated[ + Annotated[ + Optional[Literal["reference"]], AfterValidator(validate_const("reference")) + ], + pydantic.Field(alias="type"), + ] = "reference" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ReferenceChunk.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/responseformat.py b/packages/gcp/src/mistralai/gcp/client/models/responseformat.py new file mode 100644 index 00000000..f3aa9930 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/responseformat.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .jsonschema import JSONSchema, JSONSchemaTypedDict +from .responseformats import ResponseFormats +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ResponseFormatTypedDict(TypedDict): + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + type: NotRequired[ResponseFormats] + json_schema: NotRequired[Nullable[JSONSchemaTypedDict]] + + +class ResponseFormat(BaseModel): + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + type: Optional[ResponseFormats] = None + + json_schema: OptionalNullable[JSONSchema] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "json_schema"]) + nullable_fields = set(["json_schema"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/responseformats.py b/packages/gcp/src/mistralai/gcp/client/models/responseformats.py new file mode 100644 index 00000000..cbf83ce7 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/responseformats.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ResponseFormats = Literal[ + "text", + "json_object", + "json_schema", +] diff --git a/packages/gcp/src/mistralai/gcp/client/models/security.py b/packages/gcp/src/mistralai/gcp/client/models/security.py new file mode 100644 index 00000000..10a469b5 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/security.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import FieldMetadata, SecurityMetadata +from typing_extensions import Annotated, TypedDict + + +class SecurityTypedDict(TypedDict): + api_key: str + + +class Security(BaseModel): + api_key: Annotated[ + str, + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="http", + sub_type="bearer", + field_name="Authorization", + ) + ), + ] diff --git a/packages/gcp/src/mistralai/gcp/client/models/systemmessage.py b/packages/gcp/src/mistralai/gcp/client/models/systemmessage.py new file mode 100644 index 00000000..b3795c4b --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/systemmessage.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .systemmessagecontentchunks import ( + SystemMessageContentChunks, + SystemMessageContentChunksTypedDict, +) +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +SystemMessageContentTypedDict = TypeAliasType( + "SystemMessageContentTypedDict", + Union[str, List[SystemMessageContentChunksTypedDict]], +) + + +SystemMessageContent = TypeAliasType( + "SystemMessageContent", Union[str, List[SystemMessageContentChunks]] +) + + +class SystemMessageTypedDict(TypedDict): + content: SystemMessageContentTypedDict + role: Literal["system"] + + +class SystemMessage(BaseModel): + content: SystemMessageContent + + role: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="role"), + ] = "system" + + +try: + SystemMessage.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/systemmessagecontentchunks.py b/packages/gcp/src/mistralai/gcp/client/models/systemmessagecontentchunks.py new file mode 100644 index 00000000..8de71c90 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/systemmessagecontentchunks.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .textchunk import TextChunk, TextChunkTypedDict +from .thinkchunk import ThinkChunk, ThinkChunkTypedDict +from pydantic import Field +from typing import Union +from typing_extensions import Annotated, TypeAliasType + + +SystemMessageContentChunksTypedDict = TypeAliasType( + "SystemMessageContentChunksTypedDict", + Union[TextChunkTypedDict, ThinkChunkTypedDict], +) + + +SystemMessageContentChunks = Annotated[ + Union[TextChunk, ThinkChunk], Field(discriminator="type") +] diff --git a/packages/gcp/src/mistralai/gcp/client/models/textchunk.py b/packages/gcp/src/mistralai/gcp/client/models/textchunk.py new file mode 100644 index 00000000..69032272 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/textchunk.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class TextChunkTypedDict(TypedDict): + text: str + type: Literal["text"] + + +class TextChunk(BaseModel): + text: str + + type: Annotated[ + Annotated[Literal["text"], AfterValidator(validate_const("text"))], + pydantic.Field(alias="type"), + ] = "text" + + +try: + TextChunk.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py b/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py new file mode 100644 index 00000000..d534fc1e --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/thinkchunk.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict +from .textchunk import TextChunk, TextChunkTypedDict +from .toolreferencechunk import ToolReferenceChunk, ToolReferenceChunkTypedDict +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ThinkingTypedDict = TypeAliasType( + "ThinkingTypedDict", + Union[TextChunkTypedDict, ReferenceChunkTypedDict, ToolReferenceChunkTypedDict], +) + + +Thinking = TypeAliasType( + "Thinking", Union[TextChunk, ReferenceChunk, ToolReferenceChunk] +) + + +class ThinkChunkTypedDict(TypedDict): + thinking: List[ThinkingTypedDict] + type: Literal["thinking"] + closed: NotRequired[bool] + r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" + + +class ThinkChunk(BaseModel): + thinking: List[Thinking] + + type: Annotated[ + Annotated[Literal["thinking"], AfterValidator(validate_const("thinking"))], + pydantic.Field(alias="type"), + ] = "thinking" + + closed: Optional[bool] = None + r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["closed"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ThinkChunk.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/tool.py b/packages/gcp/src/mistralai/gcp/client/models/tool.py new file mode 100644 index 00000000..670aa81f --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/tool.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .function import Function, FunctionTypedDict +from .tooltypes import ToolTypes +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ToolTypedDict(TypedDict): + function: FunctionTypedDict + type: NotRequired[ToolTypes] + + +class Tool(BaseModel): + function: Function + + type: Optional[ToolTypes] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolcall.py b/packages/gcp/src/mistralai/gcp/client/models/toolcall.py new file mode 100644 index 00000000..3ea8e283 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/toolcall.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .functioncall import FunctionCall, FunctionCallTypedDict +from .tooltypes import ToolTypes +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ToolCallTypedDict(TypedDict): + function: FunctionCallTypedDict + id: NotRequired[str] + type: NotRequired[ToolTypes] + index: NotRequired[int] + + +class ToolCall(BaseModel): + function: FunctionCall + + id: Optional[str] = "null" + + type: Optional[ToolTypes] = None + + index: Optional[int] = 0 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id", "type", "index"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py b/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py new file mode 100644 index 00000000..6e795fd7 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/toolchoice.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .functionname import FunctionName, FunctionNameTypedDict +from .tooltypes import ToolTypes +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ToolChoiceTypedDict(TypedDict): + r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" + + function: FunctionNameTypedDict + r"""this restriction of `Function` is used to select a specific function to call""" + type: NotRequired[ToolTypes] + + +class ToolChoice(BaseModel): + r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" + + function: FunctionName + r"""this restriction of `Function` is used to select a specific function to call""" + + type: Optional[ToolTypes] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolchoiceenum.py b/packages/gcp/src/mistralai/gcp/client/models/toolchoiceenum.py new file mode 100644 index 00000000..01f6f677 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/toolchoiceenum.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ToolChoiceEnum = Literal[ + "auto", + "none", + "any", + "required", +] diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py b/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py new file mode 100644 index 00000000..ce160391 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/toolmessage.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolMessageContentTypedDict = TypeAliasType( + "ToolMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]]) + + +class ToolMessageTypedDict(TypedDict): + content: Nullable[ToolMessageContentTypedDict] + role: Literal["tool"] + tool_call_id: NotRequired[Nullable[str]] + name: NotRequired[Nullable[str]] + + +class ToolMessage(BaseModel): + content: Nullable[ToolMessageContent] + + role: Annotated[ + Annotated[Literal["tool"], AfterValidator(validate_const("tool"))], + pydantic.Field(alias="role"), + ] = "tool" + + tool_call_id: OptionalNullable[str] = UNSET + + name: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_call_id", "name"]) + nullable_fields = set(["content", "tool_call_id", "name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolMessage.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/toolreferencechunk.py b/packages/gcp/src/mistralai/gcp/client/models/toolreferencechunk.py new file mode 100644 index 00000000..0a2a7fa3 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/toolreferencechunk.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .builtinconnectors import BuiltInConnectors +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolUnionTypedDict = TypeAliasType("ToolUnionTypedDict", Union[BuiltInConnectors, str]) + + +ToolUnion = TypeAliasType("ToolUnion", Union[BuiltInConnectors, str]) + + +class ToolReferenceChunkTypedDict(TypedDict): + tool: ToolUnionTypedDict + title: str + type: Literal["tool_reference"] + url: NotRequired[Nullable[str]] + favicon: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + + +class ToolReferenceChunk(BaseModel): + tool: ToolUnion + + title: str + + type: Annotated[ + Annotated[ + Optional[Literal["tool_reference"]], + AfterValidator(validate_const("tool_reference")), + ], + pydantic.Field(alias="type"), + ] = "tool_reference" + + url: OptionalNullable[str] = UNSET + + favicon: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "url", "favicon", "description"]) + nullable_fields = set(["url", "favicon", "description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolReferenceChunk.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/tooltypes.py b/packages/gcp/src/mistralai/gcp/client/models/tooltypes.py new file mode 100644 index 00000000..fd1aa13d --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/tooltypes.py @@ -0,0 +1,8 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import UnrecognizedStr +from typing import Literal, Union + + +ToolTypes = Union[Literal["function",], UnrecognizedStr] diff --git a/packages/gcp/src/mistralai/gcp/client/models/usageinfo.py b/packages/gcp/src/mistralai/gcp/client/models/usageinfo.py new file mode 100644 index 00000000..cb6feb6e --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/usageinfo.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class UsageInfoTypedDict(TypedDict): + prompt_tokens: NotRequired[int] + completion_tokens: NotRequired[int] + total_tokens: NotRequired[int] + prompt_audio_seconds: NotRequired[Nullable[int]] + + +class UsageInfo(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + prompt_tokens: Optional[int] = 0 + + completion_tokens: Optional[int] = 0 + + total_tokens: Optional[int] = 0 + + prompt_audio_seconds: OptionalNullable[int] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "prompt_tokens", + "completion_tokens", + "total_tokens", + "prompt_audio_seconds", + ] + ) + nullable_fields = set(["prompt_audio_seconds"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/packages/gcp/src/mistralai/gcp/client/models/usermessage.py b/packages/gcp/src/mistralai/gcp/client/models/usermessage.py new file mode 100644 index 00000000..e237e900 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/usermessage.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from mistralai.gcp.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.gcp.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +UserMessageContentTypedDict = TypeAliasType( + "UserMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]]) + + +class UserMessageTypedDict(TypedDict): + content: Nullable[UserMessageContentTypedDict] + role: Literal["user"] + + +class UserMessage(BaseModel): + content: Nullable[UserMessageContent] + + role: Annotated[ + Annotated[Literal["user"], AfterValidator(validate_const("user"))], + pydantic.Field(alias="role"), + ] = "user" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + m[k] = val + + return m + + +try: + UserMessage.model_rebuild() +except NameError: + pass diff --git a/packages/gcp/src/mistralai/gcp/client/models/validationerror.py b/packages/gcp/src/mistralai/gcp/client/models/validationerror.py new file mode 100644 index 00000000..3ff872c1 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/models/validationerror.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from mistralai.gcp.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int]) + + +Loc = TypeAliasType("Loc", Union[str, int]) + + +class ContextTypedDict(TypedDict): + pass + + +class Context(BaseModel): + pass + + +class ValidationErrorTypedDict(TypedDict): + loc: List[LocTypedDict] + msg: str + type: str + input: NotRequired[Any] + ctx: NotRequired[ContextTypedDict] + + +class ValidationError(BaseModel): + loc: List[Loc] + + msg: str + + type: str + + input: Optional[Any] = None + + ctx: Optional[Context] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input", "ctx"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/py.typed b/packages/gcp/src/mistralai/gcp/client/py.typed similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/py.typed rename to packages/gcp/src/mistralai/gcp/client/py.typed diff --git a/packages/gcp/src/mistralai/gcp/client/sdk.py b/packages/gcp/src/mistralai/gcp/client/sdk.py new file mode 100644 index 00000000..b3f48158 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/sdk.py @@ -0,0 +1,241 @@ +from .basesdk import BaseSDK +from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients +from .sdkconfiguration import SDKConfiguration +from .utils.logger import Logger, get_default_logger +from .utils.retries import RetryConfig +import google.auth +import google.auth.credentials +import google.auth.transport.requests +import httpx +import importlib +from mistralai.gcp.client import models, utils +from mistralai.gcp.client._hooks import SDKHooks +from mistralai.gcp.client._hooks.registration import GCPVertexAIPathHook +from mistralai.gcp.client.types import OptionalNullable, UNSET +import sys +from typing import Callable, Dict, Optional, TYPE_CHECKING, cast +import weakref + +if TYPE_CHECKING: + from mistralai.gcp.client.chat import Chat + from mistralai.gcp.client.fim import Fim + + +class MistralGCP(BaseSDK): + r"""Mistral AI API: Dora OpenAPI schema + + Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. + """ + + chat: "Chat" + r"""Chat Completion API.""" + fim: "Fim" + r"""Fill-in-the-middle API.""" + _sub_sdk_map = { + "chat": ("mistralai.gcp.client.chat", "Chat"), + "fim": ("mistralai.gcp.client.fim", "Fim"), + } + + def __init__( + self, + project_id: Optional[str] = None, + region: str = "europe-west4", + access_token: Optional[str] = None, + server: Optional[str] = None, + server_url: Optional[str] = None, + url_params: Optional[Dict[str, str]] = None, + client: Optional[HttpClient] = None, + async_client: Optional[AsyncHttpClient] = None, + retry_config: OptionalNullable[RetryConfig] = UNSET, + timeout_ms: Optional[int] = None, + debug_logger: Optional[Logger] = None, + ) -> None: + r"""Instantiates the SDK configuring it with the provided parameters. + + :param project_id: GCP project ID (auto-detected from credentials if not provided) + :param region: GCP region for Vertex AI (default: europe-west4) + :param access_token: Fixed access token for testing (skips google.auth) + :param server: The server by name to use for all methods + :param server_url: The server URL to use for all methods + :param url_params: Parameters to optionally template the server URL with + :param client: The HTTP client to use for all synchronous methods + :param async_client: The Async HTTP client to use for all asynchronous methods + :param retry_config: The retry configuration to use for all supported methods + :param timeout_ms: Optional request timeout applied to each operation in milliseconds + """ + credentials: Optional[google.auth.credentials.Credentials] = None + if access_token is None: + creds, detected_project_id = google.auth.default( + scopes=["https://www.googleapis.com/auth/cloud-platform"], + ) + if creds is None: + raise ValueError("Failed to obtain GCP credentials") + # Cast to Credentials base class which has refresh() and token + creds = cast(google.auth.credentials.Credentials, creds) + creds.refresh(google.auth.transport.requests.Request()) + credentials = creds + project_id = project_id or detected_project_id + + if project_id is None: + raise ValueError( + "project_id must be provided or available from default credentials" + ) + + self._credentials = credentials + self._project_id = project_id + self._region = region + self._fixed_access_token = access_token + + def get_auth_token() -> str: + if self._fixed_access_token: + return self._fixed_access_token + creds = self._credentials + if creds is None: + raise ValueError("No credentials available") + # Only refresh when the token is expired or missing. + # This avoids a blocking HTTP round-trip on every request and + # minimises event-loop blocking when called from async paths + # (the Speakeasy-generated basesdk always calls security + # callables synchronously). + if not creds.valid: + creds.refresh(google.auth.transport.requests.Request()) + token = creds.token + if token is None: + raise ValueError("Failed to obtain access token") + return token + + if server_url is None: + server_url = f"https://{region}-aiplatform.googleapis.com" + + client_supplied = True + if client is None: + client = httpx.Client(follow_redirects=True) + client_supplied = False + + assert issubclass( + type(client), HttpClient + ), "The provided client must implement the HttpClient protocol." + + async_client_supplied = True + if async_client is None: + async_client = httpx.AsyncClient(follow_redirects=True) + async_client_supplied = False + + if debug_logger is None: + debug_logger = get_default_logger() + + assert issubclass( + type(async_client), AsyncHttpClient + ), "The provided async_client must implement the AsyncHttpClient protocol." + + def get_security() -> models.Security: + return models.Security(api_key=get_auth_token()) + + security: Callable[[], models.Security] = get_security + + if url_params is not None: + server_url = utils.template_url(server_url, url_params) + + BaseSDK.__init__( + self, + SDKConfiguration( + client=client, + client_supplied=client_supplied, + async_client=async_client, + async_client_supplied=async_client_supplied, + security=security, + server_url=server_url, + server=server, + retry_config=retry_config, + timeout_ms=timeout_ms, + debug_logger=debug_logger, + ), + parent_ref=self, + ) + + hooks = SDKHooks() + self.sdk_configuration.__dict__["_hooks"] = hooks + + # Register hook that builds Vertex AI URL path + hooks.register_before_request_hook(GCPVertexAIPathHook(project_id, region)) + + current_server_url, *_ = self.sdk_configuration.get_server_details() + server_url, self.sdk_configuration.client = hooks.sdk_init( + current_server_url, client + ) + if current_server_url != server_url: + self.sdk_configuration.server_url = server_url + + weakref.finalize( + self, + close_clients, + cast(ClientOwner, self.sdk_configuration), + self.sdk_configuration.client, + self.sdk_configuration.client_supplied, + self.sdk_configuration.async_client, + self.sdk_configuration.async_client_supplied, + ) + + def dynamic_import(self, modname, retries=3): + last_exc: Optional[Exception] = None + for attempt in range(retries): + try: + return importlib.import_module(modname) + except (KeyError, ImportError, ModuleNotFoundError) as e: + last_exc = e + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise ImportError( + f"Failed to import module '{modname}' after {retries} attempts" + ) from last_exc + + def __getattr__(self, name: str): + if name in self._sub_sdk_map: + module_path, class_name = self._sub_sdk_map[name] + try: + module = self.dynamic_import(module_path) + klass = getattr(module, class_name) + instance = klass(self.sdk_configuration, parent_ref=self) + setattr(self, name, instance) + return instance + except ImportError as e: + raise AttributeError( + f"Failed to import module {module_path} for attribute {name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}" + ) from e + + raise AttributeError( + f"'{type(self).__name__}' object has no attribute '{name}'" + ) + + def __dir__(self): + default_attrs = list(super().__dir__()) + lazy_attrs = list(self._sub_sdk_map.keys()) + return sorted(list(set(default_attrs + lazy_attrs))) + + def __enter__(self): + return self + + async def __aenter__(self): + return self + + def __exit__(self, _exc_type, _exc_val, _exc_tb): + if ( + self.sdk_configuration.client is not None + and not self.sdk_configuration.client_supplied + ): + self.sdk_configuration.client.close() + self.sdk_configuration.client = None + + async def __aexit__(self, _exc_type, _exc_val, _exc_tb): + if ( + self.sdk_configuration.async_client is not None + and not self.sdk_configuration.async_client_supplied + ): + await self.sdk_configuration.async_client.aclose() + self.sdk_configuration.async_client = None diff --git a/packages/gcp/src/mistralai/gcp/client/sdkconfiguration.py b/packages/gcp/src/mistralai/gcp/client/sdkconfiguration.py new file mode 100644 index 00000000..d56a634f --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/sdkconfiguration.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._version import ( + __gen_version__, + __openapi_doc_version__, + __user_agent__, + __version__, +) +from .httpclient import AsyncHttpClient, HttpClient +from .utils import Logger, RetryConfig, remove_suffix +from dataclasses import dataclass +from mistralai.gcp.client import models +from mistralai.gcp.client.types import OptionalNullable, UNSET +from pydantic import Field +from typing import Callable, Dict, Optional, Tuple, Union + + +SERVER_EU = "eu" +r"""EU Production server""" +SERVERS = { + SERVER_EU: "https://api.mistral.ai", +} +"""Contains the list of servers available to the SDK""" + + +@dataclass +class SDKConfiguration: + client: Union[HttpClient, None] + client_supplied: bool + async_client: Union[AsyncHttpClient, None] + async_client_supplied: bool + debug_logger: Logger + security: Optional[Union[models.Security, Callable[[], models.Security]]] = None + server_url: Optional[str] = "" + server: Optional[str] = "" + language: str = "python" + openapi_doc_version: str = __openapi_doc_version__ + sdk_version: str = __version__ + gen_version: str = __gen_version__ + user_agent: str = __user_agent__ + retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) + timeout_ms: Optional[int] = None + + def get_server_details(self) -> Tuple[str, Dict[str, str]]: + if self.server_url is not None and self.server_url: + return remove_suffix(self.server_url, "/"), {} + if not self.server: + self.server = SERVER_EU + + if self.server not in SERVERS: + raise ValueError(f'Invalid server "{self.server}"') + + return SERVERS[self.server], {} diff --git a/packages/mistralai_gcp/src/mistralai_gcp/types/__init__.py b/packages/gcp/src/mistralai/gcp/client/types/__init__.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/types/__init__.py rename to packages/gcp/src/mistralai/gcp/client/types/__init__.py diff --git a/packages/gcp/src/mistralai/gcp/client/types/basemodel.py b/packages/gcp/src/mistralai/gcp/client/types/basemodel.py new file mode 100644 index 00000000..a9a640a1 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/types/basemodel.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from pydantic import ConfigDict, model_serializer +from pydantic import BaseModel as PydanticBaseModel +from pydantic_core import core_schema +from typing import TYPE_CHECKING, Any, Literal, Optional, TypeVar, Union +from typing_extensions import TypeAliasType, TypeAlias + + +class BaseModel(PydanticBaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() + ) + + +class Unset(BaseModel): + @model_serializer(mode="plain") + def serialize_model(self): + return UNSET_SENTINEL + + def __bool__(self) -> Literal[False]: + return False + + +UNSET = Unset() +UNSET_SENTINEL = "~?~unset~?~sentinel~?~" + + +T = TypeVar("T") +if TYPE_CHECKING: + Nullable: TypeAlias = Union[T, None] + OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] +else: + Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) + OptionalNullable = TypeAliasType( + "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) + ) + + +class UnrecognizedStr(str): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema: + # Make UnrecognizedStr only work in lax mode, not strict mode + # This makes it a "fallback" option when more specific types (like Literals) don't match + def validate_lax(v: Any) -> 'UnrecognizedStr': + if isinstance(v, cls): + return v + return cls(str(v)) + + # Use lax_or_strict_schema where strict always fails + # This forces Pydantic to prefer other union members in strict mode + # and only fall back to UnrecognizedStr in lax mode + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema([ + core_schema.str_schema(), + core_schema.no_info_plain_validator_function(validate_lax) + ]), + strict_schema=core_schema.none_schema(), # Always fails in strict mode + ) + + +class UnrecognizedInt(int): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema: + # Make UnrecognizedInt only work in lax mode, not strict mode + # This makes it a "fallback" option when more specific types (like Literals) don't match + def validate_lax(v: Any) -> 'UnrecognizedInt': + if isinstance(v, cls): + return v + return cls(int(v)) + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema([ + core_schema.int_schema(), + core_schema.no_info_plain_validator_function(validate_lax) + ]), + strict_schema=core_schema.none_schema(), # Always fails in strict mode + ) diff --git a/packages/gcp/src/mistralai/gcp/client/utils/__init__.py b/packages/gcp/src/mistralai/gcp/client/utils/__init__.py new file mode 100644 index 00000000..b488c2df --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/__init__.py @@ -0,0 +1,178 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, TYPE_CHECKING, Callable, TypeVar +import asyncio + +from .dynamic_imports import lazy_getattr, lazy_dir + +_T = TypeVar("_T") + + +async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T: + """Run a synchronous function in a thread pool to avoid blocking the event loop.""" + return await asyncio.to_thread(func, *args) + + +if TYPE_CHECKING: + from .annotations import get_discriminator + from .datetimes import parse_datetime + from .enums import OpenEnumMeta + from .unions import parse_open_union + from .headers import get_headers, get_response_headers + from .metadata import ( + FieldMetadata, + find_metadata, + FormMetadata, + HeaderMetadata, + MultipartFormMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, + SecurityMetadata, + ) + from .queryparams import get_query_params + from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig + from .requestbodies import serialize_request_body, SerializedRequestBody + from .security import get_security + from .serializers import ( + get_pydantic_model, + marshal_json, + unmarshal, + unmarshal_json, + serialize_decimal, + serialize_float, + serialize_int, + stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, + validate_decimal, + validate_float, + validate_int, + ) + from .url import generate_url, template_url, remove_suffix + from .values import ( + get_global_from_env, + match_content_type, + match_status_codes, + match_response, + cast_partial, + ) + from .logger import Logger, get_body_content, get_default_logger + +__all__ = [ + "BackoffStrategy", + "FieldMetadata", + "find_metadata", + "FormMetadata", + "generate_url", + "get_body_content", + "get_default_logger", + "get_discriminator", + "parse_datetime", + "get_global_from_env", + "get_headers", + "get_pydantic_model", + "get_query_params", + "get_response_headers", + "get_security", + "HeaderMetadata", + "Logger", + "marshal_json", + "match_content_type", + "match_status_codes", + "match_response", + "MultipartFormMetadata", + "OpenEnumMeta", + "parse_open_union", + "PathParamMetadata", + "QueryParamMetadata", + "remove_suffix", + "Retries", + "retry", + "retry_async", + "RetryConfig", + "RequestMetadata", + "SecurityMetadata", + "serialize_decimal", + "serialize_float", + "serialize_int", + "serialize_request_body", + "SerializedRequestBody", + "stream_to_text", + "stream_to_text_async", + "stream_to_bytes", + "stream_to_bytes_async", + "template_url", + "unmarshal", + "unmarshal_json", + "validate_decimal", + "validate_const", + "validate_float", + "validate_int", + "cast_partial", +] + +_dynamic_imports: dict[str, str] = { + "BackoffStrategy": ".retries", + "FieldMetadata": ".metadata", + "find_metadata": ".metadata", + "FormMetadata": ".metadata", + "generate_url": ".url", + "get_body_content": ".logger", + "get_default_logger": ".logger", + "get_discriminator": ".annotations", + "parse_datetime": ".datetimes", + "get_global_from_env": ".values", + "get_headers": ".headers", + "get_pydantic_model": ".serializers", + "get_query_params": ".queryparams", + "get_response_headers": ".headers", + "get_security": ".security", + "HeaderMetadata": ".metadata", + "Logger": ".logger", + "marshal_json": ".serializers", + "match_content_type": ".values", + "match_status_codes": ".values", + "match_response": ".values", + "MultipartFormMetadata": ".metadata", + "OpenEnumMeta": ".enums", + "parse_open_union": ".unions", + "PathParamMetadata": ".metadata", + "QueryParamMetadata": ".metadata", + "remove_suffix": ".url", + "Retries": ".retries", + "retry": ".retries", + "retry_async": ".retries", + "RetryConfig": ".retries", + "RequestMetadata": ".metadata", + "SecurityMetadata": ".metadata", + "serialize_decimal": ".serializers", + "serialize_float": ".serializers", + "serialize_int": ".serializers", + "serialize_request_body": ".requestbodies", + "SerializedRequestBody": ".requestbodies", + "stream_to_text": ".serializers", + "stream_to_text_async": ".serializers", + "stream_to_bytes": ".serializers", + "stream_to_bytes_async": ".serializers", + "template_url": ".url", + "unmarshal": ".serializers", + "unmarshal_json": ".serializers", + "validate_decimal": ".serializers", + "validate_const": ".serializers", + "validate_float": ".serializers", + "validate_int": ".serializers", + "cast_partial": ".values", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/packages/gcp/src/mistralai/gcp/client/utils/annotations.py b/packages/gcp/src/mistralai/gcp/client/utils/annotations.py new file mode 100644 index 00000000..12e0aa4f --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/annotations.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from enum import Enum +from typing import Any, Optional + + +def get_discriminator(model: Any, fieldname: str, key: str) -> str: + """ + Recursively search for the discriminator attribute in a model. + + Args: + model (Any): The model to search within. + fieldname (str): The name of the field to search for. + key (str): The key to search for in dictionaries. + + Returns: + str: The name of the discriminator attribute. + + Raises: + ValueError: If the discriminator attribute is not found. + """ + upper_fieldname = fieldname.upper() + + def get_field_discriminator(field: Any) -> Optional[str]: + """Search for the discriminator attribute in a given field.""" + + if isinstance(field, dict): + if key in field: + return f"{field[key]}" + + if hasattr(field, fieldname): + attr = getattr(field, fieldname) + if isinstance(attr, Enum): + return f"{attr.value}" + return f"{attr}" + + if hasattr(field, upper_fieldname): + attr = getattr(field, upper_fieldname) + if isinstance(attr, Enum): + return f"{attr.value}" + return f"{attr}" + + return None + + def search_nested_discriminator(obj: Any) -> Optional[str]: + """Recursively search for discriminator in nested structures.""" + # First try direct field lookup + discriminator = get_field_discriminator(obj) + if discriminator is not None: + return discriminator + + # If it's a dict, search in nested values + if isinstance(obj, dict): + for value in obj.values(): + if isinstance(value, list): + # Search in list items + for item in value: + nested_discriminator = search_nested_discriminator(item) + if nested_discriminator is not None: + return nested_discriminator + elif isinstance(value, dict): + # Search in nested dict + nested_discriminator = search_nested_discriminator(value) + if nested_discriminator is not None: + return nested_discriminator + + return None + + if isinstance(model, list): + for field in model: + discriminator = search_nested_discriminator(field) + if discriminator is not None: + return discriminator + + discriminator = search_nested_discriminator(model) + if discriminator is not None: + return discriminator + + raise ValueError(f"Could not find discriminator field {fieldname} in {model}") diff --git a/src/mistralai/utils/datetimes.py b/packages/gcp/src/mistralai/gcp/client/utils/datetimes.py similarity index 100% rename from src/mistralai/utils/datetimes.py rename to packages/gcp/src/mistralai/gcp/client/utils/datetimes.py diff --git a/packages/gcp/src/mistralai/gcp/client/utils/dynamic_imports.py b/packages/gcp/src/mistralai/gcp/client/utils/dynamic_imports.py new file mode 100644 index 00000000..673edf82 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/dynamic_imports.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from importlib import import_module +import builtins +import sys + + +def dynamic_import(package, modname, retries=3): + """Import a module relative to package, retrying on KeyError from half-initialized modules.""" + for attempt in range(retries): + try: + return import_module(modname, package) + except KeyError: + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + +def lazy_getattr(attr_name, *, package, dynamic_imports, sub_packages=None): + """Module-level __getattr__ that lazily loads from a dynamic_imports mapping. + + Args: + attr_name: The attribute being looked up. + package: The caller's __package__ (for relative imports). + dynamic_imports: Dict mapping attribute names to relative module paths. + sub_packages: Optional list of subpackage names to lazy-load. + """ + module_name = dynamic_imports.get(attr_name) + if module_name is not None: + try: + module = dynamic_import(package, module_name) + return getattr(module, attr_name) + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + if sub_packages and attr_name in sub_packages: + return import_module(f".{attr_name}", package) + + raise AttributeError(f"module '{package}' has no attribute '{attr_name}'") + + +def lazy_dir(*, dynamic_imports, sub_packages=None): + """Module-level __dir__ that lists lazily-loadable attributes.""" + lazy_attrs = builtins.list(dynamic_imports.keys()) + if sub_packages: + lazy_attrs.extend(sub_packages) + return builtins.sorted(lazy_attrs) diff --git a/packages/gcp/src/mistralai/gcp/client/utils/enums.py b/packages/gcp/src/mistralai/gcp/client/utils/enums.py new file mode 100644 index 00000000..3324e1bc --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/enums.py @@ -0,0 +1,134 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import enum +import sys +from typing import Any + +from pydantic_core import core_schema + + +class OpenEnumMeta(enum.EnumMeta): + # The __call__ method `boundary` kwarg was added in 3.11 and must be present + # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 + # pylint: disable=unexpected-keyword-arg + # The __call__ method `values` varg must be named for pyright. + # pylint: disable=keyword-arg-before-vararg + + if sys.version_info >= (3, 11): + def __call__( + cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + except ValueError: + return value + else: + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value + + def __new__(mcs, name, bases, namespace, **kwargs): + cls = super().__new__(mcs, name, bases, namespace, **kwargs) + + # Add __get_pydantic_core_schema__ to make open enums work correctly + # in union discrimination. In strict mode (used by Pydantic for unions), + # only known enum values match. In lax mode, unknown values are accepted. + def __get_pydantic_core_schema__( + cls_inner: Any, _source_type: Any, _handler: Any + ) -> core_schema.CoreSchema: + # Create a validator that only accepts known enum values (for strict mode) + def validate_strict(v: Any) -> Any: + if isinstance(v, cls_inner): + return v + # Use the parent EnumMeta's __call__ which raises ValueError for unknown values + return enum.EnumMeta.__call__(cls_inner, v) + + # Create a lax validator that accepts unknown values + def validate_lax(v: Any) -> Any: + if isinstance(v, cls_inner): + return v + try: + return enum.EnumMeta.__call__(cls_inner, v) + except ValueError: + # Return the raw value for unknown enum values + return v + + # Determine the base type schema (str or int) + is_int_enum = False + for base in cls_inner.__mro__: + if base is int: + is_int_enum = True + break + if base is str: + break + + base_schema = ( + core_schema.int_schema() + if is_int_enum + else core_schema.str_schema() + ) + + # Use lax_or_strict_schema: + # - strict mode: only known enum values match (raises ValueError for unknown) + # - lax mode: accept any value, return enum member or raw value + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema( + [base_schema, core_schema.no_info_plain_validator_function(validate_lax)] + ), + strict_schema=core_schema.chain_schema( + [base_schema, core_schema.no_info_plain_validator_function(validate_strict)] + ), + ) + + setattr(cls, "__get_pydantic_core_schema__", classmethod(__get_pydantic_core_schema__)) + return cls diff --git a/packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py b/packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py new file mode 100644 index 00000000..f2052fc2 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/eventstreaming.py @@ -0,0 +1,280 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import re +import json +from dataclasses import dataclass, asdict +from typing import ( + Any, + Callable, + Generic, + TypeVar, + Optional, + Generator, + AsyncGenerator, + Tuple, +) +import httpx + +T = TypeVar("T") + + +class EventStream(Generic[T]): + # Holds a reference to the SDK client to avoid it being garbage collected + # and cause termination of the underlying httpx client. + client_ref: Optional[object] + response: httpx.Response + generator: Generator[T, None, None] + _closed: bool + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + client_ref: Optional[object] = None, + ): + self.response = response + self.generator = stream_events(response, decoder, sentinel) + self.client_ref = client_ref + self._closed = False + + def __iter__(self): + return self + + def __next__(self): + if self._closed: + raise StopIteration + return next(self.generator) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self._closed = True + self.response.close() + + +class EventStreamAsync(Generic[T]): + # Holds a reference to the SDK client to avoid it being garbage collected + # and cause termination of the underlying httpx client. + client_ref: Optional[object] + response: httpx.Response + generator: AsyncGenerator[T, None] + _closed: bool + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + client_ref: Optional[object] = None, + ): + self.response = response + self.generator = stream_events_async(response, decoder, sentinel) + self.client_ref = client_ref + self._closed = False + + def __aiter__(self): + return self + + async def __anext__(self): + if self._closed: + raise StopAsyncIteration + return await self.generator.__anext__() + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + self._closed = True + await self.response.aclose() + + +@dataclass +class ServerEvent: + id: Optional[str] = None + event: Optional[str] = None + data: Any = None + retry: Optional[int] = None + + +MESSAGE_BOUNDARIES = [ + b"\r\n\r\n", + b"\r\n\r", + b"\r\n\n", + b"\r\r\n", + b"\n\r\n", + b"\r\r", + b"\n\r", + b"\n\n", +] + +UTF8_BOM = b"\xef\xbb\xbf" + + +async def stream_events_async( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> AsyncGenerator[T, None]: + buffer = bytearray() + position = 0 + event_id: Optional[str] = None + async for chunk in response.aiter_bytes(): + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard, event_id = _parse_event( + raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + ) + if event is not None: + yield event + if discard: + await response.aclose() + return + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard, _ = _parse_event( + raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + ) + if event is not None: + yield event + + +def stream_events( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> Generator[T, None, None]: + buffer = bytearray() + position = 0 + event_id: Optional[str] = None + for chunk in response.iter_bytes(): + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard, event_id = _parse_event( + raw=block, decoder=decoder, sentinel=sentinel, event_id=event_id + ) + if event is not None: + yield event + if discard: + response.close() + return + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard, _ = _parse_event( + raw=buffer, decoder=decoder, sentinel=sentinel, event_id=event_id + ) + if event is not None: + yield event + + +def _parse_event( + *, + raw: bytearray, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + event_id: Optional[str] = None, +) -> Tuple[Optional[T], bool, Optional[str]]: + block = raw.decode() + lines = re.split(r"\r?\n|\r", block) + publish = False + event = ServerEvent() + data = "" + for line in lines: + if not line: + continue + + delim = line.find(":") + if delim == 0: + continue + + field = line + value = "" + if delim > 0: + field = line[0:delim] + value = line[delim + 1 :] if delim < len(line) - 1 else "" + if len(value) and value[0] == " ": + value = value[1:] + + if field == "event": + event.event = value + publish = True + elif field == "data": + data += value + "\n" + publish = True + elif field == "id": + publish = True + if "\x00" not in value: + event_id = value + elif field == "retry": + if value.isdigit(): + event.retry = int(value) + publish = True + + event.id = event_id + + if sentinel and data == f"{sentinel}\n": + return None, True, event_id + + if data: + data = data[:-1] + try: + event.data = json.loads(data) + except json.JSONDecodeError: + event.data = data + + out = None + if publish: + out_dict = { + k: v + for k, v in asdict(event).items() + if v is not None or (k == "data" and data) + } + out = decoder(json.dumps(out_dict)) + + return out, False, event_id + + +def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): + if len(sequence) > (len(buffer) - position): + return None + + for i, seq in enumerate(sequence): + if buffer[position + i] != seq: + return None + + return sequence diff --git a/packages/gcp/src/mistralai/gcp/client/utils/forms.py b/packages/gcp/src/mistralai/gcp/client/utils/forms.py new file mode 100644 index 00000000..1e550bd5 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/forms.py @@ -0,0 +1,234 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .serializers import marshal_json + +from .metadata import ( + FormMetadata, + MultipartFormMetadata, + find_field_metadata, +) +from .values import _is_set, _val_to_string + + +def _populate_form( + field_name: str, + explode: bool, + obj: Any, + delimiter: str, + form: Dict[str, List[str]], +): + if not _is_set(obj): + return form + + if isinstance(obj, BaseModel): + items = [] + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_field_name = obj_field.alias if obj_field.alias is not None else name + if obj_field_name == "": + continue + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + form[obj_field_name] = [_val_to_string(val)] + else: + items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, Dict): + items = [] + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + form[key] = [_val_to_string(value)] + else: + items.append(f"{key}{delimiter}{_val_to_string(value)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + if explode: + if not field_name in form: + form[field_name] = [] + form[field_name].append(_val_to_string(value)) + else: + items.append(_val_to_string(value)) + + if len(items) > 0: + form[field_name] = [delimiter.join([str(item) for item in items])] + else: + form[field_name] = [_val_to_string(obj)] + + return form + + +def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: + """Extract file name, content, and content type from a file object.""" + file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields + + file_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(file_obj, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(file_obj, file_field_name, None) + else: + file_name = getattr(file_obj, file_field_name) + + if file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + return file_name, content, content_type + + +def serialize_multipart_form( + media_type: str, request: Any +) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: + form: Dict[str, Any] = {} + files: List[Tuple[str, Any]] = [] + + if not isinstance(request, BaseModel): + raise TypeError("invalid request body type") + + request_fields: Dict[str, FieldInfo] = request.__class__.model_fields + request_field_types = get_type_hints(request.__class__) + + for name in request_fields: + field = request_fields[name] + + val = getattr(request, name) + if not _is_set(val): + continue + + field_metadata = find_field_metadata(field, MultipartFormMetadata) + if not field_metadata: + continue + + f_name = field.alias if field.alias else name + + if field_metadata.file: + if isinstance(val, List): + # Handle array of files + array_field_name = f_name + for file_obj in val: + if not _is_set(file_obj): + continue + + file_name, content, content_type = _extract_file_properties( + file_obj + ) + + if content_type is not None: + files.append( + (array_field_name, (file_name, content, content_type)) + ) + else: + files.append((array_field_name, (file_name, content))) + else: + # Handle single file + file_name, content, content_type = _extract_file_properties(val) + + if content_type is not None: + files.append((f_name, (file_name, content, content_type))) + else: + files.append((f_name, (file_name, content))) + elif field_metadata.json: + files.append( + ( + f_name, + ( + None, + marshal_json(val, request_field_types[name]), + "application/json", + ), + ) + ) + else: + if isinstance(val, List): + values = [] + + for value in val: + if not _is_set(value): + continue + values.append(_val_to_string(value)) + + array_field_name = f_name + form[array_field_name] = values + else: + form[f_name] = _val_to_string(val) + return media_type, form, files + + +def serialize_form_data(data: Any) -> Dict[str, Any]: + form: Dict[str, List[str]] = {} + + if isinstance(data, BaseModel): + data_fields: Dict[str, FieldInfo] = data.__class__.model_fields + data_field_types = get_type_hints(data.__class__) + for name in data_fields: + field = data_fields[name] + + val = getattr(data, name) + if not _is_set(val): + continue + + metadata = find_field_metadata(field, FormMetadata) + if metadata is None: + continue + + f_name = field.alias if field.alias is not None else name + + if metadata.json: + form[f_name] = [marshal_json(val, data_field_types[name])] + else: + if metadata.style == "form": + _populate_form( + f_name, + metadata.explode, + val, + ",", + form, + ) + else: + raise ValueError(f"Invalid form style for field {name}") + elif isinstance(data, Dict): + for key, value in data.items(): + if _is_set(value): + form[key] = [_val_to_string(value)] + else: + raise TypeError(f"Invalid request body type {type(data)} for form data") + + return form diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/headers.py b/packages/gcp/src/mistralai/gcp/client/utils/headers.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/headers.py rename to packages/gcp/src/mistralai/gcp/client/utils/headers.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/logger.py b/packages/gcp/src/mistralai/gcp/client/utils/logger.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/logger.py rename to packages/gcp/src/mistralai/gcp/client/utils/logger.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/metadata.py b/packages/gcp/src/mistralai/gcp/client/utils/metadata.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/metadata.py rename to packages/gcp/src/mistralai/gcp/client/utils/metadata.py diff --git a/packages/gcp/src/mistralai/gcp/client/utils/queryparams.py b/packages/gcp/src/mistralai/gcp/client/utils/queryparams.py new file mode 100644 index 00000000..c04e0db8 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/queryparams.py @@ -0,0 +1,217 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, +) + +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + QueryParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) +from .forms import _populate_form + + +def get_query_params( + query_params: Any, + gbls: Optional[Any] = None, + allow_empty_value: Optional[List[str]] = None, +) -> Dict[str, List[str]]: + params: Dict[str, List[str]] = {} + + globals_already_populated = _populate_query_params(query_params, gbls, params, [], allow_empty_value) + if _is_set(gbls): + _populate_query_params(gbls, None, params, globals_already_populated, allow_empty_value) + + return params + + +def _populate_query_params( + query_params: Any, + gbls: Any, + query_param_values: Dict[str, List[str]], + skip_fields: List[str], + allow_empty_value: Optional[List[str]] = None, +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(query_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields + param_field_types = get_type_hints(query_params.__class__) + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + + metadata = find_field_metadata(field, QueryParamMetadata) + if not metadata: + continue + + value = getattr(query_params, name) if _is_set(query_params) else None + + value, global_found = _populate_from_globals( + name, value, QueryParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + f_name = field.alias if field.alias is not None else name + + allow_empty_set = set(allow_empty_value or []) + should_include_empty = f_name in allow_empty_set and ( + value is None or value == [] or value == "" + ) + + if should_include_empty: + query_param_values[f_name] = [""] + continue + + serialization = metadata.serialization + if serialization is not None: + serialized_parms = _get_serialized_params( + metadata, f_name, value, param_field_types[name] + ) + for key, value in serialized_parms.items(): + if key in query_param_values: + query_param_values[key].extend(value) + else: + query_param_values[key] = [value] + else: + style = metadata.style + if style == "deepObject": + _populate_deep_object_query_params(f_name, value, query_param_values) + elif style == "form": + _populate_delimited_query_params( + metadata, f_name, value, ",", query_param_values + ) + elif style == "pipeDelimited": + _populate_delimited_query_params( + metadata, f_name, value, "|", query_param_values + ) + else: + raise NotImplementedError( + f"query param style {style} not yet supported" + ) + + return globals_already_populated + + +def _populate_deep_object_query_params( + field_name: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj): + return + + if isinstance(obj, BaseModel): + _populate_deep_object_query_params_basemodel(field_name, obj, params) + elif isinstance(obj, Dict): + _populate_deep_object_query_params_dict(field_name, obj, params) + + +def _populate_deep_object_query_params_basemodel( + prior_params_key: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj) or not isinstance(obj, BaseModel): + return + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + + f_name = obj_field.alias if obj_field.alias is not None else name + + params_key = f"{prior_params_key}[{f_name}]" + + obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) + if not _is_set(obj_param_metadata): + continue + + obj_val = getattr(obj, name) + if not _is_set(obj_val): + continue + + if isinstance(obj_val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, obj_val, params) + elif isinstance(obj_val, Dict): + _populate_deep_object_query_params_dict(params_key, obj_val, params) + elif isinstance(obj_val, List): + _populate_deep_object_query_params_list(params_key, obj_val, params) + else: + params[params_key] = [_val_to_string(obj_val)] + + +def _populate_deep_object_query_params_dict( + prior_params_key: str, + value: Dict, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for key, val in value.items(): + if not _is_set(val): + continue + + params_key = f"{prior_params_key}[{key}]" + + if isinstance(val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, val, params) + elif isinstance(val, Dict): + _populate_deep_object_query_params_dict(params_key, val, params) + elif isinstance(val, List): + _populate_deep_object_query_params_list(params_key, val, params) + else: + params[params_key] = [_val_to_string(val)] + + +def _populate_deep_object_query_params_list( + params_key: str, + value: List, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for val in value: + if not _is_set(val): + continue + + if params.get(params_key) is None: + params[params_key] = [] + + params[params_key].append(_val_to_string(val)) + + +def _populate_delimited_query_params( + metadata: QueryParamMetadata, + field_name: str, + obj: Any, + delimiter: str, + query_param_values: Dict[str, List[str]], +): + _populate_form( + field_name, + metadata.explode, + obj, + delimiter, + query_param_values, + ) diff --git a/packages/gcp/src/mistralai/gcp/client/utils/requestbodies.py b/packages/gcp/src/mistralai/gcp/client/utils/requestbodies.py new file mode 100644 index 00000000..1de32b6d --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/requestbodies.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import io +from dataclasses import dataclass +import re +from typing import ( + Any, + Optional, +) + +from .forms import serialize_form_data, serialize_multipart_form + +from .serializers import marshal_json + +SERIALIZATION_METHOD_TO_CONTENT_TYPE = { + "json": "application/json", + "form": "application/x-www-form-urlencoded", + "multipart": "multipart/form-data", + "raw": "application/octet-stream", + "string": "text/plain", +} + + +@dataclass +class SerializedRequestBody: + media_type: Optional[str] = None + content: Optional[Any] = None + data: Optional[Any] = None + files: Optional[Any] = None + + +def serialize_request_body( + request_body: Any, + nullable: bool, + optional: bool, + serialization_method: str, + request_body_type, +) -> Optional[SerializedRequestBody]: + if request_body is None: + if not nullable and optional: + return None + + media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] + + serialized_request_body = SerializedRequestBody(media_type) + + if re.match(r"^(application|text)\/([^+]+\+)*json.*", media_type) is not None: + serialized_request_body.content = marshal_json(request_body, request_body_type) + elif re.match(r"^multipart\/.*", media_type) is not None: + ( + serialized_request_body.media_type, + serialized_request_body.data, + serialized_request_body.files, + ) = serialize_multipart_form(media_type, request_body) + elif re.match(r"^application\/x-www-form-urlencoded.*", media_type) is not None: + serialized_request_body.data = serialize_form_data(request_body) + elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): + serialized_request_body.content = request_body + elif isinstance(request_body, str): + serialized_request_body.content = request_body + else: + raise TypeError( + f"invalid request body type {type(request_body)} for mediaType {media_type}" + ) + + return serialized_request_body diff --git a/packages/gcp/src/mistralai/gcp/client/utils/retries.py b/packages/gcp/src/mistralai/gcp/client/utils/retries.py new file mode 100644 index 00000000..af07d4e9 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/retries.py @@ -0,0 +1,271 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import asyncio +import random +import time +from datetime import datetime +from email.utils import parsedate_to_datetime +from typing import List, Optional + +import httpx + + +class BackoffStrategy: + initial_interval: int + max_interval: int + exponent: float + max_elapsed_time: int + + def __init__( + self, + initial_interval: int, + max_interval: int, + exponent: float, + max_elapsed_time: int, + ): + self.initial_interval = initial_interval + self.max_interval = max_interval + self.exponent = exponent + self.max_elapsed_time = max_elapsed_time + + +class RetryConfig: + strategy: str + backoff: BackoffStrategy + retry_connection_errors: bool + + def __init__( + self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool + ): + self.strategy = strategy + self.backoff = backoff + self.retry_connection_errors = retry_connection_errors + + +class Retries: + config: RetryConfig + status_codes: List[str] + + def __init__(self, config: RetryConfig, status_codes: List[str]): + self.config = config + self.status_codes = status_codes + + +class TemporaryError(Exception): + response: httpx.Response + retry_after: Optional[int] + + def __init__(self, response: httpx.Response): + self.response = response + self.retry_after = _parse_retry_after_header(response) + + +class PermanentError(Exception): + inner: Exception + + def __init__(self, inner: Exception): + self.inner = inner + + +def _parse_retry_after_header(response: httpx.Response) -> Optional[int]: + """Parse Retry-After header from response. + + Returns: + Retry interval in milliseconds, or None if header is missing or invalid. + """ + retry_after_header = response.headers.get("retry-after") + if not retry_after_header: + return None + + try: + seconds = float(retry_after_header) + return round(seconds * 1000) + except ValueError: + pass + + try: + retry_date = parsedate_to_datetime(retry_after_header) + delta = (retry_date - datetime.now(retry_date.tzinfo)).total_seconds() + return round(max(0, delta) * 1000) + except (ValueError, TypeError): + pass + + return None + + +def _get_sleep_interval( + exception: Exception, + initial_interval: int, + max_interval: int, + exponent: float, + retries: int, +) -> float: + """Get sleep interval for retry with exponential backoff. + + Args: + exception: The exception that triggered the retry. + initial_interval: Initial retry interval in milliseconds. + max_interval: Maximum retry interval in milliseconds. + exponent: Base for exponential backoff calculation. + retries: Current retry attempt count. + + Returns: + Sleep interval in seconds. + """ + if ( + isinstance(exception, TemporaryError) + and exception.retry_after is not None + and exception.retry_after > 0 + ): + return exception.retry_after / 1000 + + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + return min(sleep, max_interval / 1000) + + +def retry(func, retries: Retries): + if retries.config.strategy == "backoff": + + def do_request() -> httpx.Response: + res: httpx.Response + try: + res = func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except (httpx.NetworkError, httpx.TimeoutException) as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return retry_with_backoff( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return func() + + +async def retry_async(func, retries: Retries): + if retries.config.strategy == "backoff": + + async def do_request() -> httpx.Response: + res: httpx.Response + try: + res = await func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except (httpx.NetworkError, httpx.TimeoutException) as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return await retry_with_backoff_async( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return await func() + + +def retry_with_backoff( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + + sleep = _get_sleep_interval( + exception, initial_interval, max_interval, exponent, retries + ) + time.sleep(sleep) + retries += 1 + + +async def retry_with_backoff_async( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return await func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + + sleep = _get_sleep_interval( + exception, initial_interval, max_interval, exponent, retries + ) + await asyncio.sleep(sleep) + retries += 1 diff --git a/packages/gcp/src/mistralai/gcp/client/utils/security.py b/packages/gcp/src/mistralai/gcp/client/utils/security.py new file mode 100644 index 00000000..17996bd5 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/security.py @@ -0,0 +1,176 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import base64 +from typing import ( + Any, + Dict, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + SecurityMetadata, + find_field_metadata, +) + + +def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: + headers: Dict[str, str] = {} + query_params: Dict[str, List[str]] = {} + + if security is None: + return headers, query_params + + if not isinstance(security, BaseModel): + raise TypeError("security must be a pydantic model") + + sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields + for name in sec_fields: + sec_field = sec_fields[name] + + value = getattr(security, name) + if value is None: + continue + + metadata = find_field_metadata(sec_field, SecurityMetadata) + if metadata is None: + continue + if metadata.option: + _parse_security_option(headers, query_params, value) + return headers, query_params + if metadata.scheme: + # Special case for basic auth or custom auth which could be a flattened model + if metadata.sub_type in ["basic", "custom"] and not isinstance( + value, BaseModel + ): + _parse_security_scheme(headers, query_params, metadata, name, security) + else: + _parse_security_scheme(headers, query_params, metadata, name, value) + + return headers, query_params + + +def _parse_security_option( + headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any +): + if not isinstance(option, BaseModel): + raise TypeError("security option must be a pydantic model") + + opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields + for name in opt_fields: + opt_field = opt_fields[name] + + metadata = find_field_metadata(opt_field, SecurityMetadata) + if metadata is None or not metadata.scheme: + continue + _parse_security_scheme( + headers, query_params, metadata, name, getattr(option, name) + ) + + +def _parse_security_scheme( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + field_name: str, + scheme: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + if isinstance(scheme, BaseModel): + if scheme_type == "http": + if sub_type == "basic": + _parse_basic_auth_scheme(headers, scheme) + return + if sub_type == "custom": + return + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + value = getattr(scheme, name) + + _parse_security_scheme_value( + headers, query_params, scheme_metadata, metadata, name, value + ) + else: + _parse_security_scheme_value( + headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme + ) + + +def _parse_security_scheme_value( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + security_metadata: SecurityMetadata, + field_name: str, + value: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + header_name = security_metadata.get_field_name(field_name) + + if scheme_type == "apiKey": + if sub_type == "header": + headers[header_name] = value + elif sub_type == "query": + query_params[header_name] = [value] + else: + raise ValueError("sub type {sub_type} not supported") + elif scheme_type == "openIdConnect": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "oauth2": + if sub_type != "client_credentials": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "http": + if sub_type == "bearer": + headers[header_name] = _apply_bearer(value) + elif sub_type == "basic": + headers[header_name] = value + elif sub_type == "custom": + return + else: + raise ValueError("sub type {sub_type} not supported") + else: + raise ValueError("scheme type {scheme_type} not supported") + + +def _apply_bearer(token: str) -> str: + return token.lower().startswith("bearer ") and token or f"Bearer {token}" + + +def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): + username = "" + password = "" + + if not isinstance(scheme, BaseModel): + raise TypeError("basic auth scheme must be a pydantic model") + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + field_name = metadata.field_name + value = getattr(scheme, name) + + if field_name == "username": + username = value + if field_name == "password": + password = value + + data = f"{username}:{password}".encode() + headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/packages/gcp/src/mistralai/gcp/client/utils/serializers.py b/packages/gcp/src/mistralai/gcp/client/utils/serializers.py new file mode 100644 index 00000000..14321eb4 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/serializers.py @@ -0,0 +1,229 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from decimal import Decimal +import functools +import json +import typing +from typing import Any, Dict, List, Tuple, Union, get_args +import typing_extensions +from typing_extensions import get_origin + +import httpx +from pydantic import ConfigDict, create_model +from pydantic_core import from_json + +from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset + + +def serialize_decimal(as_str: bool): + def serialize(d): + # Optional[T] is a Union[T, None] + if is_union(type(d)) and type(None) in get_args(type(d)) and d is None: + return None + if isinstance(d, Unset): + return d + + if not isinstance(d, Decimal): + raise ValueError("Expected Decimal object") + + return str(d) if as_str else float(d) + + return serialize + + +def validate_decimal(d): + if d is None: + return None + + if isinstance(d, (Decimal, Unset)): + return d + + if not isinstance(d, (str, int, float)): + raise ValueError("Expected string, int or float") + + return Decimal(str(d)) + + +def serialize_float(as_str: bool): + def serialize(f): + # Optional[T] is a Union[T, None] + if is_union(type(f)) and type(None) in get_args(type(f)) and f is None: + return None + if isinstance(f, Unset): + return f + + if not isinstance(f, float): + raise ValueError("Expected float") + + return str(f) if as_str else f + + return serialize + + +def validate_float(f): + if f is None: + return None + + if isinstance(f, (float, Unset)): + return f + + if not isinstance(f, str): + raise ValueError("Expected string") + + return float(f) + + +def serialize_int(as_str: bool): + def serialize(i): + # Optional[T] is a Union[T, None] + if is_union(type(i)) and type(None) in get_args(type(i)) and i is None: + return None + if isinstance(i, Unset): + return i + + if not isinstance(i, int): + raise ValueError("Expected int") + + return str(i) if as_str else i + + return serialize + + +def validate_int(b): + if b is None: + return None + + if isinstance(b, (int, Unset)): + return b + + if not isinstance(b, str): + raise ValueError("Expected string") + + return int(b) + + +def validate_const(v): + def validate(c): + # Optional[T] is a Union[T, None] + if is_union(type(c)) and type(None) in get_args(type(c)) and c is None: + return None + + if v != c: + raise ValueError(f"Expected {v}") + + return c + + return validate + + +def unmarshal_json(raw, typ: Any) -> Any: + return unmarshal(from_json(raw), typ) + + +def unmarshal(val, typ: Any) -> Any: + unmarshaller = create_model( + "Unmarshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = unmarshaller(body=val) + + # pyright: ignore[reportAttributeAccessIssue] + return m.body # type: ignore + + +def marshal_json(val, typ): + if is_nullable(typ) and val is None: + return "null" + + marshaller = create_model( + "Marshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = marshaller(body=val) + + d = m.model_dump(by_alias=True, mode="json", exclude_none=True) + + if len(d) == 0: + return "" + + return json.dumps(d[next(iter(d))], separators=(",", ":")) + + +def is_nullable(field): + origin = get_origin(field) + if origin is Nullable or origin is OptionalNullable: + return True + + if not origin is Union or type(None) not in get_args(field): + return False + + for arg in get_args(field): + if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: + return True + + return False + + +def is_union(obj: object) -> bool: + """ + Returns True if the given object is a typing.Union or typing_extensions.Union. + """ + return any( + obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union") + ) + + +def stream_to_text(stream: httpx.Response) -> str: + return "".join(stream.iter_text()) + + +async def stream_to_text_async(stream: httpx.Response) -> str: + return "".join([chunk async for chunk in stream.aiter_text()]) + + +def stream_to_bytes(stream: httpx.Response) -> bytes: + return stream.content + + +async def stream_to_bytes_async(stream: httpx.Response) -> bytes: + return await stream.aread() + + +def get_pydantic_model(data: Any, typ: Any) -> Any: + if not _contains_pydantic_model(data): + return unmarshal(data, typ) + + return data + + +def _contains_pydantic_model(data: Any) -> bool: + if isinstance(data, BaseModel): + return True + if isinstance(data, List): + return any(_contains_pydantic_model(item) for item in data) + if isinstance(data, Dict): + return any(_contains_pydantic_model(value) for value in data.values()) + + return False + + +@functools.cache +def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: + """ + Get typing objects by name from typing and typing_extensions. + Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types + """ + result = tuple( + getattr(module, name) + for module in (typing, typing_extensions) + if hasattr(module, name) + ) + if not result: + raise ValueError( + f"Neither typing nor typing_extensions has an object called {name!r}" + ) + return result diff --git a/packages/gcp/src/mistralai/gcp/client/utils/unions.py b/packages/gcp/src/mistralai/gcp/client/utils/unions.py new file mode 100644 index 00000000..a227f4e8 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/unions.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any + +from pydantic import BaseModel, TypeAdapter + + +def parse_open_union( + v: Any, + *, + disc_key: str, + variants: dict[str, Any], + unknown_cls: type, + union_name: str, +) -> Any: + """Parse an open discriminated union value with forward-compatibility. + + Known discriminator values are dispatched to their variant types. + Unknown discriminator values produce an instance of the fallback class, + preserving the raw payload for inspection. + """ + if isinstance(v, BaseModel): + return v + if not isinstance(v, dict) or disc_key not in v: + raise ValueError(f"{union_name}: expected object with '{disc_key}' field") + disc = v[disc_key] + variant_cls = variants.get(disc) + if variant_cls is not None: + if isinstance(variant_cls, type) and issubclass(variant_cls, BaseModel): + return variant_cls.model_validate(v) + return TypeAdapter(variant_cls).validate_python(v) + return unknown_cls(raw=v) diff --git a/packages/gcp/src/mistralai/gcp/client/utils/unmarshal_json_response.py b/packages/gcp/src/mistralai/gcp/client/utils/unmarshal_json_response.py new file mode 100644 index 00000000..ead3e5a0 --- /dev/null +++ b/packages/gcp/src/mistralai/gcp/client/utils/unmarshal_json_response.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Any, Optional, Type, TypeVar, overload + +import httpx + +from .serializers import unmarshal_json +from mistralai.gcp.client import errors + +T = TypeVar("T") + + +@overload +def unmarshal_json_response( + typ: Type[T], http_res: httpx.Response, body: Optional[str] = None +) -> T: ... + + +@overload +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: ... + + +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: + if body is None: + body = http_res.text + try: + return unmarshal_json(body, typ) + except Exception as e: + raise errors.ResponseValidationError( + "Response validation failed", + http_res, + e, + body, + ) from e diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/url.py b/packages/gcp/src/mistralai/gcp/client/utils/url.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/url.py rename to packages/gcp/src/mistralai/gcp/client/utils/url.py diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/values.py b/packages/gcp/src/mistralai/gcp/client/utils/values.py similarity index 100% rename from packages/mistralai_gcp/src/mistralai_gcp/utils/values.py rename to packages/gcp/src/mistralai/gcp/client/utils/values.py diff --git a/packages/gcp/uv.lock b/packages/gcp/uv.lock new file mode 100644 index 00000000..3fca8e89 --- /dev/null +++ b/packages/gcp/uv.lock @@ -0,0 +1,774 @@ +version = 1 +revision = 3 +requires-python = ">=3.10" +resolution-markers = [ + "python_full_version >= '3.12'", + "python_full_version == '3.11.*'", + "python_full_version < '3.11'", +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "anyio" +version = "4.12.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/16/ce/8a777047513153587e5434fd752e89334ac33e379aa3497db860eeb60377/anyio-4.12.0.tar.gz", hash = "sha256:73c693b567b0c55130c104d0b43a9baf3aa6a31fc6110116509f27bf75e21ec0", size = 228266, upload-time = "2025-11-28T23:37:38.911Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/9c/36c5c37947ebfb8c7f22e0eb6e4d188ee2d53aa3880f3f2744fb894f0cb1/anyio-4.12.0-py3-none-any.whl", hash = "sha256:dad2376a628f98eeca4881fc56cd06affd18f659b17a747d3ff0307ced94b1bb", size = 113362, upload-time = "2025-11-28T23:36:57.897Z" }, +] + +[[package]] +name = "astroid" +version = "3.2.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/53/1067e1113ecaf58312357f2cd93063674924119d80d173adc3f6f2387aa2/astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a", size = 397576, upload-time = "2024-07-20T12:57:43.26Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/80/96/b32bbbb46170a1c8b8b1f28c794202e25cfe743565e9d3469b8eb1e0cc05/astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25", size = 276348, upload-time = "2024-07-20T12:57:40.886Z" }, +] + +[[package]] +name = "cachetools" +version = "6.2.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bc/1d/ede8680603f6016887c062a2cf4fc8fdba905866a3ab8831aa8aa651320c/cachetools-6.2.4.tar.gz", hash = "sha256:82c5c05585e70b6ba2d3ae09ea60b79548872185d2f24ae1f2709d37299fd607", size = 31731, upload-time = "2025-12-15T18:24:53.744Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/fc/1d7b80d0eb7b714984ce40efc78859c022cd930e402f599d8ca9e39c78a4/cachetools-6.2.4-py3-none-any.whl", hash = "sha256:69a7a52634fed8b8bf6e24a050fb60bff1c9bd8f6d24572b99c32d4e71e62a51", size = 11551, upload-time = "2025-12-15T18:24:52.332Z" }, +] + +[[package]] +name = "certifi" +version = "2025.11.12" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/8c/58f469717fa48465e4a50c014a0400602d3c437d7c0c468e17ada824da3a/certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316", size = 160538, upload-time = "2025-11-12T02:54:51.517Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/70/7d/9bc192684cea499815ff478dfcdc13835ddf401365057044fb721ec6bddb/certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b", size = 159438, upload-time = "2025-11-12T02:54:49.735Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz", hash = "sha256:94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a", size = 129418, upload-time = "2025-10-14T04:42:32.879Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1f/b8/6d51fc1d52cbd52cd4ccedd5b5b2f0f6a11bbf6765c782298b0f3e808541/charset_normalizer-3.4.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e824f1492727fa856dd6eda4f7cee25f8518a12f3c4a56a74e8095695089cf6d", size = 209709, upload-time = "2025-10-14T04:40:11.385Z" }, + { url = "https://files.pythonhosted.org/packages/5c/af/1f9d7f7faafe2ddfb6f72a2e07a548a629c61ad510fe60f9630309908fef/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4bd5d4137d500351a30687c2d3971758aac9a19208fc110ccb9d7188fbe709e8", size = 148814, upload-time = "2025-10-14T04:40:13.135Z" }, + { url = "https://files.pythonhosted.org/packages/79/3d/f2e3ac2bbc056ca0c204298ea4e3d9db9b4afe437812638759db2c976b5f/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:027f6de494925c0ab2a55eab46ae5129951638a49a34d87f4c3eda90f696b4ad", size = 144467, upload-time = "2025-10-14T04:40:14.728Z" }, + { url = "https://files.pythonhosted.org/packages/ec/85/1bf997003815e60d57de7bd972c57dc6950446a3e4ccac43bc3070721856/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f820802628d2694cb7e56db99213f930856014862f3fd943d290ea8438d07ca8", size = 162280, upload-time = "2025-10-14T04:40:16.14Z" }, + { url = "https://files.pythonhosted.org/packages/3e/8e/6aa1952f56b192f54921c436b87f2aaf7c7a7c3d0d1a765547d64fd83c13/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:798d75d81754988d2565bff1b97ba5a44411867c0cf32b77a7e8f8d84796b10d", size = 159454, upload-time = "2025-10-14T04:40:17.567Z" }, + { url = "https://files.pythonhosted.org/packages/36/3b/60cbd1f8e93aa25d1c669c649b7a655b0b5fb4c571858910ea9332678558/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d1bb833febdff5c8927f922386db610b49db6e0d4f4ee29601d71e7c2694313", size = 153609, upload-time = "2025-10-14T04:40:19.08Z" }, + { url = "https://files.pythonhosted.org/packages/64/91/6a13396948b8fd3c4b4fd5bc74d045f5637d78c9675585e8e9fbe5636554/charset_normalizer-3.4.4-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9cd98cdc06614a2f768d2b7286d66805f94c48cde050acdbbb7db2600ab3197e", size = 151849, upload-time = "2025-10-14T04:40:20.607Z" }, + { url = "https://files.pythonhosted.org/packages/b7/7a/59482e28b9981d105691e968c544cc0df3b7d6133152fb3dcdc8f135da7a/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:077fbb858e903c73f6c9db43374fd213b0b6a778106bc7032446a8e8b5b38b93", size = 151586, upload-time = "2025-10-14T04:40:21.719Z" }, + { url = "https://files.pythonhosted.org/packages/92/59/f64ef6a1c4bdd2baf892b04cd78792ed8684fbc48d4c2afe467d96b4df57/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:244bfb999c71b35de57821b8ea746b24e863398194a4014e4c76adc2bbdfeff0", size = 145290, upload-time = "2025-10-14T04:40:23.069Z" }, + { url = "https://files.pythonhosted.org/packages/6b/63/3bf9f279ddfa641ffa1962b0db6a57a9c294361cc2f5fcac997049a00e9c/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:64b55f9dce520635f018f907ff1b0df1fdc31f2795a922fb49dd14fbcdf48c84", size = 163663, upload-time = "2025-10-14T04:40:24.17Z" }, + { url = "https://files.pythonhosted.org/packages/ed/09/c9e38fc8fa9e0849b172b581fd9803bdf6e694041127933934184e19f8c3/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:faa3a41b2b66b6e50f84ae4a68c64fcd0c44355741c6374813a800cd6695db9e", size = 151964, upload-time = "2025-10-14T04:40:25.368Z" }, + { url = "https://files.pythonhosted.org/packages/d2/d1/d28b747e512d0da79d8b6a1ac18b7ab2ecfd81b2944c4c710e166d8dd09c/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6515f3182dbe4ea06ced2d9e8666d97b46ef4c75e326b79bb624110f122551db", size = 161064, upload-time = "2025-10-14T04:40:26.806Z" }, + { url = "https://files.pythonhosted.org/packages/bb/9a/31d62b611d901c3b9e5500c36aab0ff5eb442043fb3a1c254200d3d397d9/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:cc00f04ed596e9dc0da42ed17ac5e596c6ccba999ba6bd92b0e0aef2f170f2d6", size = 155015, upload-time = "2025-10-14T04:40:28.284Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f3/107e008fa2bff0c8b9319584174418e5e5285fef32f79d8ee6a430d0039c/charset_normalizer-3.4.4-cp310-cp310-win32.whl", hash = "sha256:f34be2938726fc13801220747472850852fe6b1ea75869a048d6f896838c896f", size = 99792, upload-time = "2025-10-14T04:40:29.613Z" }, + { url = "https://files.pythonhosted.org/packages/eb/66/e396e8a408843337d7315bab30dbf106c38966f1819f123257f5520f8a96/charset_normalizer-3.4.4-cp310-cp310-win_amd64.whl", hash = "sha256:a61900df84c667873b292c3de315a786dd8dac506704dea57bc957bd31e22c7d", size = 107198, upload-time = "2025-10-14T04:40:30.644Z" }, + { url = "https://files.pythonhosted.org/packages/b5/58/01b4f815bf0312704c267f2ccb6e5d42bcc7752340cd487bc9f8c3710597/charset_normalizer-3.4.4-cp310-cp310-win_arm64.whl", hash = "sha256:cead0978fc57397645f12578bfd2d5ea9138ea0fac82b2f63f7f7c6877986a69", size = 100262, upload-time = "2025-10-14T04:40:32.108Z" }, + { url = "https://files.pythonhosted.org/packages/ed/27/c6491ff4954e58a10f69ad90aca8a1b6fe9c5d3c6f380907af3c37435b59/charset_normalizer-3.4.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e1fcf0720908f200cd21aa4e6750a48ff6ce4afe7ff5a79a90d5ed8a08296f8", size = 206988, upload-time = "2025-10-14T04:40:33.79Z" }, + { url = "https://files.pythonhosted.org/packages/94/59/2e87300fe67ab820b5428580a53cad894272dbb97f38a7a814a2a1ac1011/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f819d5fe9234f9f82d75bdfa9aef3a3d72c4d24a6e57aeaebba32a704553aa0", size = 147324, upload-time = "2025-10-14T04:40:34.961Z" }, + { url = "https://files.pythonhosted.org/packages/07/fb/0cf61dc84b2b088391830f6274cb57c82e4da8bbc2efeac8c025edb88772/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a59cb51917aa591b1c4e6a43c132f0cdc3c76dbad6155df4e28ee626cc77a0a3", size = 142742, upload-time = "2025-10-14T04:40:36.105Z" }, + { url = "https://files.pythonhosted.org/packages/62/8b/171935adf2312cd745d290ed93cf16cf0dfe320863ab7cbeeae1dcd6535f/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8ef3c867360f88ac904fd3f5e1f902f13307af9052646963ee08ff4f131adafc", size = 160863, upload-time = "2025-10-14T04:40:37.188Z" }, + { url = "https://files.pythonhosted.org/packages/09/73/ad875b192bda14f2173bfc1bc9a55e009808484a4b256748d931b6948442/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d9e45d7faa48ee908174d8fe84854479ef838fc6a705c9315372eacbc2f02897", size = 157837, upload-time = "2025-10-14T04:40:38.435Z" }, + { url = "https://files.pythonhosted.org/packages/6d/fc/de9cce525b2c5b94b47c70a4b4fb19f871b24995c728e957ee68ab1671ea/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:840c25fb618a231545cbab0564a799f101b63b9901f2569faecd6b222ac72381", size = 151550, upload-time = "2025-10-14T04:40:40.053Z" }, + { url = "https://files.pythonhosted.org/packages/55/c2/43edd615fdfba8c6f2dfbd459b25a6b3b551f24ea21981e23fb768503ce1/charset_normalizer-3.4.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ca5862d5b3928c4940729dacc329aa9102900382fea192fc5e52eb69d6093815", size = 149162, upload-time = "2025-10-14T04:40:41.163Z" }, + { url = "https://files.pythonhosted.org/packages/03/86/bde4ad8b4d0e9429a4e82c1e8f5c659993a9a863ad62c7df05cf7b678d75/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d9c7f57c3d666a53421049053eaacdd14bbd0a528e2186fcb2e672effd053bb0", size = 150019, upload-time = "2025-10-14T04:40:42.276Z" }, + { url = "https://files.pythonhosted.org/packages/1f/86/a151eb2af293a7e7bac3a739b81072585ce36ccfb4493039f49f1d3cae8c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:277e970e750505ed74c832b4bf75dac7476262ee2a013f5574dd49075879e161", size = 143310, upload-time = "2025-10-14T04:40:43.439Z" }, + { url = "https://files.pythonhosted.org/packages/b5/fe/43dae6144a7e07b87478fdfc4dbe9efd5defb0e7ec29f5f58a55aeef7bf7/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:31fd66405eaf47bb62e8cd575dc621c56c668f27d46a61d975a249930dd5e2a4", size = 162022, upload-time = "2025-10-14T04:40:44.547Z" }, + { url = "https://files.pythonhosted.org/packages/80/e6/7aab83774f5d2bca81f42ac58d04caf44f0cc2b65fc6db2b3b2e8a05f3b3/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:0d3d8f15c07f86e9ff82319b3d9ef6f4bf907608f53fe9d92b28ea9ae3d1fd89", size = 149383, upload-time = "2025-10-14T04:40:46.018Z" }, + { url = "https://files.pythonhosted.org/packages/4f/e8/b289173b4edae05c0dde07f69f8db476a0b511eac556dfe0d6bda3c43384/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9f7fcd74d410a36883701fafa2482a6af2ff5ba96b9a620e9e0721e28ead5569", size = 159098, upload-time = "2025-10-14T04:40:47.081Z" }, + { url = "https://files.pythonhosted.org/packages/d8/df/fe699727754cae3f8478493c7f45f777b17c3ef0600e28abfec8619eb49c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ebf3e58c7ec8a8bed6d66a75d7fb37b55e5015b03ceae72a8e7c74495551e224", size = 152991, upload-time = "2025-10-14T04:40:48.246Z" }, + { url = "https://files.pythonhosted.org/packages/1a/86/584869fe4ddb6ffa3bd9f491b87a01568797fb9bd8933f557dba9771beaf/charset_normalizer-3.4.4-cp311-cp311-win32.whl", hash = "sha256:eecbc200c7fd5ddb9a7f16c7decb07b566c29fa2161a16cf67b8d068bd21690a", size = 99456, upload-time = "2025-10-14T04:40:49.376Z" }, + { url = "https://files.pythonhosted.org/packages/65/f6/62fdd5feb60530f50f7e38b4f6a1d5203f4d16ff4f9f0952962c044e919a/charset_normalizer-3.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:5ae497466c7901d54b639cf42d5b8c1b6a4fead55215500d2f486d34db48d016", size = 106978, upload-time = "2025-10-14T04:40:50.844Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9d/0710916e6c82948b3be62d9d398cb4fcf4e97b56d6a6aeccd66c4b2f2bd5/charset_normalizer-3.4.4-cp311-cp311-win_arm64.whl", hash = "sha256:65e2befcd84bc6f37095f5961e68a6f077bf44946771354a28ad434c2cce0ae1", size = 99969, upload-time = "2025-10-14T04:40:52.272Z" }, + { url = "https://files.pythonhosted.org/packages/f3/85/1637cd4af66fa687396e757dec650f28025f2a2f5a5531a3208dc0ec43f2/charset_normalizer-3.4.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0a98e6759f854bd25a58a73fa88833fba3b7c491169f86ce1180c948ab3fd394", size = 208425, upload-time = "2025-10-14T04:40:53.353Z" }, + { url = "https://files.pythonhosted.org/packages/9d/6a/04130023fef2a0d9c62d0bae2649b69f7b7d8d24ea5536feef50551029df/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b5b290ccc2a263e8d185130284f8501e3e36c5e02750fc6b6bdeb2e9e96f1e25", size = 148162, upload-time = "2025-10-14T04:40:54.558Z" }, + { url = "https://files.pythonhosted.org/packages/78/29/62328d79aa60da22c9e0b9a66539feae06ca0f5a4171ac4f7dc285b83688/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74bb723680f9f7a6234dcf67aea57e708ec1fbdf5699fb91dfd6f511b0a320ef", size = 144558, upload-time = "2025-10-14T04:40:55.677Z" }, + { url = "https://files.pythonhosted.org/packages/86/bb/b32194a4bf15b88403537c2e120b817c61cd4ecffa9b6876e941c3ee38fe/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f1e34719c6ed0b92f418c7c780480b26b5d9c50349e9a9af7d76bf757530350d", size = 161497, upload-time = "2025-10-14T04:40:57.217Z" }, + { url = "https://files.pythonhosted.org/packages/19/89/a54c82b253d5b9b111dc74aca196ba5ccfcca8242d0fb64146d4d3183ff1/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2437418e20515acec67d86e12bf70056a33abdacb5cb1655042f6538d6b085a8", size = 159240, upload-time = "2025-10-14T04:40:58.358Z" }, + { url = "https://files.pythonhosted.org/packages/c0/10/d20b513afe03acc89ec33948320a5544d31f21b05368436d580dec4e234d/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:11d694519d7f29d6cd09f6ac70028dba10f92f6cdd059096db198c283794ac86", size = 153471, upload-time = "2025-10-14T04:40:59.468Z" }, + { url = "https://files.pythonhosted.org/packages/61/fa/fbf177b55bdd727010f9c0a3c49eefa1d10f960e5f09d1d887bf93c2e698/charset_normalizer-3.4.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ac1c4a689edcc530fc9d9aa11f5774b9e2f33f9a0c6a57864e90908f5208d30a", size = 150864, upload-time = "2025-10-14T04:41:00.623Z" }, + { url = "https://files.pythonhosted.org/packages/05/12/9fbc6a4d39c0198adeebbde20b619790e9236557ca59fc40e0e3cebe6f40/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:21d142cc6c0ec30d2efee5068ca36c128a30b0f2c53c1c07bd78cb6bc1d3be5f", size = 150647, upload-time = "2025-10-14T04:41:01.754Z" }, + { url = "https://files.pythonhosted.org/packages/ad/1f/6a9a593d52e3e8c5d2b167daf8c6b968808efb57ef4c210acb907c365bc4/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5dbe56a36425d26d6cfb40ce79c314a2e4dd6211d51d6d2191c00bed34f354cc", size = 145110, upload-time = "2025-10-14T04:41:03.231Z" }, + { url = "https://files.pythonhosted.org/packages/30/42/9a52c609e72471b0fc54386dc63c3781a387bb4fe61c20231a4ebcd58bdd/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5bfbb1b9acf3334612667b61bd3002196fe2a1eb4dd74d247e0f2a4d50ec9bbf", size = 162839, upload-time = "2025-10-14T04:41:04.715Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5b/c0682bbf9f11597073052628ddd38344a3d673fda35a36773f7d19344b23/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d055ec1e26e441f6187acf818b73564e6e6282709e9bcb5b63f5b23068356a15", size = 150667, upload-time = "2025-10-14T04:41:05.827Z" }, + { url = "https://files.pythonhosted.org/packages/e4/24/a41afeab6f990cf2daf6cb8c67419b63b48cf518e4f56022230840c9bfb2/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:af2d8c67d8e573d6de5bc30cdb27e9b95e49115cd9baad5ddbd1a6207aaa82a9", size = 160535, upload-time = "2025-10-14T04:41:06.938Z" }, + { url = "https://files.pythonhosted.org/packages/2a/e5/6a4ce77ed243c4a50a1fecca6aaaab419628c818a49434be428fe24c9957/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:780236ac706e66881f3b7f2f32dfe90507a09e67d1d454c762cf642e6e1586e0", size = 154816, upload-time = "2025-10-14T04:41:08.101Z" }, + { url = "https://files.pythonhosted.org/packages/a8/ef/89297262b8092b312d29cdb2517cb1237e51db8ecef2e9af5edbe7b683b1/charset_normalizer-3.4.4-cp312-cp312-win32.whl", hash = "sha256:5833d2c39d8896e4e19b689ffc198f08ea58116bee26dea51e362ecc7cd3ed26", size = 99694, upload-time = "2025-10-14T04:41:09.23Z" }, + { url = "https://files.pythonhosted.org/packages/3d/2d/1e5ed9dd3b3803994c155cd9aacb60c82c331bad84daf75bcb9c91b3295e/charset_normalizer-3.4.4-cp312-cp312-win_amd64.whl", hash = "sha256:a79cfe37875f822425b89a82333404539ae63dbdddf97f84dcbc3d339aae9525", size = 107131, upload-time = "2025-10-14T04:41:10.467Z" }, + { url = "https://files.pythonhosted.org/packages/d0/d9/0ed4c7098a861482a7b6a95603edce4c0d9db2311af23da1fb2b75ec26fc/charset_normalizer-3.4.4-cp312-cp312-win_arm64.whl", hash = "sha256:376bec83a63b8021bb5c8ea75e21c4ccb86e7e45ca4eb81146091b56599b80c3", size = 100390, upload-time = "2025-10-14T04:41:11.915Z" }, + { url = "https://files.pythonhosted.org/packages/97/45/4b3a1239bbacd321068ea6e7ac28875b03ab8bc0aa0966452db17cd36714/charset_normalizer-3.4.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:e1f185f86a6f3403aa2420e815904c67b2f9ebc443f045edd0de921108345794", size = 208091, upload-time = "2025-10-14T04:41:13.346Z" }, + { url = "https://files.pythonhosted.org/packages/7d/62/73a6d7450829655a35bb88a88fca7d736f9882a27eacdca2c6d505b57e2e/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b39f987ae8ccdf0d2642338faf2abb1862340facc796048b604ef14919e55ed", size = 147936, upload-time = "2025-10-14T04:41:14.461Z" }, + { url = "https://files.pythonhosted.org/packages/89/c5/adb8c8b3d6625bef6d88b251bbb0d95f8205831b987631ab0c8bb5d937c2/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3162d5d8ce1bb98dd51af660f2121c55d0fa541b46dff7bb9b9f86ea1d87de72", size = 144180, upload-time = "2025-10-14T04:41:15.588Z" }, + { url = "https://files.pythonhosted.org/packages/91/ed/9706e4070682d1cc219050b6048bfd293ccf67b3d4f5a4f39207453d4b99/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:81d5eb2a312700f4ecaa977a8235b634ce853200e828fbadf3a9c50bab278328", size = 161346, upload-time = "2025-10-14T04:41:16.738Z" }, + { url = "https://files.pythonhosted.org/packages/d5/0d/031f0d95e4972901a2f6f09ef055751805ff541511dc1252ba3ca1f80cf5/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5bd2293095d766545ec1a8f612559f6b40abc0eb18bb2f5d1171872d34036ede", size = 158874, upload-time = "2025-10-14T04:41:17.923Z" }, + { url = "https://files.pythonhosted.org/packages/f5/83/6ab5883f57c9c801ce5e5677242328aa45592be8a00644310a008d04f922/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a8a8b89589086a25749f471e6a900d3f662d1d3b6e2e59dcecf787b1cc3a1894", size = 153076, upload-time = "2025-10-14T04:41:19.106Z" }, + { url = "https://files.pythonhosted.org/packages/75/1e/5ff781ddf5260e387d6419959ee89ef13878229732732ee73cdae01800f2/charset_normalizer-3.4.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc7637e2f80d8530ee4a78e878bce464f70087ce73cf7c1caf142416923b98f1", size = 150601, upload-time = "2025-10-14T04:41:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/d7/57/71be810965493d3510a6ca79b90c19e48696fb1ff964da319334b12677f0/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f8bf04158c6b607d747e93949aa60618b61312fe647a6369f88ce2ff16043490", size = 150376, upload-time = "2025-10-14T04:41:21.398Z" }, + { url = "https://files.pythonhosted.org/packages/e5/d5/c3d057a78c181d007014feb7e9f2e65905a6c4ef182c0ddf0de2924edd65/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:554af85e960429cf30784dd47447d5125aaa3b99a6f0683589dbd27e2f45da44", size = 144825, upload-time = "2025-10-14T04:41:22.583Z" }, + { url = "https://files.pythonhosted.org/packages/e6/8c/d0406294828d4976f275ffbe66f00266c4b3136b7506941d87c00cab5272/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:74018750915ee7ad843a774364e13a3db91682f26142baddf775342c3f5b1133", size = 162583, upload-time = "2025-10-14T04:41:23.754Z" }, + { url = "https://files.pythonhosted.org/packages/d7/24/e2aa1f18c8f15c4c0e932d9287b8609dd30ad56dbe41d926bd846e22fb8d/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c0463276121fdee9c49b98908b3a89c39be45d86d1dbaa22957e38f6321d4ce3", size = 150366, upload-time = "2025-10-14T04:41:25.27Z" }, + { url = "https://files.pythonhosted.org/packages/e4/5b/1e6160c7739aad1e2df054300cc618b06bf784a7a164b0f238360721ab86/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:362d61fd13843997c1c446760ef36f240cf81d3ebf74ac62652aebaf7838561e", size = 160300, upload-time = "2025-10-14T04:41:26.725Z" }, + { url = "https://files.pythonhosted.org/packages/7a/10/f882167cd207fbdd743e55534d5d9620e095089d176d55cb22d5322f2afd/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9a26f18905b8dd5d685d6d07b0cdf98a79f3c7a918906af7cc143ea2e164c8bc", size = 154465, upload-time = "2025-10-14T04:41:28.322Z" }, + { url = "https://files.pythonhosted.org/packages/89/66/c7a9e1b7429be72123441bfdbaf2bc13faab3f90b933f664db506dea5915/charset_normalizer-3.4.4-cp313-cp313-win32.whl", hash = "sha256:9b35f4c90079ff2e2edc5b26c0c77925e5d2d255c42c74fdb70fb49b172726ac", size = 99404, upload-time = "2025-10-14T04:41:29.95Z" }, + { url = "https://files.pythonhosted.org/packages/c4/26/b9924fa27db384bdcd97ab83b4f0a8058d96ad9626ead570674d5e737d90/charset_normalizer-3.4.4-cp313-cp313-win_amd64.whl", hash = "sha256:b435cba5f4f750aa6c0a0d92c541fb79f69a387c91e61f1795227e4ed9cece14", size = 107092, upload-time = "2025-10-14T04:41:31.188Z" }, + { url = "https://files.pythonhosted.org/packages/af/8f/3ed4bfa0c0c72a7ca17f0380cd9e4dd842b09f664e780c13cff1dcf2ef1b/charset_normalizer-3.4.4-cp313-cp313-win_arm64.whl", hash = "sha256:542d2cee80be6f80247095cc36c418f7bddd14f4a6de45af91dfad36d817bba2", size = 100408, upload-time = "2025-10-14T04:41:32.624Z" }, + { url = "https://files.pythonhosted.org/packages/2a/35/7051599bd493e62411d6ede36fd5af83a38f37c4767b92884df7301db25d/charset_normalizer-3.4.4-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:da3326d9e65ef63a817ecbcc0df6e94463713b754fe293eaa03da99befb9a5bd", size = 207746, upload-time = "2025-10-14T04:41:33.773Z" }, + { url = "https://files.pythonhosted.org/packages/10/9a/97c8d48ef10d6cd4fcead2415523221624bf58bcf68a802721a6bc807c8f/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8af65f14dc14a79b924524b1e7fffe304517b2bff5a58bf64f30b98bbc5079eb", size = 147889, upload-time = "2025-10-14T04:41:34.897Z" }, + { url = "https://files.pythonhosted.org/packages/10/bf/979224a919a1b606c82bd2c5fa49b5c6d5727aa47b4312bb27b1734f53cd/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74664978bb272435107de04e36db5a9735e78232b85b77d45cfb38f758efd33e", size = 143641, upload-time = "2025-10-14T04:41:36.116Z" }, + { url = "https://files.pythonhosted.org/packages/ba/33/0ad65587441fc730dc7bd90e9716b30b4702dc7b617e6ba4997dc8651495/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:752944c7ffbfdd10c074dc58ec2d5a8a4cd9493b314d367c14d24c17684ddd14", size = 160779, upload-time = "2025-10-14T04:41:37.229Z" }, + { url = "https://files.pythonhosted.org/packages/67/ed/331d6b249259ee71ddea93f6f2f0a56cfebd46938bde6fcc6f7b9a3d0e09/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d1f13550535ad8cff21b8d757a3257963e951d96e20ec82ab44bc64aeb62a191", size = 159035, upload-time = "2025-10-14T04:41:38.368Z" }, + { url = "https://files.pythonhosted.org/packages/67/ff/f6b948ca32e4f2a4576aa129d8bed61f2e0543bf9f5f2b7fc3758ed005c9/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecaae4149d99b1c9e7b88bb03e3221956f68fd6d50be2ef061b2381b61d20838", size = 152542, upload-time = "2025-10-14T04:41:39.862Z" }, + { url = "https://files.pythonhosted.org/packages/16/85/276033dcbcc369eb176594de22728541a925b2632f9716428c851b149e83/charset_normalizer-3.4.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cb6254dc36b47a990e59e1068afacdcd02958bdcce30bb50cc1700a8b9d624a6", size = 149524, upload-time = "2025-10-14T04:41:41.319Z" }, + { url = "https://files.pythonhosted.org/packages/9e/f2/6a2a1f722b6aba37050e626530a46a68f74e63683947a8acff92569f979a/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c8ae8a0f02f57a6e61203a31428fa1d677cbe50c93622b4149d5c0f319c1d19e", size = 150395, upload-time = "2025-10-14T04:41:42.539Z" }, + { url = "https://files.pythonhosted.org/packages/60/bb/2186cb2f2bbaea6338cad15ce23a67f9b0672929744381e28b0592676824/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:47cc91b2f4dd2833fddaedd2893006b0106129d4b94fdb6af1f4ce5a9965577c", size = 143680, upload-time = "2025-10-14T04:41:43.661Z" }, + { url = "https://files.pythonhosted.org/packages/7d/a5/bf6f13b772fbb2a90360eb620d52ed8f796f3c5caee8398c3b2eb7b1c60d/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:82004af6c302b5d3ab2cfc4cc5f29db16123b1a8417f2e25f9066f91d4411090", size = 162045, upload-time = "2025-10-14T04:41:44.821Z" }, + { url = "https://files.pythonhosted.org/packages/df/c5/d1be898bf0dc3ef9030c3825e5d3b83f2c528d207d246cbabe245966808d/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:2b7d8f6c26245217bd2ad053761201e9f9680f8ce52f0fcd8d0755aeae5b2152", size = 149687, upload-time = "2025-10-14T04:41:46.442Z" }, + { url = "https://files.pythonhosted.org/packages/a5/42/90c1f7b9341eef50c8a1cb3f098ac43b0508413f33affd762855f67a410e/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:799a7a5e4fb2d5898c60b640fd4981d6a25f1c11790935a44ce38c54e985f828", size = 160014, upload-time = "2025-10-14T04:41:47.631Z" }, + { url = "https://files.pythonhosted.org/packages/76/be/4d3ee471e8145d12795ab655ece37baed0929462a86e72372fd25859047c/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:99ae2cffebb06e6c22bdc25801d7b30f503cc87dbd283479e7b606f70aff57ec", size = 154044, upload-time = "2025-10-14T04:41:48.81Z" }, + { url = "https://files.pythonhosted.org/packages/b0/6f/8f7af07237c34a1defe7defc565a9bc1807762f672c0fde711a4b22bf9c0/charset_normalizer-3.4.4-cp314-cp314-win32.whl", hash = "sha256:f9d332f8c2a2fcbffe1378594431458ddbef721c1769d78e2cbc06280d8155f9", size = 99940, upload-time = "2025-10-14T04:41:49.946Z" }, + { url = "https://files.pythonhosted.org/packages/4b/51/8ade005e5ca5b0d80fb4aff72a3775b325bdc3d27408c8113811a7cbe640/charset_normalizer-3.4.4-cp314-cp314-win_amd64.whl", hash = "sha256:8a6562c3700cce886c5be75ade4a5db4214fda19fede41d9792d100288d8f94c", size = 107104, upload-time = "2025-10-14T04:41:51.051Z" }, + { url = "https://files.pythonhosted.org/packages/da/5f/6b8f83a55bb8278772c5ae54a577f3099025f9ade59d0136ac24a0df4bde/charset_normalizer-3.4.4-cp314-cp314-win_arm64.whl", hash = "sha256:de00632ca48df9daf77a2c65a484531649261ec9f25489917f09e455cb09ddb2", size = 100743, upload-time = "2025-10-14T04:41:52.122Z" }, + { url = "https://files.pythonhosted.org/packages/0a/4c/925909008ed5a988ccbb72dcc897407e5d6d3bd72410d69e051fc0c14647/charset_normalizer-3.4.4-py3-none-any.whl", hash = "sha256:7a32c560861a02ff789ad905a2fe94e3f840803362c84fecf1851cb4cf3dc37f", size = 53402, upload-time = "2025-10-14T04:42:31.76Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "dill" +version = "0.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/12/80/630b4b88364e9a8c8c5797f4602d0f76ef820909ee32f0bacb9f90654042/dill-0.4.0.tar.gz", hash = "sha256:0633f1d2df477324f53a895b02c901fb961bdbf65a17122586ea7019292cbcf0", size = 186976, upload-time = "2025-04-16T00:41:48.867Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/3d/9373ad9c56321fdab5b41197068e1d8c25883b3fea29dd361f9b55116869/dill-0.4.0-py3-none-any.whl", hash = "sha256:44f54bf6412c2c8464c14e8243eb163690a9800dbe2c367330883b19c7561049", size = 119668, upload-time = "2025-04-16T00:41:47.671Z" }, +] + +[[package]] +name = "eval-type-backport" +version = "0.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fb/a3/cafafb4558fd638aadfe4121dc6cefb8d743368c085acb2f521df0f3d9d7/eval_type_backport-0.3.1.tar.gz", hash = "sha256:57e993f7b5b69d271e37482e62f74e76a0276c82490cf8e4f0dffeb6b332d5ed", size = 9445, upload-time = "2025-12-02T11:51:42.987Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cf/22/fdc2e30d43ff853720042fa15baa3e6122722be1a7950a98233ebb55cd71/eval_type_backport-0.3.1-py3-none-any.whl", hash = "sha256:279ab641905e9f11129f56a8a78f493518515b83402b860f6f06dd7c011fdfa8", size = 6063, upload-time = "2025-12-02T11:51:41.665Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "google-auth" +version = "2.45.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cachetools" }, + { name = "pyasn1-modules" }, + { name = "rsa" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e5/00/3c794502a8b892c404b2dea5b3650eb21bfc7069612fbfd15c7f17c1cb0d/google_auth-2.45.0.tar.gz", hash = "sha256:90d3f41b6b72ea72dd9811e765699ee491ab24139f34ebf1ca2b9cc0c38708f3", size = 320708, upload-time = "2025-12-15T22:58:42.889Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c6/97/451d55e05487a5cd6279a01a7e34921858b16f7dc8aa38a2c684743cd2b3/google_auth-2.45.0-py2.py3-none-any.whl", hash = "sha256:82344e86dc00410ef5382d99be677c6043d72e502b625aa4f4afa0bdacca0f36", size = 233312, upload-time = "2025-12-15T22:58:40.777Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "idna" +version = "3.11" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "isort" +version = "5.13.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/87/f9/c1eb8635a24e87ade2efce21e3ce8cd6b8630bb685ddc9cdaca1349b2eb5/isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109", size = 175303, upload-time = "2023-12-13T20:37:26.124Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/b3/8def84f539e7d2289a02f0524b944b15d7c75dab7628bedf1c4f0992029c/isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6", size = 92310, upload-time = "2023-12-13T20:37:23.244Z" }, +] + +[[package]] +name = "mccabe" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e7/ff/0ffefdcac38932a54d2b5eed4e0ba8a408f215002cd178ad1df0f2806ff8/mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", size = 9658, upload-time = "2022-01-24T01:14:51.113Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e", size = 7350, upload-time = "2022-01-24T01:14:49.62Z" }, +] + +[[package]] +name = "mistralai-gcp" +version = "2.0.0" +source = { editable = "." } +dependencies = [ + { name = "eval-type-backport" }, + { name = "google-auth" }, + { name = "httpx" }, + { name = "pydantic" }, + { name = "python-dateutil" }, + { name = "requests" }, + { name = "typing-inspection" }, +] + +[package.dev-dependencies] +dev = [ + { name = "mypy" }, + { name = "pylint" }, + { name = "pyright" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "types-python-dateutil" }, +] + +[package.metadata] +requires-dist = [ + { name = "eval-type-backport", specifier = ">=0.2.0" }, + { name = "google-auth", specifier = ">=2.31.0,<3.0.0" }, + { name = "httpx", specifier = ">=0.28.1" }, + { name = "pydantic", specifier = ">=2.11.2" }, + { name = "python-dateutil", specifier = ">=2.8.2" }, + { name = "requests", specifier = ">=2.32.3,<3.0.0" }, + { name = "typing-inspection", specifier = ">=0.4.0" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "mypy", specifier = "==1.15.0" }, + { name = "pylint", specifier = "==3.2.3" }, + { name = "pyright", specifier = ">=1.1.401,<2" }, + { name = "pytest", specifier = ">=8.2.2,<9" }, + { name = "pytest-asyncio", specifier = ">=0.23.7,<0.24" }, + { name = "types-python-dateutil", specifier = ">=2.9.0.20240316,<3" }, +] + +[[package]] +name = "mypy" +version = "1.15.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mypy-extensions" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ce/43/d5e49a86afa64bd3839ea0d5b9c7103487007d728e1293f52525d6d5486a/mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43", size = 3239717, upload-time = "2025-02-05T03:50:34.655Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/68/f8/65a7ce8d0e09b6329ad0c8d40330d100ea343bd4dd04c4f8ae26462d0a17/mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13", size = 10738433, upload-time = "2025-02-05T03:49:29.145Z" }, + { url = "https://files.pythonhosted.org/packages/b4/95/9c0ecb8eacfe048583706249439ff52105b3f552ea9c4024166c03224270/mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559", size = 9861472, upload-time = "2025-02-05T03:49:16.986Z" }, + { url = "https://files.pythonhosted.org/packages/84/09/9ec95e982e282e20c0d5407bc65031dfd0f0f8ecc66b69538296e06fcbee/mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b", size = 11611424, upload-time = "2025-02-05T03:49:46.908Z" }, + { url = "https://files.pythonhosted.org/packages/78/13/f7d14e55865036a1e6a0a69580c240f43bc1f37407fe9235c0d4ef25ffb0/mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3", size = 12365450, upload-time = "2025-02-05T03:50:05.89Z" }, + { url = "https://files.pythonhosted.org/packages/48/e1/301a73852d40c241e915ac6d7bcd7fedd47d519246db2d7b86b9d7e7a0cb/mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b", size = 12551765, upload-time = "2025-02-05T03:49:33.56Z" }, + { url = "https://files.pythonhosted.org/packages/77/ba/c37bc323ae5fe7f3f15a28e06ab012cd0b7552886118943e90b15af31195/mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828", size = 9274701, upload-time = "2025-02-05T03:49:38.981Z" }, + { url = "https://files.pythonhosted.org/packages/03/bc/f6339726c627bd7ca1ce0fa56c9ae2d0144604a319e0e339bdadafbbb599/mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f", size = 10662338, upload-time = "2025-02-05T03:50:17.287Z" }, + { url = "https://files.pythonhosted.org/packages/e2/90/8dcf506ca1a09b0d17555cc00cd69aee402c203911410136cd716559efe7/mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5", size = 9787540, upload-time = "2025-02-05T03:49:51.21Z" }, + { url = "https://files.pythonhosted.org/packages/05/05/a10f9479681e5da09ef2f9426f650d7b550d4bafbef683b69aad1ba87457/mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e", size = 11538051, upload-time = "2025-02-05T03:50:20.885Z" }, + { url = "https://files.pythonhosted.org/packages/e9/9a/1f7d18b30edd57441a6411fcbc0c6869448d1a4bacbaee60656ac0fc29c8/mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c", size = 12286751, upload-time = "2025-02-05T03:49:42.408Z" }, + { url = "https://files.pythonhosted.org/packages/72/af/19ff499b6f1dafcaf56f9881f7a965ac2f474f69f6f618b5175b044299f5/mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f", size = 12421783, upload-time = "2025-02-05T03:49:07.707Z" }, + { url = "https://files.pythonhosted.org/packages/96/39/11b57431a1f686c1aed54bf794870efe0f6aeca11aca281a0bd87a5ad42c/mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f", size = 9265618, upload-time = "2025-02-05T03:49:54.581Z" }, + { url = "https://files.pythonhosted.org/packages/98/3a/03c74331c5eb8bd025734e04c9840532226775c47a2c39b56a0c8d4f128d/mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd", size = 10793981, upload-time = "2025-02-05T03:50:28.25Z" }, + { url = "https://files.pythonhosted.org/packages/f0/1a/41759b18f2cfd568848a37c89030aeb03534411eef981df621d8fad08a1d/mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f", size = 9749175, upload-time = "2025-02-05T03:50:13.411Z" }, + { url = "https://files.pythonhosted.org/packages/12/7e/873481abf1ef112c582db832740f4c11b2bfa510e829d6da29b0ab8c3f9c/mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464", size = 11455675, upload-time = "2025-02-05T03:50:31.421Z" }, + { url = "https://files.pythonhosted.org/packages/b3/d0/92ae4cde706923a2d3f2d6c39629134063ff64b9dedca9c1388363da072d/mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee", size = 12410020, upload-time = "2025-02-05T03:48:48.705Z" }, + { url = "https://files.pythonhosted.org/packages/46/8b/df49974b337cce35f828ba6fda228152d6db45fed4c86ba56ffe442434fd/mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e", size = 12498582, upload-time = "2025-02-05T03:49:03.628Z" }, + { url = "https://files.pythonhosted.org/packages/13/50/da5203fcf6c53044a0b699939f31075c45ae8a4cadf538a9069b165c1050/mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22", size = 9366614, upload-time = "2025-02-05T03:50:00.313Z" }, + { url = "https://files.pythonhosted.org/packages/6a/9b/fd2e05d6ffff24d912f150b87db9e364fa8282045c875654ce7e32fffa66/mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445", size = 10788592, upload-time = "2025-02-05T03:48:55.789Z" }, + { url = "https://files.pythonhosted.org/packages/74/37/b246d711c28a03ead1fd906bbc7106659aed7c089d55fe40dd58db812628/mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d", size = 9753611, upload-time = "2025-02-05T03:48:44.581Z" }, + { url = "https://files.pythonhosted.org/packages/a6/ac/395808a92e10cfdac8003c3de9a2ab6dc7cde6c0d2a4df3df1b815ffd067/mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5", size = 11438443, upload-time = "2025-02-05T03:49:25.514Z" }, + { url = "https://files.pythonhosted.org/packages/d2/8b/801aa06445d2de3895f59e476f38f3f8d610ef5d6908245f07d002676cbf/mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036", size = 12402541, upload-time = "2025-02-05T03:49:57.623Z" }, + { url = "https://files.pythonhosted.org/packages/c7/67/5a4268782eb77344cc613a4cf23540928e41f018a9a1ec4c6882baf20ab8/mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357", size = 12494348, upload-time = "2025-02-05T03:48:52.361Z" }, + { url = "https://files.pythonhosted.org/packages/83/3e/57bb447f7bbbfaabf1712d96f9df142624a386d98fb026a761532526057e/mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf", size = 9373648, upload-time = "2025-02-05T03:49:11.395Z" }, + { url = "https://files.pythonhosted.org/packages/09/4e/a7d65c7322c510de2c409ff3828b03354a7c43f5a8ed458a7a131b41c7b9/mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e", size = 2221777, upload-time = "2025-02-05T03:50:08.348Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, +] + +[[package]] +name = "packaging" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cf/86/0248f086a84f01b37aaec0fa567b397df1a119f73c16f6c7a9aac73ea309/platformdirs-4.5.1.tar.gz", hash = "sha256:61d5cdcc6065745cdd94f0f878977f8de9437be93de97c1c12f853c9c0cdcbda", size = 21715, upload-time = "2025-12-05T13:52:58.638Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/28/3bfe2fa5a7b9c46fe7e13c97bda14c895fb10fa2ebf1d0abb90e0cea7ee1/platformdirs-4.5.1-py3-none-any.whl", hash = "sha256:d03afa3963c806a9bed9d5125c8f4cb2fdaf74a55ab60e5d59b3fde758104d31", size = 18731, upload-time = "2025-12-05T13:52:56.823Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pyasn1" +version = "0.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ba/e9/01f1a64245b89f039897cb0130016d79f77d52669aae6ee7b159a6c4c018/pyasn1-0.6.1.tar.gz", hash = "sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034", size = 145322, upload-time = "2024-09-10T22:41:42.55Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c8/f1/d6a797abb14f6283c0ddff96bbdd46937f64122b8c925cab503dd37f8214/pyasn1-0.6.1-py3-none-any.whl", hash = "sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629", size = 83135, upload-time = "2024-09-11T16:00:36.122Z" }, +] + +[[package]] +name = "pyasn1-modules" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyasn1" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e9/e6/78ebbb10a8c8e4b61a59249394a4a594c1a7af95593dc933a349c8d00964/pyasn1_modules-0.4.2.tar.gz", hash = "sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6", size = 307892, upload-time = "2025-03-28T02:41:22.17Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/47/8d/d529b5d697919ba8c11ad626e835d4039be708a35b0d22de83a269a6682c/pyasn1_modules-0.4.2-py3-none-any.whl", hash = "sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a", size = 181259, upload-time = "2025-03-28T02:41:19.028Z" }, +] + +[[package]] +name = "pydantic" +version = "2.12.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.41.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c6/90/32c9941e728d564b411d574d8ee0cf09b12ec978cb22b294995bae5549a5/pydantic_core-2.41.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:77b63866ca88d804225eaa4af3e664c5faf3568cea95360d21f4725ab6e07146", size = 2107298, upload-time = "2025-11-04T13:39:04.116Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a8/61c96a77fe28993d9a6fb0f4127e05430a267b235a124545d79fea46dd65/pydantic_core-2.41.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dfa8a0c812ac681395907e71e1274819dec685fec28273a28905df579ef137e2", size = 1901475, upload-time = "2025-11-04T13:39:06.055Z" }, + { url = "https://files.pythonhosted.org/packages/5d/b6/338abf60225acc18cdc08b4faef592d0310923d19a87fba1faf05af5346e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5921a4d3ca3aee735d9fd163808f5e8dd6c6972101e4adbda9a4667908849b97", size = 1918815, upload-time = "2025-11-04T13:39:10.41Z" }, + { url = "https://files.pythonhosted.org/packages/d1/1c/2ed0433e682983d8e8cba9c8d8ef274d4791ec6a6f24c58935b90e780e0a/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e25c479382d26a2a41b7ebea1043564a937db462816ea07afa8a44c0866d52f9", size = 2065567, upload-time = "2025-11-04T13:39:12.244Z" }, + { url = "https://files.pythonhosted.org/packages/b3/24/cf84974ee7d6eae06b9e63289b7b8f6549d416b5c199ca2d7ce13bbcf619/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f547144f2966e1e16ae626d8ce72b4cfa0caedc7fa28052001c94fb2fcaa1c52", size = 2230442, upload-time = "2025-11-04T13:39:13.962Z" }, + { url = "https://files.pythonhosted.org/packages/fd/21/4e287865504b3edc0136c89c9c09431be326168b1eb7841911cbc877a995/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f52298fbd394f9ed112d56f3d11aabd0d5bd27beb3084cc3d8ad069483b8941", size = 2350956, upload-time = "2025-11-04T13:39:15.889Z" }, + { url = "https://files.pythonhosted.org/packages/a8/76/7727ef2ffa4b62fcab916686a68a0426b9b790139720e1934e8ba797e238/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:100baa204bb412b74fe285fb0f3a385256dad1d1879f0a5cb1499ed2e83d132a", size = 2068253, upload-time = "2025-11-04T13:39:17.403Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8c/a4abfc79604bcb4c748e18975c44f94f756f08fb04218d5cb87eb0d3a63e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:05a2c8852530ad2812cb7914dc61a1125dc4e06252ee98e5638a12da6cc6fb6c", size = 2177050, upload-time = "2025-11-04T13:39:19.351Z" }, + { url = "https://files.pythonhosted.org/packages/67/b1/de2e9a9a79b480f9cb0b6e8b6ba4c50b18d4e89852426364c66aa82bb7b3/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:29452c56df2ed968d18d7e21f4ab0ac55e71dc59524872f6fc57dcf4a3249ed2", size = 2147178, upload-time = "2025-11-04T13:39:21Z" }, + { url = "https://files.pythonhosted.org/packages/16/c1/dfb33f837a47b20417500efaa0378adc6635b3c79e8369ff7a03c494b4ac/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:d5160812ea7a8a2ffbe233d8da666880cad0cbaf5d4de74ae15c313213d62556", size = 2341833, upload-time = "2025-11-04T13:39:22.606Z" }, + { url = "https://files.pythonhosted.org/packages/47/36/00f398642a0f4b815a9a558c4f1dca1b4020a7d49562807d7bc9ff279a6c/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:df3959765b553b9440adfd3c795617c352154e497a4eaf3752555cfb5da8fc49", size = 2321156, upload-time = "2025-11-04T13:39:25.843Z" }, + { url = "https://files.pythonhosted.org/packages/7e/70/cad3acd89fde2010807354d978725ae111ddf6d0ea46d1ea1775b5c1bd0c/pydantic_core-2.41.5-cp310-cp310-win32.whl", hash = "sha256:1f8d33a7f4d5a7889e60dc39856d76d09333d8a6ed0f5f1190635cbec70ec4ba", size = 1989378, upload-time = "2025-11-04T13:39:27.92Z" }, + { url = "https://files.pythonhosted.org/packages/76/92/d338652464c6c367e5608e4488201702cd1cbb0f33f7b6a85a60fe5f3720/pydantic_core-2.41.5-cp310-cp310-win_amd64.whl", hash = "sha256:62de39db01b8d593e45871af2af9e497295db8d73b085f6bfd0b18c83c70a8f9", size = 2013622, upload-time = "2025-11-04T13:39:29.848Z" }, + { url = "https://files.pythonhosted.org/packages/e8/72/74a989dd9f2084b3d9530b0915fdda64ac48831c30dbf7c72a41a5232db8/pydantic_core-2.41.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a3a52f6156e73e7ccb0f8cced536adccb7042be67cb45f9562e12b319c119da6", size = 2105873, upload-time = "2025-11-04T13:39:31.373Z" }, + { url = "https://files.pythonhosted.org/packages/12/44/37e403fd9455708b3b942949e1d7febc02167662bf1a7da5b78ee1ea2842/pydantic_core-2.41.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7f3bf998340c6d4b0c9a2f02d6a400e51f123b59565d74dc60d252ce888c260b", size = 1899826, upload-time = "2025-11-04T13:39:32.897Z" }, + { url = "https://files.pythonhosted.org/packages/33/7f/1d5cab3ccf44c1935a359d51a8a2a9e1a654b744b5e7f80d41b88d501eec/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:378bec5c66998815d224c9ca994f1e14c0c21cb95d2f52b6021cc0b2a58f2a5a", size = 1917869, upload-time = "2025-11-04T13:39:34.469Z" }, + { url = "https://files.pythonhosted.org/packages/6e/6a/30d94a9674a7fe4f4744052ed6c5e083424510be1e93da5bc47569d11810/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b576130c69225432866fe2f4a469a85a54ade141d96fd396dffcf607b558f8", size = 2063890, upload-time = "2025-11-04T13:39:36.053Z" }, + { url = "https://files.pythonhosted.org/packages/50/be/76e5d46203fcb2750e542f32e6c371ffa9b8ad17364cf94bb0818dbfb50c/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6cb58b9c66f7e4179a2d5e0f849c48eff5c1fca560994d6eb6543abf955a149e", size = 2229740, upload-time = "2025-11-04T13:39:37.753Z" }, + { url = "https://files.pythonhosted.org/packages/d3/ee/fed784df0144793489f87db310a6bbf8118d7b630ed07aa180d6067e653a/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88942d3a3dff3afc8288c21e565e476fc278902ae4d6d134f1eeda118cc830b1", size = 2350021, upload-time = "2025-11-04T13:39:40.94Z" }, + { url = "https://files.pythonhosted.org/packages/c8/be/8fed28dd0a180dca19e72c233cbf58efa36df055e5b9d90d64fd1740b828/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f31d95a179f8d64d90f6831d71fa93290893a33148d890ba15de25642c5d075b", size = 2066378, upload-time = "2025-11-04T13:39:42.523Z" }, + { url = "https://files.pythonhosted.org/packages/b0/3b/698cf8ae1d536a010e05121b4958b1257f0b5522085e335360e53a6b1c8b/pydantic_core-2.41.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c1df3d34aced70add6f867a8cf413e299177e0c22660cc767218373d0779487b", size = 2175761, upload-time = "2025-11-04T13:39:44.553Z" }, + { url = "https://files.pythonhosted.org/packages/b8/ba/15d537423939553116dea94ce02f9c31be0fa9d0b806d427e0308ec17145/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4009935984bd36bd2c774e13f9a09563ce8de4abaa7226f5108262fa3e637284", size = 2146303, upload-time = "2025-11-04T13:39:46.238Z" }, + { url = "https://files.pythonhosted.org/packages/58/7f/0de669bf37d206723795f9c90c82966726a2ab06c336deba4735b55af431/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:34a64bc3441dc1213096a20fe27e8e128bd3ff89921706e83c0b1ac971276594", size = 2340355, upload-time = "2025-11-04T13:39:48.002Z" }, + { url = "https://files.pythonhosted.org/packages/e5/de/e7482c435b83d7e3c3ee5ee4451f6e8973cff0eb6007d2872ce6383f6398/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c9e19dd6e28fdcaa5a1de679aec4141f691023916427ef9bae8584f9c2fb3b0e", size = 2319875, upload-time = "2025-11-04T13:39:49.705Z" }, + { url = "https://files.pythonhosted.org/packages/fe/e6/8c9e81bb6dd7560e33b9053351c29f30c8194b72f2d6932888581f503482/pydantic_core-2.41.5-cp311-cp311-win32.whl", hash = "sha256:2c010c6ded393148374c0f6f0bf89d206bf3217f201faa0635dcd56bd1520f6b", size = 1987549, upload-time = "2025-11-04T13:39:51.842Z" }, + { url = "https://files.pythonhosted.org/packages/11/66/f14d1d978ea94d1bc21fc98fcf570f9542fe55bfcc40269d4e1a21c19bf7/pydantic_core-2.41.5-cp311-cp311-win_amd64.whl", hash = "sha256:76ee27c6e9c7f16f47db7a94157112a2f3a00e958bc626e2f4ee8bec5c328fbe", size = 2011305, upload-time = "2025-11-04T13:39:53.485Z" }, + { url = "https://files.pythonhosted.org/packages/56/d8/0e271434e8efd03186c5386671328154ee349ff0354d83c74f5caaf096ed/pydantic_core-2.41.5-cp311-cp311-win_arm64.whl", hash = "sha256:4bc36bbc0b7584de96561184ad7f012478987882ebf9f9c389b23f432ea3d90f", size = 1972902, upload-time = "2025-11-04T13:39:56.488Z" }, + { url = "https://files.pythonhosted.org/packages/5f/5d/5f6c63eebb5afee93bcaae4ce9a898f3373ca23df3ccaef086d0233a35a7/pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7", size = 2110990, upload-time = "2025-11-04T13:39:58.079Z" }, + { url = "https://files.pythonhosted.org/packages/aa/32/9c2e8ccb57c01111e0fd091f236c7b371c1bccea0fa85247ac55b1e2b6b6/pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0", size = 1896003, upload-time = "2025-11-04T13:39:59.956Z" }, + { url = "https://files.pythonhosted.org/packages/68/b8/a01b53cb0e59139fbc9e4fda3e9724ede8de279097179be4ff31f1abb65a/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69", size = 1919200, upload-time = "2025-11-04T13:40:02.241Z" }, + { url = "https://files.pythonhosted.org/packages/38/de/8c36b5198a29bdaade07b5985e80a233a5ac27137846f3bc2d3b40a47360/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75", size = 2052578, upload-time = "2025-11-04T13:40:04.401Z" }, + { url = "https://files.pythonhosted.org/packages/00/b5/0e8e4b5b081eac6cb3dbb7e60a65907549a1ce035a724368c330112adfdd/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05", size = 2208504, upload-time = "2025-11-04T13:40:06.072Z" }, + { url = "https://files.pythonhosted.org/packages/77/56/87a61aad59c7c5b9dc8caad5a41a5545cba3810c3e828708b3d7404f6cef/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc", size = 2335816, upload-time = "2025-11-04T13:40:07.835Z" }, + { url = "https://files.pythonhosted.org/packages/0d/76/941cc9f73529988688a665a5c0ecff1112b3d95ab48f81db5f7606f522d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c", size = 2075366, upload-time = "2025-11-04T13:40:09.804Z" }, + { url = "https://files.pythonhosted.org/packages/d3/43/ebef01f69baa07a482844faaa0a591bad1ef129253ffd0cdaa9d8a7f72d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5", size = 2171698, upload-time = "2025-11-04T13:40:12.004Z" }, + { url = "https://files.pythonhosted.org/packages/b1/87/41f3202e4193e3bacfc2c065fab7706ebe81af46a83d3e27605029c1f5a6/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c", size = 2132603, upload-time = "2025-11-04T13:40:13.868Z" }, + { url = "https://files.pythonhosted.org/packages/49/7d/4c00df99cb12070b6bccdef4a195255e6020a550d572768d92cc54dba91a/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294", size = 2329591, upload-time = "2025-11-04T13:40:15.672Z" }, + { url = "https://files.pythonhosted.org/packages/cc/6a/ebf4b1d65d458f3cda6a7335d141305dfa19bdc61140a884d165a8a1bbc7/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1", size = 2319068, upload-time = "2025-11-04T13:40:17.532Z" }, + { url = "https://files.pythonhosted.org/packages/49/3b/774f2b5cd4192d5ab75870ce4381fd89cf218af999515baf07e7206753f0/pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d", size = 1985908, upload-time = "2025-11-04T13:40:19.309Z" }, + { url = "https://files.pythonhosted.org/packages/86/45/00173a033c801cacf67c190fef088789394feaf88a98a7035b0e40d53dc9/pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815", size = 2020145, upload-time = "2025-11-04T13:40:21.548Z" }, + { url = "https://files.pythonhosted.org/packages/f9/22/91fbc821fa6d261b376a3f73809f907cec5ca6025642c463d3488aad22fb/pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3", size = 1976179, upload-time = "2025-11-04T13:40:23.393Z" }, + { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" }, + { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" }, + { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" }, + { url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" }, + { url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" }, + { url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" }, + { url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" }, + { url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" }, + { url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" }, + { url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" }, + { url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" }, + { url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" }, + { url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" }, + { url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" }, + { url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" }, + { url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" }, + { url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" }, + { url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" }, + { url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" }, + { url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" }, + { url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" }, + { url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" }, + { url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" }, + { url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" }, + { url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" }, + { url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" }, + { url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" }, + { url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" }, + { url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" }, + { url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" }, + { url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" }, + { url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" }, + { url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" }, + { url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" }, + { url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" }, + { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" }, + { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" }, + { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" }, + { url = "https://files.pythonhosted.org/packages/11/72/90fda5ee3b97e51c494938a4a44c3a35a9c96c19bba12372fb9c634d6f57/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:b96d5f26b05d03cc60f11a7761a5ded1741da411e7fe0909e27a5e6a0cb7b034", size = 2115441, upload-time = "2025-11-04T13:42:39.557Z" }, + { url = "https://files.pythonhosted.org/packages/1f/53/8942f884fa33f50794f119012dc6a1a02ac43a56407adaac20463df8e98f/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:634e8609e89ceecea15e2d61bc9ac3718caaaa71963717bf3c8f38bfde64242c", size = 1930291, upload-time = "2025-11-04T13:42:42.169Z" }, + { url = "https://files.pythonhosted.org/packages/79/c8/ecb9ed9cd942bce09fc888ee960b52654fbdbede4ba6c2d6e0d3b1d8b49c/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93e8740d7503eb008aa2df04d3b9735f845d43ae845e6dcd2be0b55a2da43cd2", size = 1948632, upload-time = "2025-11-04T13:42:44.564Z" }, + { url = "https://files.pythonhosted.org/packages/2e/1b/687711069de7efa6af934e74f601e2a4307365e8fdc404703afc453eab26/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15489ba13d61f670dcc96772e733aad1a6f9c429cc27574c6cdaed82d0146ad", size = 2138905, upload-time = "2025-11-04T13:42:47.156Z" }, + { url = "https://files.pythonhosted.org/packages/09/32/59b0c7e63e277fa7911c2fc70ccfb45ce4b98991e7ef37110663437005af/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd", size = 2110495, upload-time = "2025-11-04T13:42:49.689Z" }, + { url = "https://files.pythonhosted.org/packages/aa/81/05e400037eaf55ad400bcd318c05bb345b57e708887f07ddb2d20e3f0e98/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc", size = 1915388, upload-time = "2025-11-04T13:42:52.215Z" }, + { url = "https://files.pythonhosted.org/packages/6e/0d/e3549b2399f71d56476b77dbf3cf8937cec5cd70536bdc0e374a421d0599/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56", size = 1942879, upload-time = "2025-11-04T13:42:56.483Z" }, + { url = "https://files.pythonhosted.org/packages/f7/07/34573da085946b6a313d7c42f82f16e8920bfd730665de2d11c0c37a74b5/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b", size = 2139017, upload-time = "2025-11-04T13:42:59.471Z" }, + { url = "https://files.pythonhosted.org/packages/e6/b0/1a2aa41e3b5a4ba11420aba2d091b2d17959c8d1519ece3627c371951e73/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b5819cd790dbf0c5eb9f82c73c16b39a65dd6dd4d1439dcdea7816ec9adddab8", size = 2103351, upload-time = "2025-11-04T13:43:02.058Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ee/31b1f0020baaf6d091c87900ae05c6aeae101fa4e188e1613c80e4f1ea31/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:5a4e67afbc95fa5c34cf27d9089bca7fcab4e51e57278d710320a70b956d1b9a", size = 1925363, upload-time = "2025-11-04T13:43:05.159Z" }, + { url = "https://files.pythonhosted.org/packages/e1/89/ab8e86208467e467a80deaca4e434adac37b10a9d134cd2f99b28a01e483/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ece5c59f0ce7d001e017643d8d24da587ea1f74f6993467d85ae8a5ef9d4f42b", size = 2135615, upload-time = "2025-11-04T13:43:08.116Z" }, + { url = "https://files.pythonhosted.org/packages/99/0a/99a53d06dd0348b2008f2f30884b34719c323f16c3be4e6cc1203b74a91d/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16f80f7abe3351f8ea6858914ddc8c77e02578544a0ebc15b4c2e1a0e813b0b2", size = 2175369, upload-time = "2025-11-04T13:43:12.49Z" }, + { url = "https://files.pythonhosted.org/packages/6d/94/30ca3b73c6d485b9bb0bc66e611cff4a7138ff9736b7e66bcf0852151636/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:33cb885e759a705b426baada1fe68cbb0a2e68e34c5d0d0289a364cf01709093", size = 2144218, upload-time = "2025-11-04T13:43:15.431Z" }, + { url = "https://files.pythonhosted.org/packages/87/57/31b4f8e12680b739a91f472b5671294236b82586889ef764b5fbc6669238/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:c8d8b4eb992936023be7dee581270af5c6e0697a8559895f527f5b7105ecd36a", size = 2329951, upload-time = "2025-11-04T13:43:18.062Z" }, + { url = "https://files.pythonhosted.org/packages/7d/73/3c2c8edef77b8f7310e6fb012dbc4b8551386ed575b9eb6fb2506e28a7eb/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:242a206cd0318f95cd21bdacff3fcc3aab23e79bba5cac3db5a841c9ef9c6963", size = 2318428, upload-time = "2025-11-04T13:43:20.679Z" }, + { url = "https://files.pythonhosted.org/packages/2f/02/8559b1f26ee0d502c74f9cca5c0d2fd97e967e083e006bbbb4e97f3a043a/pydantic_core-2.41.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d3a978c4f57a597908b7e697229d996d77a6d3c94901e9edee593adada95ce1a", size = 2147009, upload-time = "2025-11-04T13:43:23.286Z" }, + { url = "https://files.pythonhosted.org/packages/5f/9b/1b3f0e9f9305839d7e84912f9e8bfbd191ed1b1ef48083609f0dabde978c/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b2379fa7ed44ddecb5bfe4e48577d752db9fc10be00a6b7446e9663ba143de26", size = 2101980, upload-time = "2025-11-04T13:43:25.97Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ed/d71fefcb4263df0da6a85b5d8a7508360f2f2e9b3bf5814be9c8bccdccc1/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:266fb4cbf5e3cbd0b53669a6d1b039c45e3ce651fd5442eff4d07c2cc8d66808", size = 1923865, upload-time = "2025-11-04T13:43:28.763Z" }, + { url = "https://files.pythonhosted.org/packages/ce/3a/626b38db460d675f873e4444b4bb030453bbe7b4ba55df821d026a0493c4/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58133647260ea01e4d0500089a8c4f07bd7aa6ce109682b1426394988d8aaacc", size = 2134256, upload-time = "2025-11-04T13:43:31.71Z" }, + { url = "https://files.pythonhosted.org/packages/83/d9/8412d7f06f616bbc053d30cb4e5f76786af3221462ad5eee1f202021eb4e/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:287dad91cfb551c363dc62899a80e9e14da1f0e2b6ebde82c806612ca2a13ef1", size = 2174762, upload-time = "2025-11-04T13:43:34.744Z" }, + { url = "https://files.pythonhosted.org/packages/55/4c/162d906b8e3ba3a99354e20faa1b49a85206c47de97a639510a0e673f5da/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:03b77d184b9eb40240ae9fd676ca364ce1085f203e1b1256f8ab9984dca80a84", size = 2143141, upload-time = "2025-11-04T13:43:37.701Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f2/f11dd73284122713f5f89fc940f370d035fa8e1e078d446b3313955157fe/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:a668ce24de96165bb239160b3d854943128f4334822900534f2fe947930e5770", size = 2330317, upload-time = "2025-11-04T13:43:40.406Z" }, + { url = "https://files.pythonhosted.org/packages/88/9d/b06ca6acfe4abb296110fb1273a4d848a0bfb2ff65f3ee92127b3244e16b/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f14f8f046c14563f8eb3f45f499cc658ab8d10072961e07225e507adb700e93f", size = 2316992, upload-time = "2025-11-04T13:43:43.602Z" }, + { url = "https://files.pythonhosted.org/packages/36/c7/cfc8e811f061c841d7990b0201912c3556bfeb99cdcb7ed24adc8d6f8704/pydantic_core-2.41.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56121965f7a4dc965bff783d70b907ddf3d57f6eba29b6d2e5dabfaf07799c51", size = 2145302, upload-time = "2025-11-04T13:43:46.64Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "pylint" +version = "3.2.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "astroid" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "dill" }, + { name = "isort" }, + { name = "mccabe" }, + { name = "platformdirs" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "tomlkit" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9a/e9/60280b14cc1012794120345ce378504cf17409e38cd88f455dc24e0ad6b5/pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60", size = 1506739, upload-time = "2024-06-06T14:19:17.955Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/d3/d346f779cbc9384d8b805a7557b5f2b8ee9f842bffebec9fc6364d6ae183/pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8", size = 519244, upload-time = "2024-06-06T14:19:13.228Z" }, +] + +[[package]] +name = "pyright" +version = "1.1.408" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nodeenv" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/74/b2/5db700e52554b8f025faa9c3c624c59f1f6c8841ba81ab97641b54322f16/pyright-1.1.408.tar.gz", hash = "sha256:f28f2321f96852fa50b5829ea492f6adb0e6954568d1caa3f3af3a5f555eb684", size = 4400578, upload-time = "2026-01-08T08:07:38.795Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/82/a2c93e32800940d9573fb28c346772a14778b84ba7524e691b324620ab89/pyright-1.1.408-py3-none-any.whl", hash = "sha256:090b32865f4fdb1e0e6cd82bf5618480d48eecd2eb2e70f960982a3d9a4c17c1", size = 6399144, upload-time = "2026-01-08T08:07:37.082Z" }, +] + +[[package]] +name = "pytest" +version = "8.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "0.23.8" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/de/b4/0b378b7bf26a8ae161c3890c0b48a91a04106c5713ce81b4b080ea2f4f18/pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3", size = 46920, upload-time = "2024-07-17T17:39:34.617Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ee/82/62e2d63639ecb0fbe8a7ee59ef0bc69a4669ec50f6d3459f74ad4e4189a2/pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2", size = 17663, upload-time = "2024-07-17T17:39:32.478Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "requests" +version = "2.32.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c9/74/b3ff8e6c8446842c3f5c837e9c3dfcfe2018ea6ecef224c710c85ef728f4/requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf", size = 134517, upload-time = "2025-08-18T20:46:02.573Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", size = 64738, upload-time = "2025-08-18T20:46:00.542Z" }, +] + +[[package]] +name = "rsa" +version = "4.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyasn1" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/da/8a/22b7beea3ee0d44b1916c0c1cb0ee3af23b700b6da9f04991899d0c555d4/rsa-4.9.1.tar.gz", hash = "sha256:e7bdbfdb5497da4c07dfd35530e1a902659db6ff241e39d9953cad06ebd0ae75", size = 29034, upload-time = "2025-04-16T09:51:18.218Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/8d/0133e4eb4beed9e425d9a98ed6e081a55d195481b7632472be1af08d2f6b/rsa-4.9.1-py3-none-any.whl", hash = "sha256:68635866661c6836b8d39430f97a996acbd61bfa49406748ea243539fe239762", size = 34696, upload-time = "2025-04-16T09:51:17.142Z" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "tomli" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/ed/3f73f72945444548f33eba9a87fc7a6e969915e7b1acc8260b30e1f76a2f/tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549", size = 17392, upload-time = "2025-10-08T22:01:47.119Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/2e/299f62b401438d5fe1624119c723f5d877acc86a4c2492da405626665f12/tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45", size = 153236, upload-time = "2025-10-08T22:01:00.137Z" }, + { url = "https://files.pythonhosted.org/packages/86/7f/d8fffe6a7aefdb61bced88fcb5e280cfd71e08939da5894161bd71bea022/tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba", size = 148084, upload-time = "2025-10-08T22:01:01.63Z" }, + { url = "https://files.pythonhosted.org/packages/47/5c/24935fb6a2ee63e86d80e4d3b58b222dafaf438c416752c8b58537c8b89a/tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf", size = 234832, upload-time = "2025-10-08T22:01:02.543Z" }, + { url = "https://files.pythonhosted.org/packages/89/da/75dfd804fc11e6612846758a23f13271b76d577e299592b4371a4ca4cd09/tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441", size = 242052, upload-time = "2025-10-08T22:01:03.836Z" }, + { url = "https://files.pythonhosted.org/packages/70/8c/f48ac899f7b3ca7eb13af73bacbc93aec37f9c954df3c08ad96991c8c373/tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845", size = 239555, upload-time = "2025-10-08T22:01:04.834Z" }, + { url = "https://files.pythonhosted.org/packages/ba/28/72f8afd73f1d0e7829bfc093f4cb98ce0a40ffc0cc997009ee1ed94ba705/tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c", size = 245128, upload-time = "2025-10-08T22:01:05.84Z" }, + { url = "https://files.pythonhosted.org/packages/b6/eb/a7679c8ac85208706d27436e8d421dfa39d4c914dcf5fa8083a9305f58d9/tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456", size = 96445, upload-time = "2025-10-08T22:01:06.896Z" }, + { url = "https://files.pythonhosted.org/packages/0a/fe/3d3420c4cb1ad9cb462fb52967080575f15898da97e21cb6f1361d505383/tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be", size = 107165, upload-time = "2025-10-08T22:01:08.107Z" }, + { url = "https://files.pythonhosted.org/packages/ff/b7/40f36368fcabc518bb11c8f06379a0fd631985046c038aca08c6d6a43c6e/tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac", size = 154891, upload-time = "2025-10-08T22:01:09.082Z" }, + { url = "https://files.pythonhosted.org/packages/f9/3f/d9dd692199e3b3aab2e4e4dd948abd0f790d9ded8cd10cbaae276a898434/tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22", size = 148796, upload-time = "2025-10-08T22:01:10.266Z" }, + { url = "https://files.pythonhosted.org/packages/60/83/59bff4996c2cf9f9387a0f5a3394629c7efa5ef16142076a23a90f1955fa/tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f", size = 242121, upload-time = "2025-10-08T22:01:11.332Z" }, + { url = "https://files.pythonhosted.org/packages/45/e5/7c5119ff39de8693d6baab6c0b6dcb556d192c165596e9fc231ea1052041/tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52", size = 250070, upload-time = "2025-10-08T22:01:12.498Z" }, + { url = "https://files.pythonhosted.org/packages/45/12/ad5126d3a278f27e6701abde51d342aa78d06e27ce2bb596a01f7709a5a2/tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8", size = 245859, upload-time = "2025-10-08T22:01:13.551Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a1/4d6865da6a71c603cfe6ad0e6556c73c76548557a8d658f9e3b142df245f/tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6", size = 250296, upload-time = "2025-10-08T22:01:14.614Z" }, + { url = "https://files.pythonhosted.org/packages/a0/b7/a7a7042715d55c9ba6e8b196d65d2cb662578b4d8cd17d882d45322b0d78/tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876", size = 97124, upload-time = "2025-10-08T22:01:15.629Z" }, + { url = "https://files.pythonhosted.org/packages/06/1e/f22f100db15a68b520664eb3328fb0ae4e90530887928558112c8d1f4515/tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878", size = 107698, upload-time = "2025-10-08T22:01:16.51Z" }, + { url = "https://files.pythonhosted.org/packages/89/48/06ee6eabe4fdd9ecd48bf488f4ac783844fd777f547b8d1b61c11939974e/tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b", size = 154819, upload-time = "2025-10-08T22:01:17.964Z" }, + { url = "https://files.pythonhosted.org/packages/f1/01/88793757d54d8937015c75dcdfb673c65471945f6be98e6a0410fba167ed/tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae", size = 148766, upload-time = "2025-10-08T22:01:18.959Z" }, + { url = "https://files.pythonhosted.org/packages/42/17/5e2c956f0144b812e7e107f94f1cc54af734eb17b5191c0bbfb72de5e93e/tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b", size = 240771, upload-time = "2025-10-08T22:01:20.106Z" }, + { url = "https://files.pythonhosted.org/packages/d5/f4/0fbd014909748706c01d16824eadb0307115f9562a15cbb012cd9b3512c5/tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf", size = 248586, upload-time = "2025-10-08T22:01:21.164Z" }, + { url = "https://files.pythonhosted.org/packages/30/77/fed85e114bde5e81ecf9bc5da0cc69f2914b38f4708c80ae67d0c10180c5/tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f", size = 244792, upload-time = "2025-10-08T22:01:22.417Z" }, + { url = "https://files.pythonhosted.org/packages/55/92/afed3d497f7c186dc71e6ee6d4fcb0acfa5f7d0a1a2878f8beae379ae0cc/tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05", size = 248909, upload-time = "2025-10-08T22:01:23.859Z" }, + { url = "https://files.pythonhosted.org/packages/f8/84/ef50c51b5a9472e7265ce1ffc7f24cd4023d289e109f669bdb1553f6a7c2/tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606", size = 96946, upload-time = "2025-10-08T22:01:24.893Z" }, + { url = "https://files.pythonhosted.org/packages/b2/b7/718cd1da0884f281f95ccfa3a6cc572d30053cba64603f79d431d3c9b61b/tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999", size = 107705, upload-time = "2025-10-08T22:01:26.153Z" }, + { url = "https://files.pythonhosted.org/packages/19/94/aeafa14a52e16163008060506fcb6aa1949d13548d13752171a755c65611/tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e", size = 154244, upload-time = "2025-10-08T22:01:27.06Z" }, + { url = "https://files.pythonhosted.org/packages/db/e4/1e58409aa78eefa47ccd19779fc6f36787edbe7d4cd330eeeedb33a4515b/tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3", size = 148637, upload-time = "2025-10-08T22:01:28.059Z" }, + { url = "https://files.pythonhosted.org/packages/26/b6/d1eccb62f665e44359226811064596dd6a366ea1f985839c566cd61525ae/tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc", size = 241925, upload-time = "2025-10-08T22:01:29.066Z" }, + { url = "https://files.pythonhosted.org/packages/70/91/7cdab9a03e6d3d2bb11beae108da5bdc1c34bdeb06e21163482544ddcc90/tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0", size = 249045, upload-time = "2025-10-08T22:01:31.98Z" }, + { url = "https://files.pythonhosted.org/packages/15/1b/8c26874ed1f6e4f1fcfeb868db8a794cbe9f227299402db58cfcc858766c/tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879", size = 245835, upload-time = "2025-10-08T22:01:32.989Z" }, + { url = "https://files.pythonhosted.org/packages/fd/42/8e3c6a9a4b1a1360c1a2a39f0b972cef2cc9ebd56025168c4137192a9321/tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005", size = 253109, upload-time = "2025-10-08T22:01:34.052Z" }, + { url = "https://files.pythonhosted.org/packages/22/0c/b4da635000a71b5f80130937eeac12e686eefb376b8dee113b4a582bba42/tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463", size = 97930, upload-time = "2025-10-08T22:01:35.082Z" }, + { url = "https://files.pythonhosted.org/packages/b9/74/cb1abc870a418ae99cd5c9547d6bce30701a954e0e721821df483ef7223c/tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8", size = 107964, upload-time = "2025-10-08T22:01:36.057Z" }, + { url = "https://files.pythonhosted.org/packages/54/78/5c46fff6432a712af9f792944f4fcd7067d8823157949f4e40c56b8b3c83/tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77", size = 163065, upload-time = "2025-10-08T22:01:37.27Z" }, + { url = "https://files.pythonhosted.org/packages/39/67/f85d9bd23182f45eca8939cd2bc7050e1f90c41f4a2ecbbd5963a1d1c486/tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf", size = 159088, upload-time = "2025-10-08T22:01:38.235Z" }, + { url = "https://files.pythonhosted.org/packages/26/5a/4b546a0405b9cc0659b399f12b6adb750757baf04250b148d3c5059fc4eb/tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530", size = 268193, upload-time = "2025-10-08T22:01:39.712Z" }, + { url = "https://files.pythonhosted.org/packages/42/4f/2c12a72ae22cf7b59a7fe75b3465b7aba40ea9145d026ba41cb382075b0e/tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b", size = 275488, upload-time = "2025-10-08T22:01:40.773Z" }, + { url = "https://files.pythonhosted.org/packages/92/04/a038d65dbe160c3aa5a624e93ad98111090f6804027d474ba9c37c8ae186/tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67", size = 272669, upload-time = "2025-10-08T22:01:41.824Z" }, + { url = "https://files.pythonhosted.org/packages/be/2f/8b7c60a9d1612a7cbc39ffcca4f21a73bf368a80fc25bccf8253e2563267/tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f", size = 279709, upload-time = "2025-10-08T22:01:43.177Z" }, + { url = "https://files.pythonhosted.org/packages/7e/46/cc36c679f09f27ded940281c38607716c86cf8ba4a518d524e349c8b4874/tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0", size = 107563, upload-time = "2025-10-08T22:01:44.233Z" }, + { url = "https://files.pythonhosted.org/packages/84/ff/426ca8683cf7b753614480484f6437f568fd2fda2edbdf57a2d3d8b27a0b/tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba", size = 119756, upload-time = "2025-10-08T22:01:45.234Z" }, + { url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" }, +] + +[[package]] +name = "tomlkit" +version = "0.13.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cc/18/0bbf3884e9eaa38819ebe46a7bd25dcd56b67434402b66a58c4b8e552575/tomlkit-0.13.3.tar.gz", hash = "sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1", size = 185207, upload-time = "2025-06-05T07:13:44.947Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/75/8539d011f6be8e29f339c42e633aae3cb73bffa95dd0f9adec09b9c58e85/tomlkit-0.13.3-py3-none-any.whl", hash = "sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0", size = 38901, upload-time = "2025-06-05T07:13:43.546Z" }, +] + +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20251115" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/36/06d01fb52c0d57e9ad0c237654990920fa41195e4b3d640830dabf9eeb2f/types_python_dateutil-2.9.0.20251115.tar.gz", hash = "sha256:8a47f2c3920f52a994056b8786309b43143faa5a64d4cbb2722d6addabdf1a58", size = 16363, upload-time = "2025-11-15T03:00:13.717Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/0b/56961d3ba517ed0df9b3a27bfda6514f3d01b28d499d1bce9068cfe4edd1/types_python_dateutil-2.9.0.20251115-py3-none-any.whl", hash = "sha256:9cf9c1c582019753b8639a081deefd7e044b9fa36bd8217f565c6c4e36ee0624", size = 18251, upload-time = "2025-11-15T03:00:12.317Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, +] + +[[package]] +name = "urllib3" +version = "2.6.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/24/a2a2ed9addd907787d7aa0355ba36a6cadf1768b934c652ea78acbd59dcd/urllib3-2.6.2.tar.gz", hash = "sha256:016f9c98bb7e98085cb2b4b17b87d2c702975664e4f060c6532e64d1c1a5e797", size = 432930, upload-time = "2025-12-11T15:56:40.252Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/b9/4095b668ea3678bf6a0af005527f39de12fb026516fb3df17495a733b7f8/urllib3-2.6.2-py3-none-any.whl", hash = "sha256:ec21cddfe7724fc7cb4ba4bea7aa8e2ef36f607a4bab81aa6ce42a13dc3f03dd", size = 131182, upload-time = "2025-12-11T15:56:38.584Z" }, +] diff --git a/packages/mistralai_azure/.genignore b/packages/mistralai_azure/.genignore deleted file mode 100644 index 513646da..00000000 --- a/packages/mistralai_azure/.genignore +++ /dev/null @@ -1,4 +0,0 @@ -src/mistralai_azure/sdk.py -README.md -USAGE.md -docs/sdks/**/README.md \ No newline at end of file diff --git a/packages/mistralai_azure/.gitignore b/packages/mistralai_azure/.gitignore deleted file mode 100644 index f2ea8c39..00000000 --- a/packages/mistralai_azure/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -**/__pycache__/ -**/.speakeasy/temp/ -**/.speakeasy/logs/ -.speakeasy/reports -README-PYPI.md -.venv/ -venv/ -src/*.egg-info/ -__pycache__/ -.pytest_cache/ -.python-version -.DS_Store -pyrightconfig.json diff --git a/packages/mistralai_azure/.speakeasy/gen.lock b/packages/mistralai_azure/.speakeasy/gen.lock deleted file mode 100644 index bce8e3c8..00000000 --- a/packages/mistralai_azure/.speakeasy/gen.lock +++ /dev/null @@ -1,215 +0,0 @@ -lockVersion: 2.0.0 -id: dc40fa48-2c4d-46ad-ac8b-270749770f34 -management: - docChecksum: 87653f040f5b36c90e066870f34c478e - docVersion: 1.0.0 - speakeasyVersion: 1.568.2 - generationVersion: 2.634.2 - releaseVersion: 1.6.0 - configChecksum: 0b604304465a25f89acca310710262d1 - published: true -features: - python: - additionalDependencies: 1.0.0 - additionalProperties: 1.0.1 - constsAndDefaults: 1.0.5 - core: 5.19.3 - defaultEnabledRetries: 0.2.0 - enumUnions: 0.1.0 - envVarSecurityUsage: 0.3.2 - examples: 3.0.1 - flatRequests: 1.0.1 - globalSecurity: 3.0.3 - globalSecurityCallbacks: 1.0.0 - globalSecurityFlattening: 1.0.0 - globalServerURLs: 3.1.1 - methodArguments: 1.0.2 - nameOverrides: 3.0.1 - nullables: 1.0.1 - openEnums: 1.0.1 - responseFormat: 1.0.1 - retries: 3.0.2 - sdkHooks: 1.1.0 - serverEvents: 1.0.7 - serverEventsSentinels: 0.1.0 - serverIDs: 3.0.0 - unions: 3.0.4 -generatedFiles: - - .gitattributes - - .python-version - - .vscode/settings.json - - docs/models/arguments.md - - docs/models/assistantmessage.md - - docs/models/assistantmessagecontent.md - - docs/models/assistantmessagerole.md - - docs/models/chatcompletionchoice.md - - docs/models/chatcompletionchoicefinishreason.md - - docs/models/chatcompletionrequest.md - - docs/models/chatcompletionrequestmessages.md - - docs/models/chatcompletionrequeststop.md - - docs/models/chatcompletionrequesttoolchoice.md - - docs/models/chatcompletionresponse.md - - docs/models/chatcompletionstreamrequest.md - - docs/models/chatcompletionstreamrequesttoolchoice.md - - docs/models/completionchunk.md - - docs/models/completionevent.md - - docs/models/completionresponsestreamchoice.md - - docs/models/content.md - - docs/models/contentchunk.md - - docs/models/deltamessage.md - - docs/models/document.md - - docs/models/documenturlchunk.md - - docs/models/documenturlchunktype.md - - docs/models/filechunk.md - - docs/models/finishreason.md - - docs/models/function.md - - docs/models/functioncall.md - - docs/models/functionname.md - - docs/models/httpvalidationerror.md - - docs/models/imageurl.md - - docs/models/imageurlchunk.md - - docs/models/imageurlchunkimageurl.md - - docs/models/imageurlchunktype.md - - docs/models/jsonschema.md - - docs/models/loc.md - - docs/models/messages.md - - docs/models/mistralpromptmode.md - - docs/models/ocrimageobject.md - - docs/models/ocrpagedimensions.md - - docs/models/ocrpageobject.md - - docs/models/ocrrequest.md - - docs/models/ocrresponse.md - - docs/models/ocrusageinfo.md - - docs/models/prediction.md - - docs/models/referencechunk.md - - docs/models/referencechunktype.md - - docs/models/responseformat.md - - docs/models/responseformats.md - - docs/models/role.md - - docs/models/security.md - - docs/models/stop.md - - docs/models/systemmessage.md - - docs/models/systemmessagecontent.md - - docs/models/textchunk.md - - docs/models/tool.md - - docs/models/toolcall.md - - docs/models/toolchoice.md - - docs/models/toolchoiceenum.md - - docs/models/toolmessage.md - - docs/models/toolmessagecontent.md - - docs/models/toolmessagerole.md - - docs/models/tooltypes.md - - docs/models/type.md - - docs/models/usageinfo.md - - docs/models/usermessage.md - - docs/models/usermessagecontent.md - - docs/models/usermessagerole.md - - docs/models/utils/retryconfig.md - - docs/models/validationerror.md - - poetry.toml - - py.typed - - pylintrc - - pyproject.toml - - scripts/publish.sh - - src/mistralai_azure/__init__.py - - src/mistralai_azure/_hooks/__init__.py - - src/mistralai_azure/_hooks/sdkhooks.py - - src/mistralai_azure/_hooks/types.py - - src/mistralai_azure/_version.py - - src/mistralai_azure/basesdk.py - - src/mistralai_azure/chat.py - - src/mistralai_azure/httpclient.py - - src/mistralai_azure/models/__init__.py - - src/mistralai_azure/models/assistantmessage.py - - src/mistralai_azure/models/chatcompletionchoice.py - - src/mistralai_azure/models/chatcompletionrequest.py - - src/mistralai_azure/models/chatcompletionresponse.py - - src/mistralai_azure/models/chatcompletionstreamrequest.py - - src/mistralai_azure/models/completionchunk.py - - src/mistralai_azure/models/completionevent.py - - src/mistralai_azure/models/completionresponsestreamchoice.py - - src/mistralai_azure/models/contentchunk.py - - src/mistralai_azure/models/deltamessage.py - - src/mistralai_azure/models/documenturlchunk.py - - src/mistralai_azure/models/filechunk.py - - src/mistralai_azure/models/function.py - - src/mistralai_azure/models/functioncall.py - - src/mistralai_azure/models/functionname.py - - src/mistralai_azure/models/httpvalidationerror.py - - src/mistralai_azure/models/imageurl.py - - src/mistralai_azure/models/imageurlchunk.py - - src/mistralai_azure/models/jsonschema.py - - src/mistralai_azure/models/mistralpromptmode.py - - src/mistralai_azure/models/ocrimageobject.py - - src/mistralai_azure/models/ocrpagedimensions.py - - src/mistralai_azure/models/ocrpageobject.py - - src/mistralai_azure/models/ocrrequest.py - - src/mistralai_azure/models/ocrresponse.py - - src/mistralai_azure/models/ocrusageinfo.py - - src/mistralai_azure/models/prediction.py - - src/mistralai_azure/models/referencechunk.py - - src/mistralai_azure/models/responseformat.py - - src/mistralai_azure/models/responseformats.py - - src/mistralai_azure/models/sdkerror.py - - src/mistralai_azure/models/security.py - - src/mistralai_azure/models/systemmessage.py - - src/mistralai_azure/models/textchunk.py - - src/mistralai_azure/models/tool.py - - src/mistralai_azure/models/toolcall.py - - src/mistralai_azure/models/toolchoice.py - - src/mistralai_azure/models/toolchoiceenum.py - - src/mistralai_azure/models/toolmessage.py - - src/mistralai_azure/models/tooltypes.py - - src/mistralai_azure/models/usageinfo.py - - src/mistralai_azure/models/usermessage.py - - src/mistralai_azure/models/validationerror.py - - src/mistralai_azure/ocr.py - - src/mistralai_azure/py.typed - - src/mistralai_azure/sdk.py - - src/mistralai_azure/sdkconfiguration.py - - src/mistralai_azure/types/__init__.py - - src/mistralai_azure/types/basemodel.py - - src/mistralai_azure/utils/__init__.py - - src/mistralai_azure/utils/annotations.py - - src/mistralai_azure/utils/datetimes.py - - src/mistralai_azure/utils/enums.py - - src/mistralai_azure/utils/eventstreaming.py - - src/mistralai_azure/utils/forms.py - - src/mistralai_azure/utils/headers.py - - src/mistralai_azure/utils/logger.py - - src/mistralai_azure/utils/metadata.py - - src/mistralai_azure/utils/queryparams.py - - src/mistralai_azure/utils/requestbodies.py - - src/mistralai_azure/utils/retries.py - - src/mistralai_azure/utils/security.py - - src/mistralai_azure/utils/serializers.py - - src/mistralai_azure/utils/url.py - - src/mistralai_azure/utils/values.py -examples: - stream_chat: - speakeasy-default-stream-chat: - requestBody: - application/json: {"model": "azureai", "stream": true, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}]} - responses: - "422": - application/json: {} - chat_completion_v1_chat_completions_post: - speakeasy-default-chat-completion-v1-chat-completions-post: - requestBody: - application/json: {"model": "azureai", "stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}]} - responses: - "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}, "created": 1702256327, "choices": []} - "422": - application/json: {} - ocr_v1_ocr_post: - speakeasy-default-ocr-v1-ocr-post: - requestBody: - application/json: {"model": "CX-9", "document": {"document_url": "https://upset-labourer.net/", "type": "document_url"}} - responses: - "200": - application/json: {"pages": [], "model": "Golf", "usage_info": {"pages_processed": 944919}} - "422": - application/json: {} -examplesVersion: 1.0.2 -generatedTests: {} diff --git a/packages/mistralai_azure/.speakeasy/gen.yaml b/packages/mistralai_azure/.speakeasy/gen.yaml deleted file mode 100644 index 63e2da75..00000000 --- a/packages/mistralai_azure/.speakeasy/gen.yaml +++ /dev/null @@ -1,59 +0,0 @@ -configVersion: 2.0.0 -generation: - sdkClassName: MistralAzure - maintainOpenAPIOrder: true - usageSnippets: - optionalPropertyRendering: withExample - sdkInitStyle: constructor - useClassNamesForArrayFields: true - fixes: - nameResolutionDec2023: true - nameResolutionFeb2025: false - parameterOrderingFeb2024: true - requestResponseComponentNamesFeb2024: true - securityFeb2025: false - sharedErrorComponentsApr2025: false - auth: - oAuth2ClientCredentialsEnabled: true - oAuth2PasswordEnabled: false - tests: - generateTests: true - generateNewTests: false - skipResponseBodyAssertions: false -python: - version: 1.6.0 - additionalDependencies: - dev: - pytest: ^8.2.2 - pytest-asyncio: ^0.23.7 - authors: - - Mistral - baseErrorName: MistralAzureError - clientServerStatusCodesAsErrors: true - defaultErrorName: SDKError - description: Python Client SDK for the Mistral AI API in Azure. - enableCustomCodeRegions: false - enumFormat: union - fixFlags: - responseRequiredSep2024: false - flattenGlobalSecurity: true - flattenRequests: true - flatteningOrder: parameters-first - imports: - option: openapi - paths: - callbacks: "" - errors: "" - operations: "" - shared: "" - webhooks: "" - inputModelSuffix: input - maxMethodParams: 15 - methodArguments: infer-optional-args - moduleName: "" - outputModelSuffix: output - packageName: mistralai_azure - pytestFilterWarnings: [] - pytestTimeout: 0 - responseFormat: flat - templateVersion: v2 diff --git a/packages/mistralai_azure/.vscode/settings.json b/packages/mistralai_azure/.vscode/settings.json deleted file mode 100644 index 8d79f0ab..00000000 --- a/packages/mistralai_azure/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "python.testing.pytestArgs": ["tests", "-vv"], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "pylint.args": ["--rcfile=pylintrc"] -} diff --git a/packages/mistralai_azure/README.md b/packages/mistralai_azure/README.md deleted file mode 100644 index 65bc2e4f..00000000 --- a/packages/mistralai_azure/README.md +++ /dev/null @@ -1,430 +0,0 @@ -# Mistral on Azure Python Client - -## SDK Installation - -PIP -```bash -pip install mistralai -``` - -Poetry -```bash -poetry add mistralai -``` - -**Prerequisites** - -Before you begin, ensure you have `AZUREAI_ENDPOINT` and an `AZURE_API_KEY`. To obtain these, you will need to deploy Mistral on Azure AI. -See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/). - - -## SDK Example Usage - -### Create Chat Completions - -This example shows how to create chat completions. - -```python -# Synchronous Example -from mistralai_azure import MistralAzure -import os - -s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.complete( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="azureai" -) - -if res is not None: - # handle response - pass -``` - -
- -The same SDK client can also be used to make asychronous requests by importing asyncio. -```python -# Asynchronous Example -import asyncio -from mistralai_azure import MistralAzure -import os - -async def main(): - s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") - ) - res = await s.chat.complete_async( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="azureai" - ) - if res is not None: - # handle response - pass - -asyncio.run(main()) -``` - - - -## Available Resources and Operations - -### [chat](docs/sdks/chat/README.md) - -* [stream](docs/sdks/chat/README.md#stream) - Stream chat completion -* [create](docs/sdks/chat/README.md#create) - Chat Completion - - - -## Server-sent event streaming - -[Server-sent events][mdn-sse] are used to stream content from certain -operations. These operations will expose the stream as [Generator][generator] that -can be consumed using a simple `for` loop. The loop will -terminate when the server no longer has any events to send and closes the -underlying connection. - -```python -from mistralai_azure import MistralAzure -import os - -s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.stream( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="azureai" -) - -if res is not None: - for event in res: - # handle event - print(event) - -``` - -[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events -[generator]: https://wiki.python.org/moin/Generators - - - -## Retries - -Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. - -To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: -```python -from mistralai_azure import MistralAzure -from mistralazure.utils import BackoffStrategy, RetryConfig -import os - -s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.stream(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai", - RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - -if res is not None: - for event in res: - # handle event - print(event) - -``` - -If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: -```python -from mistralai_azure import MistralAzure -from mistralazure.utils import BackoffStrategy, RetryConfig -import os - -s = MistralAzure( - retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.stream(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai") - -if res is not None: - for event in res: - # handle event - print(event) - -``` - - - -## Error Handling - -Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. - -| Error Object | Status Code | Content Type | -| -------------------------- | ----------- | ---------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4xx-5xx | */* | - -### Example - -```python -from mistralai_azure import MistralAzure, models -import os - -s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - -res = None -try: - res = s.chat.complete(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai") - -except models.HTTPValidationError as e: - # handle exception - raise(e) -except models.SDKError as e: - # handle exception - raise(e) - -if res is not None: - # handle response - pass - -``` - - - -## Server Selection - -### Select Server by Name - -You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: - -| Name | Server | Variables | -| ------ | ------------------------ | --------- | -| `prod` | `https://api.mistral.ai` | None | - -#### Example - -```python -from mistralai_azure import MistralAzure -import os - -s = MistralAzure( - server="prod", - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.stream(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai") - -if res is not None: - for event in res: - # handle event - print(event) - -``` - - -### Override Server URL Per-Client - -The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: -```python -from mistralai_azure import MistralAzure -import os - -s = MistralAzure( - server_url="https://api.mistral.ai", - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.stream(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai") - -if res is not None: - for event in res: - # handle event - print(event) - -``` - - - -## Custom HTTP Client - -The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. -Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. -This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. - -For example, you could specify a header for every request that this sdk makes as follows: -```python -from mistralai_azure import MistralAzure -import httpx - -http_client = httpx.Client(headers={"x-custom-header": "someValue"}) -s = MistralAzure(client=http_client) -``` - -or you could wrap the client with your own custom logic: -```python -from mistralai_azure import MistralAzure -from mistralai_azure.httpclient import AsyncHttpClient -import httpx - -class CustomClient(AsyncHttpClient): - client: AsyncHttpClient - - def __init__(self, client: AsyncHttpClient): - self.client = client - - async def send( - self, - request: httpx.Request, - *, - stream: bool = False, - auth: Union[ - httpx._types.AuthTypes, httpx._client.UseClientDefault, None - ] = httpx.USE_CLIENT_DEFAULT, - follow_redirects: Union[ - bool, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - ) -> httpx.Response: - request.headers["Client-Level-Header"] = "added by client" - - return await self.client.send( - request, stream=stream, auth=auth, follow_redirects=follow_redirects - ) - - def build_request( - self, - method: str, - url: httpx._types.URLTypes, - *, - content: Optional[httpx._types.RequestContent] = None, - data: Optional[httpx._types.RequestData] = None, - files: Optional[httpx._types.RequestFiles] = None, - json: Optional[Any] = None, - params: Optional[httpx._types.QueryParamTypes] = None, - headers: Optional[httpx._types.HeaderTypes] = None, - cookies: Optional[httpx._types.CookieTypes] = None, - timeout: Union[ - httpx._types.TimeoutTypes, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - extensions: Optional[httpx._types.RequestExtensions] = None, - ) -> httpx.Request: - return self.client.build_request( - method, - url, - content=content, - data=data, - files=files, - json=json, - params=params, - headers=headers, - cookies=cookies, - timeout=timeout, - extensions=extensions, - ) - -s = MistralAzure(async_client=CustomClient(httpx.AsyncClient())) -``` - - - -## Authentication - -### Per-Client Security Schemes - -This SDK supports the following security scheme globally: - -| Name | Type | Scheme | -| --------- | ---- | ----------- | -| `api_key` | http | HTTP Bearer | - -To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example: -```python -from mistralai_azure import MistralAzure -import os - -s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.stream(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai") - -if res is not None: - for event in res: - # handle event - print(event) - -``` - - - - -# Development - -## Contributions - -While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. -We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. diff --git a/packages/mistralai_azure/USAGE.md b/packages/mistralai_azure/USAGE.md deleted file mode 100644 index 0ccf3d70..00000000 --- a/packages/mistralai_azure/USAGE.md +++ /dev/null @@ -1,55 +0,0 @@ - -### Create Chat Completions - -This example shows how to create chat completions. - -```python -# Synchronous Example -from mistralai_azure import MistralAzure -import os - -s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.complete(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai") - -if res is not None: - # handle response - pass -``` - -
- -The same SDK client can also be used to make asychronous requests by importing asyncio. -```python -# Asynchronous Example -import asyncio -from mistralai_azure import MistralAzure -import os - -async def main(): - s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") - ) - res = await s.chat.complete_async(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], model="azureai") - if res is not None: - # handle response - pass - -asyncio.run(main()) -``` - \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/assistantmessage.md b/packages/mistralai_azure/docs/models/assistantmessage.md deleted file mode 100644 index 3d0bd90b..00000000 --- a/packages/mistralai_azure/docs/models/assistantmessage.md +++ /dev/null @@ -1,11 +0,0 @@ -# AssistantMessage - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content` | [OptionalNullable[models.AssistantMessageContent]](../models/assistantmessagecontent.md) | :heavy_minus_sign: | N/A | -| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | -| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | -| `role` | [Optional[models.AssistantMessageRole]](../models/assistantmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/assistantmessagerole.md b/packages/mistralai_azure/docs/models/assistantmessagerole.md deleted file mode 100644 index 658229e7..00000000 --- a/packages/mistralai_azure/docs/models/assistantmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# AssistantMessageRole - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ASSISTANT` | assistant | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/chatcompletionrequest.md b/packages/mistralai_azure/docs/models/chatcompletionrequest.md deleted file mode 100644 index b0f05d37..00000000 --- a/packages/mistralai_azure/docs/models/chatcompletionrequest.md +++ /dev/null @@ -1,25 +0,0 @@ -# ChatCompletionRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *Optional[str]* | :heavy_minus_sign: | The ID of the model to use for this request. | azureai | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.ChatCompletionRequestStop]](../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `messages` | List[[models.ChatCompletionRequestMessages](../models/chatcompletionrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/chatcompletionrequestmessages.md b/packages/mistralai_azure/docs/models/chatcompletionrequestmessages.md deleted file mode 100644 index bc7708a6..00000000 --- a/packages/mistralai_azure/docs/models/chatcompletionrequestmessages.md +++ /dev/null @@ -1,29 +0,0 @@ -# ChatCompletionRequestMessages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/packages/mistralai_azure/docs/models/chatcompletionrequesttoolchoice.md b/packages/mistralai_azure/docs/models/chatcompletionrequesttoolchoice.md deleted file mode 100644 index 1646528d..00000000 --- a/packages/mistralai_azure/docs/models/chatcompletionrequesttoolchoice.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatCompletionRequestToolChoice - - -## Supported Types - -### `models.ToolChoice` - -```python -value: models.ToolChoice = /* values here */ -``` - -### `models.ToolChoiceEnum` - -```python -value: models.ToolChoiceEnum = /* values here */ -``` - diff --git a/packages/mistralai_azure/docs/models/chatcompletionstreamrequest.md b/packages/mistralai_azure/docs/models/chatcompletionstreamrequest.md deleted file mode 100644 index 90397dec..00000000 --- a/packages/mistralai_azure/docs/models/chatcompletionstreamrequest.md +++ /dev/null @@ -1,25 +0,0 @@ -# ChatCompletionStreamRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *Optional[str]* | :heavy_minus_sign: | The ID of the model to use for this request. | azureai | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.Stop]](../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `messages` | List[[models.Messages](../models/messages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `prompt_mode` | [OptionalNullable[models.MistralPromptMode]](../models/mistralpromptmode.md) | :heavy_minus_sign: | Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/chatcompletionstreamrequesttoolchoice.md b/packages/mistralai_azure/docs/models/chatcompletionstreamrequesttoolchoice.md deleted file mode 100644 index cce0ca3e..00000000 --- a/packages/mistralai_azure/docs/models/chatcompletionstreamrequesttoolchoice.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatCompletionStreamRequestToolChoice - - -## Supported Types - -### `models.ToolChoice` - -```python -value: models.ToolChoice = /* values here */ -``` - -### `models.ToolChoiceEnum` - -```python -value: models.ToolChoiceEnum = /* values here */ -``` - diff --git a/packages/mistralai_azure/docs/models/completionresponsestreamchoice.md b/packages/mistralai_azure/docs/models/completionresponsestreamchoice.md deleted file mode 100644 index c807dacd..00000000 --- a/packages/mistralai_azure/docs/models/completionresponsestreamchoice.md +++ /dev/null @@ -1,10 +0,0 @@ -# CompletionResponseStreamChoice - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `index` | *int* | :heavy_check_mark: | N/A | -| `delta` | [models.DeltaMessage](../models/deltamessage.md) | :heavy_check_mark: | N/A | -| `finish_reason` | [Nullable[models.FinishReason]](../models/finishreason.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/content.md b/packages/mistralai_azure/docs/models/content.md deleted file mode 100644 index a833dc2c..00000000 --- a/packages/mistralai_azure/docs/models/content.md +++ /dev/null @@ -1,17 +0,0 @@ -# Content - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[models.ContentChunk]` - -```python -value: List[models.ContentChunk] = /* values here */ -``` - diff --git a/packages/mistralai_azure/docs/models/deltamessage.md b/packages/mistralai_azure/docs/models/deltamessage.md deleted file mode 100644 index 61deabbf..00000000 --- a/packages/mistralai_azure/docs/models/deltamessage.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeltaMessage - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `content` | [OptionalNullable[models.Content]](../models/content.md) | :heavy_minus_sign: | N/A | -| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/documenturlchunk.md b/packages/mistralai_azure/docs/models/documenturlchunk.md deleted file mode 100644 index 6c9a5b4d..00000000 --- a/packages/mistralai_azure/docs/models/documenturlchunk.md +++ /dev/null @@ -1,10 +0,0 @@ -# DocumentURLChunk - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `document_url` | *str* | :heavy_check_mark: | N/A | -| `document_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The filename of the document | -| `type` | [Optional[models.DocumentURLChunkType]](../models/documenturlchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/documenturlchunktype.md b/packages/mistralai_azure/docs/models/documenturlchunktype.md deleted file mode 100644 index 32e1fa9e..00000000 --- a/packages/mistralai_azure/docs/models/documenturlchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# DocumentURLChunkType - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `DOCUMENT_URL` | document_url | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/finishreason.md b/packages/mistralai_azure/docs/models/finishreason.md deleted file mode 100644 index 45a5aedb..00000000 --- a/packages/mistralai_azure/docs/models/finishreason.md +++ /dev/null @@ -1,11 +0,0 @@ -# FinishReason - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `STOP` | stop | -| `LENGTH` | length | -| `ERROR` | error | -| `TOOL_CALLS` | tool_calls | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/imageurl.md b/packages/mistralai_azure/docs/models/imageurl.md deleted file mode 100644 index 7c2bcbc3..00000000 --- a/packages/mistralai_azure/docs/models/imageurl.md +++ /dev/null @@ -1,9 +0,0 @@ -# ImageURL - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `url` | *str* | :heavy_check_mark: | N/A | -| `detail` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/imageurlchunk.md b/packages/mistralai_azure/docs/models/imageurlchunk.md deleted file mode 100644 index f1b926ef..00000000 --- a/packages/mistralai_azure/docs/models/imageurlchunk.md +++ /dev/null @@ -1,11 +0,0 @@ -# ImageURLChunk - -{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `image_url` | [models.ImageURLChunkImageURL](../models/imageurlchunkimageurl.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ImageURLChunkType]](../models/imageurlchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/imageurlchunkimageurl.md b/packages/mistralai_azure/docs/models/imageurlchunkimageurl.md deleted file mode 100644 index 76738908..00000000 --- a/packages/mistralai_azure/docs/models/imageurlchunkimageurl.md +++ /dev/null @@ -1,17 +0,0 @@ -# ImageURLChunkImageURL - - -## Supported Types - -### `models.ImageURL` - -```python -value: models.ImageURL = /* values here */ -``` - -### `str` - -```python -value: str = /* values here */ -``` - diff --git a/packages/mistralai_azure/docs/models/imageurlchunktype.md b/packages/mistralai_azure/docs/models/imageurlchunktype.md deleted file mode 100644 index 2064a0b4..00000000 --- a/packages/mistralai_azure/docs/models/imageurlchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ImageURLChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `IMAGE_URL` | image_url | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/messages.md b/packages/mistralai_azure/docs/models/messages.md deleted file mode 100644 index 1d394500..00000000 --- a/packages/mistralai_azure/docs/models/messages.md +++ /dev/null @@ -1,29 +0,0 @@ -# Messages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/packages/mistralai_azure/docs/models/mistralpromptmode.md b/packages/mistralai_azure/docs/models/mistralpromptmode.md deleted file mode 100644 index 7416e203..00000000 --- a/packages/mistralai_azure/docs/models/mistralpromptmode.md +++ /dev/null @@ -1,8 +0,0 @@ -# MistralPromptMode - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `REASONING` | reasoning | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/ocrpageobject.md b/packages/mistralai_azure/docs/models/ocrpageobject.md deleted file mode 100644 index 9db3bb77..00000000 --- a/packages/mistralai_azure/docs/models/ocrpageobject.md +++ /dev/null @@ -1,11 +0,0 @@ -# OCRPageObject - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `index` | *int* | :heavy_check_mark: | The page index in a pdf document starting from 0 | -| `markdown` | *str* | :heavy_check_mark: | The markdown string response of the page | -| `images` | List[[models.OCRImageObject](../models/ocrimageobject.md)] | :heavy_check_mark: | List of all extracted images in the page | -| `dimensions` | [Nullable[models.OCRPageDimensions]](../models/ocrpagedimensions.md) | :heavy_check_mark: | The dimensions of the PDF Page's screenshot image | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/ocrrequest.md b/packages/mistralai_azure/docs/models/ocrrequest.md deleted file mode 100644 index 6a9c77ab..00000000 --- a/packages/mistralai_azure/docs/models/ocrrequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# OCRRequest - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *Nullable[str]* | :heavy_check_mark: | N/A | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `document` | [models.Document](../models/document.md) | :heavy_check_mark: | Document to run OCR on | -| `pages` | List[*int*] | :heavy_minus_sign: | Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 | -| `include_image_base64` | *OptionalNullable[bool]* | :heavy_minus_sign: | Include image URLs in response | -| `image_limit` | *OptionalNullable[int]* | :heavy_minus_sign: | Max images to extract | -| `image_min_size` | *OptionalNullable[int]* | :heavy_minus_sign: | Minimum height and width of image to extract | -| `bbox_annotation_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field | -| `document_annotation_format` | [OptionalNullable[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/prediction.md b/packages/mistralai_azure/docs/models/prediction.md deleted file mode 100644 index 86e9c396..00000000 --- a/packages/mistralai_azure/docs/models/prediction.md +++ /dev/null @@ -1,9 +0,0 @@ -# Prediction - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `type` | *Optional[Literal["content"]]* | :heavy_minus_sign: | N/A | -| `content` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/referencechunk.md b/packages/mistralai_azure/docs/models/referencechunk.md deleted file mode 100644 index a132ca2f..00000000 --- a/packages/mistralai_azure/docs/models/referencechunk.md +++ /dev/null @@ -1,9 +0,0 @@ -# ReferenceChunk - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ReferenceChunkType]](../models/referencechunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/referencechunktype.md b/packages/mistralai_azure/docs/models/referencechunktype.md deleted file mode 100644 index 1e0e2fe6..00000000 --- a/packages/mistralai_azure/docs/models/referencechunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReferenceChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `REFERENCE` | reference | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/responseformat.md b/packages/mistralai_azure/docs/models/responseformat.md deleted file mode 100644 index 23a1641b..00000000 --- a/packages/mistralai_azure/docs/models/responseformat.md +++ /dev/null @@ -1,9 +0,0 @@ -# ResponseFormat - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Optional[models.ResponseFormats]](../models/responseformats.md) | :heavy_minus_sign: | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. | -| `json_schema` | [OptionalNullable[models.JSONSchema]](../models/jsonschema.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/responseformats.md b/packages/mistralai_azure/docs/models/responseformats.md deleted file mode 100644 index 06886afe..00000000 --- a/packages/mistralai_azure/docs/models/responseformats.md +++ /dev/null @@ -1,12 +0,0 @@ -# ResponseFormats - -An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `TEXT` | text | -| `JSON_OBJECT` | json_object | -| `JSON_SCHEMA` | json_schema | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/role.md b/packages/mistralai_azure/docs/models/role.md deleted file mode 100644 index affca78d..00000000 --- a/packages/mistralai_azure/docs/models/role.md +++ /dev/null @@ -1,8 +0,0 @@ -# Role - - -## Values - -| Name | Value | -| -------- | -------- | -| `SYSTEM` | system | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/stop.md b/packages/mistralai_azure/docs/models/stop.md deleted file mode 100644 index ba40ca83..00000000 --- a/packages/mistralai_azure/docs/models/stop.md +++ /dev/null @@ -1,19 +0,0 @@ -# Stop - -Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[str]` - -```python -value: List[str] = /* values here */ -``` - diff --git a/packages/mistralai_azure/docs/models/systemmessage.md b/packages/mistralai_azure/docs/models/systemmessage.md deleted file mode 100644 index 0dba71c0..00000000 --- a/packages/mistralai_azure/docs/models/systemmessage.md +++ /dev/null @@ -1,9 +0,0 @@ -# SystemMessage - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.Role]](../models/role.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/systemmessagecontent.md b/packages/mistralai_azure/docs/models/systemmessagecontent.md deleted file mode 100644 index e0d27d9f..00000000 --- a/packages/mistralai_azure/docs/models/systemmessagecontent.md +++ /dev/null @@ -1,17 +0,0 @@ -# SystemMessageContent - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[models.TextChunk]` - -```python -value: List[models.TextChunk] = /* values here */ -``` - diff --git a/packages/mistralai_azure/docs/models/textchunk.md b/packages/mistralai_azure/docs/models/textchunk.md deleted file mode 100644 index 6daab3c3..00000000 --- a/packages/mistralai_azure/docs/models/textchunk.md +++ /dev/null @@ -1,9 +0,0 @@ -# TextChunk - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `text` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.Type]](../models/type.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/toolmessage.md b/packages/mistralai_azure/docs/models/toolmessage.md deleted file mode 100644 index a54f4933..00000000 --- a/packages/mistralai_azure/docs/models/toolmessage.md +++ /dev/null @@ -1,11 +0,0 @@ -# ToolMessage - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `content` | [Nullable[models.ToolMessageContent]](../models/toolmessagecontent.md) | :heavy_check_mark: | N/A | -| `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.ToolMessageRole]](../models/toolmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/toolmessagerole.md b/packages/mistralai_azure/docs/models/toolmessagerole.md deleted file mode 100644 index c24e59c0..00000000 --- a/packages/mistralai_azure/docs/models/toolmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `TOOL` | tool | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/type.md b/packages/mistralai_azure/docs/models/type.md deleted file mode 100644 index eb0581e7..00000000 --- a/packages/mistralai_azure/docs/models/type.md +++ /dev/null @@ -1,8 +0,0 @@ -# Type - - -## Values - -| Name | Value | -| ------ | ------ | -| `TEXT` | text | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/usermessage.md b/packages/mistralai_azure/docs/models/usermessage.md deleted file mode 100644 index 63b01310..00000000 --- a/packages/mistralai_azure/docs/models/usermessage.md +++ /dev/null @@ -1,9 +0,0 @@ -# UserMessage - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.UserMessageRole]](../models/usermessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/usermessagerole.md b/packages/mistralai_azure/docs/models/usermessagerole.md deleted file mode 100644 index 171124e4..00000000 --- a/packages/mistralai_azure/docs/models/usermessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# UserMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `USER` | user | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/models/validationerror.md b/packages/mistralai_azure/docs/models/validationerror.md deleted file mode 100644 index 7a1654a1..00000000 --- a/packages/mistralai_azure/docs/models/validationerror.md +++ /dev/null @@ -1,10 +0,0 @@ -# ValidationError - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `loc` | List[[models.Loc](../models/loc.md)] | :heavy_check_mark: | N/A | -| `msg` | *str* | :heavy_check_mark: | N/A | -| `type` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_azure/docs/sdks/chat/README.md b/packages/mistralai_azure/docs/sdks/chat/README.md deleted file mode 100644 index 26d20bb4..00000000 --- a/packages/mistralai_azure/docs/sdks/chat/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# Chat -(*chat*) - -## Overview - -Chat Completion API. - -### Available Operations - -* [stream](#stream) - Stream chat completion -* [create](#create) - Chat Completion - -## stream - -Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - -### Example Usage - -```python -from mistralai_azure import MistralAzure -import os - -s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.stream(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai") - -if res is not None: - for event in res: - # handle event - print(event) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ----------------- | ----------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `messages` | List[[models.Messages](../../models/messages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | {
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
} | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the model to use for this request. | azureai | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.Stop]](../../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | -| `tool_choice` | [Optional[models.ToolChoice]](../../models/toolchoice.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - - -### Response - -**[Union[Generator[models.CompletionEvent, None, None], AsyncGenerator[models.CompletionEvent, None]]](../../models/.md)** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | ----------- | ------------ | -| models.SDKError | 4xx-5xx | */* | - -## create - -Chat Completion - -### Example Usage - -```python -from mistralai_azure import MistralAzure -import os - -s = MistralAzure( - azure_api_key=os.getenv("AZURE_API_KEY", ""), - azure_endpoint=os.getenv("AZURE_ENDPOINT", "") -) - - -res = s.chat.complete(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="azureai") - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ----------------- | --------------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `messages` | List[[models.ChatCompletionRequestMessages](../../models/chatcompletionrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | {
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
} | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the model to use for this request. | azureai | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.ChatCompletionRequestStop]](../../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `safe_prompt` | *Optional[bool]* | :heavy_minus_sign: | Whether to inject a safety prompt before all conversations. | | -| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - - -### Response - -**[models.ChatCompletionResponse](../../models/chatcompletionresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | ----------- | ---------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4xx-5xx | */* | diff --git a/packages/mistralai_azure/poetry.lock b/packages/mistralai_azure/poetry.lock deleted file mode 100644 index fb5b615e..00000000 --- a/packages/mistralai_azure/poetry.lock +++ /dev/null @@ -1,605 +0,0 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. - -[[package]] -name = "annotated-types" -version = "0.7.0" -description = "Reusable constraint types to use with typing.Annotated" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, - {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, -] - -[[package]] -name = "anyio" -version = "4.4.0" -description = "High level compatibility layer for multiple asynchronous event loop implementations" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, - {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, -] - -[package.dependencies] -exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} -idna = ">=2.8" -sniffio = ">=1.1" -typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} - -[package.extras] -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) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""] -trio = ["trio (>=0.23)"] - -[[package]] -name = "astroid" -version = "3.2.4" -description = "An abstract syntax tree for Python with inference support." -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, - {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} - -[[package]] -name = "certifi" -version = "2024.7.4" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, - {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, -] - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["dev"] -markers = "sys_platform == \"win32\"" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "dill" -version = "0.3.8" -description = "serialize all of Python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, - {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, -] - -[package.extras] -graph = ["objgraph (>=1.7.2)"] -profile = ["gprof2dot (>=2022.7.29)"] - -[[package]] -name = "exceptiongroup" -version = "1.2.2" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -groups = ["main", "dev"] -markers = "python_version < \"3.11\"" -files = [ - {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, - {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, -] - -[package.extras] -test = ["pytest (>=6)"] - -[[package]] -name = "h11" -version = "0.16.0" -description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, - {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, -] - -[[package]] -name = "httpcore" -version = "1.0.9" -description = "A minimal low-level HTTP client." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, - {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, -] - -[package.dependencies] -certifi = "*" -h11 = ">=0.16" - -[package.extras] -asyncio = ["anyio (>=4.0,<5.0)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<1.0)"] - -[[package]] -name = "httpx" -version = "0.28.1" -description = "The next generation HTTP client." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, - {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, -] - -[package.dependencies] -anyio = "*" -certifi = "*" -httpcore = "==1.*" -idna = "*" - -[package.extras] -brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "idna" -version = "3.7" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.5" -groups = ["main"] -files = [ - {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, - {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, -] - -[[package]] -name = "iniconfig" -version = "2.0.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.7" -groups = ["dev"] -files = [ - {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, - {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, -] - -[[package]] -name = "isort" -version = "5.13.2" -description = "A Python utility / library to sort Python imports." -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, - {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, -] - -[package.extras] -colors = ["colorama (>=0.4.6)"] - -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = false -python-versions = ">=3.6" -groups = ["dev"] -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - -[[package]] -name = "mypy" -version = "1.15.0" -description = "Optional static typing for Python" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, - {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, - {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b"}, - {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3"}, - {file = "mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b"}, - {file = "mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828"}, - {file = "mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f"}, - {file = "mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5"}, - {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e"}, - {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c"}, - {file = "mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f"}, - {file = "mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f"}, - {file = "mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd"}, - {file = "mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f"}, - {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464"}, - {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee"}, - {file = "mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e"}, - {file = "mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22"}, - {file = "mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445"}, - {file = "mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d"}, - {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5"}, - {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036"}, - {file = "mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357"}, - {file = "mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf"}, - {file = "mypy-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078"}, - {file = "mypy-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba"}, - {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5"}, - {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b"}, - {file = "mypy-1.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2"}, - {file = "mypy-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980"}, - {file = "mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e"}, - {file = "mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43"}, -] - -[package.dependencies] -mypy_extensions = ">=1.0.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing_extensions = ">=4.6.0" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -faster-cache = ["orjson"] -install-types = ["pip"] -mypyc = ["setuptools (>=50)"] -reports = ["lxml"] - -[[package]] -name = "mypy-extensions" -version = "1.0.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.5" -groups = ["dev"] -files = [ - {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, - {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, -] - -[[package]] -name = "packaging" -version = "24.1" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, - {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, -] - -[[package]] -name = "platformdirs" -version = "4.2.2" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, - {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, -] - -[package.extras] -docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] -type = ["mypy (>=1.8)"] - -[[package]] -name = "pluggy" -version = "1.5.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, - {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] - -[[package]] -name = "pydantic" -version = "2.11.7" -description = "Data validation using Python type hints" -optional = false -python-versions = ">=3.9" -groups = ["main"] -files = [ - {file = "pydantic-2.11.7-py3-none-any.whl", hash = "sha256:dde5df002701f6de26248661f6835bbe296a47bf73990135c7d07ce741b9623b"}, - {file = "pydantic-2.11.7.tar.gz", hash = "sha256:d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db"}, -] - -[package.dependencies] -annotated-types = ">=0.6.0" -pydantic-core = "2.33.2" -typing-extensions = ">=4.12.2" -typing-inspection = ">=0.4.0" - -[package.extras] -email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] - -[[package]] -name = "pydantic-core" -version = "2.33.2" -description = "Core functionality for Pydantic validation and serialization" -optional = false -python-versions = ">=3.9" -groups = ["main"] -files = [ - {file = "pydantic_core-2.33.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8"}, - {file = "pydantic_core-2.33.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d"}, - {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d"}, - {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572"}, - {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02"}, - {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b"}, - {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2"}, - {file = "pydantic_core-2.33.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a"}, - {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac"}, - {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a"}, - {file = "pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b"}, - {file = "pydantic_core-2.33.2-cp310-cp310-win32.whl", hash = "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22"}, - {file = "pydantic_core-2.33.2-cp310-cp310-win_amd64.whl", hash = "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640"}, - {file = "pydantic_core-2.33.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7"}, - {file = "pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246"}, - {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f"}, - {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc"}, - {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de"}, - {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a"}, - {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef"}, - {file = "pydantic_core-2.33.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e"}, - {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d"}, - {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30"}, - {file = "pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf"}, - {file = "pydantic_core-2.33.2-cp311-cp311-win32.whl", hash = "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51"}, - {file = "pydantic_core-2.33.2-cp311-cp311-win_amd64.whl", hash = "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab"}, - {file = "pydantic_core-2.33.2-cp311-cp311-win_arm64.whl", hash = "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65"}, - {file = "pydantic_core-2.33.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc"}, - {file = "pydantic_core-2.33.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7"}, - {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025"}, - {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011"}, - {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f"}, - {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88"}, - {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1"}, - {file = "pydantic_core-2.33.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b"}, - {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1"}, - {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6"}, - {file = "pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea"}, - {file = "pydantic_core-2.33.2-cp312-cp312-win32.whl", hash = "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290"}, - {file = "pydantic_core-2.33.2-cp312-cp312-win_amd64.whl", hash = "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2"}, - {file = "pydantic_core-2.33.2-cp312-cp312-win_arm64.whl", hash = "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab"}, - {file = "pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f"}, - {file = "pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6"}, - {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef"}, - {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a"}, - {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916"}, - {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a"}, - {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d"}, - {file = "pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56"}, - {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5"}, - {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e"}, - {file = "pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162"}, - {file = "pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849"}, - {file = "pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9"}, - {file = "pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9"}, - {file = "pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac"}, - {file = "pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5"}, - {file = "pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9"}, - {file = "pydantic_core-2.33.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d"}, - {file = "pydantic_core-2.33.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954"}, - {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb"}, - {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7"}, - {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4"}, - {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b"}, - {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3"}, - {file = "pydantic_core-2.33.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a"}, - {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782"}, - {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9"}, - {file = "pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e"}, - {file = "pydantic_core-2.33.2-cp39-cp39-win32.whl", hash = "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9"}, - {file = "pydantic_core-2.33.2-cp39-cp39-win_amd64.whl", hash = "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c"}, - {file = "pydantic_core-2.33.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb"}, - {file = "pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039"}, - {file = "pydantic_core-2.33.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27"}, - {file = "pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc"}, -] - -[package.dependencies] -typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" - -[[package]] -name = "pylint" -version = "3.2.3" -description = "python code static checker" -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, - {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, -] - -[package.dependencies] -astroid = ">=3.2.2,<=3.3.0-dev0" -colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -dill = [ - {version = ">=0.2", markers = "python_version < \"3.11\""}, - {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version == \"3.11\""}, -] -isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" -mccabe = ">=0.6,<0.8" -platformdirs = ">=2.2.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -tomlkit = ">=0.10.1" -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} - -[package.extras] -spelling = ["pyenchant (>=3.2,<4.0)"] -testutils = ["gitpython (>3)"] - -[[package]] -name = "pytest" -version = "8.3.2" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5"}, - {file = "pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=1.5,<2" -tomli = {version = ">=1", markers = "python_version < \"3.11\""} - -[package.extras] -dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-asyncio" -version = "0.23.8" -description = "Pytest support for asyncio" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, - {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, -] - -[package.dependencies] -pytest = ">=7.0.0,<9" - -[package.extras] -docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] -testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] - -[[package]] -name = "sniffio" -version = "1.3.1" -description = "Sniff out which async library your code is running under" -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, - {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, -] - -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.7" -groups = ["dev"] -markers = "python_version < \"3.11\"" -files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, -] - -[[package]] -name = "tomlkit" -version = "0.13.0" -description = "Style preserving TOML library" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "tomlkit-0.13.0-py3-none-any.whl", hash = "sha256:7075d3042d03b80f603482d69bf0c8f345c2b30e41699fd8883227f89972b264"}, - {file = "tomlkit-0.13.0.tar.gz", hash = "sha256:08ad192699734149f5b97b45f1f18dad7eb1b6d16bc72ad0c2335772650d7b72"}, -] - -[[package]] -name = "typing-extensions" -version = "4.12.2" -description = "Backported and Experimental Type Hints for Python 3.8+" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, - {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, -] - -[[package]] -name = "typing-inspection" -version = "0.4.0" -description = "Runtime typing introspection tools" -optional = false -python-versions = ">=3.9" -groups = ["main"] -files = [ - {file = "typing_inspection-0.4.0-py3-none-any.whl", hash = "sha256:50e72559fcd2a6367a19f7a7e610e6afcb9fac940c650290eed893d61386832f"}, - {file = "typing_inspection-0.4.0.tar.gz", hash = "sha256:9765c87de36671694a67904bf2c96e395be9c6439bb6c87b5142569dcdd65122"}, -] - -[package.dependencies] -typing-extensions = ">=4.12.0" - -[metadata] -lock-version = "2.1" -python-versions = ">=3.9.2" -content-hash = "7783570c2127219ca33415a933b1f4b8e43c4b432d4f04679552c25f89596fc1" diff --git a/packages/mistralai_azure/poetry.toml b/packages/mistralai_azure/poetry.toml deleted file mode 100644 index ab1033bd..00000000 --- a/packages/mistralai_azure/poetry.toml +++ /dev/null @@ -1,2 +0,0 @@ -[virtualenvs] -in-project = true diff --git a/packages/mistralai_azure/pylintrc b/packages/mistralai_azure/pylintrc deleted file mode 100644 index a8fcb932..00000000 --- a/packages/mistralai_azure/pylintrc +++ /dev/null @@ -1,663 +0,0 @@ -[MAIN] - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Clear in-memory caches upon conclusion of linting. Useful if running pylint -# in a server-like mode. -clear-cache-post-run=no - -# Load and enable all available extensions. Use --list-extensions to see a list -# all available extensions. -#enable-all-extensions= - -# In error mode, messages with a category besides ERROR or FATAL are -# suppressed, and no reports are done by default. Error mode is compatible with -# disabling specific errors. -#errors-only= - -# Always return a 0 (non-error) status code, even if lint errors are found. -# This is primarily useful in continuous integration scripts. -#exit-zero= - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code. -extension-pkg-allow-list= - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code. (This is an alternative name to extension-pkg-allow-list -# for backward compatibility.) -extension-pkg-whitelist= - -# Return non-zero exit code if any of these messages/categories are detected, -# even if score is above --fail-under value. Syntax same as enable. Messages -# specified are enabled, while categories only check already-enabled messages. -fail-on= - -# Specify a score threshold under which the program will exit with error. -fail-under=10 - -# Interpret the stdin as a python script, whose filename needs to be passed as -# the module_or_package argument. -#from-stdin= - -# Files or directories to be skipped. They should be base names, not paths. -ignore=CVS - -# Add files or directories matching the regular expressions patterns to the -# ignore-list. The regex matches against paths and can be in Posix or Windows -# format. Because '\\' represents the directory delimiter on Windows systems, -# it can't be used as an escape character. -ignore-paths= - -# Files or directories matching the regular expression patterns are skipped. -# The regex matches against base names, not paths. The default value ignores -# Emacs file locks -ignore-patterns=^\.# - -# List of module names for which member attributes should not be checked and -# will not be imported (useful for modules/projects where namespaces are -# manipulated during runtime and thus existing member attributes cannot be -# deduced by static analysis). It supports qualified module names, as well as -# Unix pattern matching. -ignored-modules= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the -# number of processors available to use, and will cap the count on Windows to -# avoid hangs. -jobs=1 - -# Control the amount of potential inferred values when inferring a single -# object. This can help the performance when dealing with large functions or -# complex, nested conditions. -limit-inference-results=100 - -# List of plugins (as comma separated values of python module names) to load, -# usually to register additional checkers. -load-plugins= - -# Pickle collected data for later comparisons. -persistent=yes - -# Minimum Python version to use for version dependent checks. Will default to -# the version used to run pylint. -py-version=3.9 - -# Discover python modules and packages in the file system subtree. -recursive=no - -# Add paths to the list of the source roots. Supports globbing patterns. The -# source root is an absolute path or a path relative to the current working -# directory used to determine a package namespace for modules located under the -# source root. -source-roots=src - -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages. -suggestion-mode=yes - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - -# In verbose mode, extra non-checker-related info will be displayed. -#verbose= - - -[BASIC] - -# Naming style matching correct argument names. -argument-naming-style=snake_case - -# Regular expression matching correct argument names. Overrides argument- -# naming-style. If left empty, argument names will be checked with the set -# naming style. -#argument-rgx= - -# Naming style matching correct attribute names. -#attr-naming-style=snake_case - -# Regular expression matching correct attribute names. Overrides attr-naming- -# style. If left empty, attribute names will be checked with the set naming -# style. -attr-rgx=[^\W\d][^\W]*|__.*__$ - -# Bad variable names which should always be refused, separated by a comma. -bad-names= - -# Bad variable names regexes, separated by a comma. If names match any regex, -# they will always be refused -bad-names-rgxs= - -# Naming style matching correct class attribute names. -class-attribute-naming-style=any - -# Regular expression matching correct class attribute names. Overrides class- -# attribute-naming-style. If left empty, class attribute names will be checked -# with the set naming style. -#class-attribute-rgx= - -# Naming style matching correct class constant names. -class-const-naming-style=UPPER_CASE - -# Regular expression matching correct class constant names. Overrides class- -# const-naming-style. If left empty, class constant names will be checked with -# the set naming style. -#class-const-rgx= - -# Naming style matching correct class names. -class-naming-style=PascalCase - -# Regular expression matching correct class names. Overrides class-naming- -# style. If left empty, class names will be checked with the set naming style. -#class-rgx= - -# Naming style matching correct constant names. -const-naming-style=UPPER_CASE - -# Regular expression matching correct constant names. Overrides const-naming- -# style. If left empty, constant names will be checked with the set naming -# style. -#const-rgx= - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming style matching correct function names. -function-naming-style=snake_case - -# Regular expression matching correct function names. Overrides function- -# naming-style. If left empty, function names will be checked with the set -# naming style. -#function-rgx= - -# Good variable names which should always be accepted, separated by a comma. -good-names=i, - j, - k, - ex, - Run, - _, - e, - id, - n - -# Good variable names regexes, separated by a comma. If names match any regex, -# they will always be accepted -good-names-rgxs= - -# Include a hint for the correct naming format with invalid-name. -include-naming-hint=no - -# Naming style matching correct inline iteration names. -inlinevar-naming-style=any - -# Regular expression matching correct inline iteration names. Overrides -# inlinevar-naming-style. If left empty, inline iteration names will be checked -# with the set naming style. -#inlinevar-rgx= - -# Naming style matching correct method names. -method-naming-style=snake_case - -# Regular expression matching correct method names. Overrides method-naming- -# style. If left empty, method names will be checked with the set naming style. -#method-rgx= - -# Naming style matching correct module names. -module-naming-style=snake_case - -# Regular expression matching correct module names. Overrides module-naming- -# style. If left empty, module names will be checked with the set naming style. -#module-rgx= - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -# These decorators are taken in consideration only for invalid-name. -property-classes=abc.abstractproperty - -# Regular expression matching correct type alias names. If left empty, type -# alias names will be checked with the set naming style. -typealias-rgx=.* - -# Regular expression matching correct type variable names. If left empty, type -# variable names will be checked with the set naming style. -#typevar-rgx= - -# Naming style matching correct variable names. -variable-naming-style=snake_case - -# Regular expression matching correct variable names. Overrides variable- -# naming-style. If left empty, variable names will be checked with the set -# naming style. -#variable-rgx= - - -[CLASSES] - -# Warn about protected attribute access inside special methods -check-protected-access-in-special-methods=no - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__, - __new__, - setUp, - asyncSetUp, - __post_init__ - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[DESIGN] - -# List of regular expressions of class ancestor names to ignore when counting -# public methods (see R0903) -exclude-too-few-public-methods= - -# List of qualified class names to ignore when counting class parents (see -# R0901) -ignored-parents= - -# Maximum number of arguments for function / method. -max-args=5 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in an if statement (see R0916). -max-bool-expr=5 - -# Maximum number of branch for function / method body. -max-branches=12 - -# Maximum number of locals for function / method body. -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=25 - -# Maximum number of return / yield for function / method body. -max-returns=6 - -# Maximum number of statements in function / method body. -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when caught. -overgeneral-exceptions=builtins.BaseException,builtins.Exception - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=100 - -# Maximum number of lines in a module. -max-module-lines=1000 - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[IMPORTS] - -# List of modules that can be imported at any level, not just the top level -# one. -allow-any-import-level= - -# Allow explicit reexports by alias from a package __init__. -allow-reexport-from-package=no - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Deprecated modules which should not be used, separated by a comma. -deprecated-modules= - -# Output a graph (.gv or any supported image format) of external dependencies -# to the given file (report RP0402 must not be disabled). -ext-import-graph= - -# Output a graph (.gv or any supported image format) of all (i.e. internal and -# external) dependencies to the given file (report RP0402 must not be -# disabled). -import-graph= - -# Output a graph (.gv or any supported image format) of internal dependencies -# to the given file (report RP0402 must not be disabled). -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - -# Couples of modules and preferred modules, separated by a comma. -preferred-modules= - - -[LOGGING] - -# The type of string formatting that logging methods do. `old` means using % -# formatting, `new` is for `{}` formatting. -logging-format-style=old - -# Logging modules to check that the string format arguments are in logging -# function parameter format. -logging-modules=logging - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, -# UNDEFINED. -confidence=HIGH, - CONTROL_FLOW, - INFERENCE, - INFERENCE_FAILURE, - UNDEFINED - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once). You can also use "--disable=all" to -# disable everything first and then re-enable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use "--disable=all --enable=classes -# --disable=W". -disable=raw-checker-failed, - bad-inline-option, - locally-disabled, - file-ignored, - suppressed-message, - useless-suppression, - deprecated-pragma, - use-implicit-booleaness-not-comparison-to-string, - use-implicit-booleaness-not-comparison-to-zero, - use-symbolic-message-instead, - trailing-whitespace, - line-too-long, - missing-class-docstring, - missing-module-docstring, - missing-function-docstring, - too-many-instance-attributes, - wrong-import-order, - too-many-arguments, - broad-exception-raised, - too-few-public-methods, - too-many-branches, - duplicate-code, - trailing-newlines, - too-many-public-methods, - too-many-locals, - too-many-lines, - using-constant-test, - too-many-statements, - cyclic-import, - too-many-nested-blocks, - too-many-boolean-expressions, - no-else-raise, - bare-except, - broad-exception-caught, - fixme, - relative-beyond-top-level, - consider-using-with, - wildcard-import, - unused-wildcard-import, - too-many-return-statements - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable= - - -[METHOD_ARGS] - -# List of qualified names (i.e., library.method) which require a timeout -# parameter e.g. 'requests.api.get,requests.api.post' -timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -notes=FIXME, - XXX, - TODO - -# Regular expression of note tags to take in consideration. -notes-rgx= - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - -# Complete name of functions that never returns. When checking for -# inconsistent-return-statements if a never returning function is called then -# it will be considered as an explicit return statement and no message will be -# printed. -never-returning-functions=sys.exit,argparse.parse_error - - -[REPORTS] - -# Python expression which should return a score less than or equal to 10. You -# have access to the variables 'fatal', 'error', 'warning', 'refactor', -# 'convention', and 'info' which contain the number of messages in each -# category, as well as 'statement' which is the total number of statements -# analyzed. This score is used by the global evaluation report (RP0004). -evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details. -msg-template= - -# Set the output format. Available formats are: text, parseable, colorized, -# json2 (improved json format), json (old json format) and msvs (visual -# studio). You can also give a reporter class, e.g. -# mypackage.mymodule.MyReporterClass. -#output-format= - -# Tells whether to display a full report or only the messages. -reports=no - -# Activate the evaluation score. -score=yes - - -[SIMILARITIES] - -# Comments are removed from the similarity computation -ignore-comments=yes - -# Docstrings are removed from the similarity computation -ignore-docstrings=yes - -# Imports are removed from the similarity computation -ignore-imports=yes - -# Signatures are removed from the similarity computation -ignore-signatures=yes - -# Minimum lines number of a similarity. -min-similarity-lines=4 - - -[SPELLING] - -# Limits count of emitted suggestions for spelling mistakes. -max-spelling-suggestions=4 - -# Spelling dictionary name. No available dictionaries : You need to install -# both the python package and the system dependency for enchant to work. -spelling-dict= - -# List of comma separated words that should be considered directives if they -# appear at the beginning of a comment and should not be checked. -spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains the private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to the private dictionary (see the -# --spelling-private-dict-file option) instead of raising a message. -spelling-store-unknown-words=no - - -[STRING] - -# This flag controls whether inconsistent-quotes generates a warning when the -# character used as a quote delimiter is used inconsistently within a module. -check-quote-consistency=no - -# This flag controls whether the implicit-str-concat should generate a warning -# on implicit string concatenation in sequences defined over several lines. -check-str-concat-over-line-jumps=no - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= - -# Tells whether to warn about missing members when the owner of the attribute -# is inferred to be None. -ignore-none=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of symbolic message names to ignore for Mixin members. -ignored-checks-for-mixins=no-member, - not-async-context-manager, - not-context-manager, - attribute-defined-outside-init - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - -# Regex pattern to define which classes are considered mixins. -mixin-class-rgx=.*[Mm]ixin - -# List of decorators that change the signature of a decorated function. -signature-mutators= - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid defining new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of names allowed to shadow builtins -allowed-redefined-builtins=id,object - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_, - _cb - -# A regular expression matching the name of dummy variables (i.e. expected to -# not be used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/packages/mistralai_azure/pyproject.toml b/packages/mistralai_azure/pyproject.toml deleted file mode 100644 index 81387b21..00000000 --- a/packages/mistralai_azure/pyproject.toml +++ /dev/null @@ -1,57 +0,0 @@ -[project] -name = "mistralai_azure" -version = "1.6.0" -description = "Python Client SDK for the Mistral AI API in Azure." -authors = [{ name = "Mistral" },] -readme = "README.md" -requires-python = ">=3.9.2" -dependencies = [ - "httpcore >=1.0.9", - "httpx >=0.28.1", - "pydantic >=2.11.2", -] - -[tool.poetry] -packages = [ - { include = "mistralai_azure", from = "src" } -] -include = ["py.typed", "src/mistralai_azure/py.typed"] - -[tool.setuptools.package-data] -"*" = ["py.typed", "src/mistralai_azure/py.typed"] - -[virtualenvs] -in-project = true - -[tool.poetry.group.dev.dependencies] -mypy = "==1.15.0" -pylint = "==3.2.3" -pytest = "^8.2.2" -pytest-asyncio = "^0.23.7" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.pytest.ini_options] -asyncio_default_fixture_loop_scope = "function" -pythonpath = ["src"] - -[tool.mypy] -disable_error_code = "misc" -explicit_package_bases = true -mypy_path = "src" - -[[tool.mypy.overrides]] -module = "typing_inspect" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = "jsonpath" -ignore_missing_imports = true - -[tool.pyright] -venvPath = "." -venv = ".venv" - - diff --git a/packages/mistralai_azure/scripts/publish.sh b/packages/mistralai_azure/scripts/publish.sh deleted file mode 100755 index 1ee7194c..00000000 --- a/packages/mistralai_azure/scripts/publish.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} - -poetry publish --build --skip-existing diff --git a/packages/mistralai_azure/src/mistralai_azure/__init__.py b/packages/mistralai_azure/src/mistralai_azure/__init__.py deleted file mode 100644 index dd02e42e..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from ._version import ( - __title__, - __version__, - __openapi_doc_version__, - __gen_version__, - __user_agent__, -) -from .sdk import * -from .sdkconfiguration import * -from .models import * - - -VERSION: str = __version__ -OPENAPI_DOC_VERSION = __openapi_doc_version__ -SPEAKEASY_GENERATOR_VERSION = __gen_version__ -USER_AGENT = __user_agent__ diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py b/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py deleted file mode 100644 index 77df6aef..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py +++ /dev/null @@ -1,22 +0,0 @@ -# THIS FILE IS THE EXACT COPY OF THE ORIGINAL FILE FROM src/mistralai/_hooks/custom_user_agent.py -from typing import Union - -import httpx - -from .types import BeforeRequestContext, BeforeRequestHook - -PREFIX = "mistral-client-python/" - -class CustomUserAgentHook(BeforeRequestHook): - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> Union[httpx.Request, Exception]: - current = request.headers["user-agent"] - if current.startswith(PREFIX): - return request - - request.headers["user-agent"] = ( - PREFIX + current.split(" ")[1] - ) - - return request diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py b/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py deleted file mode 100644 index 304edfa2..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py +++ /dev/null @@ -1,15 +0,0 @@ -from .custom_user_agent import CustomUserAgentHook -from .types import Hooks - -# This file is only ever generated once on the first generation and then is free to be modified. -# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them -# in this file or in separate files in the hooks folder. - - -def init_hooks(hooks: Hooks): - # pylint: disable=unused-argument - """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook - with an instance of a hook that implements that specific Hook interface - Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance - """ - hooks.register_before_request_hook(CustomUserAgentHook()) diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py b/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py deleted file mode 100644 index 37ff4e9f..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py +++ /dev/null @@ -1,76 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import httpx -from .types import ( - SDKInitHook, - BeforeRequestContext, - BeforeRequestHook, - AfterSuccessContext, - AfterSuccessHook, - AfterErrorContext, - AfterErrorHook, - Hooks, -) -from .registration import init_hooks -from typing import List, Optional, Tuple -from mistralai_azure.httpclient import HttpClient - - -class SDKHooks(Hooks): - def __init__(self) -> None: - self.sdk_init_hooks: List[SDKInitHook] = [] - self.before_request_hooks: List[BeforeRequestHook] = [] - self.after_success_hooks: List[AfterSuccessHook] = [] - self.after_error_hooks: List[AfterErrorHook] = [] - init_hooks(self) - - def register_sdk_init_hook(self, hook: SDKInitHook) -> None: - self.sdk_init_hooks.append(hook) - - def register_before_request_hook(self, hook: BeforeRequestHook) -> None: - self.before_request_hooks.append(hook) - - def register_after_success_hook(self, hook: AfterSuccessHook) -> None: - self.after_success_hooks.append(hook) - - def register_after_error_hook(self, hook: AfterErrorHook) -> None: - self.after_error_hooks.append(hook) - - def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: - for hook in self.sdk_init_hooks: - base_url, client = hook.sdk_init(base_url, client) - return base_url, client - - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> httpx.Request: - for hook in self.before_request_hooks: - out = hook.before_request(hook_ctx, request) - if isinstance(out, Exception): - raise out - request = out - - return request - - def after_success( - self, hook_ctx: AfterSuccessContext, response: httpx.Response - ) -> httpx.Response: - for hook in self.after_success_hooks: - out = hook.after_success(hook_ctx, response) - if isinstance(out, Exception): - raise out - response = out - return response - - def after_error( - self, - hook_ctx: AfterErrorContext, - response: Optional[httpx.Response], - error: Optional[Exception], - ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: - for hook in self.after_error_hooks: - result = hook.after_error(hook_ctx, response, error) - if isinstance(result, Exception): - raise result - response, error = result - return response, error diff --git a/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py b/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py deleted file mode 100644 index 0c22d7eb..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py +++ /dev/null @@ -1,113 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from abc import ABC, abstractmethod -import httpx -from mistralai_azure.httpclient import HttpClient -from mistralai_azure.sdkconfiguration import SDKConfiguration -from typing import Any, Callable, List, Optional, Tuple, Union - - -class HookContext: - config: SDKConfiguration - base_url: str - operation_id: str - oauth2_scopes: Optional[List[str]] = None - security_source: Optional[Union[Any, Callable[[], Any]]] = None - - def __init__( - self, - config: SDKConfiguration, - base_url: str, - operation_id: str, - oauth2_scopes: Optional[List[str]], - security_source: Optional[Union[Any, Callable[[], Any]]], - ): - self.config = config - self.base_url = base_url - self.operation_id = operation_id - self.oauth2_scopes = oauth2_scopes - self.security_source = security_source - - -class BeforeRequestContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.config, - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class AfterSuccessContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.config, - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class AfterErrorContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.config, - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class SDKInitHook(ABC): - @abstractmethod - def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: - pass - - -class BeforeRequestHook(ABC): - @abstractmethod - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> Union[httpx.Request, Exception]: - pass - - -class AfterSuccessHook(ABC): - @abstractmethod - def after_success( - self, hook_ctx: AfterSuccessContext, response: httpx.Response - ) -> Union[httpx.Response, Exception]: - pass - - -class AfterErrorHook(ABC): - @abstractmethod - def after_error( - self, - hook_ctx: AfterErrorContext, - response: Optional[httpx.Response], - error: Optional[Exception], - ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: - pass - - -class Hooks(ABC): - @abstractmethod - def register_sdk_init_hook(self, hook: SDKInitHook): - pass - - @abstractmethod - def register_before_request_hook(self, hook: BeforeRequestHook): - pass - - @abstractmethod - def register_after_success_hook(self, hook: AfterSuccessHook): - pass - - @abstractmethod - def register_after_error_hook(self, hook: AfterErrorHook): - pass diff --git a/packages/mistralai_azure/src/mistralai_azure/_version.py b/packages/mistralai_azure/src/mistralai_azure/_version.py deleted file mode 100644 index 5fd03467..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/_version.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import importlib.metadata - -__title__: str = "mistralai_azure" -__version__: str = "1.6.0" -__openapi_doc_version__: str = "1.0.0" -__gen_version__: str = "2.634.2" -__user_agent__: str = "speakeasy-sdk/python 1.6.0 2.634.2 1.0.0 mistralai_azure" - -try: - if __package__ is not None: - __version__ = importlib.metadata.version(__package__) -except importlib.metadata.PackageNotFoundError: - pass diff --git a/packages/mistralai_azure/src/mistralai_azure/basesdk.py b/packages/mistralai_azure/src/mistralai_azure/basesdk.py deleted file mode 100644 index 84738ce8..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/basesdk.py +++ /dev/null @@ -1,354 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .sdkconfiguration import SDKConfiguration -import httpx -from mistralai_azure import models, utils -from mistralai_azure._hooks import ( - AfterErrorContext, - AfterSuccessContext, - BeforeRequestContext, -) -from mistralai_azure.utils import RetryConfig, SerializedRequestBody, get_body_content -from typing import Callable, List, Mapping, Optional, Tuple -from urllib.parse import parse_qs, urlparse - - -class BaseSDK: - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - def _get_url(self, base_url, url_variables): - sdk_url, sdk_variables = self.sdk_configuration.get_server_details() - - if base_url is None: - base_url = sdk_url - - if url_variables is None: - url_variables = sdk_variables - - return utils.template_url(base_url, url_variables) - - def _build_request_async( - self, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - client = self.sdk_configuration.async_client - return self._build_request_with_client( - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals, - security, - timeout_ms, - get_serialized_body, - url_override, - http_headers, - ) - - def _build_request( - self, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - client = self.sdk_configuration.client - return self._build_request_with_client( - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals, - security, - timeout_ms, - get_serialized_body, - url_override, - http_headers, - ) - - def _build_request_with_client( - self, - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - query_params = {} - - url = url_override - if url is None: - url = utils.generate_url( - self._get_url(base_url, url_variables), - path, - request if request_has_path_params else None, - _globals if request_has_path_params else None, - ) - - query_params = utils.get_query_params( - request if request_has_query_params else None, - _globals if request_has_query_params else None, - ) - else: - # Pick up the query parameter from the override so they can be - # preserved when building the request later on (necessary as of - # httpx 0.28). - parsed_override = urlparse(str(url_override)) - query_params = parse_qs(parsed_override.query, keep_blank_values=True) - - headers = utils.get_headers(request, _globals) - headers["Accept"] = accept_header_value - headers[user_agent_header] = self.sdk_configuration.user_agent - - if security is not None: - if callable(security): - security = security() - - if security is not None: - security_headers, security_query_params = utils.get_security(security) - headers = {**headers, **security_headers} - query_params = {**query_params, **security_query_params} - - serialized_request_body = SerializedRequestBody() - if get_serialized_body is not None: - rb = get_serialized_body() - if request_body_required and rb is None: - raise ValueError("request body is required") - - if rb is not None: - serialized_request_body = rb - - if ( - serialized_request_body.media_type is not None - and serialized_request_body.media_type - not in ( - "multipart/form-data", - "multipart/mixed", - ) - ): - headers["content-type"] = serialized_request_body.media_type - - if http_headers is not None: - for header, value in http_headers.items(): - headers[header] = value - - timeout = timeout_ms / 1000 if timeout_ms is not None else None - - return client.build_request( - method, - url, - params=query_params, - content=serialized_request_body.content, - data=serialized_request_body.data, - files=serialized_request_body.files, - headers=headers, - timeout=timeout, - ) - - def do_request( - self, - hook_ctx, - request, - error_status_codes, - stream=False, - retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, - ) -> httpx.Response: - client = self.sdk_configuration.client - logger = self.sdk_configuration.debug_logger - - hooks = self.sdk_configuration.__dict__["_hooks"] - - def do(): - http_res = None - try: - req = hooks.before_request(BeforeRequestContext(hook_ctx), request) - logger.debug( - "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", - req.method, - req.url, - req.headers, - get_body_content(req), - ) - - if client is None: - raise ValueError("client is required") - - http_res = client.send(req, stream=stream) - except Exception as e: - _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - logger.debug("Request Exception", exc_info=True) - raise e - - if http_res is None: - logger.debug("Raising no response SDK error") - raise models.SDKError("No response received") - - logger.debug( - "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", - http_res.status_code, - http_res.url, - http_res.headers, - "" if stream else http_res.text, - ) - - if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = hooks.after_error( - AfterErrorContext(hook_ctx), http_res, None - ) - if err is not None: - logger.debug("Request Exception", exc_info=True) - raise err - if result is not None: - http_res = result - else: - logger.debug("Raising unexpected SDK error") - raise models.SDKError("Unexpected error occurred") - - return http_res - - if retry_config is not None: - http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) - else: - http_res = do() - - if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - async def do_request_async( - self, - hook_ctx, - request, - error_status_codes, - stream=False, - retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, - ) -> httpx.Response: - client = self.sdk_configuration.async_client - logger = self.sdk_configuration.debug_logger - - hooks = self.sdk_configuration.__dict__["_hooks"] - - async def do(): - http_res = None - try: - req = hooks.before_request(BeforeRequestContext(hook_ctx), request) - logger.debug( - "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", - req.method, - req.url, - req.headers, - get_body_content(req), - ) - - if client is None: - raise ValueError("client is required") - - http_res = await client.send(req, stream=stream) - except Exception as e: - _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - logger.debug("Request Exception", exc_info=True) - raise e - - if http_res is None: - logger.debug("Raising no response SDK error") - raise models.SDKError("No response received") - - logger.debug( - "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", - http_res.status_code, - http_res.url, - http_res.headers, - "" if stream else http_res.text, - ) - - if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = hooks.after_error( - AfterErrorContext(hook_ctx), http_res, None - ) - if err is not None: - logger.debug("Request Exception", exc_info=True) - raise err - if result is not None: - http_res = result - else: - logger.debug("Raising unexpected SDK error") - raise models.SDKError("Unexpected error occurred") - - return http_res - - if retry_config is not None: - http_res = await utils.retry_async( - do, utils.Retries(retry_config[0], retry_config[1]) - ) - else: - http_res = await do() - - if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res diff --git a/packages/mistralai_azure/src/mistralai_azure/chat.py b/packages/mistralai_azure/src/mistralai_azure/chat.py deleted file mode 100644 index 20184014..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/chat.py +++ /dev/null @@ -1,720 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai_azure import models, utils -from mistralai_azure._hooks import HookContext -from mistralai_azure.types import OptionalNullable, UNSET -from mistralai_azure.utils import eventstreaming -from typing import Any, List, Mapping, Optional, Union - - -class Chat(BaseSDK): - r"""Chat Completion API.""" - - def stream( - self, - *, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], - model: Optional[str] = "azureai", - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionStreamRequestToolChoice, - models.ChatCompletionStreamRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - safe_prompt: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[eventstreaming.EventStream[models.CompletionEvent]]: - r"""Stream chat completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param model: The ID of the model to use for this request. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model(messages, List[models.Messages]), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - safe_prompt=safe_prompt, - ) - - req = self._build_request( - method="POST", - path="/chat/completions#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="stream_chat", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def stream_async( - self, - *, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], - model: Optional[str] = "azureai", - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionStreamRequestToolChoice, - models.ChatCompletionStreamRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - safe_prompt: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[eventstreaming.EventStreamAsync[models.CompletionEvent]]: - r"""Stream chat completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param model: The ID of the model to use for this request. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model(messages, List[models.Messages]), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - safe_prompt=safe_prompt, - ) - - req = self._build_request_async( - method="POST", - path="/chat/completions#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="stream_chat", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - def complete( - self, - *, - messages: Union[ - List[models.ChatCompletionRequestMessages], - List[models.ChatCompletionRequestMessagesTypedDict], - ], - model: Optional[str] = "azureai", - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.ChatCompletionRequestStop, - models.ChatCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionRequestToolChoice, - models.ChatCompletionRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - safe_prompt: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.ChatCompletionResponse]: - r"""Chat Completion - - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param model: The ID of the model to use for this request. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - safe_prompt=safe_prompt, - ) - - req = self._build_request( - method="POST", - path="/chat/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="chat_completion_v1_chat_completions_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, Optional[models.ChatCompletionResponse] - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def complete_async( - self, - *, - messages: Union[ - List[models.ChatCompletionRequestMessages], - List[models.ChatCompletionRequestMessagesTypedDict], - ], - model: Optional[str] = "azureai", - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.ChatCompletionRequestStop, - models.ChatCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionRequestToolChoice, - models.ChatCompletionRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - safe_prompt: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.ChatCompletionResponse]: - r"""Chat Completion - - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param model: The ID of the model to use for this request. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - safe_prompt=safe_prompt, - ) - - req = self._build_request_async( - method="POST", - path="/chat/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="chat_completion_v1_chat_completions_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, Optional[models.ChatCompletionResponse] - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) diff --git a/packages/mistralai_azure/src/mistralai_azure/httpclient.py b/packages/mistralai_azure/src/mistralai_azure/httpclient.py deleted file mode 100644 index 47b052cb..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/httpclient.py +++ /dev/null @@ -1,126 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -# pyright: reportReturnType = false -import asyncio -from typing_extensions import Protocol, runtime_checkable -import httpx -from typing import Any, Optional, Union - - -@runtime_checkable -class HttpClient(Protocol): - def send( - self, - request: httpx.Request, - *, - stream: bool = False, - auth: Union[ - httpx._types.AuthTypes, httpx._client.UseClientDefault, None - ] = httpx.USE_CLIENT_DEFAULT, - follow_redirects: Union[ - bool, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - ) -> httpx.Response: - pass - - def build_request( - self, - method: str, - url: httpx._types.URLTypes, - *, - content: Optional[httpx._types.RequestContent] = None, - data: Optional[httpx._types.RequestData] = None, - files: Optional[httpx._types.RequestFiles] = None, - json: Optional[Any] = None, - params: Optional[httpx._types.QueryParamTypes] = None, - headers: Optional[httpx._types.HeaderTypes] = None, - cookies: Optional[httpx._types.CookieTypes] = None, - timeout: Union[ - httpx._types.TimeoutTypes, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - extensions: Optional[httpx._types.RequestExtensions] = None, - ) -> httpx.Request: - pass - - def close(self) -> None: - pass - - -@runtime_checkable -class AsyncHttpClient(Protocol): - async def send( - self, - request: httpx.Request, - *, - stream: bool = False, - auth: Union[ - httpx._types.AuthTypes, httpx._client.UseClientDefault, None - ] = httpx.USE_CLIENT_DEFAULT, - follow_redirects: Union[ - bool, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - ) -> httpx.Response: - pass - - def build_request( - self, - method: str, - url: httpx._types.URLTypes, - *, - content: Optional[httpx._types.RequestContent] = None, - data: Optional[httpx._types.RequestData] = None, - files: Optional[httpx._types.RequestFiles] = None, - json: Optional[Any] = None, - params: Optional[httpx._types.QueryParamTypes] = None, - headers: Optional[httpx._types.HeaderTypes] = None, - cookies: Optional[httpx._types.CookieTypes] = None, - timeout: Union[ - httpx._types.TimeoutTypes, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - extensions: Optional[httpx._types.RequestExtensions] = None, - ) -> httpx.Request: - pass - - async def aclose(self) -> None: - pass - - -class ClientOwner(Protocol): - client: Union[HttpClient, None] - async_client: Union[AsyncHttpClient, None] - - -def close_clients( - owner: ClientOwner, - sync_client: Union[HttpClient, None], - sync_client_supplied: bool, - async_client: Union[AsyncHttpClient, None], - async_client_supplied: bool, -) -> None: - """ - A finalizer function that is meant to be used with weakref.finalize to close - httpx clients used by an SDK so that underlying resources can be garbage - collected. - """ - - # Unset the client/async_client properties so there are no more references - # to them from the owning SDK instance and they can be reaped. - owner.client = None - owner.async_client = None - - if sync_client is not None and not sync_client_supplied: - try: - sync_client.close() - except Exception: - pass - - if async_client is not None and not async_client_supplied: - try: - loop = asyncio.get_running_loop() - asyncio.run_coroutine_threadsafe(async_client.aclose(), loop) - except RuntimeError: - try: - asyncio.run(async_client.aclose()) - except RuntimeError: - # best effort - pass diff --git a/packages/mistralai_azure/src/mistralai_azure/models/__init__.py b/packages/mistralai_azure/src/mistralai_azure/models/__init__.py deleted file mode 100644 index bc1a3f4f..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/__init__.py +++ /dev/null @@ -1,405 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import TYPE_CHECKING -from importlib import import_module - -if TYPE_CHECKING: - from .assistantmessage import ( - AssistantMessage, - AssistantMessageContent, - AssistantMessageContentTypedDict, - AssistantMessageRole, - AssistantMessageTypedDict, - ) - from .chatcompletionchoice import ( - ChatCompletionChoice, - ChatCompletionChoiceFinishReason, - ChatCompletionChoiceTypedDict, - ) - from .chatcompletionrequest import ( - ChatCompletionRequest, - ChatCompletionRequestMessages, - ChatCompletionRequestMessagesTypedDict, - ChatCompletionRequestStop, - ChatCompletionRequestStopTypedDict, - ChatCompletionRequestToolChoice, - ChatCompletionRequestToolChoiceTypedDict, - ChatCompletionRequestTypedDict, - ) - from .chatcompletionresponse import ( - ChatCompletionResponse, - ChatCompletionResponseTypedDict, - ) - from .chatcompletionstreamrequest import ( - ChatCompletionStreamRequest, - ChatCompletionStreamRequestToolChoice, - ChatCompletionStreamRequestToolChoiceTypedDict, - ChatCompletionStreamRequestTypedDict, - Messages, - MessagesTypedDict, - Stop, - StopTypedDict, - ) - from .completionchunk import CompletionChunk, CompletionChunkTypedDict - from .completionevent import CompletionEvent, CompletionEventTypedDict - from .completionresponsestreamchoice import ( - CompletionResponseStreamChoice, - CompletionResponseStreamChoiceTypedDict, - FinishReason, - ) - from .contentchunk import ContentChunk, ContentChunkTypedDict - from .deltamessage import ( - Content, - ContentTypedDict, - DeltaMessage, - DeltaMessageTypedDict, - ) - from .documenturlchunk import ( - DocumentURLChunk, - DocumentURLChunkType, - DocumentURLChunkTypedDict, - ) - from .filechunk import FileChunk, FileChunkTypedDict - from .function import Function, FunctionTypedDict - from .functioncall import ( - Arguments, - ArgumentsTypedDict, - FunctionCall, - FunctionCallTypedDict, - ) - from .functionname import FunctionName, FunctionNameTypedDict - from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData - from .imageurl import ImageURL, ImageURLTypedDict - from .imageurlchunk import ( - ImageURLChunk, - ImageURLChunkImageURL, - ImageURLChunkImageURLTypedDict, - ImageURLChunkType, - ImageURLChunkTypedDict, - ) - from .jsonschema import JSONSchema, JSONSchemaTypedDict - from .mistralpromptmode import MistralPromptMode - from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict - from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict - from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict - from .ocrrequest import Document, DocumentTypedDict, OCRRequest, OCRRequestTypedDict - from .ocrresponse import OCRResponse, OCRResponseTypedDict - from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict - from .prediction import Prediction, PredictionTypedDict - from .referencechunk import ( - ReferenceChunk, - ReferenceChunkType, - ReferenceChunkTypedDict, - ) - from .responseformat import ResponseFormat, ResponseFormatTypedDict - from .responseformats import ResponseFormats - from .sdkerror import SDKError - from .security import Security, SecurityTypedDict - from .systemmessage import ( - Role, - SystemMessage, - SystemMessageContent, - SystemMessageContentTypedDict, - SystemMessageTypedDict, - ) - from .textchunk import TextChunk, TextChunkTypedDict, Type - from .tool import Tool, ToolTypedDict - from .toolcall import ToolCall, ToolCallTypedDict - from .toolchoice import ToolChoice, ToolChoiceTypedDict - from .toolchoiceenum import ToolChoiceEnum - from .toolmessage import ( - ToolMessage, - ToolMessageContent, - ToolMessageContentTypedDict, - ToolMessageRole, - ToolMessageTypedDict, - ) - from .tooltypes import ToolTypes - from .usageinfo import UsageInfo, UsageInfoTypedDict - from .usermessage import ( - UserMessage, - UserMessageContent, - UserMessageContentTypedDict, - UserMessageRole, - UserMessageTypedDict, - ) - from .validationerror import ( - Loc, - LocTypedDict, - ValidationError, - ValidationErrorTypedDict, - ) - -__all__ = [ - "Arguments", - "ArgumentsTypedDict", - "AssistantMessage", - "AssistantMessageContent", - "AssistantMessageContentTypedDict", - "AssistantMessageRole", - "AssistantMessageTypedDict", - "ChatCompletionChoice", - "ChatCompletionChoiceFinishReason", - "ChatCompletionChoiceTypedDict", - "ChatCompletionRequest", - "ChatCompletionRequestMessages", - "ChatCompletionRequestMessagesTypedDict", - "ChatCompletionRequestStop", - "ChatCompletionRequestStopTypedDict", - "ChatCompletionRequestToolChoice", - "ChatCompletionRequestToolChoiceTypedDict", - "ChatCompletionRequestTypedDict", - "ChatCompletionResponse", - "ChatCompletionResponseTypedDict", - "ChatCompletionStreamRequest", - "ChatCompletionStreamRequestToolChoice", - "ChatCompletionStreamRequestToolChoiceTypedDict", - "ChatCompletionStreamRequestTypedDict", - "CompletionChunk", - "CompletionChunkTypedDict", - "CompletionEvent", - "CompletionEventTypedDict", - "CompletionResponseStreamChoice", - "CompletionResponseStreamChoiceTypedDict", - "Content", - "ContentChunk", - "ContentChunkTypedDict", - "ContentTypedDict", - "DeltaMessage", - "DeltaMessageTypedDict", - "Document", - "DocumentTypedDict", - "DocumentURLChunk", - "DocumentURLChunkType", - "DocumentURLChunkTypedDict", - "FileChunk", - "FileChunkTypedDict", - "FinishReason", - "Function", - "FunctionCall", - "FunctionCallTypedDict", - "FunctionName", - "FunctionNameTypedDict", - "FunctionTypedDict", - "HTTPValidationError", - "HTTPValidationErrorData", - "ImageURL", - "ImageURLChunk", - "ImageURLChunkImageURL", - "ImageURLChunkImageURLTypedDict", - "ImageURLChunkType", - "ImageURLChunkTypedDict", - "ImageURLTypedDict", - "JSONSchema", - "JSONSchemaTypedDict", - "Loc", - "LocTypedDict", - "Messages", - "MessagesTypedDict", - "MistralPromptMode", - "OCRImageObject", - "OCRImageObjectTypedDict", - "OCRPageDimensions", - "OCRPageDimensionsTypedDict", - "OCRPageObject", - "OCRPageObjectTypedDict", - "OCRRequest", - "OCRRequestTypedDict", - "OCRResponse", - "OCRResponseTypedDict", - "OCRUsageInfo", - "OCRUsageInfoTypedDict", - "Prediction", - "PredictionTypedDict", - "ReferenceChunk", - "ReferenceChunkType", - "ReferenceChunkTypedDict", - "ResponseFormat", - "ResponseFormatTypedDict", - "ResponseFormats", - "Role", - "SDKError", - "Security", - "SecurityTypedDict", - "Stop", - "StopTypedDict", - "SystemMessage", - "SystemMessageContent", - "SystemMessageContentTypedDict", - "SystemMessageTypedDict", - "TextChunk", - "TextChunkTypedDict", - "Tool", - "ToolCall", - "ToolCallTypedDict", - "ToolChoice", - "ToolChoiceEnum", - "ToolChoiceTypedDict", - "ToolMessage", - "ToolMessageContent", - "ToolMessageContentTypedDict", - "ToolMessageRole", - "ToolMessageTypedDict", - "ToolTypedDict", - "ToolTypes", - "Type", - "UsageInfo", - "UsageInfoTypedDict", - "UserMessage", - "UserMessageContent", - "UserMessageContentTypedDict", - "UserMessageRole", - "UserMessageTypedDict", - "ValidationError", - "ValidationErrorTypedDict", -] - -_dynamic_imports: dict[str, str] = { - "AssistantMessage": ".assistantmessage", - "AssistantMessageContent": ".assistantmessage", - "AssistantMessageContentTypedDict": ".assistantmessage", - "AssistantMessageRole": ".assistantmessage", - "AssistantMessageTypedDict": ".assistantmessage", - "ChatCompletionChoice": ".chatcompletionchoice", - "ChatCompletionChoiceFinishReason": ".chatcompletionchoice", - "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", - "ChatCompletionRequest": ".chatcompletionrequest", - "ChatCompletionRequestMessages": ".chatcompletionrequest", - "ChatCompletionRequestMessagesTypedDict": ".chatcompletionrequest", - "ChatCompletionRequestStop": ".chatcompletionrequest", - "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", - "ChatCompletionRequestToolChoice": ".chatcompletionrequest", - "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", - "ChatCompletionRequestTypedDict": ".chatcompletionrequest", - "ChatCompletionResponse": ".chatcompletionresponse", - "ChatCompletionResponseTypedDict": ".chatcompletionresponse", - "ChatCompletionStreamRequest": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", - "Messages": ".chatcompletionstreamrequest", - "MessagesTypedDict": ".chatcompletionstreamrequest", - "Stop": ".chatcompletionstreamrequest", - "StopTypedDict": ".chatcompletionstreamrequest", - "CompletionChunk": ".completionchunk", - "CompletionChunkTypedDict": ".completionchunk", - "CompletionEvent": ".completionevent", - "CompletionEventTypedDict": ".completionevent", - "CompletionResponseStreamChoice": ".completionresponsestreamchoice", - "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", - "FinishReason": ".completionresponsestreamchoice", - "ContentChunk": ".contentchunk", - "ContentChunkTypedDict": ".contentchunk", - "Content": ".deltamessage", - "ContentTypedDict": ".deltamessage", - "DeltaMessage": ".deltamessage", - "DeltaMessageTypedDict": ".deltamessage", - "DocumentURLChunk": ".documenturlchunk", - "DocumentURLChunkType": ".documenturlchunk", - "DocumentURLChunkTypedDict": ".documenturlchunk", - "FileChunk": ".filechunk", - "FileChunkTypedDict": ".filechunk", - "Function": ".function", - "FunctionTypedDict": ".function", - "Arguments": ".functioncall", - "ArgumentsTypedDict": ".functioncall", - "FunctionCall": ".functioncall", - "FunctionCallTypedDict": ".functioncall", - "FunctionName": ".functionname", - "FunctionNameTypedDict": ".functionname", - "HTTPValidationError": ".httpvalidationerror", - "HTTPValidationErrorData": ".httpvalidationerror", - "ImageURL": ".imageurl", - "ImageURLTypedDict": ".imageurl", - "ImageURLChunk": ".imageurlchunk", - "ImageURLChunkImageURL": ".imageurlchunk", - "ImageURLChunkImageURLTypedDict": ".imageurlchunk", - "ImageURLChunkType": ".imageurlchunk", - "ImageURLChunkTypedDict": ".imageurlchunk", - "JSONSchema": ".jsonschema", - "JSONSchemaTypedDict": ".jsonschema", - "MistralPromptMode": ".mistralpromptmode", - "OCRImageObject": ".ocrimageobject", - "OCRImageObjectTypedDict": ".ocrimageobject", - "OCRPageDimensions": ".ocrpagedimensions", - "OCRPageDimensionsTypedDict": ".ocrpagedimensions", - "OCRPageObject": ".ocrpageobject", - "OCRPageObjectTypedDict": ".ocrpageobject", - "Document": ".ocrrequest", - "DocumentTypedDict": ".ocrrequest", - "OCRRequest": ".ocrrequest", - "OCRRequestTypedDict": ".ocrrequest", - "OCRResponse": ".ocrresponse", - "OCRResponseTypedDict": ".ocrresponse", - "OCRUsageInfo": ".ocrusageinfo", - "OCRUsageInfoTypedDict": ".ocrusageinfo", - "Prediction": ".prediction", - "PredictionTypedDict": ".prediction", - "ReferenceChunk": ".referencechunk", - "ReferenceChunkType": ".referencechunk", - "ReferenceChunkTypedDict": ".referencechunk", - "ResponseFormat": ".responseformat", - "ResponseFormatTypedDict": ".responseformat", - "ResponseFormats": ".responseformats", - "SDKError": ".sdkerror", - "Security": ".security", - "SecurityTypedDict": ".security", - "Role": ".systemmessage", - "SystemMessage": ".systemmessage", - "SystemMessageContent": ".systemmessage", - "SystemMessageContentTypedDict": ".systemmessage", - "SystemMessageTypedDict": ".systemmessage", - "TextChunk": ".textchunk", - "TextChunkTypedDict": ".textchunk", - "Type": ".textchunk", - "Tool": ".tool", - "ToolTypedDict": ".tool", - "ToolCall": ".toolcall", - "ToolCallTypedDict": ".toolcall", - "ToolChoice": ".toolchoice", - "ToolChoiceTypedDict": ".toolchoice", - "ToolChoiceEnum": ".toolchoiceenum", - "ToolMessage": ".toolmessage", - "ToolMessageContent": ".toolmessage", - "ToolMessageContentTypedDict": ".toolmessage", - "ToolMessageRole": ".toolmessage", - "ToolMessageTypedDict": ".toolmessage", - "ToolTypes": ".tooltypes", - "UsageInfo": ".usageinfo", - "UsageInfoTypedDict": ".usageinfo", - "UserMessage": ".usermessage", - "UserMessageContent": ".usermessage", - "UserMessageContentTypedDict": ".usermessage", - "UserMessageRole": ".usermessage", - "UserMessageTypedDict": ".usermessage", - "Loc": ".validationerror", - "LocTypedDict": ".validationerror", - "ValidationError": ".validationerror", - "ValidationErrorTypedDict": ".validationerror", -} - - -def __getattr__(attr_name: str) -> object: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError( - f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " - ) - - try: - module = import_module(module_name, __package__) - result = getattr(module, attr_name) - return result - except ImportError as e: - raise ImportError( - f"Failed to import {attr_name} from {module_name}: {e}" - ) from e - except AttributeError as e: - raise AttributeError( - f"Failed to get {attr_name} from {module_name}: {e}" - ) from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) diff --git a/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py b/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py deleted file mode 100644 index 86f5ec09..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py +++ /dev/null @@ -1,77 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from .toolcall import ToolCall, ToolCallTypedDict -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -AssistantMessageContentTypedDict = TypeAliasType( - "AssistantMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -AssistantMessageContent = TypeAliasType( - "AssistantMessageContent", Union[str, List[ContentChunk]] -) - - -AssistantMessageRole = Literal["assistant"] - - -class AssistantMessageTypedDict(TypedDict): - content: NotRequired[Nullable[AssistantMessageContentTypedDict]] - tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] - prefix: NotRequired[bool] - r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - role: NotRequired[AssistantMessageRole] - - -class AssistantMessage(BaseModel): - content: OptionalNullable[AssistantMessageContent] = UNSET - - tool_calls: OptionalNullable[List[ToolCall]] = UNSET - - prefix: Optional[bool] = False - r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - - role: Optional[AssistantMessageRole] = "assistant" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["content", "tool_calls", "prefix", "role"] - nullable_fields = ["content", "tool_calls"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py b/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py deleted file mode 100644 index a78b72d5..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from mistralai_azure.types import BaseModel, UnrecognizedStr -from mistralai_azure.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Literal, Union -from typing_extensions import Annotated, TypedDict - - -ChatCompletionChoiceFinishReason = Union[ - Literal["stop", "length", "model_length", "error", "tool_calls"], UnrecognizedStr -] - - -class ChatCompletionChoiceTypedDict(TypedDict): - index: int - message: AssistantMessageTypedDict - finish_reason: ChatCompletionChoiceFinishReason - - -class ChatCompletionChoice(BaseModel): - index: int - - message: AssistantMessage - - finish_reason: Annotated[ - ChatCompletionChoiceFinishReason, PlainValidator(validate_open_enum(False)) - ] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py b/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py deleted file mode 100644 index 8dffe1bd..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py +++ /dev/null @@ -1,212 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .mistralpromptmode import MistralPromptMode -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .tool import Tool, ToolTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from mistralai_azure.utils import get_discriminator, validate_open_enum -from pydantic import Discriminator, Tag, model_serializer -from pydantic.functional_validators import PlainValidator -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -ChatCompletionRequestStopTypedDict = TypeAliasType( - "ChatCompletionRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -ChatCompletionRequestStop = TypeAliasType( - "ChatCompletionRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -ChatCompletionRequestMessagesTypedDict = TypeAliasType( - "ChatCompletionRequestMessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -ChatCompletionRequestMessages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -ChatCompletionRequestToolChoiceTypedDict = TypeAliasType( - "ChatCompletionRequestToolChoiceTypedDict", - Union[ToolChoiceTypedDict, ToolChoiceEnum], -) - - -ChatCompletionRequestToolChoice = TypeAliasType( - "ChatCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] -) - - -class ChatCompletionRequestTypedDict(TypedDict): - messages: List[ChatCompletionRequestMessagesTypedDict] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - model: NotRequired[str] - r"""The ID of the model to use for this request.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - stop: NotRequired[ChatCompletionRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - response_format: NotRequired[ResponseFormatTypedDict] - tools: NotRequired[Nullable[List[ToolTypedDict]]] - tool_choice: NotRequired[ChatCompletionRequestToolChoiceTypedDict] - presence_penalty: NotRequired[float] - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: NotRequired[float] - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - n: NotRequired[Nullable[int]] - r"""Number of completions to return for each request, input tokens are only billed once.""" - prediction: NotRequired[PredictionTypedDict] - parallel_tool_calls: NotRequired[bool] - prompt_mode: NotRequired[Nullable[MistralPromptMode]] - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - safe_prompt: NotRequired[bool] - r"""Whether to inject a safety prompt before all conversations.""" - - -class ChatCompletionRequest(BaseModel): - messages: List[ChatCompletionRequestMessages] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - - model: Optional[str] = "azureai" - r"""The ID of the model to use for this request.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = None - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = False - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - - stop: Optional[ChatCompletionRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - response_format: Optional[ResponseFormat] = None - - tools: OptionalNullable[List[Tool]] = UNSET - - tool_choice: Optional[ChatCompletionRequestToolChoice] = None - - presence_penalty: Optional[float] = None - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - - frequency_penalty: Optional[float] = None - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - - n: OptionalNullable[int] = UNSET - r"""Number of completions to return for each request, input tokens are only billed once.""" - - prediction: Optional[Prediction] = None - - parallel_tool_calls: Optional[bool] = None - - prompt_mode: Annotated[ - OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False)) - ] = UNSET - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - - safe_prompt: Optional[bool] = None - r"""Whether to inject a safety prompt before all conversations.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "model", - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "response_format", - "tools", - "tool_choice", - "presence_penalty", - "frequency_penalty", - "n", - "prediction", - "parallel_tool_calls", - "prompt_mode", - "safe_prompt", - ] - nullable_fields = [ - "temperature", - "max_tokens", - "random_seed", - "tools", - "n", - "prompt_mode", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py b/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py deleted file mode 100644 index 7a66f322..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_azure.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ChatCompletionResponseTypedDict(TypedDict): - id: str - object: str - model: str - usage: UsageInfoTypedDict - created: int - choices: List[ChatCompletionChoiceTypedDict] - - -class ChatCompletionResponse(BaseModel): - id: str - - object: str - - model: str - - usage: UsageInfo - - created: int - - choices: List[ChatCompletionChoice] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py b/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py deleted file mode 100644 index 5fced93e..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py +++ /dev/null @@ -1,206 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .mistralpromptmode import MistralPromptMode -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .tool import Tool, ToolTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from mistralai_azure.utils import get_discriminator, validate_open_enum -from pydantic import Discriminator, Tag, model_serializer -from pydantic.functional_validators import PlainValidator -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str]]) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -Stop = TypeAliasType("Stop", Union[str, List[str]]) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -MessagesTypedDict = TypeAliasType( - "MessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -Messages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -ChatCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( - "ChatCompletionStreamRequestToolChoiceTypedDict", - Union[ToolChoiceTypedDict, ToolChoiceEnum], -) - - -ChatCompletionStreamRequestToolChoice = TypeAliasType( - "ChatCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] -) - - -class ChatCompletionStreamRequestTypedDict(TypedDict): - messages: List[MessagesTypedDict] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - model: NotRequired[str] - r"""The ID of the model to use for this request.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - stop: NotRequired[StopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - response_format: NotRequired[ResponseFormatTypedDict] - tools: NotRequired[Nullable[List[ToolTypedDict]]] - tool_choice: NotRequired[ChatCompletionStreamRequestToolChoiceTypedDict] - presence_penalty: NotRequired[float] - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: NotRequired[float] - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - n: NotRequired[Nullable[int]] - r"""Number of completions to return for each request, input tokens are only billed once.""" - prediction: NotRequired[PredictionTypedDict] - parallel_tool_calls: NotRequired[bool] - prompt_mode: NotRequired[Nullable[MistralPromptMode]] - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - safe_prompt: NotRequired[bool] - r"""Whether to inject a safety prompt before all conversations.""" - - -class ChatCompletionStreamRequest(BaseModel): - messages: List[Messages] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - - model: Optional[str] = "azureai" - r"""The ID of the model to use for this request.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = None - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = True - - stop: Optional[Stop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - response_format: Optional[ResponseFormat] = None - - tools: OptionalNullable[List[Tool]] = UNSET - - tool_choice: Optional[ChatCompletionStreamRequestToolChoice] = None - - presence_penalty: Optional[float] = None - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - - frequency_penalty: Optional[float] = None - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - - n: OptionalNullable[int] = UNSET - r"""Number of completions to return for each request, input tokens are only billed once.""" - - prediction: Optional[Prediction] = None - - parallel_tool_calls: Optional[bool] = None - - prompt_mode: Annotated[ - OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False)) - ] = UNSET - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - - safe_prompt: Optional[bool] = None - r"""Whether to inject a safety prompt before all conversations.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "model", - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "response_format", - "tools", - "tool_choice", - "presence_penalty", - "frequency_penalty", - "n", - "prediction", - "parallel_tool_calls", - "prompt_mode", - "safe_prompt", - ] - nullable_fields = [ - "temperature", - "max_tokens", - "random_seed", - "tools", - "n", - "prompt_mode", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py b/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py deleted file mode 100644 index d6cc2a86..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionresponsestreamchoice import ( - CompletionResponseStreamChoice, - CompletionResponseStreamChoiceTypedDict, -) -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_azure.types import BaseModel -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class CompletionChunkTypedDict(TypedDict): - id: str - model: str - choices: List[CompletionResponseStreamChoiceTypedDict] - object: NotRequired[str] - created: NotRequired[int] - usage: NotRequired[UsageInfoTypedDict] - - -class CompletionChunk(BaseModel): - id: str - - model: str - - choices: List[CompletionResponseStreamChoice] - - object: Optional[str] = None - - created: Optional[int] = None - - usage: Optional[UsageInfo] = None diff --git a/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py b/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py deleted file mode 100644 index 5a2039c2..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionchunk import CompletionChunk, CompletionChunkTypedDict -from mistralai_azure.types import BaseModel -from typing_extensions import TypedDict - - -class CompletionEventTypedDict(TypedDict): - data: CompletionChunkTypedDict - - -class CompletionEvent(BaseModel): - data: CompletionChunk diff --git a/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py b/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py deleted file mode 100644 index 1a492204..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py +++ /dev/null @@ -1,59 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .deltamessage import DeltaMessage, DeltaMessageTypedDict -from mistralai_azure.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr -from mistralai_azure.utils import validate_open_enum -from pydantic import model_serializer -from pydantic.functional_validators import PlainValidator -from typing import Literal, Union -from typing_extensions import Annotated, TypedDict - - -FinishReason = Union[Literal["stop", "length", "error", "tool_calls"], UnrecognizedStr] - - -class CompletionResponseStreamChoiceTypedDict(TypedDict): - index: int - delta: DeltaMessageTypedDict - finish_reason: Nullable[FinishReason] - - -class CompletionResponseStreamChoice(BaseModel): - index: int - - delta: DeltaMessage - - finish_reason: Annotated[ - Nullable[FinishReason], PlainValidator(validate_open_enum(False)) - ] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [] - nullable_fields = ["finish_reason"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py b/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py deleted file mode 100644 index e6a3e24a..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict -from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict -from .textchunk import TextChunk, TextChunkTypedDict -from mistralai_azure.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType - - -ContentChunkTypedDict = TypeAliasType( - "ContentChunkTypedDict", - Union[TextChunkTypedDict, ImageURLChunkTypedDict, ReferenceChunkTypedDict], -) - - -ContentChunk = Annotated[ - Union[ - Annotated[ImageURLChunk, Tag("image_url")], - Annotated[TextChunk, Tag("text")], - Annotated[ReferenceChunk, Tag("reference")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py b/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py deleted file mode 100644 index 7fa3c3f2..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py +++ /dev/null @@ -1,67 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from .toolcall import ToolCall, ToolCallTypedDict -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ContentTypedDict = TypeAliasType( - "ContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -Content = TypeAliasType("Content", Union[str, List[ContentChunk]]) - - -class DeltaMessageTypedDict(TypedDict): - role: NotRequired[Nullable[str]] - content: NotRequired[Nullable[ContentTypedDict]] - tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] - - -class DeltaMessage(BaseModel): - role: OptionalNullable[str] = UNSET - - content: OptionalNullable[Content] = UNSET - - tool_calls: OptionalNullable[List[ToolCall]] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["role", "content", "tool_calls"] - nullable_fields = ["role", "content", "tool_calls"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/documenturlchunk.py b/packages/mistralai_azure/src/mistralai_azure/models/documenturlchunk.py deleted file mode 100644 index 23ff71a6..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/documenturlchunk.py +++ /dev/null @@ -1,62 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -DocumentURLChunkType = Literal["document_url"] - - -class DocumentURLChunkTypedDict(TypedDict): - document_url: str - document_name: NotRequired[Nullable[str]] - r"""The filename of the document""" - type: NotRequired[DocumentURLChunkType] - - -class DocumentURLChunk(BaseModel): - document_url: str - - document_name: OptionalNullable[str] = UNSET - r"""The filename of the document""" - - type: Optional[DocumentURLChunkType] = "document_url" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["document_name", "type"] - nullable_fields = ["document_name"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/filechunk.py b/packages/mistralai_azure/src/mistralai_azure/models/filechunk.py deleted file mode 100644 index 2c3edc07..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/filechunk.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import validate_const -import pydantic -from pydantic.functional_validators import AfterValidator -from typing import Literal, Optional -from typing_extensions import Annotated, TypedDict - - -class FileChunkTypedDict(TypedDict): - file_id: str - type: Literal["file"] - - -class FileChunk(BaseModel): - file_id: str - - TYPE: Annotated[ - Annotated[Optional[Literal["file"]], AfterValidator(validate_const("file"))], - pydantic.Field(alias="type"), - ] = "file" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/function.py b/packages/mistralai_azure/src/mistralai_azure/models/function.py deleted file mode 100644 index a4642f92..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/function.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing import Any, Dict, Optional -from typing_extensions import NotRequired, TypedDict - - -class FunctionTypedDict(TypedDict): - name: str - parameters: Dict[str, Any] - description: NotRequired[str] - strict: NotRequired[bool] - - -class Function(BaseModel): - name: str - - parameters: Dict[str, Any] - - description: Optional[str] = None - - strict: Optional[bool] = None diff --git a/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py b/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py deleted file mode 100644 index dd93c462..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing import Any, Dict, Union -from typing_extensions import TypeAliasType, TypedDict - - -ArgumentsTypedDict = TypeAliasType("ArgumentsTypedDict", Union[Dict[str, Any], str]) - - -Arguments = TypeAliasType("Arguments", Union[Dict[str, Any], str]) - - -class FunctionCallTypedDict(TypedDict): - name: str - arguments: ArgumentsTypedDict - - -class FunctionCall(BaseModel): - name: str - - arguments: Arguments diff --git a/packages/mistralai_azure/src/mistralai_azure/models/functionname.py b/packages/mistralai_azure/src/mistralai_azure/models/functionname.py deleted file mode 100644 index b55c82af..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/functionname.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing_extensions import TypedDict - - -class FunctionNameTypedDict(TypedDict): - r"""this restriction of `Function` is used to select a specific function to call""" - - name: str - - -class FunctionName(BaseModel): - r"""this restriction of `Function` is used to select a specific function to call""" - - name: str diff --git a/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py b/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py deleted file mode 100644 index 1d22d97a..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .validationerror import ValidationError -from mistralai_azure import utils -from mistralai_azure.types import BaseModel -from typing import List, Optional - - -class HTTPValidationErrorData(BaseModel): - detail: Optional[List[ValidationError]] = None - - -class HTTPValidationError(Exception): - data: HTTPValidationErrorData - - def __init__(self, data: HTTPValidationErrorData): - self.data = data - - def __str__(self) -> str: - return utils.marshal_json(self.data, HTTPValidationErrorData) diff --git a/packages/mistralai_azure/src/mistralai_azure/models/imageurl.py b/packages/mistralai_azure/src/mistralai_azure/models/imageurl.py deleted file mode 100644 index a5a66360..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/imageurl.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class ImageURLTypedDict(TypedDict): - url: str - detail: NotRequired[Nullable[str]] - - -class ImageURL(BaseModel): - url: str - - detail: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["detail"] - nullable_fields = ["detail"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/imageurlchunk.py b/packages/mistralai_azure/src/mistralai_azure/models/imageurlchunk.py deleted file mode 100644 index 734d7f79..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/imageurlchunk.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .imageurl import ImageURL, ImageURLTypedDict -from mistralai_azure.types import BaseModel -from typing import Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ImageURLChunkImageURLTypedDict = TypeAliasType( - "ImageURLChunkImageURLTypedDict", Union[ImageURLTypedDict, str] -) - - -ImageURLChunkImageURL = TypeAliasType("ImageURLChunkImageURL", Union[ImageURL, str]) - - -ImageURLChunkType = Literal["image_url"] - - -class ImageURLChunkTypedDict(TypedDict): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURLTypedDict - type: NotRequired[ImageURLChunkType] - - -class ImageURLChunk(BaseModel): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURL - - type: Optional[ImageURLChunkType] = "image_url" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/jsonschema.py b/packages/mistralai_azure/src/mistralai_azure/models/jsonschema.py deleted file mode 100644 index 0f7563fc..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/jsonschema.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -import pydantic -from pydantic import model_serializer -from typing import Any, Dict, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class JSONSchemaTypedDict(TypedDict): - name: str - schema_definition: Dict[str, Any] - description: NotRequired[Nullable[str]] - strict: NotRequired[bool] - - -class JSONSchema(BaseModel): - name: str - - schema_definition: Annotated[Dict[str, Any], pydantic.Field(alias="schema")] - - description: OptionalNullable[str] = UNSET - - strict: Optional[bool] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["description", "strict"] - nullable_fields = ["description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/mistralpromptmode.py b/packages/mistralai_azure/src/mistralai_azure/models/mistralpromptmode.py deleted file mode 100644 index bd4584a5..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/mistralpromptmode.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import UnrecognizedStr -from typing import Literal, Union - - -MistralPromptMode = Union[Literal["reasoning"], UnrecognizedStr] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrimageobject.py b/packages/mistralai_azure/src/mistralai_azure/models/ocrimageobject.py deleted file mode 100644 index 9d0dd01d..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrimageobject.py +++ /dev/null @@ -1,89 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class OCRImageObjectTypedDict(TypedDict): - id: str - r"""Image ID for extracted image in a page""" - top_left_x: Nullable[int] - r"""X coordinate of top-left corner of the extracted image""" - top_left_y: Nullable[int] - r"""Y coordinate of top-left corner of the extracted image""" - bottom_right_x: Nullable[int] - r"""X coordinate of bottom-right corner of the extracted image""" - bottom_right_y: Nullable[int] - r"""Y coordinate of bottom-right corner of the extracted image""" - image_base64: NotRequired[Nullable[str]] - r"""Base64 string of the extracted image""" - image_annotation: NotRequired[Nullable[str]] - r"""Annotation of the extracted image in json str""" - - -class OCRImageObject(BaseModel): - id: str - r"""Image ID for extracted image in a page""" - - top_left_x: Nullable[int] - r"""X coordinate of top-left corner of the extracted image""" - - top_left_y: Nullable[int] - r"""Y coordinate of top-left corner of the extracted image""" - - bottom_right_x: Nullable[int] - r"""X coordinate of bottom-right corner of the extracted image""" - - bottom_right_y: Nullable[int] - r"""Y coordinate of bottom-right corner of the extracted image""" - - image_base64: OptionalNullable[str] = UNSET - r"""Base64 string of the extracted image""" - - image_annotation: OptionalNullable[str] = UNSET - r"""Annotation of the extracted image in json str""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["image_base64", "image_annotation"] - nullable_fields = [ - "top_left_x", - "top_left_y", - "bottom_right_x", - "bottom_right_y", - "image_base64", - "image_annotation", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrpagedimensions.py b/packages/mistralai_azure/src/mistralai_azure/models/ocrpagedimensions.py deleted file mode 100644 index efb62a58..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrpagedimensions.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing_extensions import TypedDict - - -class OCRPageDimensionsTypedDict(TypedDict): - dpi: int - r"""Dots per inch of the page-image""" - height: int - r"""Height of the image in pixels""" - width: int - r"""Width of the image in pixels""" - - -class OCRPageDimensions(BaseModel): - dpi: int - r"""Dots per inch of the page-image""" - - height: int - r"""Height of the image in pixels""" - - width: int - r"""Width of the image in pixels""" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrpageobject.py b/packages/mistralai_azure/src/mistralai_azure/models/ocrpageobject.py deleted file mode 100644 index 4438e732..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrpageobject.py +++ /dev/null @@ -1,64 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict -from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict -from mistralai_azure.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List -from typing_extensions import TypedDict - - -class OCRPageObjectTypedDict(TypedDict): - index: int - r"""The page index in a pdf document starting from 0""" - markdown: str - r"""The markdown string response of the page""" - images: List[OCRImageObjectTypedDict] - r"""List of all extracted images in the page""" - dimensions: Nullable[OCRPageDimensionsTypedDict] - r"""The dimensions of the PDF Page's screenshot image""" - - -class OCRPageObject(BaseModel): - index: int - r"""The page index in a pdf document starting from 0""" - - markdown: str - r"""The markdown string response of the page""" - - images: List[OCRImageObject] - r"""List of all extracted images in the page""" - - dimensions: Nullable[OCRPageDimensions] - r"""The dimensions of the PDF Page's screenshot image""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [] - nullable_fields = ["dimensions"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrrequest.py b/packages/mistralai_azure/src/mistralai_azure/models/ocrrequest.py deleted file mode 100644 index 533d0742..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrrequest.py +++ /dev/null @@ -1,120 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict -from .filechunk import FileChunk, FileChunkTypedDict -from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -DocumentTypedDict = TypeAliasType( - "DocumentTypedDict", - Union[FileChunkTypedDict, ImageURLChunkTypedDict, DocumentURLChunkTypedDict], -) -r"""Document to run OCR on""" - - -Document = TypeAliasType("Document", Union[FileChunk, ImageURLChunk, DocumentURLChunk]) -r"""Document to run OCR on""" - - -class OCRRequestTypedDict(TypedDict): - model: Nullable[str] - document: DocumentTypedDict - r"""Document to run OCR on""" - id: NotRequired[str] - pages: NotRequired[Nullable[List[int]]] - r"""Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0""" - include_image_base64: NotRequired[Nullable[bool]] - r"""Include image URLs in response""" - image_limit: NotRequired[Nullable[int]] - r"""Max images to extract""" - image_min_size: NotRequired[Nullable[int]] - r"""Minimum height and width of image to extract""" - bbox_annotation_format: NotRequired[Nullable[ResponseFormatTypedDict]] - r"""Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field""" - document_annotation_format: NotRequired[Nullable[ResponseFormatTypedDict]] - r"""Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field""" - - -class OCRRequest(BaseModel): - model: Nullable[str] - - document: Document - r"""Document to run OCR on""" - - id: Optional[str] = None - - pages: OptionalNullable[List[int]] = UNSET - r"""Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0""" - - include_image_base64: OptionalNullable[bool] = UNSET - r"""Include image URLs in response""" - - image_limit: OptionalNullable[int] = UNSET - r"""Max images to extract""" - - image_min_size: OptionalNullable[int] = UNSET - r"""Minimum height and width of image to extract""" - - bbox_annotation_format: OptionalNullable[ResponseFormat] = UNSET - r"""Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field""" - - document_annotation_format: OptionalNullable[ResponseFormat] = UNSET - r"""Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "id", - "pages", - "include_image_base64", - "image_limit", - "image_min_size", - "bbox_annotation_format", - "document_annotation_format", - ] - nullable_fields = [ - "model", - "pages", - "include_image_base64", - "image_limit", - "image_min_size", - "bbox_annotation_format", - "document_annotation_format", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrresponse.py b/packages/mistralai_azure/src/mistralai_azure/models/ocrresponse.py deleted file mode 100644 index 3e43fa8e..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrresponse.py +++ /dev/null @@ -1,68 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict -from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List -from typing_extensions import NotRequired, TypedDict - - -class OCRResponseTypedDict(TypedDict): - pages: List[OCRPageObjectTypedDict] - r"""List of OCR info for pages.""" - model: str - r"""The model used to generate the OCR.""" - usage_info: OCRUsageInfoTypedDict - document_annotation: NotRequired[Nullable[str]] - r"""Formatted response in the request_format if provided in json str""" - - -class OCRResponse(BaseModel): - pages: List[OCRPageObject] - r"""List of OCR info for pages.""" - - model: str - r"""The model used to generate the OCR.""" - - usage_info: OCRUsageInfo - - document_annotation: OptionalNullable[str] = UNSET - r"""Formatted response in the request_format if provided in json str""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["document_annotation"] - nullable_fields = ["document_annotation"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/ocrusageinfo.py b/packages/mistralai_azure/src/mistralai_azure/models/ocrusageinfo.py deleted file mode 100644 index 1f5c9f1b..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/ocrusageinfo.py +++ /dev/null @@ -1,57 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class OCRUsageInfoTypedDict(TypedDict): - pages_processed: int - r"""Number of pages processed""" - doc_size_bytes: NotRequired[Nullable[int]] - r"""Document size in bytes""" - - -class OCRUsageInfo(BaseModel): - pages_processed: int - r"""Number of pages processed""" - - doc_size_bytes: OptionalNullable[int] = UNSET - r"""Document size in bytes""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["doc_size_bytes"] - nullable_fields = ["doc_size_bytes"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/prediction.py b/packages/mistralai_azure/src/mistralai_azure/models/prediction.py deleted file mode 100644 index 888337d3..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/prediction.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import validate_const -import pydantic -from pydantic.functional_validators import AfterValidator -from typing import Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class PredictionTypedDict(TypedDict): - type: Literal["content"] - content: NotRequired[str] - - -class Prediction(BaseModel): - TYPE: Annotated[ - Annotated[ - Optional[Literal["content"]], AfterValidator(validate_const("content")) - ], - pydantic.Field(alias="type"), - ] = "content" - - content: Optional[str] = "" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/referencechunk.py b/packages/mistralai_azure/src/mistralai_azure/models/referencechunk.py deleted file mode 100644 index 4df3bfbc..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/referencechunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ReferenceChunkType = Literal["reference"] - - -class ReferenceChunkTypedDict(TypedDict): - reference_ids: List[int] - type: NotRequired[ReferenceChunkType] - - -class ReferenceChunk(BaseModel): - reference_ids: List[int] - - type: Optional[ReferenceChunkType] = "reference" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py b/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py deleted file mode 100644 index 6d09de5b..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .jsonschema import JSONSchema, JSONSchemaTypedDict -from .responseformats import ResponseFormats -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class ResponseFormatTypedDict(TypedDict): - type: NotRequired[ResponseFormats] - r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" - json_schema: NotRequired[Nullable[JSONSchemaTypedDict]] - - -class ResponseFormat(BaseModel): - type: Optional[ResponseFormats] = None - r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" - - json_schema: OptionalNullable[JSONSchema] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "json_schema"] - nullable_fields = ["json_schema"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/responseformats.py b/packages/mistralai_azure/src/mistralai_azure/models/responseformats.py deleted file mode 100644 index 08c39951..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/responseformats.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -ResponseFormats = Literal["text", "json_object", "json_schema"] -r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py b/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py deleted file mode 100644 index 03216cbf..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from dataclasses import dataclass -from typing import Optional -import httpx - - -@dataclass -class SDKError(Exception): - """Represents an error returned by the API.""" - - message: str - status_code: int = -1 - body: str = "" - raw_response: Optional[httpx.Response] = None - - def __str__(self): - body = "" - if len(self.body) > 0: - body = f"\n{self.body}" - - return f"{self.message}: Status {self.status_code}{body}" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/security.py b/packages/mistralai_azure/src/mistralai_azure/models/security.py deleted file mode 100644 index c1ae8313..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/security.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import FieldMetadata, SecurityMetadata -from typing_extensions import Annotated, TypedDict - - -class SecurityTypedDict(TypedDict): - api_key: str - - -class Security(BaseModel): - api_key: Annotated[ - str, - FieldMetadata( - security=SecurityMetadata( - scheme=True, - scheme_type="http", - sub_type="bearer", - field_name="Authorization", - ) - ), - ] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py b/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py deleted file mode 100644 index b7d975b6..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .textchunk import TextChunk, TextChunkTypedDict -from mistralai_azure.types import BaseModel -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -SystemMessageContentTypedDict = TypeAliasType( - "SystemMessageContentTypedDict", Union[str, List[TextChunkTypedDict]] -) - - -SystemMessageContent = TypeAliasType( - "SystemMessageContent", Union[str, List[TextChunk]] -) - - -Role = Literal["system"] - - -class SystemMessageTypedDict(TypedDict): - content: SystemMessageContentTypedDict - role: NotRequired[Role] - - -class SystemMessage(BaseModel): - content: SystemMessageContent - - role: Optional[Role] = "system" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py b/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py deleted file mode 100644 index be60c8f9..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -Type = Literal["text"] - - -class TextChunkTypedDict(TypedDict): - text: str - type: NotRequired[Type] - - -class TextChunk(BaseModel): - text: str - - type: Optional[Type] = "text" diff --git a/packages/mistralai_azure/src/mistralai_azure/models/tool.py b/packages/mistralai_azure/src/mistralai_azure/models/tool.py deleted file mode 100644 index ffd9b062..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/tool.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .function import Function, FunctionTypedDict -from .tooltypes import ToolTypes -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolTypedDict(TypedDict): - function: FunctionTypedDict - type: NotRequired[ToolTypes] - - -class Tool(BaseModel): - function: Function - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) diff --git a/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py b/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py deleted file mode 100644 index 6ccdcaa2..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .functioncall import FunctionCall, FunctionCallTypedDict -from .tooltypes import ToolTypes -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolCallTypedDict(TypedDict): - function: FunctionCallTypedDict - id: NotRequired[str] - type: NotRequired[ToolTypes] - index: NotRequired[int] - - -class ToolCall(BaseModel): - function: FunctionCall - - id: Optional[str] = "null" - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) - - index: Optional[int] = 0 diff --git a/packages/mistralai_azure/src/mistralai_azure/models/toolchoice.py b/packages/mistralai_azure/src/mistralai_azure/models/toolchoice.py deleted file mode 100644 index cc3c2c1f..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/toolchoice.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .functionname import FunctionName, FunctionNameTypedDict -from .tooltypes import ToolTypes -from mistralai_azure.types import BaseModel -from mistralai_azure.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolChoiceTypedDict(TypedDict): - r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" - - function: FunctionNameTypedDict - r"""this restriction of `Function` is used to select a specific function to call""" - type: NotRequired[ToolTypes] - - -class ToolChoice(BaseModel): - r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" - - function: FunctionName - r"""this restriction of `Function` is used to select a specific function to call""" - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) diff --git a/packages/mistralai_azure/src/mistralai_azure/models/toolchoiceenum.py b/packages/mistralai_azure/src/mistralai_azure/models/toolchoiceenum.py deleted file mode 100644 index 8e6a6ad8..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/toolchoiceenum.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -ToolChoiceEnum = Literal["auto", "none", "any", "required"] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py b/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py deleted file mode 100644 index abca8abe..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py +++ /dev/null @@ -1,72 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ToolMessageContentTypedDict = TypeAliasType( - "ToolMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]]) - - -ToolMessageRole = Literal["tool"] - - -class ToolMessageTypedDict(TypedDict): - content: Nullable[ToolMessageContentTypedDict] - tool_call_id: NotRequired[Nullable[str]] - name: NotRequired[Nullable[str]] - role: NotRequired[ToolMessageRole] - - -class ToolMessage(BaseModel): - content: Nullable[ToolMessageContent] - - tool_call_id: OptionalNullable[str] = UNSET - - name: OptionalNullable[str] = UNSET - - role: Optional[ToolMessageRole] = "tool" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["tool_call_id", "name", "role"] - nullable_fields = ["content", "tool_call_id", "name"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/tooltypes.py b/packages/mistralai_azure/src/mistralai_azure/models/tooltypes.py deleted file mode 100644 index dfcd31f0..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/tooltypes.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import UnrecognizedStr -from typing import Literal, Union - - -ToolTypes = Union[Literal["function"], UnrecognizedStr] diff --git a/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py b/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py deleted file mode 100644 index bbe5cdfa..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py +++ /dev/null @@ -1,82 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -import pydantic -from pydantic import ConfigDict, model_serializer -from typing import Any, Dict, Optional -from typing_extensions import NotRequired, TypedDict - - -class UsageInfoTypedDict(TypedDict): - prompt_tokens: NotRequired[int] - completion_tokens: NotRequired[int] - total_tokens: NotRequired[int] - prompt_audio_seconds: NotRequired[Nullable[int]] - - -class UsageInfo(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - - prompt_tokens: Optional[int] = 0 - - completion_tokens: Optional[int] = 0 - - total_tokens: Optional[int] = 0 - - prompt_audio_seconds: OptionalNullable[int] = UNSET - - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "prompt_tokens", - "completion_tokens", - "total_tokens", - "prompt_audio_seconds", - ] - nullable_fields = ["prompt_audio_seconds"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - for k, v in serialized.items(): - m[k] = v - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py b/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py deleted file mode 100644 index 05976fc0..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py +++ /dev/null @@ -1,60 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai_azure.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -UserMessageContentTypedDict = TypeAliasType( - "UserMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]]) - - -UserMessageRole = Literal["user"] - - -class UserMessageTypedDict(TypedDict): - content: Nullable[UserMessageContentTypedDict] - role: NotRequired[UserMessageRole] - - -class UserMessage(BaseModel): - content: Nullable[UserMessageContent] - - role: Optional[UserMessageRole] = "user" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["role"] - nullable_fields = ["content"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py b/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py deleted file mode 100644 index 4caff4a6..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_azure.types import BaseModel -from typing import List, Union -from typing_extensions import TypeAliasType, TypedDict - - -LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int]) - - -Loc = TypeAliasType("Loc", Union[str, int]) - - -class ValidationErrorTypedDict(TypedDict): - loc: List[LocTypedDict] - msg: str - type: str - - -class ValidationError(BaseModel): - loc: List[Loc] - - msg: str - - type: str diff --git a/packages/mistralai_azure/src/mistralai_azure/ocr.py b/packages/mistralai_azure/src/mistralai_azure/ocr.py deleted file mode 100644 index 71fe0337..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/ocr.py +++ /dev/null @@ -1,271 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai_azure import models, utils -from mistralai_azure._hooks import HookContext -from mistralai_azure.types import Nullable, OptionalNullable, UNSET -from typing import Any, List, Mapping, Optional, Union - - -class Ocr(BaseSDK): - def process( - self, - *, - model: Nullable[str], - document: Union[models.Document, models.DocumentTypedDict], - id: Optional[str] = None, - pages: OptionalNullable[List[int]] = UNSET, - include_image_base64: OptionalNullable[bool] = UNSET, - image_limit: OptionalNullable[int] = UNSET, - image_min_size: OptionalNullable[int] = UNSET, - bbox_annotation_format: OptionalNullable[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = UNSET, - document_annotation_format: OptionalNullable[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.OCRResponse]: - r"""OCR - - :param model: - :param document: Document to run OCR on - :param id: - :param pages: Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 - :param include_image_base64: Include image URLs in response - :param image_limit: Max images to extract - :param image_min_size: Minimum height and width of image to extract - :param bbox_annotation_format: Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field - :param document_annotation_format: Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.OCRRequest( - model=model, - id=id, - document=utils.get_pydantic_model(document, models.Document), - pages=pages, - include_image_base64=include_image_base64, - image_limit=image_limit, - image_min_size=image_min_size, - bbox_annotation_format=utils.get_pydantic_model( - bbox_annotation_format, OptionalNullable[models.ResponseFormat] - ), - document_annotation_format=utils.get_pydantic_model( - document_annotation_format, OptionalNullable[models.ResponseFormat] - ), - ) - - req = self._build_request( - method="POST", - path="/ocr", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.OCRRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="ocr_v1_ocr_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.OCRResponse]) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def process_async( - self, - *, - model: Nullable[str], - document: Union[models.Document, models.DocumentTypedDict], - id: Optional[str] = None, - pages: OptionalNullable[List[int]] = UNSET, - include_image_base64: OptionalNullable[bool] = UNSET, - image_limit: OptionalNullable[int] = UNSET, - image_min_size: OptionalNullable[int] = UNSET, - bbox_annotation_format: OptionalNullable[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = UNSET, - document_annotation_format: OptionalNullable[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.OCRResponse]: - r"""OCR - - :param model: - :param document: Document to run OCR on - :param id: - :param pages: Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 - :param include_image_base64: Include image URLs in response - :param image_limit: Max images to extract - :param image_min_size: Minimum height and width of image to extract - :param bbox_annotation_format: Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field - :param document_annotation_format: Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.OCRRequest( - model=model, - id=id, - document=utils.get_pydantic_model(document, models.Document), - pages=pages, - include_image_base64=include_image_base64, - image_limit=image_limit, - image_min_size=image_min_size, - bbox_annotation_format=utils.get_pydantic_model( - bbox_annotation_format, OptionalNullable[models.ResponseFormat] - ), - document_annotation_format=utils.get_pydantic_model( - document_annotation_format, OptionalNullable[models.ResponseFormat] - ), - ) - - req = self._build_request_async( - method="POST", - path="/ocr", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.OCRRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="ocr_v1_ocr_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, Optional[models.OCRResponse]) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) diff --git a/packages/mistralai_azure/src/mistralai_azure/sdk.py b/packages/mistralai_azure/src/mistralai_azure/sdk.py deleted file mode 100644 index 04bc7743..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/sdk.py +++ /dev/null @@ -1,177 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients -from .sdkconfiguration import SDKConfiguration -from .utils.logger import Logger, get_default_logger -from .utils.retries import RetryConfig -import httpx -import importlib -from mistralai_azure import models, utils -from mistralai_azure._hooks import SDKHooks -from mistralai_azure.types import OptionalNullable, UNSET -from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast -import weakref - -if TYPE_CHECKING: - from mistralai_azure.chat import Chat - from mistralai_azure.ocr import Ocr - - -class MistralAzure(BaseSDK): - r"""Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.""" - - chat: "Chat" - r"""Chat Completion API.""" - ocr: "Ocr" - _sub_sdk_map = { - "chat": ("mistralai_azure.chat", "Chat"), - "ocr": ("mistralai_azure.ocr", "Ocr"), - } - - def __init__( - self, - azure_api_key: Union[str, Callable[[], str]], - azure_endpoint: str, - url_params: Optional[Dict[str, str]] = None, - client: Optional[HttpClient] = None, - async_client: Optional[AsyncHttpClient] = None, - retry_config: OptionalNullable[RetryConfig] = UNSET, - timeout_ms: Optional[int] = None, - debug_logger: Optional[Logger] = None, - ) -> None: - r"""Instantiates the SDK configuring it with the provided parameters. - - :param azure_api_key: The azure_api_key required for authentication - :param azure_endpoint: The Azure AI endpoint URL to use for all methods - :param url_params: Parameters to optionally template the server URL with - :param client: The HTTP client to use for all synchronous methods - :param async_client: The Async HTTP client to use for all asynchronous methods - :param retry_config: The retry configuration to use for all supported methods - :param timeout_ms: Optional request timeout applied to each operation in milliseconds - """ - - # if azure_endpoint doesn't end with `/v1` add it - if not azure_endpoint.endswith("/"): - azure_endpoint += "/" - if not azure_endpoint.endswith("v1/"): - azure_endpoint += "v1/" - server_url = azure_endpoint - - client_supplied = True - if client is None: - client = httpx.Client() - client_supplied = False - - assert issubclass( - type(client), HttpClient - ), "The provided client must implement the HttpClient protocol." - - async_client_supplied = True - if async_client is None: - async_client = httpx.AsyncClient() - async_client_supplied = False - - if debug_logger is None: - debug_logger = get_default_logger() - - assert issubclass( - type(async_client), AsyncHttpClient - ), "The provided async_client must implement the AsyncHttpClient protocol." - - security: Any = None - if callable(azure_api_key): - security = lambda: models.Security(api_key=azure_api_key()) # pylint: disable=unnecessary-lambda-assignment - else: - security = models.Security(api_key=azure_api_key) - - if server_url is not None: - if url_params is not None: - server_url = utils.template_url(server_url, url_params) - - BaseSDK.__init__( - self, - SDKConfiguration( - client=client, - client_supplied=client_supplied, - async_client=async_client, - async_client_supplied=async_client_supplied, - security=security, - server_url=server_url, - server=None, - retry_config=retry_config, - timeout_ms=timeout_ms, - debug_logger=debug_logger, - ), - ) - - hooks = SDKHooks() - - # pylint: disable=protected-access - self.sdk_configuration.__dict__["_hooks"] = hooks - - current_server_url, *_ = self.sdk_configuration.get_server_details() - server_url, self.sdk_configuration.client = hooks.sdk_init( - current_server_url, client - ) - if current_server_url != server_url: - self.sdk_configuration.server_url = server_url - - weakref.finalize( - self, - close_clients, - cast(ClientOwner, self.sdk_configuration), - self.sdk_configuration.client, - self.sdk_configuration.client_supplied, - self.sdk_configuration.async_client, - self.sdk_configuration.async_client_supplied, - ) - - def __getattr__(self, name: str): - if name in self._sub_sdk_map: - module_path, class_name = self._sub_sdk_map[name] - try: - module = importlib.import_module(module_path) - klass = getattr(module, class_name) - instance = klass(self.sdk_configuration) - setattr(self, name, instance) - return instance - except ImportError as e: - raise AttributeError( - f"Failed to import module {module_path} for attribute {name}: {e}" - ) from e - except AttributeError as e: - raise AttributeError( - f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}" - ) from e - - raise AttributeError( - f"'{type(self).__name__}' object has no attribute '{name}'" - ) - - def __dir__(self): - default_attrs = list(super().__dir__()) - lazy_attrs = list(self._sub_sdk_map.keys()) - return sorted(list(set(default_attrs + lazy_attrs))) - - def __enter__(self): - return self - - async def __aenter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - if ( - self.sdk_configuration.client is not None - and not self.sdk_configuration.client_supplied - ): - self.sdk_configuration.client.close() - self.sdk_configuration.client = None - - async def __aexit__(self, exc_type, exc_val, exc_tb): - if ( - self.sdk_configuration.async_client is not None - and not self.sdk_configuration.async_client_supplied - ): - await self.sdk_configuration.async_client.aclose() - self.sdk_configuration.async_client = None diff --git a/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py b/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py deleted file mode 100644 index 51289cf0..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from ._version import ( - __gen_version__, - __openapi_doc_version__, - __user_agent__, - __version__, -) -from .httpclient import AsyncHttpClient, HttpClient -from .utils import Logger, RetryConfig, remove_suffix -from dataclasses import dataclass -from mistralai_azure import models -from mistralai_azure.types import OptionalNullable, UNSET -from pydantic import Field -from typing import Callable, Dict, Optional, Tuple, Union - - -SERVER_EU = "eu" -r"""EU Production server""" -SERVERS = { - SERVER_EU: "https://api.mistral.ai", -} -"""Contains the list of servers available to the SDK""" - - -@dataclass -class SDKConfiguration: - client: Union[HttpClient, None] - client_supplied: bool - async_client: Union[AsyncHttpClient, None] - async_client_supplied: bool - debug_logger: Logger - security: Optional[Union[models.Security, Callable[[], models.Security]]] = None - server_url: Optional[str] = "" - server: Optional[str] = "" - language: str = "python" - openapi_doc_version: str = __openapi_doc_version__ - sdk_version: str = __version__ - gen_version: str = __gen_version__ - user_agent: str = __user_agent__ - retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) - timeout_ms: Optional[int] = None - - def get_server_details(self) -> Tuple[str, Dict[str, str]]: - if self.server_url is not None and self.server_url: - return remove_suffix(self.server_url, "/"), {} - if not self.server: - self.server = SERVER_EU - - if self.server not in SERVERS: - raise ValueError(f'Invalid server "{self.server}"') - - return SERVERS[self.server], {} diff --git a/packages/mistralai_azure/src/mistralai_azure/types/basemodel.py b/packages/mistralai_azure/src/mistralai_azure/types/basemodel.py deleted file mode 100644 index 231c2e37..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/types/basemodel.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from pydantic import ConfigDict, model_serializer -from pydantic import BaseModel as PydanticBaseModel -from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union -from typing_extensions import TypeAliasType, TypeAlias - - -class BaseModel(PydanticBaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() - ) - - -class Unset(BaseModel): - @model_serializer(mode="plain") - def serialize_model(self): - return UNSET_SENTINEL - - def __bool__(self) -> Literal[False]: - return False - - -UNSET = Unset() -UNSET_SENTINEL = "~?~unset~?~sentinel~?~" - - -T = TypeVar("T") -if TYPE_CHECKING: - Nullable: TypeAlias = Union[T, None] - OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] -else: - Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) - OptionalNullable = TypeAliasType( - "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) - ) - -UnrecognizedInt: TypeAlias = int -UnrecognizedStr: TypeAlias = str diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/__init__.py b/packages/mistralai_azure/src/mistralai_azure/utils/__init__.py deleted file mode 100644 index dd4aa4b3..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/__init__.py +++ /dev/null @@ -1,184 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import TYPE_CHECKING -from importlib import import_module - -if TYPE_CHECKING: - from .annotations import get_discriminator - from .datetimes import parse_datetime - from .enums import OpenEnumMeta - from .headers import get_headers, get_response_headers - from .metadata import ( - FieldMetadata, - find_metadata, - FormMetadata, - HeaderMetadata, - MultipartFormMetadata, - PathParamMetadata, - QueryParamMetadata, - RequestMetadata, - SecurityMetadata, - ) - from .queryparams import get_query_params - from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig - from .requestbodies import serialize_request_body, SerializedRequestBody - from .security import get_security - from .serializers import ( - get_pydantic_model, - marshal_json, - unmarshal, - unmarshal_json, - serialize_decimal, - serialize_float, - serialize_int, - stream_to_text, - stream_to_text_async, - stream_to_bytes, - stream_to_bytes_async, - validate_const, - validate_decimal, - validate_float, - validate_int, - validate_open_enum, - ) - from .url import generate_url, template_url, remove_suffix - from .values import ( - get_global_from_env, - match_content_type, - match_status_codes, - match_response, - cast_partial, - ) - from .logger import Logger, get_body_content, get_default_logger - -__all__ = [ - "BackoffStrategy", - "FieldMetadata", - "find_metadata", - "FormMetadata", - "generate_url", - "get_body_content", - "get_default_logger", - "get_discriminator", - "parse_datetime", - "get_global_from_env", - "get_headers", - "get_pydantic_model", - "get_query_params", - "get_response_headers", - "get_security", - "HeaderMetadata", - "Logger", - "marshal_json", - "match_content_type", - "match_status_codes", - "match_response", - "MultipartFormMetadata", - "OpenEnumMeta", - "PathParamMetadata", - "QueryParamMetadata", - "remove_suffix", - "Retries", - "retry", - "retry_async", - "RetryConfig", - "RequestMetadata", - "SecurityMetadata", - "serialize_decimal", - "serialize_float", - "serialize_int", - "serialize_request_body", - "SerializedRequestBody", - "stream_to_text", - "stream_to_text_async", - "stream_to_bytes", - "stream_to_bytes_async", - "template_url", - "unmarshal", - "unmarshal_json", - "validate_decimal", - "validate_const", - "validate_float", - "validate_int", - "validate_open_enum", - "cast_partial", -] - -_dynamic_imports: dict[str, str] = { - "BackoffStrategy": ".retries", - "FieldMetadata": ".metadata", - "find_metadata": ".metadata", - "FormMetadata": ".metadata", - "generate_url": ".url", - "get_body_content": ".logger", - "get_default_logger": ".logger", - "get_discriminator": ".annotations", - "parse_datetime": ".datetimes", - "get_global_from_env": ".values", - "get_headers": ".headers", - "get_pydantic_model": ".serializers", - "get_query_params": ".queryparams", - "get_response_headers": ".headers", - "get_security": ".security", - "HeaderMetadata": ".metadata", - "Logger": ".logger", - "marshal_json": ".serializers", - "match_content_type": ".values", - "match_status_codes": ".values", - "match_response": ".values", - "MultipartFormMetadata": ".metadata", - "OpenEnumMeta": ".enums", - "PathParamMetadata": ".metadata", - "QueryParamMetadata": ".metadata", - "remove_suffix": ".url", - "Retries": ".retries", - "retry": ".retries", - "retry_async": ".retries", - "RetryConfig": ".retries", - "RequestMetadata": ".metadata", - "SecurityMetadata": ".metadata", - "serialize_decimal": ".serializers", - "serialize_float": ".serializers", - "serialize_int": ".serializers", - "serialize_request_body": ".requestbodies", - "SerializedRequestBody": ".requestbodies", - "stream_to_text": ".serializers", - "stream_to_text_async": ".serializers", - "stream_to_bytes": ".serializers", - "stream_to_bytes_async": ".serializers", - "template_url": ".url", - "unmarshal": ".serializers", - "unmarshal_json": ".serializers", - "validate_decimal": ".serializers", - "validate_const": ".serializers", - "validate_float": ".serializers", - "validate_int": ".serializers", - "validate_open_enum": ".serializers", - "cast_partial": ".values", -} - - -def __getattr__(attr_name: str) -> object: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError( - f"no {attr_name} found in _dynamic_imports, module name -> {__name__} " - ) - - try: - module = import_module(module_name, __package__) - result = getattr(module, attr_name) - return result - except ImportError as e: - raise ImportError( - f"Failed to import {attr_name} from {module_name}: {e}" - ) from e - except AttributeError as e: - raise AttributeError( - f"Failed to get {attr_name} from {module_name}: {e}" - ) from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py b/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py deleted file mode 100644 index 387874ed..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from enum import Enum -from typing import Any, Optional - -def get_discriminator(model: Any, fieldname: str, key: str) -> str: - """ - Recursively search for the discriminator attribute in a model. - - Args: - model (Any): The model to search within. - fieldname (str): The name of the field to search for. - key (str): The key to search for in dictionaries. - - Returns: - str: The name of the discriminator attribute. - - Raises: - ValueError: If the discriminator attribute is not found. - """ - upper_fieldname = fieldname.upper() - - def get_field_discriminator(field: Any) -> Optional[str]: - """Search for the discriminator attribute in a given field.""" - - if isinstance(field, dict): - if key in field: - return f'{field[key]}' - - if hasattr(field, fieldname): - attr = getattr(field, fieldname) - if isinstance(attr, Enum): - return f'{attr.value}' - return f'{attr}' - - if hasattr(field, upper_fieldname): - attr = getattr(field, upper_fieldname) - if isinstance(attr, Enum): - return f'{attr.value}' - return f'{attr}' - - return None - - - if isinstance(model, list): - for field in model: - discriminator = get_field_discriminator(field) - if discriminator is not None: - return discriminator - - discriminator = get_field_discriminator(model) - if discriminator is not None: - return discriminator - - raise ValueError(f'Could not find discriminator field {fieldname} in {model}') diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/enums.py b/packages/mistralai_azure/src/mistralai_azure/utils/enums.py deleted file mode 100644 index c3bc13cf..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/enums.py +++ /dev/null @@ -1,74 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import enum -import sys - -class OpenEnumMeta(enum.EnumMeta): - # The __call__ method `boundary` kwarg was added in 3.11 and must be present - # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 - # pylint: disable=unexpected-keyword-arg - # The __call__ method `values` varg must be named for pyright. - # pylint: disable=keyword-arg-before-vararg - - if sys.version_info >= (3, 11): - def __call__( - cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin - - if names is not None: - return super().__call__( - value, - names=names, - *values, - module=module, - qualname=qualname, - type=type, - start=start, - boundary=boundary, - ) - - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - *values, - module=module, - qualname=qualname, - type=type, - start=start, - boundary=boundary, - ) - except ValueError: - return value - else: - def __call__( - cls, value, names=None, *, module=None, qualname=None, type=None, start=1 - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin - - if names is not None: - return super().__call__( - value, - names=names, - module=module, - qualname=qualname, - type=type, - start=start, - ) - - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - module=module, - qualname=qualname, - type=type, - start=start, - ) - except ValueError: - return value diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/eventstreaming.py b/packages/mistralai_azure/src/mistralai_azure/utils/eventstreaming.py deleted file mode 100644 index 74a63f75..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/eventstreaming.py +++ /dev/null @@ -1,238 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import re -import json -from typing import ( - Callable, - Generic, - TypeVar, - Optional, - Generator, - AsyncGenerator, - Tuple, -) -import httpx - -T = TypeVar("T") - - -class EventStream(Generic[T]): - response: httpx.Response - generator: Generator[T, None, None] - - def __init__( - self, - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, - ): - self.response = response - self.generator = stream_events(response, decoder, sentinel) - - def __iter__(self): - return self - - def __next__(self): - return next(self.generator) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - self.response.close() - - -class EventStreamAsync(Generic[T]): - response: httpx.Response - generator: AsyncGenerator[T, None] - - def __init__( - self, - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, - ): - self.response = response - self.generator = stream_events_async(response, decoder, sentinel) - - def __aiter__(self): - return self - - async def __anext__(self): - return await self.generator.__anext__() - - async def __aenter__(self): - return self - - async def __aexit__(self, exc_type, exc_val, exc_tb): - await self.response.aclose() - - -class ServerEvent: - id: Optional[str] = None - event: Optional[str] = None - data: Optional[str] = None - retry: Optional[int] = None - - -MESSAGE_BOUNDARIES = [ - b"\r\n\r\n", - b"\n\n", - b"\r\r", -] - - -async def stream_events_async( - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, -) -> AsyncGenerator[T, None]: - buffer = bytearray() - position = 0 - discard = False - async for chunk in response.aiter_bytes(): - # We've encountered the sentinel value and should no longer process - # incoming data. Instead we throw new data away until the server closes - # the connection. - if discard: - continue - - buffer += chunk - for i in range(position, len(buffer)): - char = buffer[i : i + 1] - seq: Optional[bytes] = None - if char in [b"\r", b"\n"]: - for boundary in MESSAGE_BOUNDARIES: - seq = _peek_sequence(i, buffer, boundary) - if seq is not None: - break - if seq is None: - continue - - block = buffer[position:i] - position = i + len(seq) - event, discard = _parse_event(block, decoder, sentinel) - if event is not None: - yield event - - if position > 0: - buffer = buffer[position:] - position = 0 - - event, discard = _parse_event(buffer, decoder, sentinel) - if event is not None: - yield event - - -def stream_events( - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, -) -> Generator[T, None, None]: - buffer = bytearray() - position = 0 - discard = False - for chunk in response.iter_bytes(): - # We've encountered the sentinel value and should no longer process - # incoming data. Instead we throw new data away until the server closes - # the connection. - if discard: - continue - - buffer += chunk - for i in range(position, len(buffer)): - char = buffer[i : i + 1] - seq: Optional[bytes] = None - if char in [b"\r", b"\n"]: - for boundary in MESSAGE_BOUNDARIES: - seq = _peek_sequence(i, buffer, boundary) - if seq is not None: - break - if seq is None: - continue - - block = buffer[position:i] - position = i + len(seq) - event, discard = _parse_event(block, decoder, sentinel) - if event is not None: - yield event - - if position > 0: - buffer = buffer[position:] - position = 0 - - event, discard = _parse_event(buffer, decoder, sentinel) - if event is not None: - yield event - - -def _parse_event( - raw: bytearray, decoder: Callable[[str], T], sentinel: Optional[str] = None -) -> Tuple[Optional[T], bool]: - block = raw.decode() - lines = re.split(r"\r?\n|\r", block) - publish = False - event = ServerEvent() - data = "" - for line in lines: - if not line: - continue - - delim = line.find(":") - if delim <= 0: - continue - - field = line[0:delim] - value = line[delim + 1 :] if delim < len(line) - 1 else "" - if len(value) and value[0] == " ": - value = value[1:] - - if field == "event": - event.event = value - publish = True - elif field == "data": - data += value + "\n" - publish = True - elif field == "id": - event.id = value - publish = True - elif field == "retry": - event.retry = int(value) if value.isdigit() else None - publish = True - - if sentinel and data == f"{sentinel}\n": - return None, True - - if data: - data = data[:-1] - event.data = data - - data_is_primitive = ( - data.isnumeric() or data == "true" or data == "false" or data == "null" - ) - data_is_json = ( - data.startswith("{") or data.startswith("[") or data.startswith('"') - ) - - if data_is_primitive or data_is_json: - try: - event.data = json.loads(data) - except Exception: - pass - - out = None - if publish: - out = decoder(json.dumps(event.__dict__)) - - return out, False - - -def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): - if len(sequence) > (len(buffer) - position): - return None - - for i, seq in enumerate(sequence): - if buffer[position + i] != seq: - return None - - return sequence diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/forms.py b/packages/mistralai_azure/src/mistralai_azure/utils/forms.py deleted file mode 100644 index e873495f..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/forms.py +++ /dev/null @@ -1,223 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import ( - Any, - Dict, - get_type_hints, - List, - Tuple, -) -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .serializers import marshal_json - -from .metadata import ( - FormMetadata, - MultipartFormMetadata, - find_field_metadata, -) -from .values import _is_set, _val_to_string - - -def _populate_form( - field_name: str, - explode: bool, - obj: Any, - delimiter: str, - form: Dict[str, List[str]], -): - if not _is_set(obj): - return form - - if isinstance(obj, BaseModel): - items = [] - - obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields - for name in obj_fields: - obj_field = obj_fields[name] - obj_field_name = obj_field.alias if obj_field.alias is not None else name - if obj_field_name == "": - continue - - val = getattr(obj, name) - if not _is_set(val): - continue - - if explode: - form[obj_field_name] = [_val_to_string(val)] - else: - items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, Dict): - items = [] - for key, value in obj.items(): - if not _is_set(value): - continue - - if explode: - form[key] = [_val_to_string(value)] - else: - items.append(f"{key}{delimiter}{_val_to_string(value)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, List): - items = [] - - for value in obj: - if not _is_set(value): - continue - - if explode: - if not field_name in form: - form[field_name] = [] - form[field_name].append(_val_to_string(value)) - else: - items.append(_val_to_string(value)) - - if len(items) > 0: - form[field_name] = [delimiter.join([str(item) for item in items])] - else: - form[field_name] = [_val_to_string(obj)] - - return form - - -def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: - """Extract file name, content, and content type from a file object.""" - file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields - - file_name = "" - content = None - content_type = None - - for file_field_name in file_fields: - file_field = file_fields[file_field_name] - - file_metadata = find_field_metadata(file_field, MultipartFormMetadata) - if file_metadata is None: - continue - - if file_metadata.content: - content = getattr(file_obj, file_field_name, None) - elif file_field_name == "content_type": - content_type = getattr(file_obj, file_field_name, None) - else: - file_name = getattr(file_obj, file_field_name) - - if file_name == "" or content is None: - raise ValueError("invalid multipart/form-data file") - - return file_name, content, content_type - - -def serialize_multipart_form( - media_type: str, request: Any -) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: - form: Dict[str, Any] = {} - files: List[Tuple[str, Any]] = [] - - if not isinstance(request, BaseModel): - raise TypeError("invalid request body type") - - request_fields: Dict[str, FieldInfo] = request.__class__.model_fields - request_field_types = get_type_hints(request.__class__) - - for name in request_fields: - field = request_fields[name] - - val = getattr(request, name) - if not _is_set(val): - continue - - field_metadata = find_field_metadata(field, MultipartFormMetadata) - if not field_metadata: - continue - - f_name = field.alias if field.alias else name - - if field_metadata.file: - if isinstance(val, List): - # Handle array of files - for file_obj in val: - if not _is_set(file_obj): - continue - - file_name, content, content_type = _extract_file_properties(file_obj) - - if content_type is not None: - files.append((f_name + "[]", (file_name, content, content_type))) - else: - files.append((f_name + "[]", (file_name, content))) - else: - # Handle single file - file_name, content, content_type = _extract_file_properties(val) - - if content_type is not None: - files.append((f_name, (file_name, content, content_type))) - else: - files.append((f_name, (file_name, content))) - elif field_metadata.json: - files.append((f_name, ( - None, - marshal_json(val, request_field_types[name]), - "application/json", - ))) - else: - if isinstance(val, List): - values = [] - - for value in val: - if not _is_set(value): - continue - values.append(_val_to_string(value)) - - form[f_name + "[]"] = values - else: - form[f_name] = _val_to_string(val) - return media_type, form, files - - -def serialize_form_data(data: Any) -> Dict[str, Any]: - form: Dict[str, List[str]] = {} - - if isinstance(data, BaseModel): - data_fields: Dict[str, FieldInfo] = data.__class__.model_fields - data_field_types = get_type_hints(data.__class__) - for name in data_fields: - field = data_fields[name] - - val = getattr(data, name) - if not _is_set(val): - continue - - metadata = find_field_metadata(field, FormMetadata) - if metadata is None: - continue - - f_name = field.alias if field.alias is not None else name - - if metadata.json: - form[f_name] = [marshal_json(val, data_field_types[name])] - else: - if metadata.style == "form": - _populate_form( - f_name, - metadata.explode, - val, - ",", - form, - ) - else: - raise ValueError(f"Invalid form style for field {name}") - elif isinstance(data, Dict): - for key, value in data.items(): - if _is_set(value): - form[key] = [_val_to_string(value)] - else: - raise TypeError(f"Invalid request body type {type(data)} for form data") - - return form diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py b/packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py deleted file mode 100644 index 37a6e7f9..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py +++ /dev/null @@ -1,205 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import ( - Any, - Dict, - get_type_hints, - List, - Optional, -) - -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .metadata import ( - QueryParamMetadata, - find_field_metadata, -) -from .values import ( - _get_serialized_params, - _is_set, - _populate_from_globals, - _val_to_string, -) -from .forms import _populate_form - - -def get_query_params( - query_params: Any, - gbls: Optional[Any] = None, -) -> Dict[str, List[str]]: - params: Dict[str, List[str]] = {} - - globals_already_populated = _populate_query_params(query_params, gbls, params, []) - if _is_set(gbls): - _populate_query_params(gbls, None, params, globals_already_populated) - - return params - - -def _populate_query_params( - query_params: Any, - gbls: Any, - query_param_values: Dict[str, List[str]], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - if not isinstance(query_params, BaseModel): - return globals_already_populated - - param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields - param_field_types = get_type_hints(query_params.__class__) - for name in param_fields: - if name in skip_fields: - continue - - field = param_fields[name] - - metadata = find_field_metadata(field, QueryParamMetadata) - if not metadata: - continue - - value = getattr(query_params, name) if _is_set(query_params) else None - - value, global_found = _populate_from_globals( - name, value, QueryParamMetadata, gbls - ) - if global_found: - globals_already_populated.append(name) - - f_name = field.alias if field.alias is not None else name - serialization = metadata.serialization - if serialization is not None: - serialized_parms = _get_serialized_params( - metadata, f_name, value, param_field_types[name] - ) - for key, value in serialized_parms.items(): - if key in query_param_values: - query_param_values[key].extend(value) - else: - query_param_values[key] = [value] - else: - style = metadata.style - if style == "deepObject": - _populate_deep_object_query_params(f_name, value, query_param_values) - elif style == "form": - _populate_delimited_query_params( - metadata, f_name, value, ",", query_param_values - ) - elif style == "pipeDelimited": - _populate_delimited_query_params( - metadata, f_name, value, "|", query_param_values - ) - else: - raise NotImplementedError( - f"query param style {style} not yet supported" - ) - - return globals_already_populated - - -def _populate_deep_object_query_params( - field_name: str, - obj: Any, - params: Dict[str, List[str]], -): - if not _is_set(obj): - return - - if isinstance(obj, BaseModel): - _populate_deep_object_query_params_basemodel(field_name, obj, params) - elif isinstance(obj, Dict): - _populate_deep_object_query_params_dict(field_name, obj, params) - - -def _populate_deep_object_query_params_basemodel( - prior_params_key: str, - obj: Any, - params: Dict[str, List[str]], -): - if not _is_set(obj) or not isinstance(obj, BaseModel): - return - - obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields - for name in obj_fields: - obj_field = obj_fields[name] - - f_name = obj_field.alias if obj_field.alias is not None else name - - params_key = f"{prior_params_key}[{f_name}]" - - obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) - if not _is_set(obj_param_metadata): - continue - - obj_val = getattr(obj, name) - if not _is_set(obj_val): - continue - - if isinstance(obj_val, BaseModel): - _populate_deep_object_query_params_basemodel(params_key, obj_val, params) - elif isinstance(obj_val, Dict): - _populate_deep_object_query_params_dict(params_key, obj_val, params) - elif isinstance(obj_val, List): - _populate_deep_object_query_params_list(params_key, obj_val, params) - else: - params[params_key] = [_val_to_string(obj_val)] - - -def _populate_deep_object_query_params_dict( - prior_params_key: str, - value: Dict, - params: Dict[str, List[str]], -): - if not _is_set(value): - return - - for key, val in value.items(): - if not _is_set(val): - continue - - params_key = f"{prior_params_key}[{key}]" - - if isinstance(val, BaseModel): - _populate_deep_object_query_params_basemodel(params_key, val, params) - elif isinstance(val, Dict): - _populate_deep_object_query_params_dict(params_key, val, params) - elif isinstance(val, List): - _populate_deep_object_query_params_list(params_key, val, params) - else: - params[params_key] = [_val_to_string(val)] - - -def _populate_deep_object_query_params_list( - params_key: str, - value: List, - params: Dict[str, List[str]], -): - if not _is_set(value): - return - - for val in value: - if not _is_set(val): - continue - - if params.get(params_key) is None: - params[params_key] = [] - - params[params_key].append(_val_to_string(val)) - - -def _populate_delimited_query_params( - metadata: QueryParamMetadata, - field_name: str, - obj: Any, - delimiter: str, - query_param_values: Dict[str, List[str]], -): - _populate_form( - field_name, - metadata.explode, - obj, - delimiter, - query_param_values, - ) diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py b/packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py deleted file mode 100644 index d5240dd5..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py +++ /dev/null @@ -1,66 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import io -from dataclasses import dataclass -import re -from typing import ( - Any, - Optional, -) - -from .forms import serialize_form_data, serialize_multipart_form - -from .serializers import marshal_json - -SERIALIZATION_METHOD_TO_CONTENT_TYPE = { - "json": "application/json", - "form": "application/x-www-form-urlencoded", - "multipart": "multipart/form-data", - "raw": "application/octet-stream", - "string": "text/plain", -} - - -@dataclass -class SerializedRequestBody: - media_type: Optional[str] = None - content: Optional[Any] = None - data: Optional[Any] = None - files: Optional[Any] = None - - -def serialize_request_body( - request_body: Any, - nullable: bool, - optional: bool, - serialization_method: str, - request_body_type, -) -> Optional[SerializedRequestBody]: - if request_body is None: - if not nullable and optional: - return None - - media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] - - serialized_request_body = SerializedRequestBody(media_type) - - if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None: - serialized_request_body.content = marshal_json(request_body, request_body_type) - elif re.match(r"multipart\/.*", media_type) is not None: - ( - serialized_request_body.media_type, - serialized_request_body.data, - serialized_request_body.files, - ) = serialize_multipart_form(media_type, request_body) - elif re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None: - serialized_request_body.data = serialize_form_data(request_body) - elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): - serialized_request_body.content = request_body - elif isinstance(request_body, str): - serialized_request_body.content = request_body - else: - raise TypeError( - f"invalid request body type {type(request_body)} for mediaType {media_type}" - ) - - return serialized_request_body diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/retries.py b/packages/mistralai_azure/src/mistralai_azure/utils/retries.py deleted file mode 100644 index 4d608671..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/retries.py +++ /dev/null @@ -1,217 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import asyncio -import random -import time -from typing import List - -import httpx - - -class BackoffStrategy: - initial_interval: int - max_interval: int - exponent: float - max_elapsed_time: int - - def __init__( - self, - initial_interval: int, - max_interval: int, - exponent: float, - max_elapsed_time: int, - ): - self.initial_interval = initial_interval - self.max_interval = max_interval - self.exponent = exponent - self.max_elapsed_time = max_elapsed_time - - -class RetryConfig: - strategy: str - backoff: BackoffStrategy - retry_connection_errors: bool - - def __init__( - self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool - ): - self.strategy = strategy - self.backoff = backoff - self.retry_connection_errors = retry_connection_errors - - -class Retries: - config: RetryConfig - status_codes: List[str] - - def __init__(self, config: RetryConfig, status_codes: List[str]): - self.config = config - self.status_codes = status_codes - - -class TemporaryError(Exception): - response: httpx.Response - - def __init__(self, response: httpx.Response): - self.response = response - - -class PermanentError(Exception): - inner: Exception - - def __init__(self, inner: Exception): - self.inner = inner - - -def retry(func, retries: Retries): - if retries.config.strategy == "backoff": - - def do_request() -> httpx.Response: - res: httpx.Response - try: - res = func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if code_range <= status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except httpx.ConnectError as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except httpx.TimeoutException as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return retry_with_backoff( - do_request, - retries.config.backoff.initial_interval, - retries.config.backoff.max_interval, - retries.config.backoff.exponent, - retries.config.backoff.max_elapsed_time, - ) - - return func() - - -async def retry_async(func, retries: Retries): - if retries.config.strategy == "backoff": - - async def do_request() -> httpx.Response: - res: httpx.Response - try: - res = await func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if code_range <= status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except httpx.ConnectError as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except httpx.TimeoutException as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return await retry_with_backoff_async( - do_request, - retries.config.backoff.initial_interval, - retries.config.backoff.max_interval, - retries.config.backoff.exponent, - retries.config.backoff.max_elapsed_time, - ) - - return await func() - - -def retry_with_backoff( - func, - initial_interval=500, - max_interval=60000, - exponent=1.5, - max_elapsed_time=3600000, -): - start = round(time.time() * 1000) - retries = 0 - - while True: - try: - return func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time() * 1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) - sleep = min(sleep, max_interval / 1000) - time.sleep(sleep) - retries += 1 - - -async def retry_with_backoff_async( - func, - initial_interval=500, - max_interval=60000, - exponent=1.5, - max_elapsed_time=3600000, -): - start = round(time.time() * 1000) - retries = 0 - - while True: - try: - return await func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time() * 1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) - sleep = min(sleep, max_interval / 1000) - await asyncio.sleep(sleep) - retries += 1 diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/security.py b/packages/mistralai_azure/src/mistralai_azure/utils/security.py deleted file mode 100644 index 295a3f40..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/security.py +++ /dev/null @@ -1,174 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import base64 -from typing import ( - Any, - Dict, - List, - Tuple, -) -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .metadata import ( - SecurityMetadata, - find_field_metadata, -) - - -def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: - headers: Dict[str, str] = {} - query_params: Dict[str, List[str]] = {} - - if security is None: - return headers, query_params - - if not isinstance(security, BaseModel): - raise TypeError("security must be a pydantic model") - - sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields - for name in sec_fields: - sec_field = sec_fields[name] - - value = getattr(security, name) - if value is None: - continue - - metadata = find_field_metadata(sec_field, SecurityMetadata) - if metadata is None: - continue - if metadata.option: - _parse_security_option(headers, query_params, value) - return headers, query_params - if metadata.scheme: - # Special case for basic auth or custom auth which could be a flattened model - if metadata.sub_type in ["basic", "custom"] and not isinstance( - value, BaseModel - ): - _parse_security_scheme(headers, query_params, metadata, name, security) - else: - _parse_security_scheme(headers, query_params, metadata, name, value) - - return headers, query_params - - -def _parse_security_option( - headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any -): - if not isinstance(option, BaseModel): - raise TypeError("security option must be a pydantic model") - - opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields - for name in opt_fields: - opt_field = opt_fields[name] - - metadata = find_field_metadata(opt_field, SecurityMetadata) - if metadata is None or not metadata.scheme: - continue - _parse_security_scheme( - headers, query_params, metadata, name, getattr(option, name) - ) - - -def _parse_security_scheme( - headers: Dict[str, str], - query_params: Dict[str, List[str]], - scheme_metadata: SecurityMetadata, - field_name: str, - scheme: Any, -): - scheme_type = scheme_metadata.scheme_type - sub_type = scheme_metadata.sub_type - - if isinstance(scheme, BaseModel): - if scheme_type == "http": - if sub_type == "basic": - _parse_basic_auth_scheme(headers, scheme) - return - if sub_type == "custom": - return - - scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields - for name in scheme_fields: - scheme_field = scheme_fields[name] - - metadata = find_field_metadata(scheme_field, SecurityMetadata) - if metadata is None or metadata.field_name is None: - continue - - value = getattr(scheme, name) - - _parse_security_scheme_value( - headers, query_params, scheme_metadata, metadata, name, value - ) - else: - _parse_security_scheme_value( - headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme - ) - - -def _parse_security_scheme_value( - headers: Dict[str, str], - query_params: Dict[str, List[str]], - scheme_metadata: SecurityMetadata, - security_metadata: SecurityMetadata, - field_name: str, - value: Any, -): - scheme_type = scheme_metadata.scheme_type - sub_type = scheme_metadata.sub_type - - header_name = security_metadata.get_field_name(field_name) - - if scheme_type == "apiKey": - if sub_type == "header": - headers[header_name] = value - elif sub_type == "query": - query_params[header_name] = [value] - else: - raise ValueError("sub type {sub_type} not supported") - elif scheme_type == "openIdConnect": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "oauth2": - if sub_type != "client_credentials": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "http": - if sub_type == "bearer": - headers[header_name] = _apply_bearer(value) - elif sub_type == "custom": - return - else: - raise ValueError("sub type {sub_type} not supported") - else: - raise ValueError("scheme type {scheme_type} not supported") - - -def _apply_bearer(token: str) -> str: - return token.lower().startswith("bearer ") and token or f"Bearer {token}" - - -def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): - username = "" - password = "" - - if not isinstance(scheme, BaseModel): - raise TypeError("basic auth scheme must be a pydantic model") - - scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields - for name in scheme_fields: - scheme_field = scheme_fields[name] - - metadata = find_field_metadata(scheme_field, SecurityMetadata) - if metadata is None or metadata.field_name is None: - continue - - field_name = metadata.field_name - value = getattr(scheme, name) - - if field_name == "username": - username = value - if field_name == "password": - password = value - - data = f"{username}:{password}".encode() - headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/packages/mistralai_azure/src/mistralai_azure/utils/serializers.py b/packages/mistralai_azure/src/mistralai_azure/utils/serializers.py deleted file mode 100644 index 76e44d71..00000000 --- a/packages/mistralai_azure/src/mistralai_azure/utils/serializers.py +++ /dev/null @@ -1,248 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from decimal import Decimal -import functools -import json -import typing -from typing import Any, Dict, List, Tuple, Union, get_args -import typing_extensions -from typing_extensions import get_origin - -import httpx -from pydantic import ConfigDict, create_model -from pydantic_core import from_json - -from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset - - -def serialize_decimal(as_str: bool): - def serialize(d): - # Optional[T] is a Union[T, None] - if is_union(type(d)) and type(None) in get_args(type(d)) and d is None: - return None - if isinstance(d, Unset): - return d - - if not isinstance(d, Decimal): - raise ValueError("Expected Decimal object") - - return str(d) if as_str else float(d) - - return serialize - - -def validate_decimal(d): - if d is None: - return None - - if isinstance(d, (Decimal, Unset)): - return d - - if not isinstance(d, (str, int, float)): - raise ValueError("Expected string, int or float") - - return Decimal(str(d)) - - -def serialize_float(as_str: bool): - def serialize(f): - # Optional[T] is a Union[T, None] - if is_union(type(f)) and type(None) in get_args(type(f)) and f is None: - return None - if isinstance(f, Unset): - return f - - if not isinstance(f, float): - raise ValueError("Expected float") - - return str(f) if as_str else f - - return serialize - - -def validate_float(f): - if f is None: - return None - - if isinstance(f, (float, Unset)): - return f - - if not isinstance(f, str): - raise ValueError("Expected string") - - return float(f) - - -def serialize_int(as_str: bool): - def serialize(i): - # Optional[T] is a Union[T, None] - if is_union(type(i)) and type(None) in get_args(type(i)) and i is None: - return None - if isinstance(i, Unset): - return i - - if not isinstance(i, int): - raise ValueError("Expected int") - - return str(i) if as_str else i - - return serialize - - -def validate_int(b): - if b is None: - return None - - if isinstance(b, (int, Unset)): - return b - - if not isinstance(b, str): - raise ValueError("Expected string") - - return int(b) - - -def validate_open_enum(is_int: bool): - def validate(e): - if e is None: - return None - - if isinstance(e, Unset): - return e - - if is_int: - if not isinstance(e, int): - raise ValueError("Expected int") - else: - if not isinstance(e, str): - raise ValueError("Expected string") - - return e - - return validate - - -def validate_const(v): - def validate(c): - # Optional[T] is a Union[T, None] - if is_union(type(c)) and type(None) in get_args(type(c)) and c is None: - return None - - if v != c: - raise ValueError(f"Expected {v}") - - return c - - return validate - - -def unmarshal_json(raw, typ: Any) -> Any: - return unmarshal(from_json(raw), typ) - - -def unmarshal(val, typ: Any) -> Any: - unmarshaller = create_model( - "Unmarshaller", - body=(typ, ...), - __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), - ) - - m = unmarshaller(body=val) - - # pyright: ignore[reportAttributeAccessIssue] - return m.body # type: ignore - - -def marshal_json(val, typ): - if is_nullable(typ) and val is None: - return "null" - - marshaller = create_model( - "Marshaller", - body=(typ, ...), - __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), - ) - - m = marshaller(body=val) - - d = m.model_dump(by_alias=True, mode="json", exclude_none=True) - - if len(d) == 0: - return "" - - return json.dumps(d[next(iter(d))], separators=(",", ":")) - - -def is_nullable(field): - origin = get_origin(field) - if origin is Nullable or origin is OptionalNullable: - return True - - if not origin is Union or type(None) not in get_args(field): - return False - - for arg in get_args(field): - if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: - return True - - return False - - -def is_union(obj: object) -> bool: - """ - Returns True if the given object is a typing.Union or typing_extensions.Union. - """ - return any(obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union")) - - -def stream_to_text(stream: httpx.Response) -> str: - return "".join(stream.iter_text()) - - -async def stream_to_text_async(stream: httpx.Response) -> str: - return "".join([chunk async for chunk in stream.aiter_text()]) - - -def stream_to_bytes(stream: httpx.Response) -> bytes: - return stream.content - - -async def stream_to_bytes_async(stream: httpx.Response) -> bytes: - return await stream.aread() - - -def get_pydantic_model(data: Any, typ: Any) -> Any: - if not _contains_pydantic_model(data): - return unmarshal(data, typ) - - return data - - -def _contains_pydantic_model(data: Any) -> bool: - if isinstance(data, BaseModel): - return True - if isinstance(data, List): - return any(_contains_pydantic_model(item) for item in data) - if isinstance(data, Dict): - return any(_contains_pydantic_model(value) for value in data.values()) - - return False - - -@functools.cache -def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: - """ - Get typing objects by name from typing and typing_extensions. - Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types - """ - result = tuple( - getattr(module, name) - for module in (typing, typing_extensions) - if hasattr(module, name) - ) - if not result: - raise ValueError( - f"Neither typing nor typing_extensions has an object called {name!r}" - ) - return result - diff --git a/packages/mistralai_gcp/.genignore b/packages/mistralai_gcp/.genignore deleted file mode 100644 index ea10bc8e..00000000 --- a/packages/mistralai_gcp/.genignore +++ /dev/null @@ -1,4 +0,0 @@ -src/mistralai_gcp/sdk.py -README.md -USAGE.md -docs/sdks/**/README.md \ No newline at end of file diff --git a/packages/mistralai_gcp/.gitignore b/packages/mistralai_gcp/.gitignore deleted file mode 100644 index 5a82b069..00000000 --- a/packages/mistralai_gcp/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.speakeasy/reports -README-PYPI.md -.venv/ -venv/ -src/*.egg-info/ -__pycache__/ -.pytest_cache/ -.python-version -.DS_Store -pyrightconfig.json diff --git a/packages/mistralai_gcp/.speakeasy/gen.lock b/packages/mistralai_gcp/.speakeasy/gen.lock deleted file mode 100644 index 5e157235..00000000 --- a/packages/mistralai_gcp/.speakeasy/gen.lock +++ /dev/null @@ -1,211 +0,0 @@ -lockVersion: 2.0.0 -id: ec60f2d8-7869-45c1-918e-773d41a8cf74 -management: - docChecksum: 28fe1ab59b4dee005217f2dbbd836060 - docVersion: 0.0.2 - speakeasyVersion: 1.517.3 - generationVersion: 2.548.6 - releaseVersion: 1.6.0 - configChecksum: 66bf5911f59189922e03a75a72923b32 - published: true -features: - python: - additionalDependencies: 1.0.0 - constsAndDefaults: 1.0.5 - core: 5.12.3 - defaultEnabledRetries: 0.2.0 - enumUnions: 0.1.0 - envVarSecurityUsage: 0.3.2 - examples: 3.0.1 - flatRequests: 1.0.1 - globalSecurity: 3.0.3 - globalSecurityCallbacks: 1.0.0 - globalSecurityFlattening: 1.0.0 - globalServerURLs: 3.1.0 - methodArguments: 1.0.2 - nameOverrides: 3.0.1 - nullables: 1.0.1 - openEnums: 1.0.0 - responseFormat: 1.0.1 - retries: 3.0.2 - sdkHooks: 1.0.1 - serverEvents: 1.0.7 - serverEventsSentinels: 0.1.0 - serverIDs: 3.0.0 - unions: 3.0.4 -generatedFiles: - - .gitattributes - - .python-version - - .vscode/settings.json - - docs/models/arguments.md - - docs/models/assistantmessage.md - - docs/models/assistantmessagecontent.md - - docs/models/assistantmessagerole.md - - docs/models/chatcompletionchoice.md - - docs/models/chatcompletionchoicefinishreason.md - - docs/models/chatcompletionrequest.md - - docs/models/chatcompletionrequestmessages.md - - docs/models/chatcompletionrequeststop.md - - docs/models/chatcompletionrequesttoolchoice.md - - docs/models/chatcompletionresponse.md - - docs/models/chatcompletionstreamrequest.md - - docs/models/chatcompletionstreamrequesttoolchoice.md - - docs/models/completionchunk.md - - docs/models/completionevent.md - - docs/models/completionresponsestreamchoice.md - - docs/models/content.md - - docs/models/contentchunk.md - - docs/models/deltamessage.md - - docs/models/fimcompletionrequest.md - - docs/models/fimcompletionrequeststop.md - - docs/models/fimcompletionresponse.md - - docs/models/fimcompletionstreamrequest.md - - docs/models/fimcompletionstreamrequeststop.md - - docs/models/finishreason.md - - docs/models/function.md - - docs/models/functioncall.md - - docs/models/functionname.md - - docs/models/httpvalidationerror.md - - docs/models/imageurl.md - - docs/models/imageurlchunk.md - - docs/models/imageurlchunkimageurl.md - - docs/models/imageurlchunktype.md - - docs/models/jsonschema.md - - docs/models/loc.md - - docs/models/messages.md - - docs/models/prediction.md - - docs/models/referencechunk.md - - docs/models/referencechunktype.md - - docs/models/responseformat.md - - docs/models/responseformats.md - - docs/models/role.md - - docs/models/security.md - - docs/models/stop.md - - docs/models/systemmessage.md - - docs/models/systemmessagecontent.md - - docs/models/textchunk.md - - docs/models/tool.md - - docs/models/toolcall.md - - docs/models/toolchoice.md - - docs/models/toolchoiceenum.md - - docs/models/toolmessage.md - - docs/models/toolmessagecontent.md - - docs/models/toolmessagerole.md - - docs/models/tooltypes.md - - docs/models/type.md - - docs/models/usageinfo.md - - docs/models/usermessage.md - - docs/models/usermessagecontent.md - - docs/models/usermessagerole.md - - docs/models/utils/retryconfig.md - - docs/models/validationerror.md - - poetry.toml - - py.typed - - pylintrc - - pyproject.toml - - scripts/prepare_readme.py - - scripts/publish.sh - - src/mistralai_gcp/__init__.py - - src/mistralai_gcp/_hooks/__init__.py - - src/mistralai_gcp/_hooks/sdkhooks.py - - src/mistralai_gcp/_hooks/types.py - - src/mistralai_gcp/_version.py - - src/mistralai_gcp/basesdk.py - - src/mistralai_gcp/chat.py - - src/mistralai_gcp/fim.py - - src/mistralai_gcp/httpclient.py - - src/mistralai_gcp/models/__init__.py - - src/mistralai_gcp/models/assistantmessage.py - - src/mistralai_gcp/models/chatcompletionchoice.py - - src/mistralai_gcp/models/chatcompletionrequest.py - - src/mistralai_gcp/models/chatcompletionresponse.py - - src/mistralai_gcp/models/chatcompletionstreamrequest.py - - src/mistralai_gcp/models/completionchunk.py - - src/mistralai_gcp/models/completionevent.py - - src/mistralai_gcp/models/completionresponsestreamchoice.py - - src/mistralai_gcp/models/contentchunk.py - - src/mistralai_gcp/models/deltamessage.py - - src/mistralai_gcp/models/fimcompletionrequest.py - - src/mistralai_gcp/models/fimcompletionresponse.py - - src/mistralai_gcp/models/fimcompletionstreamrequest.py - - src/mistralai_gcp/models/function.py - - src/mistralai_gcp/models/functioncall.py - - src/mistralai_gcp/models/functionname.py - - src/mistralai_gcp/models/httpvalidationerror.py - - src/mistralai_gcp/models/imageurl.py - - src/mistralai_gcp/models/imageurlchunk.py - - src/mistralai_gcp/models/jsonschema.py - - src/mistralai_gcp/models/prediction.py - - src/mistralai_gcp/models/referencechunk.py - - src/mistralai_gcp/models/responseformat.py - - src/mistralai_gcp/models/responseformats.py - - src/mistralai_gcp/models/sdkerror.py - - src/mistralai_gcp/models/security.py - - src/mistralai_gcp/models/systemmessage.py - - src/mistralai_gcp/models/textchunk.py - - src/mistralai_gcp/models/tool.py - - src/mistralai_gcp/models/toolcall.py - - src/mistralai_gcp/models/toolchoice.py - - src/mistralai_gcp/models/toolchoiceenum.py - - src/mistralai_gcp/models/toolmessage.py - - src/mistralai_gcp/models/tooltypes.py - - src/mistralai_gcp/models/usageinfo.py - - src/mistralai_gcp/models/usermessage.py - - src/mistralai_gcp/models/validationerror.py - - src/mistralai_gcp/py.typed - - src/mistralai_gcp/sdk.py - - src/mistralai_gcp/sdkconfiguration.py - - src/mistralai_gcp/types/__init__.py - - src/mistralai_gcp/types/basemodel.py - - src/mistralai_gcp/utils/__init__.py - - src/mistralai_gcp/utils/annotations.py - - src/mistralai_gcp/utils/enums.py - - src/mistralai_gcp/utils/eventstreaming.py - - src/mistralai_gcp/utils/forms.py - - src/mistralai_gcp/utils/headers.py - - src/mistralai_gcp/utils/logger.py - - src/mistralai_gcp/utils/metadata.py - - src/mistralai_gcp/utils/queryparams.py - - src/mistralai_gcp/utils/requestbodies.py - - src/mistralai_gcp/utils/retries.py - - src/mistralai_gcp/utils/security.py - - src/mistralai_gcp/utils/serializers.py - - src/mistralai_gcp/utils/url.py - - src/mistralai_gcp/utils/values.py -examples: - stream_chat: - speakeasy-default-stream-chat: - requestBody: - application/json: {"model": "mistral-small-latest", "stream": true, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}]} - responses: - "422": - application/json: {} - "200": {} - chat_completion_v1_chat_completions_post: - speakeasy-default-chat-completion-v1-chat-completions-post: - requestBody: - application/json: {"model": "mistral-small-latest", "stream": false, "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}]} - responses: - "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": [{"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}]} - "422": - application/json: {} - stream_fim: - speakeasy-default-stream-fim: - requestBody: - application/json: {"model": "codestral-2405", "top_p": 1, "stream": true, "prompt": "def", "suffix": "return a+b"} - responses: - "422": - application/json: {} - "200": {} - fim_completion_v1_fim_completions_post: - speakeasy-default-fim-completion-v1-fim-completions-post: - requestBody: - application/json: {"model": "codestral-2405", "top_p": 1, "stream": false, "prompt": "def", "suffix": "return a+b"} - responses: - "200": - application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "codestral-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": [{"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}, {"index": 0, "message": {"prefix": false, "role": "assistant"}, "finish_reason": "stop"}]} - "422": - application/json: {} -examplesVersion: 1.0.0 -generatedTests: {} diff --git a/packages/mistralai_gcp/.speakeasy/gen.yaml b/packages/mistralai_gcp/.speakeasy/gen.yaml deleted file mode 100644 index d7be7fed..00000000 --- a/packages/mistralai_gcp/.speakeasy/gen.yaml +++ /dev/null @@ -1,53 +0,0 @@ -configVersion: 2.0.0 -generation: - sdkClassName: MistralGCP - maintainOpenAPIOrder: true - usageSnippets: - optionalPropertyRendering: withExample - useClassNamesForArrayFields: true - fixes: - nameResolutionDec2023: true - nameResolutionFeb2025: false - parameterOrderingFeb2024: true - requestResponseComponentNamesFeb2024: true - securityFeb2025: false - auth: - oAuth2ClientCredentialsEnabled: true - oAuth2PasswordEnabled: false -python: - version: 1.6.0 - additionalDependencies: - dev: - pytest: ^8.2.2 - pytest-asyncio: ^0.23.7 - main: - google-auth: ^2.31.0 - requests: ^2.32.3 - authors: - - Mistral - clientServerStatusCodesAsErrors: true - defaultErrorName: SDKError - description: Python Client SDK for the Mistral AI API in GCP. - enableCustomCodeRegions: false - enumFormat: union - fixFlags: - responseRequiredSep2024: false - flattenGlobalSecurity: true - flattenRequests: true - flatteningOrder: parameters-first - imports: - option: openapi - paths: - callbacks: "" - errors: "" - operations: "" - shared: "" - webhooks: "" - inputModelSuffix: input - maxMethodParams: 15 - methodArguments: infer-optional-args - outputModelSuffix: output - packageName: mistralai-gcp - pytestTimeout: 0 - responseFormat: flat - templateVersion: v2 diff --git a/packages/mistralai_gcp/.vscode/settings.json b/packages/mistralai_gcp/.vscode/settings.json deleted file mode 100644 index 8d79f0ab..00000000 --- a/packages/mistralai_gcp/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "python.testing.pytestArgs": ["tests", "-vv"], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "pylint.args": ["--rcfile=pylintrc"] -} diff --git a/packages/mistralai_gcp/README.md b/packages/mistralai_gcp/README.md deleted file mode 100644 index a4233244..00000000 --- a/packages/mistralai_gcp/README.md +++ /dev/null @@ -1,425 +0,0 @@ -# Mistral on GCP Python Client - - -**Prerequisites** - -Before you begin, you will need to create a Google Cloud project and enable the Mistral API. To do this, follow the instructions [here](https://docs.mistral.ai/deployment/cloud/vertex/). - -To run this locally you will also need to ensure you are authenticated with Google Cloud. You can do this by running - -```bash -gcloud auth application-default login -``` - -## SDK Installation - -Install the extras dependencies specific to Google Cloud: - -```bash -pip install mistralai[gcp] -``` - - -## SDK Example Usage - -### Create Chat Completions - -This example shows how to create chat completions. - -```python -# Synchronous Example -from mistralai_gcp import MistralGCP -import os -) - - -res = s.chat.complete(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="mistral-small-latest") - -if res is not None: - # handle response - pass -``` - -
- -The same SDK client can also be used to make asychronous requests by importing asyncio. -```python -# Asynchronous Example -import asyncio -from mistralai_gcp import MistralGCP -import os - -async def main(): - s = MistralGCP( - api_key=os.getenv("API_KEY", ""), - ) - res = await s.chat.complete_async(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], model="mistral-small-latest") - if res is not None: - # handle response - pass - -asyncio.run(main()) -``` - - - -## Available Resources and Operations - -### [chat](docs/sdks/chat/README.md) - -* [stream](docs/sdks/chat/README.md#stream) - Stream chat completion -* [create](docs/sdks/chat/README.md#create) - Chat Completion - -### [fim](docs/sdks/fim/README.md) - -* [stream](docs/sdks/fim/README.md#stream) - Stream fim completion -* [create](docs/sdks/fim/README.md#create) - Fim Completion - - - -## Server-sent event streaming - -[Server-sent events][mdn-sse] are used to stream content from certain -operations. These operations will expose the stream as [Generator][generator] that -can be consumed using a simple `for` loop. The loop will -terminate when the server no longer has any events to send and closes the -underlying connection. - -```python -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP() - - -res = s.chat.stream(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="mistral-small-latest") - -if res is not None: - for event in res: - # handle event - print(event) - -``` - -[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events -[generator]: https://wiki.python.org/moin/Generators - - - -## Retries - -Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. - -To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: -```python -from mistralai_gcp import MistralGCP -from mistralgcp.utils import BackoffStrategy, RetryConfig -import os - -s = MistralGCP() - - -res = s.chat.stream( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="mistral-small-latest", - retries=RetryConfig( - "backoff", - BackoffStrategy(1, 50, 1.1, 100), - False - ) -) - -if res is not None: - for event in res: - # handle event - print(event) - -``` - -If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: -```python -from mistralai_gcp import MistralGCP -from mistralgcp.utils import BackoffStrategy, RetryConfig -import os - -s = MistralGCP( - retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), -) - - -res = s.chat.stream( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="mistral-small-latest" -) - -if res is not None: - for event in res: - # handle event - print(event) - -``` - - - -## Error Handling - -Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. - -| Error Object | Status Code | Content Type | -| -------------------------- | ----------- | ---------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4xx-5xx | */* | - -### Example - -```python -from mistralai_gcp import MistralGCP, models -import os - -s = MistralGCP() - -res = None -try: - res = s.chat.complete( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="mistral-small-latest" - ) - -except models.HTTPValidationError as e: - # handle exception - raise(e) -except models.SDKError as e: - # handle exception - raise(e) - -if res is not None: - # handle response - pass - -``` - - - -## Server Selection - -### Select Server by Name - -You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: - -| Name | Server | Variables | -| ------ | ------------------------ | --------- | -| `prod` | `https://api.mistral.ai` | None | - -#### Example - -```python -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP(server="prod") - - -res = s.chat.stream( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="mistral-small-latest" -) - -if res is not None: - for event in res: - # handle event - print(event) - -``` - - -### Override Server URL Per-Client - -The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: -```python -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP( - server_url="https://api.mistral.ai", -) - - -res = s.chat.stream( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="mistral-small-latest" -) - -if res is not None: - for event in res: - # handle event - print(event) - -``` - - - -## Custom HTTP Client - -The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. -Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. -This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. - -For example, you could specify a header for every request that this sdk makes as follows: -```python -from mistralai_gcp import MistralGCP -import httpx - -http_client = httpx.Client(headers={"x-custom-header": "someValue"}) -s = MistralGCP(client=http_client) -``` - -or you could wrap the client with your own custom logic: -```python -from mistralai_gcp import MistralGCP -from mistralai_gcp.httpclient import AsyncHttpClient -import httpx - -class CustomClient(AsyncHttpClient): - client: AsyncHttpClient - - def __init__(self, client: AsyncHttpClient): - self.client = client - - async def send( - self, - request: httpx.Request, - *, - stream: bool = False, - auth: Union[ - httpx._types.AuthTypes, httpx._client.UseClientDefault, None - ] = httpx.USE_CLIENT_DEFAULT, - follow_redirects: Union[ - bool, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - ) -> httpx.Response: - request.headers["Client-Level-Header"] = "added by client" - - return await self.client.send( - request, stream=stream, auth=auth, follow_redirects=follow_redirects - ) - - def build_request( - self, - method: str, - url: httpx._types.URLTypes, - *, - content: Optional[httpx._types.RequestContent] = None, - data: Optional[httpx._types.RequestData] = None, - files: Optional[httpx._types.RequestFiles] = None, - json: Optional[Any] = None, - params: Optional[httpx._types.QueryParamTypes] = None, - headers: Optional[httpx._types.HeaderTypes] = None, - cookies: Optional[httpx._types.CookieTypes] = None, - timeout: Union[ - httpx._types.TimeoutTypes, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - extensions: Optional[httpx._types.RequestExtensions] = None, - ) -> httpx.Request: - return self.client.build_request( - method, - url, - content=content, - data=data, - files=files, - json=json, - params=params, - headers=headers, - cookies=cookies, - timeout=timeout, - extensions=extensions, - ) - -s = MistralGCP(async_client=CustomClient(httpx.AsyncClient())) -``` - - - -## Authentication - -### Per-Client Security Schemes - -This SDK supports the following security scheme globally: - -| Name | Type | Scheme | -| --------- | ---- | ----------- | -| `api_key` | http | HTTP Bearer | - -To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example: -```python -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP() - - -res = s.chat.stream( - messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], - model="mistral-small-latest" -) - -if res is not None: - for event in res: - # handle event - print(event) - -``` - - - - -# Development - -## Contributions - -While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. -We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. diff --git a/packages/mistralai_gcp/USAGE.md b/packages/mistralai_gcp/USAGE.md deleted file mode 100644 index 30fa08aa..00000000 --- a/packages/mistralai_gcp/USAGE.md +++ /dev/null @@ -1,51 +0,0 @@ - -### Create Chat Completions - -This example shows how to create chat completions. - -```python -# Synchronous Example -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP() - - -res = s.chat.complete(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="mistral-small-latest") - -if res is not None: - # handle response - pass -``` - -
- -The same SDK client can also be used to make asychronous requests by importing asyncio. -```python -# Asynchronous Example -import asyncio -from mistralai_gcp import MistralGCP -import os - -async def main(): - s = MistralGCP( - api_key=os.getenv("API_KEY", ""), - ) - res = await s.chat.complete_async(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, - ], model="mistral-small-latest") - if res is not None: - # handle response - pass - -asyncio.run(main()) -``` - \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/assistantmessage.md b/packages/mistralai_gcp/docs/models/assistantmessage.md deleted file mode 100644 index 3d0bd90b..00000000 --- a/packages/mistralai_gcp/docs/models/assistantmessage.md +++ /dev/null @@ -1,11 +0,0 @@ -# AssistantMessage - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content` | [OptionalNullable[models.AssistantMessageContent]](../models/assistantmessagecontent.md) | :heavy_minus_sign: | N/A | -| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | -| `prefix` | *Optional[bool]* | :heavy_minus_sign: | Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message. | -| `role` | [Optional[models.AssistantMessageRole]](../models/assistantmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/assistantmessagerole.md b/packages/mistralai_gcp/docs/models/assistantmessagerole.md deleted file mode 100644 index 658229e7..00000000 --- a/packages/mistralai_gcp/docs/models/assistantmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# AssistantMessageRole - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `ASSISTANT` | assistant | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/chatcompletionrequest.md b/packages/mistralai_gcp/docs/models/chatcompletionrequest.md deleted file mode 100644 index 9d735d08..00000000 --- a/packages/mistralai_gcp/docs/models/chatcompletionrequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# ChatCompletionRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. | mistral-small-latest | -| `messages` | List[[models.ChatCompletionRequestMessages](../models/chatcompletionrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.ChatCompletionRequestStop]](../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/chatcompletionrequestmessages.md b/packages/mistralai_gcp/docs/models/chatcompletionrequestmessages.md deleted file mode 100644 index bc7708a6..00000000 --- a/packages/mistralai_gcp/docs/models/chatcompletionrequestmessages.md +++ /dev/null @@ -1,29 +0,0 @@ -# ChatCompletionRequestMessages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/packages/mistralai_gcp/docs/models/chatcompletionrequesttoolchoice.md b/packages/mistralai_gcp/docs/models/chatcompletionrequesttoolchoice.md deleted file mode 100644 index 1646528d..00000000 --- a/packages/mistralai_gcp/docs/models/chatcompletionrequesttoolchoice.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatCompletionRequestToolChoice - - -## Supported Types - -### `models.ToolChoice` - -```python -value: models.ToolChoice = /* values here */ -``` - -### `models.ToolChoiceEnum` - -```python -value: models.ToolChoiceEnum = /* values here */ -``` - diff --git a/packages/mistralai_gcp/docs/models/chatcompletionstreamrequest.md b/packages/mistralai_gcp/docs/models/chatcompletionstreamrequest.md deleted file mode 100644 index 827943cd..00000000 --- a/packages/mistralai_gcp/docs/models/chatcompletionstreamrequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# ChatCompletionStreamRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. | mistral-small-latest | -| `messages` | List[[models.Messages](../models/messages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | [
{
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
}
] | -| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.Stop]](../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionStreamRequestToolChoice]](../models/chatcompletionstreamrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `presence_penalty` | *Optional[float]* | :heavy_minus_sign: | presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. | | -| `frequency_penalty` | *Optional[float]* | :heavy_minus_sign: | frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. | | -| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of completions to return for each request, input tokens are only billed once. | | -| `prediction` | [Optional[models.Prediction]](../models/prediction.md) | :heavy_minus_sign: | N/A | | -| `parallel_tool_calls` | *Optional[bool]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/chatcompletionstreamrequesttoolchoice.md b/packages/mistralai_gcp/docs/models/chatcompletionstreamrequesttoolchoice.md deleted file mode 100644 index cce0ca3e..00000000 --- a/packages/mistralai_gcp/docs/models/chatcompletionstreamrequesttoolchoice.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatCompletionStreamRequestToolChoice - - -## Supported Types - -### `models.ToolChoice` - -```python -value: models.ToolChoice = /* values here */ -``` - -### `models.ToolChoiceEnum` - -```python -value: models.ToolChoiceEnum = /* values here */ -``` - diff --git a/packages/mistralai_gcp/docs/models/completionresponsestreamchoice.md b/packages/mistralai_gcp/docs/models/completionresponsestreamchoice.md deleted file mode 100644 index c807dacd..00000000 --- a/packages/mistralai_gcp/docs/models/completionresponsestreamchoice.md +++ /dev/null @@ -1,10 +0,0 @@ -# CompletionResponseStreamChoice - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `index` | *int* | :heavy_check_mark: | N/A | -| `delta` | [models.DeltaMessage](../models/deltamessage.md) | :heavy_check_mark: | N/A | -| `finish_reason` | [Nullable[models.FinishReason]](../models/finishreason.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/content.md b/packages/mistralai_gcp/docs/models/content.md deleted file mode 100644 index a833dc2c..00000000 --- a/packages/mistralai_gcp/docs/models/content.md +++ /dev/null @@ -1,17 +0,0 @@ -# Content - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[models.ContentChunk]` - -```python -value: List[models.ContentChunk] = /* values here */ -``` - diff --git a/packages/mistralai_gcp/docs/models/deltamessage.md b/packages/mistralai_gcp/docs/models/deltamessage.md deleted file mode 100644 index 61deabbf..00000000 --- a/packages/mistralai_gcp/docs/models/deltamessage.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeltaMessage - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `role` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `content` | [OptionalNullable[models.Content]](../models/content.md) | :heavy_minus_sign: | N/A | -| `tool_calls` | List[[models.ToolCall](../models/toolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/finishreason.md b/packages/mistralai_gcp/docs/models/finishreason.md deleted file mode 100644 index 45a5aedb..00000000 --- a/packages/mistralai_gcp/docs/models/finishreason.md +++ /dev/null @@ -1,11 +0,0 @@ -# FinishReason - - -## Values - -| Name | Value | -| ------------ | ------------ | -| `STOP` | stop | -| `LENGTH` | length | -| `ERROR` | error | -| `TOOL_CALLS` | tool_calls | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/imageurl.md b/packages/mistralai_gcp/docs/models/imageurl.md deleted file mode 100644 index 7c2bcbc3..00000000 --- a/packages/mistralai_gcp/docs/models/imageurl.md +++ /dev/null @@ -1,9 +0,0 @@ -# ImageURL - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `url` | *str* | :heavy_check_mark: | N/A | -| `detail` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/imageurlchunk.md b/packages/mistralai_gcp/docs/models/imageurlchunk.md deleted file mode 100644 index f1b926ef..00000000 --- a/packages/mistralai_gcp/docs/models/imageurlchunk.md +++ /dev/null @@ -1,11 +0,0 @@ -# ImageURLChunk - -{"type":"image_url","image_url":{"url":"data:image/png;base64,iVBORw0 - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `image_url` | [models.ImageURLChunkImageURL](../models/imageurlchunkimageurl.md) | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ImageURLChunkType]](../models/imageurlchunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/imageurlchunkimageurl.md b/packages/mistralai_gcp/docs/models/imageurlchunkimageurl.md deleted file mode 100644 index 76738908..00000000 --- a/packages/mistralai_gcp/docs/models/imageurlchunkimageurl.md +++ /dev/null @@ -1,17 +0,0 @@ -# ImageURLChunkImageURL - - -## Supported Types - -### `models.ImageURL` - -```python -value: models.ImageURL = /* values here */ -``` - -### `str` - -```python -value: str = /* values here */ -``` - diff --git a/packages/mistralai_gcp/docs/models/imageurlchunktype.md b/packages/mistralai_gcp/docs/models/imageurlchunktype.md deleted file mode 100644 index 2064a0b4..00000000 --- a/packages/mistralai_gcp/docs/models/imageurlchunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ImageURLChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `IMAGE_URL` | image_url | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/messages.md b/packages/mistralai_gcp/docs/models/messages.md deleted file mode 100644 index 1d394500..00000000 --- a/packages/mistralai_gcp/docs/models/messages.md +++ /dev/null @@ -1,29 +0,0 @@ -# Messages - - -## Supported Types - -### `models.AssistantMessage` - -```python -value: models.AssistantMessage = /* values here */ -``` - -### `models.SystemMessage` - -```python -value: models.SystemMessage = /* values here */ -``` - -### `models.ToolMessage` - -```python -value: models.ToolMessage = /* values here */ -``` - -### `models.UserMessage` - -```python -value: models.UserMessage = /* values here */ -``` - diff --git a/packages/mistralai_gcp/docs/models/prediction.md b/packages/mistralai_gcp/docs/models/prediction.md deleted file mode 100644 index 86e9c396..00000000 --- a/packages/mistralai_gcp/docs/models/prediction.md +++ /dev/null @@ -1,9 +0,0 @@ -# Prediction - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `type` | *Optional[Literal["content"]]* | :heavy_minus_sign: | N/A | -| `content` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/referencechunk.md b/packages/mistralai_gcp/docs/models/referencechunk.md deleted file mode 100644 index a132ca2f..00000000 --- a/packages/mistralai_gcp/docs/models/referencechunk.md +++ /dev/null @@ -1,9 +0,0 @@ -# ReferenceChunk - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `reference_ids` | List[*int*] | :heavy_check_mark: | N/A | -| `type` | [Optional[models.ReferenceChunkType]](../models/referencechunktype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/referencechunktype.md b/packages/mistralai_gcp/docs/models/referencechunktype.md deleted file mode 100644 index 1e0e2fe6..00000000 --- a/packages/mistralai_gcp/docs/models/referencechunktype.md +++ /dev/null @@ -1,8 +0,0 @@ -# ReferenceChunkType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `REFERENCE` | reference | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/responseformat.md b/packages/mistralai_gcp/docs/models/responseformat.md deleted file mode 100644 index 23a1641b..00000000 --- a/packages/mistralai_gcp/docs/models/responseformat.md +++ /dev/null @@ -1,9 +0,0 @@ -# ResponseFormat - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Optional[models.ResponseFormats]](../models/responseformats.md) | :heavy_minus_sign: | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. | -| `json_schema` | [OptionalNullable[models.JSONSchema]](../models/jsonschema.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/responseformats.md b/packages/mistralai_gcp/docs/models/responseformats.md deleted file mode 100644 index 06886afe..00000000 --- a/packages/mistralai_gcp/docs/models/responseformats.md +++ /dev/null @@ -1,12 +0,0 @@ -# ResponseFormats - -An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `TEXT` | text | -| `JSON_OBJECT` | json_object | -| `JSON_SCHEMA` | json_schema | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/role.md b/packages/mistralai_gcp/docs/models/role.md deleted file mode 100644 index affca78d..00000000 --- a/packages/mistralai_gcp/docs/models/role.md +++ /dev/null @@ -1,8 +0,0 @@ -# Role - - -## Values - -| Name | Value | -| -------- | -------- | -| `SYSTEM` | system | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/stop.md b/packages/mistralai_gcp/docs/models/stop.md deleted file mode 100644 index ba40ca83..00000000 --- a/packages/mistralai_gcp/docs/models/stop.md +++ /dev/null @@ -1,19 +0,0 @@ -# Stop - -Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[str]` - -```python -value: List[str] = /* values here */ -``` - diff --git a/packages/mistralai_gcp/docs/models/systemmessage.md b/packages/mistralai_gcp/docs/models/systemmessage.md deleted file mode 100644 index 0dba71c0..00000000 --- a/packages/mistralai_gcp/docs/models/systemmessage.md +++ /dev/null @@ -1,9 +0,0 @@ -# SystemMessage - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `content` | [models.SystemMessageContent](../models/systemmessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.Role]](../models/role.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/systemmessagecontent.md b/packages/mistralai_gcp/docs/models/systemmessagecontent.md deleted file mode 100644 index e0d27d9f..00000000 --- a/packages/mistralai_gcp/docs/models/systemmessagecontent.md +++ /dev/null @@ -1,17 +0,0 @@ -# SystemMessageContent - - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[models.TextChunk]` - -```python -value: List[models.TextChunk] = /* values here */ -``` - diff --git a/packages/mistralai_gcp/docs/models/textchunk.md b/packages/mistralai_gcp/docs/models/textchunk.md deleted file mode 100644 index 6daab3c3..00000000 --- a/packages/mistralai_gcp/docs/models/textchunk.md +++ /dev/null @@ -1,9 +0,0 @@ -# TextChunk - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `text` | *str* | :heavy_check_mark: | N/A | -| `type` | [Optional[models.Type]](../models/type.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/toolmessage.md b/packages/mistralai_gcp/docs/models/toolmessage.md deleted file mode 100644 index a54f4933..00000000 --- a/packages/mistralai_gcp/docs/models/toolmessage.md +++ /dev/null @@ -1,11 +0,0 @@ -# ToolMessage - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `content` | [Nullable[models.ToolMessageContent]](../models/toolmessagecontent.md) | :heavy_check_mark: | N/A | -| `tool_call_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `role` | [Optional[models.ToolMessageRole]](../models/toolmessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/toolmessagerole.md b/packages/mistralai_gcp/docs/models/toolmessagerole.md deleted file mode 100644 index c24e59c0..00000000 --- a/packages/mistralai_gcp/docs/models/toolmessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `TOOL` | tool | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/tooltypes.md b/packages/mistralai_gcp/docs/models/tooltypes.md deleted file mode 100644 index 84e49253..00000000 --- a/packages/mistralai_gcp/docs/models/tooltypes.md +++ /dev/null @@ -1,8 +0,0 @@ -# ToolTypes - - -## Values - -| Name | Value | -| ---------- | ---------- | -| `FUNCTION` | function | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/type.md b/packages/mistralai_gcp/docs/models/type.md deleted file mode 100644 index eb0581e7..00000000 --- a/packages/mistralai_gcp/docs/models/type.md +++ /dev/null @@ -1,8 +0,0 @@ -# Type - - -## Values - -| Name | Value | -| ------ | ------ | -| `TEXT` | text | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/usageinfo.md b/packages/mistralai_gcp/docs/models/usageinfo.md deleted file mode 100644 index 9f56a3ae..00000000 --- a/packages/mistralai_gcp/docs/models/usageinfo.md +++ /dev/null @@ -1,10 +0,0 @@ -# UsageInfo - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| `prompt_tokens` | *int* | :heavy_check_mark: | N/A | 16 | -| `completion_tokens` | *int* | :heavy_check_mark: | N/A | 34 | -| `total_tokens` | *int* | :heavy_check_mark: | N/A | 50 | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/usermessage.md b/packages/mistralai_gcp/docs/models/usermessage.md deleted file mode 100644 index 63b01310..00000000 --- a/packages/mistralai_gcp/docs/models/usermessage.md +++ /dev/null @@ -1,9 +0,0 @@ -# UserMessage - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `content` | [Nullable[models.UserMessageContent]](../models/usermessagecontent.md) | :heavy_check_mark: | N/A | -| `role` | [Optional[models.UserMessageRole]](../models/usermessagerole.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/usermessagerole.md b/packages/mistralai_gcp/docs/models/usermessagerole.md deleted file mode 100644 index 171124e4..00000000 --- a/packages/mistralai_gcp/docs/models/usermessagerole.md +++ /dev/null @@ -1,8 +0,0 @@ -# UserMessageRole - - -## Values - -| Name | Value | -| ------ | ------ | -| `USER` | user | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/models/validationerror.md b/packages/mistralai_gcp/docs/models/validationerror.md deleted file mode 100644 index 7a1654a1..00000000 --- a/packages/mistralai_gcp/docs/models/validationerror.md +++ /dev/null @@ -1,10 +0,0 @@ -# ValidationError - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `loc` | List[[models.Loc](../models/loc.md)] | :heavy_check_mark: | N/A | -| `msg` | *str* | :heavy_check_mark: | N/A | -| `type` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/packages/mistralai_gcp/docs/sdks/chat/README.md b/packages/mistralai_gcp/docs/sdks/chat/README.md deleted file mode 100644 index 6f5f1977..00000000 --- a/packages/mistralai_gcp/docs/sdks/chat/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# Chat -(*chat*) - -## Overview - -Chat Completion API. - -### Available Operations - -* [stream](#stream) - Stream chat completion -* [create](#create) - Chat Completion - -## stream - -Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - -### Example Usage - -```python -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP() - - -res = s.chat.stream(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="mistral-small-latest") - -if res is not None: - for event in res: - # handle event - print(event) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ----------------- | ----------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `messages` | List[[models.Messages](../../models/messages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | {
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
} | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the model to use. You can use the [List Available Models](/api#operation/listModels) API to see all of your available models, or see our [Model overview](/models) for model descriptions. | mistral-small-latest | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.Stop]](../../models/stop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ToolChoice]](../../models/toolchoice.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - - -### Response - -**[Union[Generator[models.CompletionEvent, None, None], AsyncGenerator[models.CompletionEvent, None]]](../../models/.md)** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | ----------- | ------------ | -| models.SDKError | 4xx-5xx | */* | - -## create - -Chat Completion - -### Example Usage - -```python -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP() - - -res = s.chat.complete(messages=[ - { - "content": "Who is the best French painter? Answer in one short sentence.", - "role": "user", - }, -], model="mistral-small-latest") - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ----------------- | --------------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `messages` | List[[models.ChatCompletionRequestMessages](../../models/chatcompletionrequestmessages.md)] | :heavy_check_mark: | The prompt(s) to generate completions for, encoded as a list of dict with role and content. | {
"role": "user",
"content": "Who is the best French painter? Answer in one short sentence."
} | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the model to use. You can use the [List Available Models](/api#operation/listModels) API to see all of your available models, or see our [Model overview](/models) for model descriptions. | mistral-small-latest | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.ChatCompletionRequestStop]](../../models/chatcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `response_format` | [Optional[models.ResponseFormat]](../../models/responseformat.md) | :heavy_minus_sign: | N/A | | -| `tools` | List[[models.Tool](../../models/tool.md)] | :heavy_minus_sign: | N/A | | -| `tool_choice` | [Optional[models.ChatCompletionRequestToolChoice]](../../models/chatcompletionrequesttoolchoice.md) | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - - -### Response - -**[models.ChatCompletionResponse](../../models/chatcompletionresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | ----------- | ---------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4xx-5xx | */* | diff --git a/packages/mistralai_gcp/docs/sdks/fim/README.md b/packages/mistralai_gcp/docs/sdks/fim/README.md deleted file mode 100644 index b997fabf..00000000 --- a/packages/mistralai_gcp/docs/sdks/fim/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# Fim -(*fim*) - -## Overview - -Fill-in-the-middle API. - -### Available Operations - -* [stream](#stream) - Stream fim completion -* [create](#create) - Fim Completion - -## stream - -Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - -### Example Usage - -```python -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP() - - -res = s.fim.stream(prompt="def", model="codestral-2405", suffix="return a+b") - -if res is not None: - for event in res: - # handle event - print(event) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------- | ------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | -| `stop` | [Optional[models.FIMCompletionStreamRequestStop]](../../models/fimcompletionstreamrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - - -### Response - -**[Union[Generator[models.CompletionEvent, None, None], AsyncGenerator[models.CompletionEvent, None]]](../../models/.md)** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | ----------- | ------------ | -| models.SDKError | 4xx-5xx | */* | - -## create - -FIM completion. - -### Example Usage - -```python -from mistralai_gcp import MistralGCP -import os - -s = MistralGCP() - - -res = s.fim.complete(prompt="def", model="codestral-2405", suffix="return a+b") - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------- | ------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -| `prompt` | *str* | :heavy_check_mark: | The text/code to complete. | def | -| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the model to use. Only compatible for now with:
- `codestral-2405`
- `codestral-latest` | codestral-2405 | -| `temperature` | *Optional[float]* | :heavy_minus_sign: | What sampling temperature to use, between 0.0 and 1.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. | | -| `top_p` | *Optional[float]* | :heavy_minus_sign: | Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. | | -| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. | | -| `min_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | The minimum number of tokens to generate in the completion. | | -| `stream` | *Optional[bool]* | :heavy_minus_sign: | Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. | | -| `stop` | [Optional[models.FIMCompletionRequestStop]](../../models/fimcompletionrequeststop.md) | :heavy_minus_sign: | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array | | -| `random_seed` | *OptionalNullable[int]* | :heavy_minus_sign: | The seed to use for random sampling. If set, different calls will generate deterministic results. | | -| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | return a+b | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - - -### Response - -**[models.FIMCompletionResponse](../../models/fimcompletionresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------- | ----------- | ---------------- | -| models.HTTPValidationError | 422 | application/json | -| models.SDKError | 4xx-5xx | */* | diff --git a/packages/mistralai_gcp/poetry.lock b/packages/mistralai_gcp/poetry.lock deleted file mode 100644 index 5f710a98..00000000 --- a/packages/mistralai_gcp/poetry.lock +++ /dev/null @@ -1,900 +0,0 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. - -[[package]] -name = "annotated-types" -version = "0.7.0" -description = "Reusable constraint types to use with typing.Annotated" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, - {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, -] - -[[package]] -name = "anyio" -version = "4.4.0" -description = "High level compatibility layer for multiple asynchronous event loop implementations" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, - {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, -] - -[package.dependencies] -exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} -idna = ">=2.8" -sniffio = ">=1.1" -typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} - -[package.extras] -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) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""] -trio = ["trio (>=0.23)"] - -[[package]] -name = "astroid" -version = "3.2.4" -description = "An abstract syntax tree for Python with inference support." -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, - {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} - -[[package]] -name = "cachetools" -version = "5.4.0" -description = "Extensible memoizing collections and decorators" -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "cachetools-5.4.0-py3-none-any.whl", hash = "sha256:3ae3b49a3d5e28a77a0be2b37dbcb89005058959cb2323858c2657c4a8cab474"}, - {file = "cachetools-5.4.0.tar.gz", hash = "sha256:b8adc2e7c07f105ced7bc56dbb6dfbe7c4a00acce20e2227b3f355be89bc6827"}, -] - -[[package]] -name = "certifi" -version = "2024.7.4" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, - {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, -] - -[[package]] -name = "charset-normalizer" -version = "3.3.2" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -optional = false -python-versions = ">=3.7.0" -groups = ["main"] -files = [ - {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, - {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, -] - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["dev"] -markers = "sys_platform == \"win32\"" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "dill" -version = "0.3.8" -description = "serialize all of Python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, - {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, -] - -[package.extras] -graph = ["objgraph (>=1.7.2)"] -profile = ["gprof2dot (>=2022.7.29)"] - -[[package]] -name = "eval-type-backport" -version = "0.2.0" -description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, - {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, -] - -[package.extras] -tests = ["pytest"] - -[[package]] -name = "exceptiongroup" -version = "1.2.2" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -groups = ["main", "dev"] -markers = "python_version < \"3.11\"" -files = [ - {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, - {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, -] - -[package.extras] -test = ["pytest (>=6)"] - -[[package]] -name = "google-auth" -version = "2.38.0" -description = "Google Authentication Library" -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "google_auth-2.38.0-py2.py3-none-any.whl", hash = "sha256:e7dae6694313f434a2727bf2906f27ad259bae090d7aa896590d86feec3d9d4a"}, - {file = "google_auth-2.38.0.tar.gz", hash = "sha256:8285113607d3b80a3f1543b75962447ba8a09fe85783432a784fdeef6ac094c4"}, -] - -[package.dependencies] -cachetools = ">=2.0.0,<6.0" -pyasn1-modules = ">=0.2.1" -rsa = ">=3.1.4,<5" - -[package.extras] -aiohttp = ["aiohttp (>=3.6.2,<4.0.0.dev0)", "requests (>=2.20.0,<3.0.0.dev0)"] -enterprise-cert = ["cryptography", "pyopenssl"] -pyjwt = ["cryptography (>=38.0.3)", "pyjwt (>=2.0)"] -pyopenssl = ["cryptography (>=38.0.3)", "pyopenssl (>=20.0.0)"] -reauth = ["pyu2f (>=0.1.5)"] -requests = ["requests (>=2.20.0,<3.0.0.dev0)"] - -[[package]] -name = "h11" -version = "0.14.0" -description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, - {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, -] - -[[package]] -name = "httpcore" -version = "1.0.5" -description = "A minimal low-level HTTP client." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "httpcore-1.0.5-py3-none-any.whl", hash = "sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"}, - {file = "httpcore-1.0.5.tar.gz", hash = "sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61"}, -] - -[package.dependencies] -certifi = "*" -h11 = ">=0.13,<0.15" - -[package.extras] -asyncio = ["anyio (>=4.0,<5.0)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<0.26.0)"] - -[[package]] -name = "httpx" -version = "0.28.1" -description = "The next generation HTTP client." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, - {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, -] - -[package.dependencies] -anyio = "*" -certifi = "*" -httpcore = "==1.*" -idna = "*" - -[package.extras] -brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "idna" -version = "3.7" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.5" -groups = ["main"] -files = [ - {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, - {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, -] - -[[package]] -name = "iniconfig" -version = "2.0.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.7" -groups = ["dev"] -files = [ - {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, - {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, -] - -[[package]] -name = "isort" -version = "5.13.2" -description = "A Python utility / library to sort Python imports." -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, - {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, -] - -[package.extras] -colors = ["colorama (>=0.4.6)"] - -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = false -python-versions = ">=3.6" -groups = ["dev"] -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - -[[package]] -name = "mypy" -version = "1.14.1" -description = "Optional static typing for Python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb"}, - {file = "mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0"}, - {file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90716d8b2d1f4cd503309788e51366f07c56635a3309b0f6a32547eaaa36a64d"}, - {file = "mypy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ae753f5c9fef278bcf12e1a564351764f2a6da579d4a81347e1d5a15819997b"}, - {file = "mypy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0fe0f5feaafcb04505bcf439e991c6d8f1bf8b15f12b05feeed96e9e7bf1427"}, - {file = "mypy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d54bd85b925e501c555a3227f3ec0cfc54ee8b6930bd6141ec872d1c572f81f"}, - {file = "mypy-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f995e511de847791c3b11ed90084a7a0aafdc074ab88c5a9711622fe4751138c"}, - {file = "mypy-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d64169ec3b8461311f8ce2fd2eb5d33e2d0f2c7b49116259c51d0d96edee48d1"}, - {file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba24549de7b89b6381b91fbc068d798192b1b5201987070319889e93038967a8"}, - {file = "mypy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:183cf0a45457d28ff9d758730cd0210419ac27d4d3f285beda038c9083363b1f"}, - {file = "mypy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f2a0ecc86378f45347f586e4163d1769dd81c5a223d577fe351f26b179e148b1"}, - {file = "mypy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:ad3301ebebec9e8ee7135d8e3109ca76c23752bac1e717bc84cd3836b4bf3eae"}, - {file = "mypy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30ff5ef8519bbc2e18b3b54521ec319513a26f1bba19a7582e7b1f58a6e69f14"}, - {file = "mypy-1.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb9f255c18052343c70234907e2e532bc7e55a62565d64536dbc7706a20b78b9"}, - {file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b4e3413e0bddea671012b063e27591b953d653209e7a4fa5e48759cda77ca11"}, - {file = "mypy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:553c293b1fbdebb6c3c4030589dab9fafb6dfa768995a453d8a5d3b23784af2e"}, - {file = "mypy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fad79bfe3b65fe6a1efaed97b445c3d37f7be9fdc348bdb2d7cac75579607c89"}, - {file = "mypy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fa2220e54d2946e94ab6dbb3ba0a992795bd68b16dc852db33028df2b00191b"}, - {file = "mypy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:92c3ed5afb06c3a8e188cb5da4984cab9ec9a77ba956ee419c68a388b4595255"}, - {file = "mypy-1.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dbec574648b3e25f43d23577309b16534431db4ddc09fda50841f1e34e64ed34"}, - {file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c6d94b16d62eb3e947281aa7347d78236688e21081f11de976376cf010eb31a"}, - {file = "mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9"}, - {file = "mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd"}, - {file = "mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107"}, - {file = "mypy-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7084fb8f1128c76cd9cf68fe5971b37072598e7c31b2f9f95586b65c741a9d31"}, - {file = "mypy-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8f845a00b4f420f693f870eaee5f3e2692fa84cc8514496114649cfa8fd5e2c6"}, - {file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:44bf464499f0e3a2d14d58b54674dee25c031703b2ffc35064bd0df2e0fac319"}, - {file = "mypy-1.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c99f27732c0b7dc847adb21c9d47ce57eb48fa33a17bc6d7d5c5e9f9e7ae5bac"}, - {file = "mypy-1.14.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:bce23c7377b43602baa0bd22ea3265c49b9ff0b76eb315d6c34721af4cdf1d9b"}, - {file = "mypy-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:8edc07eeade7ebc771ff9cf6b211b9a7d93687ff892150cb5692e4f4272b0837"}, - {file = "mypy-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3888a1816d69f7ab92092f785a462944b3ca16d7c470d564165fe703b0970c35"}, - {file = "mypy-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46c756a444117c43ee984bd055db99e498bc613a70bbbc120272bd13ca579fbc"}, - {file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:27fc248022907e72abfd8e22ab1f10e903915ff69961174784a3900a8cba9ad9"}, - {file = "mypy-1.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:499d6a72fb7e5de92218db961f1a66d5f11783f9ae549d214617edab5d4dbdbb"}, - {file = "mypy-1.14.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:57961db9795eb566dc1d1b4e9139ebc4c6b0cb6e7254ecde69d1552bf7613f60"}, - {file = "mypy-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:07ba89fdcc9451f2ebb02853deb6aaaa3d2239a236669a63ab3801bbf923ef5c"}, - {file = "mypy-1.14.1-py3-none-any.whl", hash = "sha256:b66a60cc4073aeb8ae00057f9c1f64d49e90f918fbcef9a977eb121da8b8f1d1"}, - {file = "mypy-1.14.1.tar.gz", hash = "sha256:7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6"}, -] - -[package.dependencies] -mypy_extensions = ">=1.0.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing_extensions = ">=4.6.0" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -faster-cache = ["orjson"] -install-types = ["pip"] -mypyc = ["setuptools (>=50)"] -reports = ["lxml"] - -[[package]] -name = "mypy-extensions" -version = "1.0.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.5" -groups = ["dev"] -files = [ - {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, - {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, -] - -[[package]] -name = "packaging" -version = "24.1" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, - {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, -] - -[[package]] -name = "platformdirs" -version = "4.2.2" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, - {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, -] - -[package.extras] -docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] -type = ["mypy (>=1.8)"] - -[[package]] -name = "pluggy" -version = "1.5.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, - {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] - -[[package]] -name = "pyasn1" -version = "0.6.0" -description = "Pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208)" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "pyasn1-0.6.0-py2.py3-none-any.whl", hash = "sha256:cca4bb0f2df5504f02f6f8a775b6e416ff9b0b3b16f7ee80b5a3153d9b804473"}, - {file = "pyasn1-0.6.0.tar.gz", hash = "sha256:3a35ab2c4b5ef98e17dfdec8ab074046fbda76e281c5a706ccd82328cfc8f64c"}, -] - -[[package]] -name = "pyasn1-modules" -version = "0.4.0" -description = "A collection of ASN.1-based protocols modules" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "pyasn1_modules-0.4.0-py3-none-any.whl", hash = "sha256:be04f15b66c206eed667e0bb5ab27e2b1855ea54a842e5037738099e8ca4ae0b"}, - {file = "pyasn1_modules-0.4.0.tar.gz", hash = "sha256:831dbcea1b177b28c9baddf4c6d1013c24c3accd14a1873fffaa6a2e905f17b6"}, -] - -[package.dependencies] -pyasn1 = ">=0.4.6,<0.7.0" - -[[package]] -name = "pydantic" -version = "2.10.6" -description = "Data validation using Python type hints" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, - {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, -] - -[package.dependencies] -annotated-types = ">=0.6.0" -pydantic-core = "2.27.2" -typing-extensions = ">=4.12.2" - -[package.extras] -email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] - -[[package]] -name = "pydantic-core" -version = "2.27.2" -description = "Core functionality for Pydantic validation and serialization" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, - {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, -] - -[package.dependencies] -typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" - -[[package]] -name = "pylint" -version = "3.2.3" -description = "python code static checker" -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, - {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, -] - -[package.dependencies] -astroid = ">=3.2.2,<=3.3.0-dev0" -colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -dill = [ - {version = ">=0.2", markers = "python_version < \"3.11\""}, - {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version == \"3.11\""}, -] -isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" -mccabe = ">=0.6,<0.8" -platformdirs = ">=2.2.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -tomlkit = ">=0.10.1" -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} - -[package.extras] -spelling = ["pyenchant (>=3.2,<4.0)"] -testutils = ["gitpython (>3)"] - -[[package]] -name = "pytest" -version = "8.3.2" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5"}, - {file = "pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=1.5,<2" -tomli = {version = ">=1", markers = "python_version < \"3.11\""} - -[package.extras] -dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-asyncio" -version = "0.23.8" -description = "Pytest support for asyncio" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, - {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, -] - -[package.dependencies] -pytest = ">=7.0.0,<9" - -[package.extras] -docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] -testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] - -[[package]] -name = "python-dateutil" -version = "2.8.2" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -groups = ["main"] -files = [ - {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, - {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "requests" -version = "2.32.3" -description = "Python HTTP for Humans." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, - {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, -] - -[package.dependencies] -certifi = ">=2017.4.17" -charset-normalizer = ">=2,<4" -idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<3" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)"] -use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] - -[[package]] -name = "rsa" -version = "4.2" -description = "Pure-Python RSA implementation" -optional = false -python-versions = "*" -groups = ["main"] -markers = "python_version >= \"3.12\"" -files = [ - {file = "rsa-4.2.tar.gz", hash = "sha256:aaefa4b84752e3e99bd8333a2e1e3e7a7da64614042bd66f775573424370108a"}, -] - -[package.dependencies] -pyasn1 = ">=0.1.3" - -[[package]] -name = "rsa" -version = "4.9" -description = "Pure-Python RSA implementation" -optional = false -python-versions = ">=3.6,<4" -groups = ["main"] -markers = "python_version <= \"3.11\"" -files = [ - {file = "rsa-4.9-py3-none-any.whl", hash = "sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7"}, - {file = "rsa-4.9.tar.gz", hash = "sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21"}, -] - -[package.dependencies] -pyasn1 = ">=0.1.3" - -[[package]] -name = "six" -version = "1.16.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -groups = ["main"] -files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, -] - -[[package]] -name = "sniffio" -version = "1.3.1" -description = "Sniff out which async library your code is running under" -optional = false -python-versions = ">=3.7" -groups = ["main"] -files = [ - {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, - {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, -] - -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.7" -groups = ["dev"] -markers = "python_version < \"3.11\"" -files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, -] - -[[package]] -name = "tomlkit" -version = "0.13.0" -description = "Style preserving TOML library" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "tomlkit-0.13.0-py3-none-any.whl", hash = "sha256:7075d3042d03b80f603482d69bf0c8f345c2b30e41699fd8883227f89972b264"}, - {file = "tomlkit-0.13.0.tar.gz", hash = "sha256:08ad192699734149f5b97b45f1f18dad7eb1b6d16bc72ad0c2335772650d7b72"}, -] - -[[package]] -name = "types-python-dateutil" -version = "2.9.0.20240316" -description = "Typing stubs for python-dateutil" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "types-python-dateutil-2.9.0.20240316.tar.gz", hash = "sha256:5d2f2e240b86905e40944dd787db6da9263f0deabef1076ddaed797351ec0202"}, - {file = "types_python_dateutil-2.9.0.20240316-py3-none-any.whl", hash = "sha256:6b8cb66d960771ce5ff974e9dd45e38facb81718cc1e208b10b1baccbfdbee3b"}, -] - -[[package]] -name = "typing-extensions" -version = "4.12.2" -description = "Backported and Experimental Type Hints for Python 3.8+" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, - {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, -] - -[[package]] -name = "typing-inspection" -version = "0.4.0" -description = "Runtime typing introspection tools" -optional = false -python-versions = ">=3.9" -groups = ["main"] -files = [ - {file = "typing_inspection-0.4.0-py3-none-any.whl", hash = "sha256:50e72559fcd2a6367a19f7a7e610e6afcb9fac940c650290eed893d61386832f"}, - {file = "typing_inspection-0.4.0.tar.gz", hash = "sha256:9765c87de36671694a67904bf2c96e395be9c6439bb6c87b5142569dcdd65122"}, -] - -[package.dependencies] -typing-extensions = ">=4.12.0" - -[[package]] -name = "urllib3" -version = "2.2.2" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, - {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, -] - -[package.extras] -brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] -h2 = ["h2 (>=4,<5)"] -socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] -zstd = ["zstandard (>=0.18.0)"] - -[metadata] -lock-version = "2.1" -python-versions = ">=3.9" -content-hash = "e393da36a5d5edb020e739f40ff611854b9940e11a34a4e221f3f1513efeb9db" diff --git a/packages/mistralai_gcp/poetry.toml b/packages/mistralai_gcp/poetry.toml deleted file mode 100644 index ab1033bd..00000000 --- a/packages/mistralai_gcp/poetry.toml +++ /dev/null @@ -1,2 +0,0 @@ -[virtualenvs] -in-project = true diff --git a/packages/mistralai_gcp/pylintrc b/packages/mistralai_gcp/pylintrc deleted file mode 100644 index 266bc815..00000000 --- a/packages/mistralai_gcp/pylintrc +++ /dev/null @@ -1,662 +0,0 @@ -[MAIN] - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Clear in-memory caches upon conclusion of linting. Useful if running pylint -# in a server-like mode. -clear-cache-post-run=no - -# Load and enable all available extensions. Use --list-extensions to see a list -# all available extensions. -#enable-all-extensions= - -# In error mode, messages with a category besides ERROR or FATAL are -# suppressed, and no reports are done by default. Error mode is compatible with -# disabling specific errors. -#errors-only= - -# Always return a 0 (non-error) status code, even if lint errors are found. -# This is primarily useful in continuous integration scripts. -#exit-zero= - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code. -extension-pkg-allow-list= - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code. (This is an alternative name to extension-pkg-allow-list -# for backward compatibility.) -extension-pkg-whitelist= - -# Return non-zero exit code if any of these messages/categories are detected, -# even if score is above --fail-under value. Syntax same as enable. Messages -# specified are enabled, while categories only check already-enabled messages. -fail-on= - -# Specify a score threshold under which the program will exit with error. -fail-under=10 - -# Interpret the stdin as a python script, whose filename needs to be passed as -# the module_or_package argument. -#from-stdin= - -# Files or directories to be skipped. They should be base names, not paths. -ignore=CVS - -# Add files or directories matching the regular expressions patterns to the -# ignore-list. The regex matches against paths and can be in Posix or Windows -# format. Because '\\' represents the directory delimiter on Windows systems, -# it can't be used as an escape character. -ignore-paths= - -# Files or directories matching the regular expression patterns are skipped. -# The regex matches against base names, not paths. The default value ignores -# Emacs file locks -ignore-patterns=^\.# - -# List of module names for which member attributes should not be checked and -# will not be imported (useful for modules/projects where namespaces are -# manipulated during runtime and thus existing member attributes cannot be -# deduced by static analysis). It supports qualified module names, as well as -# Unix pattern matching. -ignored-modules= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the -# number of processors available to use, and will cap the count on Windows to -# avoid hangs. -jobs=1 - -# Control the amount of potential inferred values when inferring a single -# object. This can help the performance when dealing with large functions or -# complex, nested conditions. -limit-inference-results=100 - -# List of plugins (as comma separated values of python module names) to load, -# usually to register additional checkers. -load-plugins= - -# Pickle collected data for later comparisons. -persistent=yes - -# Minimum Python version to use for version dependent checks. Will default to -# the version used to run pylint. -py-version=3.9 - -# Discover python modules and packages in the file system subtree. -recursive=no - -# Add paths to the list of the source roots. Supports globbing patterns. The -# source root is an absolute path or a path relative to the current working -# directory used to determine a package namespace for modules located under the -# source root. -source-roots=src - -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages. -suggestion-mode=yes - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - -# In verbose mode, extra non-checker-related info will be displayed. -#verbose= - - -[BASIC] - -# Naming style matching correct argument names. -argument-naming-style=snake_case - -# Regular expression matching correct argument names. Overrides argument- -# naming-style. If left empty, argument names will be checked with the set -# naming style. -#argument-rgx= - -# Naming style matching correct attribute names. -#attr-naming-style=snake_case - -# Regular expression matching correct attribute names. Overrides attr-naming- -# style. If left empty, attribute names will be checked with the set naming -# style. -attr-rgx=[^\W\d][^\W]*|__.*__$ - -# Bad variable names which should always be refused, separated by a comma. -bad-names= - -# Bad variable names regexes, separated by a comma. If names match any regex, -# they will always be refused -bad-names-rgxs= - -# Naming style matching correct class attribute names. -class-attribute-naming-style=any - -# Regular expression matching correct class attribute names. Overrides class- -# attribute-naming-style. If left empty, class attribute names will be checked -# with the set naming style. -#class-attribute-rgx= - -# Naming style matching correct class constant names. -class-const-naming-style=UPPER_CASE - -# Regular expression matching correct class constant names. Overrides class- -# const-naming-style. If left empty, class constant names will be checked with -# the set naming style. -#class-const-rgx= - -# Naming style matching correct class names. -class-naming-style=PascalCase - -# Regular expression matching correct class names. Overrides class-naming- -# style. If left empty, class names will be checked with the set naming style. -#class-rgx= - -# Naming style matching correct constant names. -const-naming-style=UPPER_CASE - -# Regular expression matching correct constant names. Overrides const-naming- -# style. If left empty, constant names will be checked with the set naming -# style. -#const-rgx= - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming style matching correct function names. -function-naming-style=snake_case - -# Regular expression matching correct function names. Overrides function- -# naming-style. If left empty, function names will be checked with the set -# naming style. -#function-rgx= - -# Good variable names which should always be accepted, separated by a comma. -good-names=i, - j, - k, - ex, - Run, - _, - e, - n, - id - -# Good variable names regexes, separated by a comma. If names match any regex, -# they will always be accepted -good-names-rgxs= - -# Include a hint for the correct naming format with invalid-name. -include-naming-hint=no - -# Naming style matching correct inline iteration names. -inlinevar-naming-style=any - -# Regular expression matching correct inline iteration names. Overrides -# inlinevar-naming-style. If left empty, inline iteration names will be checked -# with the set naming style. -#inlinevar-rgx= - -# Naming style matching correct method names. -method-naming-style=snake_case - -# Regular expression matching correct method names. Overrides method-naming- -# style. If left empty, method names will be checked with the set naming style. -#method-rgx= - -# Naming style matching correct module names. -module-naming-style=snake_case - -# Regular expression matching correct module names. Overrides module-naming- -# style. If left empty, module names will be checked with the set naming style. -#module-rgx= - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -# These decorators are taken in consideration only for invalid-name. -property-classes=abc.abstractproperty - -# Regular expression matching correct type alias names. If left empty, type -# alias names will be checked with the set naming style. -typealias-rgx=.* - -# Regular expression matching correct type variable names. If left empty, type -# variable names will be checked with the set naming style. -#typevar-rgx= - -# Naming style matching correct variable names. -variable-naming-style=snake_case - -# Regular expression matching correct variable names. Overrides variable- -# naming-style. If left empty, variable names will be checked with the set -# naming style. -#variable-rgx= - - -[CLASSES] - -# Warn about protected attribute access inside special methods -check-protected-access-in-special-methods=no - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__, - __new__, - setUp, - asyncSetUp, - __post_init__ - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[DESIGN] - -# List of regular expressions of class ancestor names to ignore when counting -# public methods (see R0903) -exclude-too-few-public-methods= - -# List of qualified class names to ignore when counting class parents (see -# R0901) -ignored-parents= - -# Maximum number of arguments for function / method. -max-args=5 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in an if statement (see R0916). -max-bool-expr=5 - -# Maximum number of branch for function / method body. -max-branches=12 - -# Maximum number of locals for function / method body. -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=25 - -# Maximum number of return / yield for function / method body. -max-returns=6 - -# Maximum number of statements in function / method body. -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when caught. -overgeneral-exceptions=builtins.BaseException,builtins.Exception - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=100 - -# Maximum number of lines in a module. -max-module-lines=1000 - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[IMPORTS] - -# List of modules that can be imported at any level, not just the top level -# one. -allow-any-import-level= - -# Allow explicit reexports by alias from a package __init__. -allow-reexport-from-package=no - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Deprecated modules which should not be used, separated by a comma. -deprecated-modules= - -# Output a graph (.gv or any supported image format) of external dependencies -# to the given file (report RP0402 must not be disabled). -ext-import-graph= - -# Output a graph (.gv or any supported image format) of all (i.e. internal and -# external) dependencies to the given file (report RP0402 must not be -# disabled). -import-graph= - -# Output a graph (.gv or any supported image format) of internal dependencies -# to the given file (report RP0402 must not be disabled). -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - -# Couples of modules and preferred modules, separated by a comma. -preferred-modules= - - -[LOGGING] - -# The type of string formatting that logging methods do. `old` means using % -# formatting, `new` is for `{}` formatting. -logging-format-style=old - -# Logging modules to check that the string format arguments are in logging -# function parameter format. -logging-modules=logging - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, -# UNDEFINED. -confidence=HIGH, - CONTROL_FLOW, - INFERENCE, - INFERENCE_FAILURE, - UNDEFINED - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once). You can also use "--disable=all" to -# disable everything first and then re-enable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use "--disable=all --enable=classes -# --disable=W". -disable=raw-checker-failed, - bad-inline-option, - locally-disabled, - file-ignored, - suppressed-message, - useless-suppression, - deprecated-pragma, - use-implicit-booleaness-not-comparison-to-string, - use-implicit-booleaness-not-comparison-to-zero, - use-symbolic-message-instead, - trailing-whitespace, - line-too-long, - missing-class-docstring, - missing-module-docstring, - missing-function-docstring, - too-many-instance-attributes, - wrong-import-order, - too-many-arguments, - broad-exception-raised, - too-few-public-methods, - too-many-branches, - duplicate-code, - trailing-newlines, - too-many-public-methods, - too-many-locals, - too-many-lines, - using-constant-test, - too-many-statements, - cyclic-import, - too-many-nested-blocks, - too-many-boolean-expressions, - no-else-raise, - bare-except, - broad-exception-caught, - fixme, - relative-beyond-top-level, - consider-using-with, - wildcard-import, - unused-wildcard-import - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable= - - -[METHOD_ARGS] - -# List of qualified names (i.e., library.method) which require a timeout -# parameter e.g. 'requests.api.get,requests.api.post' -timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -notes=FIXME, - XXX, - TODO - -# Regular expression of note tags to take in consideration. -notes-rgx= - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - -# Complete name of functions that never returns. When checking for -# inconsistent-return-statements if a never returning function is called then -# it will be considered as an explicit return statement and no message will be -# printed. -never-returning-functions=sys.exit,argparse.parse_error - - -[REPORTS] - -# Python expression which should return a score less than or equal to 10. You -# have access to the variables 'fatal', 'error', 'warning', 'refactor', -# 'convention', and 'info' which contain the number of messages in each -# category, as well as 'statement' which is the total number of statements -# analyzed. This score is used by the global evaluation report (RP0004). -evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details. -msg-template= - -# Set the output format. Available formats are: text, parseable, colorized, -# json2 (improved json format), json (old json format) and msvs (visual -# studio). You can also give a reporter class, e.g. -# mypackage.mymodule.MyReporterClass. -#output-format= - -# Tells whether to display a full report or only the messages. -reports=no - -# Activate the evaluation score. -score=yes - - -[SIMILARITIES] - -# Comments are removed from the similarity computation -ignore-comments=yes - -# Docstrings are removed from the similarity computation -ignore-docstrings=yes - -# Imports are removed from the similarity computation -ignore-imports=yes - -# Signatures are removed from the similarity computation -ignore-signatures=yes - -# Minimum lines number of a similarity. -min-similarity-lines=4 - - -[SPELLING] - -# Limits count of emitted suggestions for spelling mistakes. -max-spelling-suggestions=4 - -# Spelling dictionary name. No available dictionaries : You need to install -# both the python package and the system dependency for enchant to work. -spelling-dict= - -# List of comma separated words that should be considered directives if they -# appear at the beginning of a comment and should not be checked. -spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains the private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to the private dictionary (see the -# --spelling-private-dict-file option) instead of raising a message. -spelling-store-unknown-words=no - - -[STRING] - -# This flag controls whether inconsistent-quotes generates a warning when the -# character used as a quote delimiter is used inconsistently within a module. -check-quote-consistency=no - -# This flag controls whether the implicit-str-concat should generate a warning -# on implicit string concatenation in sequences defined over several lines. -check-str-concat-over-line-jumps=no - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= - -# Tells whether to warn about missing members when the owner of the attribute -# is inferred to be None. -ignore-none=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of symbolic message names to ignore for Mixin members. -ignored-checks-for-mixins=no-member, - not-async-context-manager, - not-context-manager, - attribute-defined-outside-init - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - -# Regex pattern to define which classes are considered mixins. -mixin-class-rgx=.*[Mm]ixin - -# List of decorators that change the signature of a decorated function. -signature-mutators= - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid defining new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of names allowed to shadow builtins -allowed-redefined-builtins=id,object - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_, - _cb - -# A regular expression matching the name of dummy variables (i.e. expected to -# not be used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io diff --git a/packages/mistralai_gcp/pyproject.toml b/packages/mistralai_gcp/pyproject.toml deleted file mode 100644 index 9763e417..00000000 --- a/packages/mistralai_gcp/pyproject.toml +++ /dev/null @@ -1,60 +0,0 @@ -[project] -name = "mistralai-gcp" -version = "1.6.0" -description = "Python Client SDK for the Mistral AI API in GCP." -authors = [{ name = "Mistral" },] -readme = "README-PYPI.md" -requires-python = ">=3.9" -dependencies = [ - "eval-type-backport >=0.2.0", - "google-auth (>=2.31.0,<3.0.0)", - "httpx >=0.28.1", - "pydantic >=2.10.3", - "python-dateutil >=2.8.2", - "requests (>=2.32.3,<3.0.0)", - "typing-inspection >=0.4.0", -] - -[tool.poetry] -packages = [ - { include = "mistralai_gcp", from = "src" } -] -include = ["py.typed", "src/mistralai_gcp/py.typed"] - -[tool.setuptools.package-data] -"*" = ["py.typed", "src/mistralai_gcp/py.typed"] - -[virtualenvs] -in-project = true - -[tool.poetry.group.dev.dependencies] -mypy = "==1.14.1" -pylint = "==3.2.3" -pytest = "^8.2.2" -pytest-asyncio = "^0.23.7" -types-python-dateutil = "^2.9.0.20240316" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - -[tool.pytest.ini_options] -asyncio_default_fixture_loop_scope = "function" -pythonpath = ["src"] - -[tool.mypy] -disable_error_code = "misc" - -[[tool.mypy.overrides]] -module = "typing_inspect" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = "jsonpath" -ignore_missing_imports = true - -[tool.pyright] -venvPath = "." -venv = ".venv" - - diff --git a/packages/mistralai_gcp/scripts/prepare_readme.py b/packages/mistralai_gcp/scripts/prepare_readme.py deleted file mode 100644 index 825d9ded..00000000 --- a/packages/mistralai_gcp/scripts/prepare_readme.py +++ /dev/null @@ -1,9 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import shutil - -try: - shutil.copyfile("README.md", "README-PYPI.md") -except Exception as e: - print("Failed to copy README.md to README-PYPI.md") - print(e) diff --git a/packages/mistralai_gcp/scripts/publish.sh b/packages/mistralai_gcp/scripts/publish.sh deleted file mode 100755 index f2f2cf2c..00000000 --- a/packages/mistralai_gcp/scripts/publish.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} - -poetry run python scripts/prepare_readme.py - -poetry publish --build --skip-existing diff --git a/packages/mistralai_gcp/src/mistralai_gcp/__init__.py b/packages/mistralai_gcp/src/mistralai_gcp/__init__.py deleted file mode 100644 index dd02e42e..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from ._version import ( - __title__, - __version__, - __openapi_doc_version__, - __gen_version__, - __user_agent__, -) -from .sdk import * -from .sdkconfiguration import * -from .models import * - - -VERSION: str = __version__ -OPENAPI_DOC_VERSION = __openapi_doc_version__ -SPEAKEASY_GENERATOR_VERSION = __gen_version__ -USER_AGENT = __user_agent__ diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py b/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py deleted file mode 100644 index 77df6aef..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py +++ /dev/null @@ -1,22 +0,0 @@ -# THIS FILE IS THE EXACT COPY OF THE ORIGINAL FILE FROM src/mistralai/_hooks/custom_user_agent.py -from typing import Union - -import httpx - -from .types import BeforeRequestContext, BeforeRequestHook - -PREFIX = "mistral-client-python/" - -class CustomUserAgentHook(BeforeRequestHook): - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> Union[httpx.Request, Exception]: - current = request.headers["user-agent"] - if current.startswith(PREFIX): - return request - - request.headers["user-agent"] = ( - PREFIX + current.split(" ")[1] - ) - - return request diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py b/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py deleted file mode 100644 index 304edfa2..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py +++ /dev/null @@ -1,15 +0,0 @@ -from .custom_user_agent import CustomUserAgentHook -from .types import Hooks - -# This file is only ever generated once on the first generation and then is free to be modified. -# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them -# in this file or in separate files in the hooks folder. - - -def init_hooks(hooks: Hooks): - # pylint: disable=unused-argument - """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook - with an instance of a hook that implements that specific Hook interface - Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance - """ - hooks.register_before_request_hook(CustomUserAgentHook()) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py b/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py deleted file mode 100644 index b81c2a27..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py +++ /dev/null @@ -1,76 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import httpx -from .types import ( - SDKInitHook, - BeforeRequestContext, - BeforeRequestHook, - AfterSuccessContext, - AfterSuccessHook, - AfterErrorContext, - AfterErrorHook, - Hooks, -) -from .registration import init_hooks -from typing import List, Optional, Tuple -from mistralai_gcp.httpclient import HttpClient - - -class SDKHooks(Hooks): - def __init__(self) -> None: - self.sdk_init_hooks: List[SDKInitHook] = [] - self.before_request_hooks: List[BeforeRequestHook] = [] - self.after_success_hooks: List[AfterSuccessHook] = [] - self.after_error_hooks: List[AfterErrorHook] = [] - init_hooks(self) - - def register_sdk_init_hook(self, hook: SDKInitHook) -> None: - self.sdk_init_hooks.append(hook) - - def register_before_request_hook(self, hook: BeforeRequestHook) -> None: - self.before_request_hooks.append(hook) - - def register_after_success_hook(self, hook: AfterSuccessHook) -> None: - self.after_success_hooks.append(hook) - - def register_after_error_hook(self, hook: AfterErrorHook) -> None: - self.after_error_hooks.append(hook) - - def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: - for hook in self.sdk_init_hooks: - base_url, client = hook.sdk_init(base_url, client) - return base_url, client - - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> httpx.Request: - for hook in self.before_request_hooks: - out = hook.before_request(hook_ctx, request) - if isinstance(out, Exception): - raise out - request = out - - return request - - def after_success( - self, hook_ctx: AfterSuccessContext, response: httpx.Response - ) -> httpx.Response: - for hook in self.after_success_hooks: - out = hook.after_success(hook_ctx, response) - if isinstance(out, Exception): - raise out - response = out - return response - - def after_error( - self, - hook_ctx: AfterErrorContext, - response: Optional[httpx.Response], - error: Optional[Exception], - ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: - for hook in self.after_error_hooks: - result = hook.after_error(hook_ctx, response, error) - if isinstance(result, Exception): - raise result - response, error = result - return response, error diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py b/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py deleted file mode 100644 index bb867b5b..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py +++ /dev/null @@ -1,106 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from abc import ABC, abstractmethod -import httpx -from mistralai_gcp.httpclient import HttpClient -from typing import Any, Callable, List, Optional, Tuple, Union - - -class HookContext: - base_url: str - operation_id: str - oauth2_scopes: Optional[List[str]] = None - security_source: Optional[Union[Any, Callable[[], Any]]] = None - - def __init__( - self, - base_url: str, - operation_id: str, - oauth2_scopes: Optional[List[str]], - security_source: Optional[Union[Any, Callable[[], Any]]], - ): - self.base_url = base_url - self.operation_id = operation_id - self.oauth2_scopes = oauth2_scopes - self.security_source = security_source - - -class BeforeRequestContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class AfterSuccessContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class AfterErrorContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class SDKInitHook(ABC): - @abstractmethod - def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: - pass - - -class BeforeRequestHook(ABC): - @abstractmethod - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> Union[httpx.Request, Exception]: - pass - - -class AfterSuccessHook(ABC): - @abstractmethod - def after_success( - self, hook_ctx: AfterSuccessContext, response: httpx.Response - ) -> Union[httpx.Response, Exception]: - pass - - -class AfterErrorHook(ABC): - @abstractmethod - def after_error( - self, - hook_ctx: AfterErrorContext, - response: Optional[httpx.Response], - error: Optional[Exception], - ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: - pass - - -class Hooks(ABC): - @abstractmethod - def register_sdk_init_hook(self, hook: SDKInitHook): - pass - - @abstractmethod - def register_before_request_hook(self, hook: BeforeRequestHook): - pass - - @abstractmethod - def register_after_success_hook(self, hook: AfterSuccessHook): - pass - - @abstractmethod - def register_after_error_hook(self, hook: AfterErrorHook): - pass diff --git a/packages/mistralai_gcp/src/mistralai_gcp/_version.py b/packages/mistralai_gcp/src/mistralai_gcp/_version.py deleted file mode 100644 index 11f38b63..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/_version.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import importlib.metadata - -__title__: str = "mistralai-gcp" -__version__: str = "1.6.0" -__openapi_doc_version__: str = "0.0.2" -__gen_version__: str = "2.548.6" -__user_agent__: str = "speakeasy-sdk/python 1.6.0 2.548.6 0.0.2 mistralai-gcp" - -try: - if __package__ is not None: - __version__ = importlib.metadata.version(__package__) -except importlib.metadata.PackageNotFoundError: - pass diff --git a/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py b/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py deleted file mode 100644 index bb0aab96..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py +++ /dev/null @@ -1,362 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .sdkconfiguration import SDKConfiguration -import httpx -from mistralai_gcp import models, utils -from mistralai_gcp._hooks import ( - AfterErrorContext, - AfterSuccessContext, - BeforeRequestContext, -) -from mistralai_gcp.utils import RetryConfig, SerializedRequestBody, get_body_content -from typing import Callable, List, Mapping, Optional, Tuple -from urllib.parse import parse_qs, urlparse - - -class BaseSDK: - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - def _get_url(self, base_url, url_variables): - sdk_url, sdk_variables = self.sdk_configuration.get_server_details() - - if base_url is None: - base_url = sdk_url - - if url_variables is None: - url_variables = sdk_variables - - return utils.template_url(base_url, url_variables) - - def _build_request_async( - self, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - client = self.sdk_configuration.async_client - return self._build_request_with_client( - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals, - security, - timeout_ms, - get_serialized_body, - url_override, - http_headers, - ) - - def _build_request( - self, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - client = self.sdk_configuration.client - return self._build_request_with_client( - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals, - security, - timeout_ms, - get_serialized_body, - url_override, - http_headers, - ) - - def _build_request_with_client( - self, - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - query_params = {} - - url = url_override - if url is None: - url = utils.generate_url( - self._get_url(base_url, url_variables), - path, - request if request_has_path_params else None, - _globals if request_has_path_params else None, - ) - - query_params = utils.get_query_params( - request if request_has_query_params else None, - _globals if request_has_query_params else None, - ) - else: - # Pick up the query parameter from the override so they can be - # preserved when building the request later on (necessary as of - # httpx 0.28). - parsed_override = urlparse(str(url_override)) - query_params = parse_qs(parsed_override.query, keep_blank_values=True) - - headers = utils.get_headers(request, _globals) - headers["Accept"] = accept_header_value - headers[user_agent_header] = self.sdk_configuration.user_agent - - if security is not None: - if callable(security): - security = security() - - if security is not None: - security_headers, security_query_params = utils.get_security(security) - headers = {**headers, **security_headers} - query_params = {**query_params, **security_query_params} - - serialized_request_body = SerializedRequestBody() - if get_serialized_body is not None: - rb = get_serialized_body() - if request_body_required and rb is None: - raise ValueError("request body is required") - - if rb is not None: - serialized_request_body = rb - - if ( - serialized_request_body.media_type is not None - and serialized_request_body.media_type - not in ( - "multipart/form-data", - "multipart/mixed", - ) - ): - headers["content-type"] = serialized_request_body.media_type - - if http_headers is not None: - for header, value in http_headers.items(): - headers[header] = value - - timeout = timeout_ms / 1000 if timeout_ms is not None else None - - return client.build_request( - method, - url, - params=query_params, - content=serialized_request_body.content, - data=serialized_request_body.data, - files=serialized_request_body.files, - headers=headers, - timeout=timeout, - ) - - def do_request( - self, - hook_ctx, - request, - error_status_codes, - stream=False, - retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, - ) -> httpx.Response: - client = self.sdk_configuration.client - logger = self.sdk_configuration.debug_logger - - def do(): - http_res = None - try: - req = self.sdk_configuration.get_hooks().before_request( - BeforeRequestContext(hook_ctx), request - ) - logger.debug( - "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", - req.method, - req.url, - req.headers, - get_body_content(req), - ) - - if client is None: - raise ValueError("client is required") - - http_res = client.send(req, stream=stream) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), None, e - ) - if e is not None: - logger.debug("Request Exception", exc_info=True) - raise e - - if http_res is None: - logger.debug("Raising no response SDK error") - raise models.SDKError("No response received") - - logger.debug( - "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", - http_res.status_code, - http_res.url, - http_res.headers, - "" if stream else http_res.text, - ) - - if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), http_res, None - ) - if err is not None: - logger.debug("Request Exception", exc_info=True) - raise err - if result is not None: - http_res = result - else: - logger.debug("Raising unexpected SDK error") - raise models.SDKError("Unexpected error occurred") - - return http_res - - if retry_config is not None: - http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) - else: - http_res = do() - - if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = self.sdk_configuration.get_hooks().after_success( - AfterSuccessContext(hook_ctx), http_res - ) - - return http_res - - async def do_request_async( - self, - hook_ctx, - request, - error_status_codes, - stream=False, - retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, - ) -> httpx.Response: - client = self.sdk_configuration.async_client - logger = self.sdk_configuration.debug_logger - - async def do(): - http_res = None - try: - req = self.sdk_configuration.get_hooks().before_request( - BeforeRequestContext(hook_ctx), request - ) - logger.debug( - "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", - req.method, - req.url, - req.headers, - get_body_content(req), - ) - - if client is None: - raise ValueError("client is required") - - http_res = await client.send(req, stream=stream) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), None, e - ) - if e is not None: - logger.debug("Request Exception", exc_info=True) - raise e - - if http_res is None: - logger.debug("Raising no response SDK error") - raise models.SDKError("No response received") - - logger.debug( - "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", - http_res.status_code, - http_res.url, - http_res.headers, - "" if stream else http_res.text, - ) - - if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = self.sdk_configuration.get_hooks().after_error( - AfterErrorContext(hook_ctx), http_res, None - ) - if err is not None: - logger.debug("Request Exception", exc_info=True) - raise err - if result is not None: - http_res = result - else: - logger.debug("Raising unexpected SDK error") - raise models.SDKError("Unexpected error occurred") - - return http_res - - if retry_config is not None: - http_res = await utils.retry_async( - do, utils.Retries(retry_config[0], retry_config[1]) - ) - else: - http_res = await do() - - if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = self.sdk_configuration.get_hooks().after_success( - AfterSuccessContext(hook_ctx), http_res - ) - - return http_res diff --git a/packages/mistralai_gcp/src/mistralai_gcp/chat.py b/packages/mistralai_gcp/src/mistralai_gcp/chat.py deleted file mode 100644 index dba369bf..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/chat.py +++ /dev/null @@ -1,692 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai_gcp import models, utils -from mistralai_gcp._hooks import HookContext -from mistralai_gcp.types import OptionalNullable, UNSET -from mistralai_gcp.utils import eventstreaming -from typing import Any, List, Mapping, Optional, Union - - -class Chat(BaseSDK): - r"""Chat Completion API.""" - - def stream( - self, - *, - model: str, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionStreamRequestToolChoice, - models.ChatCompletionStreamRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[eventstreaming.EventStream[models.CompletionEvent]]: - r"""Stream chat completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model(messages, List[models.Messages]), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - ) - - req = self._build_request( - method="POST", - path="/streamRawPredict", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="stream_chat", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def stream_async( - self, - *, - model: str, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionStreamRequestToolChoice, - models.ChatCompletionStreamRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[eventstreaming.EventStreamAsync[models.CompletionEvent]]: - r"""Stream chat completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model(messages, List[models.Messages]), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - ) - - req = self._build_request_async( - method="POST", - path="/streamRawPredict", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="stream_chat", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - def complete( - self, - *, - model: str, - messages: Union[ - List[models.ChatCompletionRequestMessages], - List[models.ChatCompletionRequestMessagesTypedDict], - ], - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.ChatCompletionRequestStop, - models.ChatCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionRequestToolChoice, - models.ChatCompletionRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.ChatCompletionResponse]: - r"""Chat Completion - - :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - ) - - req = self._build_request( - method="POST", - path="/rawPredict", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="chat_completion_v1_chat_completions_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, Optional[models.ChatCompletionResponse] - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def complete_async( - self, - *, - model: str, - messages: Union[ - List[models.ChatCompletionRequestMessages], - List[models.ChatCompletionRequestMessagesTypedDict], - ], - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.ChatCompletionRequestStop, - models.ChatCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionRequestToolChoice, - models.ChatCompletionRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.ChatCompletionResponse]: - r"""Chat Completion - - :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - ) - - req = self._build_request_async( - method="POST", - path="/rawPredict", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="chat_completion_v1_chat_completions_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, Optional[models.ChatCompletionResponse] - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/fim.py b/packages/mistralai_gcp/src/mistralai_gcp/fim.py deleted file mode 100644 index 84821c6a..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/fim.py +++ /dev/null @@ -1,556 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai_gcp import models, utils -from mistralai_gcp._hooks import HookContext -from mistralai_gcp.types import OptionalNullable, UNSET -from mistralai_gcp.utils import eventstreaming -from typing import Any, Mapping, Optional, Union - - -class Fim(BaseSDK): - r"""Fill-in-the-middle API.""" - - def stream( - self, - *, - model: str, - prompt: str, - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[ - Union[ - models.FIMCompletionStreamRequestStop, - models.FIMCompletionStreamRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - suffix: OptionalNullable[str] = UNSET, - min_tokens: OptionalNullable[int] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[eventstreaming.EventStream[models.CompletionEvent]]: - r"""Stream fim completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param model: ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` - :param prompt: The text/code to complete. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. - :param min_tokens: The minimum number of tokens to generate in the completion. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FIMCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - prompt=prompt, - suffix=suffix, - min_tokens=min_tokens, - ) - - req = self._build_request( - method="POST", - path="/streamRawPredict#fim", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.FIMCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="stream_fim", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def stream_async( - self, - *, - model: str, - prompt: str, - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[ - Union[ - models.FIMCompletionStreamRequestStop, - models.FIMCompletionStreamRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - suffix: OptionalNullable[str] = UNSET, - min_tokens: OptionalNullable[int] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[eventstreaming.EventStreamAsync[models.CompletionEvent]]: - r"""Stream fim completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param model: ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` - :param prompt: The text/code to complete. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. - :param min_tokens: The minimum number of tokens to generate in the completion. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FIMCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - prompt=prompt, - suffix=suffix, - min_tokens=min_tokens, - ) - - req = self._build_request_async( - method="POST", - path="/streamRawPredict#fim", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.FIMCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="stream_fim", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = utils.unmarshal_json( - http_res_text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - def complete( - self, - *, - model: str, - prompt: str, - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.FIMCompletionRequestStop, - models.FIMCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - suffix: OptionalNullable[str] = UNSET, - min_tokens: OptionalNullable[int] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.FIMCompletionResponse]: - r"""Fim Completion - - FIM completion. - - :param model: ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` - :param prompt: The text/code to complete. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. - :param min_tokens: The minimum number of tokens to generate in the completion. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FIMCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - prompt=prompt, - suffix=suffix, - min_tokens=min_tokens, - ) - - req = self._build_request( - method="POST", - path="/rawPredict#fim", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.FIMCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="fim_completion_v1_fim_completions_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, Optional[models.FIMCompletionResponse] - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def complete_async( - self, - *, - model: str, - prompt: str, - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.FIMCompletionRequestStop, - models.FIMCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - suffix: OptionalNullable[str] = UNSET, - min_tokens: OptionalNullable[int] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> Optional[models.FIMCompletionResponse]: - r"""Fim Completion - - FIM completion. - - :param model: ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` - :param prompt: The text/code to complete. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. - :param min_tokens: The minimum number of tokens to generate in the completion. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FIMCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - prompt=prompt, - suffix=suffix, - min_tokens=min_tokens, - ) - - req = self._build_request_async( - method="POST", - path="/rawPredict#fim", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.FIMCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="fim_completion_v1_fim_completions_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, Optional[models.FIMCompletionResponse] - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, models.HTTPValidationErrorData - ) - raise models.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/httpclient.py b/packages/mistralai_gcp/src/mistralai_gcp/httpclient.py deleted file mode 100644 index 1e426352..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/httpclient.py +++ /dev/null @@ -1,136 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -# pyright: reportReturnType = false -import asyncio -from concurrent.futures import ThreadPoolExecutor -from typing_extensions import Protocol, runtime_checkable -import httpx -from typing import Any, Optional, Union - - -@runtime_checkable -class HttpClient(Protocol): - def send( - self, - request: httpx.Request, - *, - stream: bool = False, - auth: Union[ - httpx._types.AuthTypes, httpx._client.UseClientDefault, None - ] = httpx.USE_CLIENT_DEFAULT, - follow_redirects: Union[ - bool, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - ) -> httpx.Response: - pass - - def build_request( - self, - method: str, - url: httpx._types.URLTypes, - *, - content: Optional[httpx._types.RequestContent] = None, - data: Optional[httpx._types.RequestData] = None, - files: Optional[httpx._types.RequestFiles] = None, - json: Optional[Any] = None, - params: Optional[httpx._types.QueryParamTypes] = None, - headers: Optional[httpx._types.HeaderTypes] = None, - cookies: Optional[httpx._types.CookieTypes] = None, - timeout: Union[ - httpx._types.TimeoutTypes, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - extensions: Optional[httpx._types.RequestExtensions] = None, - ) -> httpx.Request: - pass - - def close(self) -> None: - pass - - -@runtime_checkable -class AsyncHttpClient(Protocol): - async def send( - self, - request: httpx.Request, - *, - stream: bool = False, - auth: Union[ - httpx._types.AuthTypes, httpx._client.UseClientDefault, None - ] = httpx.USE_CLIENT_DEFAULT, - follow_redirects: Union[ - bool, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - ) -> httpx.Response: - pass - - def build_request( - self, - method: str, - url: httpx._types.URLTypes, - *, - content: Optional[httpx._types.RequestContent] = None, - data: Optional[httpx._types.RequestData] = None, - files: Optional[httpx._types.RequestFiles] = None, - json: Optional[Any] = None, - params: Optional[httpx._types.QueryParamTypes] = None, - headers: Optional[httpx._types.HeaderTypes] = None, - cookies: Optional[httpx._types.CookieTypes] = None, - timeout: Union[ - httpx._types.TimeoutTypes, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - extensions: Optional[httpx._types.RequestExtensions] = None, - ) -> httpx.Request: - pass - - async def aclose(self) -> None: - pass - - -class ClientOwner(Protocol): - client: Union[HttpClient, None] - async_client: Union[AsyncHttpClient, None] - - -def close_clients( - owner: ClientOwner, - sync_client: Union[HttpClient, None], - sync_client_supplied: bool, - async_client: Union[AsyncHttpClient, None], - async_client_supplied: bool, -) -> None: - """ - A finalizer function that is meant to be used with weakref.finalize to close - httpx clients used by an SDK so that underlying resources can be garbage - collected. - """ - - # Unset the client/async_client properties so there are no more references - # to them from the owning SDK instance and they can be reaped. - owner.client = None - owner.async_client = None - - if sync_client is not None and not sync_client_supplied: - try: - sync_client.close() - except Exception: - pass - - if async_client is not None and not async_client_supplied: - is_async = False - try: - asyncio.get_running_loop() - is_async = True - except RuntimeError: - pass - - try: - # If this function is called in an async loop then start another - # loop in a separate thread to close the async http client. - if is_async: - with ThreadPoolExecutor(max_workers=1) as executor: - future = executor.submit(asyncio.run, async_client.aclose()) - future.result() - else: - asyncio.run(async_client.aclose()) - except Exception: - pass diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py b/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py deleted file mode 100644 index 752e70e6..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py +++ /dev/null @@ -1,233 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .assistantmessage import ( - AssistantMessage, - AssistantMessageContent, - AssistantMessageContentTypedDict, - AssistantMessageRole, - AssistantMessageTypedDict, -) -from .chatcompletionchoice import ( - ChatCompletionChoice, - ChatCompletionChoiceFinishReason, - ChatCompletionChoiceTypedDict, -) -from .chatcompletionrequest import ( - ChatCompletionRequest, - ChatCompletionRequestMessages, - ChatCompletionRequestMessagesTypedDict, - ChatCompletionRequestStop, - ChatCompletionRequestStopTypedDict, - ChatCompletionRequestToolChoice, - ChatCompletionRequestToolChoiceTypedDict, - ChatCompletionRequestTypedDict, -) -from .chatcompletionresponse import ( - ChatCompletionResponse, - ChatCompletionResponseTypedDict, -) -from .chatcompletionstreamrequest import ( - ChatCompletionStreamRequest, - ChatCompletionStreamRequestToolChoice, - ChatCompletionStreamRequestToolChoiceTypedDict, - ChatCompletionStreamRequestTypedDict, - Messages, - MessagesTypedDict, - Stop, - StopTypedDict, -) -from .completionchunk import CompletionChunk, CompletionChunkTypedDict -from .completionevent import CompletionEvent, CompletionEventTypedDict -from .completionresponsestreamchoice import ( - CompletionResponseStreamChoice, - CompletionResponseStreamChoiceTypedDict, - FinishReason, -) -from .contentchunk import ContentChunk, ContentChunkTypedDict -from .deltamessage import Content, ContentTypedDict, DeltaMessage, DeltaMessageTypedDict -from .fimcompletionrequest import ( - FIMCompletionRequest, - FIMCompletionRequestStop, - FIMCompletionRequestStopTypedDict, - FIMCompletionRequestTypedDict, -) -from .fimcompletionresponse import FIMCompletionResponse, FIMCompletionResponseTypedDict -from .fimcompletionstreamrequest import ( - FIMCompletionStreamRequest, - FIMCompletionStreamRequestStop, - FIMCompletionStreamRequestStopTypedDict, - FIMCompletionStreamRequestTypedDict, -) -from .function import Function, FunctionTypedDict -from .functioncall import ( - Arguments, - ArgumentsTypedDict, - FunctionCall, - FunctionCallTypedDict, -) -from .functionname import FunctionName, FunctionNameTypedDict -from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData -from .imageurl import ImageURL, ImageURLTypedDict -from .imageurlchunk import ( - ImageURLChunk, - ImageURLChunkImageURL, - ImageURLChunkImageURLTypedDict, - ImageURLChunkType, - ImageURLChunkTypedDict, -) -from .jsonschema import JSONSchema, JSONSchemaTypedDict -from .prediction import Prediction, PredictionTypedDict -from .referencechunk import ReferenceChunk, ReferenceChunkType, ReferenceChunkTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .responseformats import ResponseFormats -from .sdkerror import SDKError -from .security import Security, SecurityTypedDict -from .systemmessage import ( - Role, - SystemMessage, - SystemMessageContent, - SystemMessageContentTypedDict, - SystemMessageTypedDict, -) -from .textchunk import TextChunk, TextChunkTypedDict, Type -from .tool import Tool, ToolTypedDict -from .toolcall import ToolCall, ToolCallTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ( - ToolMessage, - ToolMessageContent, - ToolMessageContentTypedDict, - ToolMessageRole, - ToolMessageTypedDict, -) -from .tooltypes import ToolTypes -from .usageinfo import UsageInfo, UsageInfoTypedDict -from .usermessage import ( - UserMessage, - UserMessageContent, - UserMessageContentTypedDict, - UserMessageRole, - UserMessageTypedDict, -) -from .validationerror import ( - Loc, - LocTypedDict, - ValidationError, - ValidationErrorTypedDict, -) - - -__all__ = [ - "Arguments", - "ArgumentsTypedDict", - "AssistantMessage", - "AssistantMessageContent", - "AssistantMessageContentTypedDict", - "AssistantMessageRole", - "AssistantMessageTypedDict", - "ChatCompletionChoice", - "ChatCompletionChoiceFinishReason", - "ChatCompletionChoiceTypedDict", - "ChatCompletionRequest", - "ChatCompletionRequestMessages", - "ChatCompletionRequestMessagesTypedDict", - "ChatCompletionRequestStop", - "ChatCompletionRequestStopTypedDict", - "ChatCompletionRequestToolChoice", - "ChatCompletionRequestToolChoiceTypedDict", - "ChatCompletionRequestTypedDict", - "ChatCompletionResponse", - "ChatCompletionResponseTypedDict", - "ChatCompletionStreamRequest", - "ChatCompletionStreamRequestToolChoice", - "ChatCompletionStreamRequestToolChoiceTypedDict", - "ChatCompletionStreamRequestTypedDict", - "CompletionChunk", - "CompletionChunkTypedDict", - "CompletionEvent", - "CompletionEventTypedDict", - "CompletionResponseStreamChoice", - "CompletionResponseStreamChoiceTypedDict", - "Content", - "ContentChunk", - "ContentChunkTypedDict", - "ContentTypedDict", - "DeltaMessage", - "DeltaMessageTypedDict", - "FIMCompletionRequest", - "FIMCompletionRequestStop", - "FIMCompletionRequestStopTypedDict", - "FIMCompletionRequestTypedDict", - "FIMCompletionResponse", - "FIMCompletionResponseTypedDict", - "FIMCompletionStreamRequest", - "FIMCompletionStreamRequestStop", - "FIMCompletionStreamRequestStopTypedDict", - "FIMCompletionStreamRequestTypedDict", - "FinishReason", - "Function", - "FunctionCall", - "FunctionCallTypedDict", - "FunctionName", - "FunctionNameTypedDict", - "FunctionTypedDict", - "HTTPValidationError", - "HTTPValidationErrorData", - "ImageURL", - "ImageURLChunk", - "ImageURLChunkImageURL", - "ImageURLChunkImageURLTypedDict", - "ImageURLChunkType", - "ImageURLChunkTypedDict", - "ImageURLTypedDict", - "JSONSchema", - "JSONSchemaTypedDict", - "Loc", - "LocTypedDict", - "Messages", - "MessagesTypedDict", - "Prediction", - "PredictionTypedDict", - "ReferenceChunk", - "ReferenceChunkType", - "ReferenceChunkTypedDict", - "ResponseFormat", - "ResponseFormatTypedDict", - "ResponseFormats", - "Role", - "SDKError", - "Security", - "SecurityTypedDict", - "Stop", - "StopTypedDict", - "SystemMessage", - "SystemMessageContent", - "SystemMessageContentTypedDict", - "SystemMessageTypedDict", - "TextChunk", - "TextChunkTypedDict", - "Tool", - "ToolCall", - "ToolCallTypedDict", - "ToolChoice", - "ToolChoiceEnum", - "ToolChoiceTypedDict", - "ToolMessage", - "ToolMessageContent", - "ToolMessageContentTypedDict", - "ToolMessageRole", - "ToolMessageTypedDict", - "ToolTypedDict", - "ToolTypes", - "Type", - "UsageInfo", - "UsageInfoTypedDict", - "UserMessage", - "UserMessageContent", - "UserMessageContentTypedDict", - "UserMessageRole", - "UserMessageTypedDict", - "ValidationError", - "ValidationErrorTypedDict", -] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py b/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py deleted file mode 100644 index 9147f566..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py +++ /dev/null @@ -1,77 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from .toolcall import ToolCall, ToolCallTypedDict -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -AssistantMessageContentTypedDict = TypeAliasType( - "AssistantMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -AssistantMessageContent = TypeAliasType( - "AssistantMessageContent", Union[str, List[ContentChunk]] -) - - -AssistantMessageRole = Literal["assistant"] - - -class AssistantMessageTypedDict(TypedDict): - content: NotRequired[Nullable[AssistantMessageContentTypedDict]] - tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] - prefix: NotRequired[bool] - r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - role: NotRequired[AssistantMessageRole] - - -class AssistantMessage(BaseModel): - content: OptionalNullable[AssistantMessageContent] = UNSET - - tool_calls: OptionalNullable[List[ToolCall]] = UNSET - - prefix: Optional[bool] = False - r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - - role: Optional[AssistantMessageRole] = "assistant" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["content", "tool_calls", "prefix", "role"] - nullable_fields = ["content", "tool_calls"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py b/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py deleted file mode 100644 index 9bcf1240..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from mistralai_gcp.types import BaseModel, UnrecognizedStr -from mistralai_gcp.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Literal, Union -from typing_extensions import Annotated, TypedDict - - -ChatCompletionChoiceFinishReason = Union[ - Literal["stop", "length", "model_length", "error", "tool_calls"], UnrecognizedStr -] - - -class ChatCompletionChoiceTypedDict(TypedDict): - index: int - message: AssistantMessageTypedDict - finish_reason: ChatCompletionChoiceFinishReason - - -class ChatCompletionChoice(BaseModel): - index: int - - message: AssistantMessage - - finish_reason: Annotated[ - ChatCompletionChoiceFinishReason, PlainValidator(validate_open_enum(False)) - ] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py b/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py deleted file mode 100644 index a0125c35..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py +++ /dev/null @@ -1,188 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .tool import Tool, ToolTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from mistralai_gcp.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -ChatCompletionRequestStopTypedDict = TypeAliasType( - "ChatCompletionRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -ChatCompletionRequestStop = TypeAliasType( - "ChatCompletionRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -ChatCompletionRequestMessagesTypedDict = TypeAliasType( - "ChatCompletionRequestMessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -ChatCompletionRequestMessages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -ChatCompletionRequestToolChoiceTypedDict = TypeAliasType( - "ChatCompletionRequestToolChoiceTypedDict", - Union[ToolChoiceTypedDict, ToolChoiceEnum], -) - - -ChatCompletionRequestToolChoice = TypeAliasType( - "ChatCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] -) - - -class ChatCompletionRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - messages: List[ChatCompletionRequestMessagesTypedDict] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - stop: NotRequired[ChatCompletionRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - response_format: NotRequired[ResponseFormatTypedDict] - tools: NotRequired[Nullable[List[ToolTypedDict]]] - tool_choice: NotRequired[ChatCompletionRequestToolChoiceTypedDict] - presence_penalty: NotRequired[float] - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: NotRequired[float] - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - n: NotRequired[Nullable[int]] - r"""Number of completions to return for each request, input tokens are only billed once.""" - prediction: NotRequired[PredictionTypedDict] - parallel_tool_calls: NotRequired[bool] - - -class ChatCompletionRequest(BaseModel): - model: str - r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - - messages: List[ChatCompletionRequestMessages] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = None - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = False - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - - stop: Optional[ChatCompletionRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - response_format: Optional[ResponseFormat] = None - - tools: OptionalNullable[List[Tool]] = UNSET - - tool_choice: Optional[ChatCompletionRequestToolChoice] = None - - presence_penalty: Optional[float] = None - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - - frequency_penalty: Optional[float] = None - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - - n: OptionalNullable[int] = UNSET - r"""Number of completions to return for each request, input tokens are only billed once.""" - - prediction: Optional[Prediction] = None - - parallel_tool_calls: Optional[bool] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "response_format", - "tools", - "tool_choice", - "presence_penalty", - "frequency_penalty", - "n", - "prediction", - "parallel_tool_calls", - ] - nullable_fields = ["temperature", "max_tokens", "random_seed", "tools", "n"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py b/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py deleted file mode 100644 index 0404a9d2..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_gcp.types import BaseModel -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class ChatCompletionResponseTypedDict(TypedDict): - id: str - object: str - model: str - usage: UsageInfoTypedDict - created: NotRequired[int] - choices: NotRequired[List[ChatCompletionChoiceTypedDict]] - - -class ChatCompletionResponse(BaseModel): - id: str - - object: str - - model: str - - usage: UsageInfo - - created: Optional[int] = None - - choices: Optional[List[ChatCompletionChoice]] = None diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py b/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py deleted file mode 100644 index 656f1d58..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py +++ /dev/null @@ -1,182 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .tool import Tool, ToolTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from mistralai_gcp.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str]]) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -Stop = TypeAliasType("Stop", Union[str, List[str]]) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -MessagesTypedDict = TypeAliasType( - "MessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -Messages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -ChatCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( - "ChatCompletionStreamRequestToolChoiceTypedDict", - Union[ToolChoiceTypedDict, ToolChoiceEnum], -) - - -ChatCompletionStreamRequestToolChoice = TypeAliasType( - "ChatCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] -) - - -class ChatCompletionStreamRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - messages: List[MessagesTypedDict] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - stop: NotRequired[StopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - response_format: NotRequired[ResponseFormatTypedDict] - tools: NotRequired[Nullable[List[ToolTypedDict]]] - tool_choice: NotRequired[ChatCompletionStreamRequestToolChoiceTypedDict] - presence_penalty: NotRequired[float] - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: NotRequired[float] - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - n: NotRequired[Nullable[int]] - r"""Number of completions to return for each request, input tokens are only billed once.""" - prediction: NotRequired[PredictionTypedDict] - parallel_tool_calls: NotRequired[bool] - - -class ChatCompletionStreamRequest(BaseModel): - model: str - r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - - messages: List[Messages] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = None - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = True - - stop: Optional[Stop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - response_format: Optional[ResponseFormat] = None - - tools: OptionalNullable[List[Tool]] = UNSET - - tool_choice: Optional[ChatCompletionStreamRequestToolChoice] = None - - presence_penalty: Optional[float] = None - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - - frequency_penalty: Optional[float] = None - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - - n: OptionalNullable[int] = UNSET - r"""Number of completions to return for each request, input tokens are only billed once.""" - - prediction: Optional[Prediction] = None - - parallel_tool_calls: Optional[bool] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "response_format", - "tools", - "tool_choice", - "presence_penalty", - "frequency_penalty", - "n", - "prediction", - "parallel_tool_calls", - ] - nullable_fields = ["temperature", "max_tokens", "random_seed", "tools", "n"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py b/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py deleted file mode 100644 index ca002f52..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionresponsestreamchoice import ( - CompletionResponseStreamChoice, - CompletionResponseStreamChoiceTypedDict, -) -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_gcp.types import BaseModel -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class CompletionChunkTypedDict(TypedDict): - id: str - model: str - choices: List[CompletionResponseStreamChoiceTypedDict] - object: NotRequired[str] - created: NotRequired[int] - usage: NotRequired[UsageInfoTypedDict] - - -class CompletionChunk(BaseModel): - id: str - - model: str - - choices: List[CompletionResponseStreamChoice] - - object: Optional[str] = None - - created: Optional[int] = None - - usage: Optional[UsageInfo] = None diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py b/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py deleted file mode 100644 index 33278c11..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionchunk import CompletionChunk, CompletionChunkTypedDict -from mistralai_gcp.types import BaseModel -from typing_extensions import TypedDict - - -class CompletionEventTypedDict(TypedDict): - data: CompletionChunkTypedDict - - -class CompletionEvent(BaseModel): - data: CompletionChunk diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py b/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py deleted file mode 100644 index 8d779971..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py +++ /dev/null @@ -1,59 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .deltamessage import DeltaMessage, DeltaMessageTypedDict -from mistralai_gcp.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr -from mistralai_gcp.utils import validate_open_enum -from pydantic import model_serializer -from pydantic.functional_validators import PlainValidator -from typing import Literal, Union -from typing_extensions import Annotated, TypedDict - - -FinishReason = Union[Literal["stop", "length", "error", "tool_calls"], UnrecognizedStr] - - -class CompletionResponseStreamChoiceTypedDict(TypedDict): - index: int - delta: DeltaMessageTypedDict - finish_reason: Nullable[FinishReason] - - -class CompletionResponseStreamChoice(BaseModel): - index: int - - delta: DeltaMessage - - finish_reason: Annotated[ - Nullable[FinishReason], PlainValidator(validate_open_enum(False)) - ] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [] - nullable_fields = ["finish_reason"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py b/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py deleted file mode 100644 index da5671e3..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict -from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict -from .textchunk import TextChunk, TextChunkTypedDict -from mistralai_gcp.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType - - -ContentChunkTypedDict = TypeAliasType( - "ContentChunkTypedDict", - Union[TextChunkTypedDict, ImageURLChunkTypedDict, ReferenceChunkTypedDict], -) - - -ContentChunk = Annotated[ - Union[ - Annotated[ImageURLChunk, Tag("image_url")], - Annotated[TextChunk, Tag("text")], - Annotated[ReferenceChunk, Tag("reference")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py b/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py deleted file mode 100644 index f9f0868b..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py +++ /dev/null @@ -1,67 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from .toolcall import ToolCall, ToolCallTypedDict -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ContentTypedDict = TypeAliasType( - "ContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -Content = TypeAliasType("Content", Union[str, List[ContentChunk]]) - - -class DeltaMessageTypedDict(TypedDict): - role: NotRequired[Nullable[str]] - content: NotRequired[Nullable[ContentTypedDict]] - tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] - - -class DeltaMessage(BaseModel): - role: OptionalNullable[str] = UNSET - - content: OptionalNullable[Content] = UNSET - - tool_calls: OptionalNullable[List[ToolCall]] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["role", "content", "tool_calls"] - nullable_fields = ["role", "content", "tool_calls"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py b/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py deleted file mode 100644 index 6dfb7373..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py +++ /dev/null @@ -1,131 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -FIMCompletionRequestStopTypedDict = TypeAliasType( - "FIMCompletionRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -FIMCompletionRequestStop = TypeAliasType( - "FIMCompletionRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -class FIMCompletionRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use. Only compatible for now with: - - `codestral-2405` - - `codestral-latest` - """ - prompt: str - r"""The text/code to complete.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - stop: NotRequired[FIMCompletionRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - suffix: NotRequired[Nullable[str]] - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - min_tokens: NotRequired[Nullable[int]] - r"""The minimum number of tokens to generate in the completion.""" - - -class FIMCompletionRequest(BaseModel): - model: str - r"""ID of the model to use. Only compatible for now with: - - `codestral-2405` - - `codestral-latest` - """ - - prompt: str - r"""The text/code to complete.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = 1 - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = False - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - - stop: Optional[FIMCompletionRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - suffix: OptionalNullable[str] = UNSET - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - - min_tokens: OptionalNullable[int] = UNSET - r"""The minimum number of tokens to generate in the completion.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "suffix", - "min_tokens", - ] - nullable_fields = [ - "temperature", - "max_tokens", - "random_seed", - "suffix", - "min_tokens", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py b/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py deleted file mode 100644 index a4d273a2..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai_gcp.types import BaseModel -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class FIMCompletionResponseTypedDict(TypedDict): - id: str - object: str - model: str - usage: UsageInfoTypedDict - created: NotRequired[int] - choices: NotRequired[List[ChatCompletionChoiceTypedDict]] - - -class FIMCompletionResponse(BaseModel): - id: str - - object: str - - model: str - - usage: UsageInfo - - created: Optional[int] = None - - choices: Optional[List[ChatCompletionChoice]] = None diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py b/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py deleted file mode 100644 index 406749bb..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py +++ /dev/null @@ -1,129 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -FIMCompletionStreamRequestStopTypedDict = TypeAliasType( - "FIMCompletionStreamRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -FIMCompletionStreamRequestStop = TypeAliasType( - "FIMCompletionStreamRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -class FIMCompletionStreamRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use. Only compatible for now with: - - `codestral-2405` - - `codestral-latest` - """ - prompt: str - r"""The text/code to complete.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - stop: NotRequired[FIMCompletionStreamRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - suffix: NotRequired[Nullable[str]] - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - min_tokens: NotRequired[Nullable[int]] - r"""The minimum number of tokens to generate in the completion.""" - - -class FIMCompletionStreamRequest(BaseModel): - model: str - r"""ID of the model to use. Only compatible for now with: - - `codestral-2405` - - `codestral-latest` - """ - - prompt: str - r"""The text/code to complete.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = 1 - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = True - - stop: Optional[FIMCompletionStreamRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - suffix: OptionalNullable[str] = UNSET - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - - min_tokens: OptionalNullable[int] = UNSET - r"""The minimum number of tokens to generate in the completion.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "suffix", - "min_tokens", - ] - nullable_fields = [ - "temperature", - "max_tokens", - "random_seed", - "suffix", - "min_tokens", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/function.py b/packages/mistralai_gcp/src/mistralai_gcp/models/function.py deleted file mode 100644 index 7ad1ae64..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/function.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing import Any, Dict, Optional -from typing_extensions import NotRequired, TypedDict - - -class FunctionTypedDict(TypedDict): - name: str - parameters: Dict[str, Any] - description: NotRequired[str] - strict: NotRequired[bool] - - -class Function(BaseModel): - name: str - - parameters: Dict[str, Any] - - description: Optional[str] = None - - strict: Optional[bool] = None diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py b/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py deleted file mode 100644 index 99554c88..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing import Any, Dict, Union -from typing_extensions import TypeAliasType, TypedDict - - -ArgumentsTypedDict = TypeAliasType("ArgumentsTypedDict", Union[Dict[str, Any], str]) - - -Arguments = TypeAliasType("Arguments", Union[Dict[str, Any], str]) - - -class FunctionCallTypedDict(TypedDict): - name: str - arguments: ArgumentsTypedDict - - -class FunctionCall(BaseModel): - name: str - - arguments: Arguments diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/functionname.py b/packages/mistralai_gcp/src/mistralai_gcp/models/functionname.py deleted file mode 100644 index 00ec22f5..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/functionname.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing_extensions import TypedDict - - -class FunctionNameTypedDict(TypedDict): - r"""this restriction of `Function` is used to select a specific function to call""" - - name: str - - -class FunctionName(BaseModel): - r"""this restriction of `Function` is used to select a specific function to call""" - - name: str diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py b/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py deleted file mode 100644 index 11024f85..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .validationerror import ValidationError -from mistralai_gcp import utils -from mistralai_gcp.types import BaseModel -from typing import List, Optional - - -class HTTPValidationErrorData(BaseModel): - detail: Optional[List[ValidationError]] = None - - -class HTTPValidationError(Exception): - data: HTTPValidationErrorData - - def __init__(self, data: HTTPValidationErrorData): - self.data = data - - def __str__(self) -> str: - return utils.marshal_json(self.data, HTTPValidationErrorData) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/imageurl.py b/packages/mistralai_gcp/src/mistralai_gcp/models/imageurl.py deleted file mode 100644 index e7aa11f0..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/imageurl.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class ImageURLTypedDict(TypedDict): - url: str - detail: NotRequired[Nullable[str]] - - -class ImageURL(BaseModel): - url: str - - detail: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["detail"] - nullable_fields = ["detail"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/imageurlchunk.py b/packages/mistralai_gcp/src/mistralai_gcp/models/imageurlchunk.py deleted file mode 100644 index 1fc0b808..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/imageurlchunk.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .imageurl import ImageURL, ImageURLTypedDict -from mistralai_gcp.types import BaseModel -from typing import Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ImageURLChunkImageURLTypedDict = TypeAliasType( - "ImageURLChunkImageURLTypedDict", Union[ImageURLTypedDict, str] -) - - -ImageURLChunkImageURL = TypeAliasType("ImageURLChunkImageURL", Union[ImageURL, str]) - - -ImageURLChunkType = Literal["image_url"] - - -class ImageURLChunkTypedDict(TypedDict): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURLTypedDict - type: NotRequired[ImageURLChunkType] - - -class ImageURLChunk(BaseModel): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURL - - type: Optional[ImageURLChunkType] = "image_url" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/jsonschema.py b/packages/mistralai_gcp/src/mistralai_gcp/models/jsonschema.py deleted file mode 100644 index 2529ce31..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/jsonschema.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -import pydantic -from pydantic import model_serializer -from typing import Any, Dict, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class JSONSchemaTypedDict(TypedDict): - name: str - schema_definition: Dict[str, Any] - description: NotRequired[Nullable[str]] - strict: NotRequired[bool] - - -class JSONSchema(BaseModel): - name: str - - schema_definition: Annotated[Dict[str, Any], pydantic.Field(alias="schema")] - - description: OptionalNullable[str] = UNSET - - strict: Optional[bool] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["description", "strict"] - nullable_fields = ["description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/prediction.py b/packages/mistralai_gcp/src/mistralai_gcp/models/prediction.py deleted file mode 100644 index 742aac0b..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/prediction.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from mistralai_gcp.utils import validate_const -import pydantic -from pydantic.functional_validators import AfterValidator -from typing import Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class PredictionTypedDict(TypedDict): - type: Literal["content"] - content: NotRequired[str] - - -class Prediction(BaseModel): - TYPE: Annotated[ - Annotated[ - Optional[Literal["content"]], AfterValidator(validate_const("content")) - ], - pydantic.Field(alias="type"), - ] = "content" - - content: Optional[str] = "" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/referencechunk.py b/packages/mistralai_gcp/src/mistralai_gcp/models/referencechunk.py deleted file mode 100644 index c4fa3b8b..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/referencechunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ReferenceChunkType = Literal["reference"] - - -class ReferenceChunkTypedDict(TypedDict): - reference_ids: List[int] - type: NotRequired[ReferenceChunkType] - - -class ReferenceChunk(BaseModel): - reference_ids: List[int] - - type: Optional[ReferenceChunkType] = "reference" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py b/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py deleted file mode 100644 index 5a24f644..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .jsonschema import JSONSchema, JSONSchemaTypedDict -from .responseformats import ResponseFormats -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class ResponseFormatTypedDict(TypedDict): - type: NotRequired[ResponseFormats] - r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" - json_schema: NotRequired[Nullable[JSONSchemaTypedDict]] - - -class ResponseFormat(BaseModel): - type: Optional[ResponseFormats] = None - r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" - - json_schema: OptionalNullable[JSONSchema] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "json_schema"] - nullable_fields = ["json_schema"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/responseformats.py b/packages/mistralai_gcp/src/mistralai_gcp/models/responseformats.py deleted file mode 100644 index 08c39951..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/responseformats.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -ResponseFormats = Literal["text", "json_object", "json_schema"] -r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py b/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py deleted file mode 100644 index 03216cbf..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from dataclasses import dataclass -from typing import Optional -import httpx - - -@dataclass -class SDKError(Exception): - """Represents an error returned by the API.""" - - message: str - status_code: int = -1 - body: str = "" - raw_response: Optional[httpx.Response] = None - - def __str__(self): - body = "" - if len(self.body) > 0: - body = f"\n{self.body}" - - return f"{self.message}: Status {self.status_code}{body}" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/security.py b/packages/mistralai_gcp/src/mistralai_gcp/models/security.py deleted file mode 100644 index 38574942..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/security.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from mistralai_gcp.utils import FieldMetadata, SecurityMetadata -from typing_extensions import Annotated, TypedDict - - -class SecurityTypedDict(TypedDict): - api_key: str - - -class Security(BaseModel): - api_key: Annotated[ - str, - FieldMetadata( - security=SecurityMetadata( - scheme=True, - scheme_type="http", - sub_type="bearer", - field_name="Authorization", - ) - ), - ] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py b/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py deleted file mode 100644 index f14acf12..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .textchunk import TextChunk, TextChunkTypedDict -from mistralai_gcp.types import BaseModel -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -SystemMessageContentTypedDict = TypeAliasType( - "SystemMessageContentTypedDict", Union[str, List[TextChunkTypedDict]] -) - - -SystemMessageContent = TypeAliasType( - "SystemMessageContent", Union[str, List[TextChunk]] -) - - -Role = Literal["system"] - - -class SystemMessageTypedDict(TypedDict): - content: SystemMessageContentTypedDict - role: NotRequired[Role] - - -class SystemMessage(BaseModel): - content: SystemMessageContent - - role: Optional[Role] = "system" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py b/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py deleted file mode 100644 index 12f666cd..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -Type = Literal["text"] - - -class TextChunkTypedDict(TypedDict): - text: str - type: NotRequired[Type] - - -class TextChunk(BaseModel): - text: str - - type: Optional[Type] = "text" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py b/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py deleted file mode 100644 index a1d477da..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .function import Function, FunctionTypedDict -from .tooltypes import ToolTypes -from mistralai_gcp.types import BaseModel -from mistralai_gcp.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolTypedDict(TypedDict): - function: FunctionTypedDict - type: NotRequired[ToolTypes] - - -class Tool(BaseModel): - function: Function - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py b/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py deleted file mode 100644 index ecbac8d6..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .functioncall import FunctionCall, FunctionCallTypedDict -from .tooltypes import ToolTypes -from mistralai_gcp.types import BaseModel -from mistralai_gcp.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolCallTypedDict(TypedDict): - function: FunctionCallTypedDict - id: NotRequired[str] - type: NotRequired[ToolTypes] - index: NotRequired[int] - - -class ToolCall(BaseModel): - function: FunctionCall - - id: Optional[str] = "null" - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) - - index: Optional[int] = 0 diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoice.py b/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoice.py deleted file mode 100644 index dc213e62..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoice.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .functionname import FunctionName, FunctionNameTypedDict -from .tooltypes import ToolTypes -from mistralai_gcp.types import BaseModel -from mistralai_gcp.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolChoiceTypedDict(TypedDict): - r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" - - function: FunctionNameTypedDict - r"""this restriction of `Function` is used to select a specific function to call""" - type: NotRequired[ToolTypes] - - -class ToolChoice(BaseModel): - r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" - - function: FunctionName - r"""this restriction of `Function` is used to select a specific function to call""" - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoiceenum.py b/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoiceenum.py deleted file mode 100644 index 8e6a6ad8..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoiceenum.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -ToolChoiceEnum = Literal["auto", "none", "any", "required"] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py b/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py deleted file mode 100644 index 886b6ff1..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py +++ /dev/null @@ -1,72 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai_gcp.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ToolMessageContentTypedDict = TypeAliasType( - "ToolMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]]) - - -ToolMessageRole = Literal["tool"] - - -class ToolMessageTypedDict(TypedDict): - content: Nullable[ToolMessageContentTypedDict] - tool_call_id: NotRequired[Nullable[str]] - name: NotRequired[Nullable[str]] - role: NotRequired[ToolMessageRole] - - -class ToolMessage(BaseModel): - content: Nullable[ToolMessageContent] - - tool_call_id: OptionalNullable[str] = UNSET - - name: OptionalNullable[str] = UNSET - - role: Optional[ToolMessageRole] = "tool" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["tool_call_id", "name", "role"] - nullable_fields = ["content", "tool_call_id", "name"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/tooltypes.py b/packages/mistralai_gcp/src/mistralai_gcp/models/tooltypes.py deleted file mode 100644 index 878444c6..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/tooltypes.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import UnrecognizedStr -from typing import Literal, Union - - -ToolTypes = Union[Literal["function"], UnrecognizedStr] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py b/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py deleted file mode 100644 index 9de6af7e..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing_extensions import TypedDict - - -class UsageInfoTypedDict(TypedDict): - prompt_tokens: int - completion_tokens: int - total_tokens: int - - -class UsageInfo(BaseModel): - prompt_tokens: int - - completion_tokens: int - - total_tokens: int diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py b/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py deleted file mode 100644 index 287bb1b4..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py +++ /dev/null @@ -1,60 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai_gcp.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -UserMessageContentTypedDict = TypeAliasType( - "UserMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]]) - - -UserMessageRole = Literal["user"] - - -class UserMessageTypedDict(TypedDict): - content: Nullable[UserMessageContentTypedDict] - role: NotRequired[UserMessageRole] - - -class UserMessage(BaseModel): - content: Nullable[UserMessageContent] - - role: Optional[UserMessageRole] = "user" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["role"] - nullable_fields = ["content"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in self.model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py b/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py deleted file mode 100644 index 033d4b63..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai_gcp.types import BaseModel -from typing import List, Union -from typing_extensions import TypeAliasType, TypedDict - - -LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int]) - - -Loc = TypeAliasType("Loc", Union[str, int]) - - -class ValidationErrorTypedDict(TypedDict): - loc: List[LocTypedDict] - msg: str - type: str - - -class ValidationError(BaseModel): - loc: List[Loc] - - msg: str - - type: str diff --git a/packages/mistralai_gcp/src/mistralai_gcp/sdk.py b/packages/mistralai_gcp/src/mistralai_gcp/sdk.py deleted file mode 100644 index dd93cc7f..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/sdk.py +++ /dev/null @@ -1,231 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import json -import weakref -from typing import Any, Optional, cast - -import google.auth -import google.auth.credentials -import google.auth.transport -import google.auth.transport.requests -import httpx - -from mistralai_gcp import models -from mistralai_gcp._hooks import BeforeRequestHook, SDKHooks -from mistralai_gcp.chat import Chat -from mistralai_gcp.fim import Fim -from mistralai_gcp.types import UNSET, OptionalNullable - -from .basesdk import BaseSDK -from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients -from .sdkconfiguration import SDKConfiguration -from .utils.logger import Logger, get_default_logger -from .utils.retries import RetryConfig - -LEGACY_MODEL_ID_FORMAT = { - "codestral-2405": "codestral@2405", - "mistral-large-2407": "mistral-large@2407", - "mistral-nemo-2407": "mistral-nemo@2407", -} - - -def get_model_info(model: str) -> tuple[str, str]: - # if the model requiers the legacy fomat, use it, else do nothing. - if model in LEGACY_MODEL_ID_FORMAT: - return "-".join(model.split("-")[:-1]), LEGACY_MODEL_ID_FORMAT[model] - return model, model - - -class MistralGoogleCloud(BaseSDK): - r"""Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.""" - - chat: Chat - r"""Chat Completion API.""" - fim: Fim - r"""Fill-in-the-middle API.""" - - def __init__( - self, - region: str = "europe-west4", - project_id: Optional[str] = None, - access_token: Optional[str] = None, - client: Optional[HttpClient] = None, - async_client: Optional[AsyncHttpClient] = None, - retry_config: OptionalNullable[RetryConfig] = UNSET, - timeout_ms: Optional[int] = None, - debug_logger: Optional[Logger] = None, - ) -> None: - r"""Instantiates the SDK configuring it with the provided parameters. - - :param api_key: The api_key required for authentication - :param server: The server by name to use for all methods - :param server_url: The server URL to use for all methods - :param url_params: Parameters to optionally template the server URL with - :param client: The HTTP client to use for all synchronous methods - :param async_client: The Async HTTP client to use for all asynchronous methods - :param retry_config: The retry configuration to use for all supported methods - :param timeout_ms: Optional request timeout applied to each operation in milliseconds - """ - - if not access_token: - credentials, loaded_project_id = google.auth.default( - scopes=["https://www.googleapis.com/auth/cloud-platform"], - ) - credentials.refresh(google.auth.transport.requests.Request()) - - if not isinstance(credentials, google.auth.credentials.Credentials): - raise models.SDKError( - "credentials must be an instance of google.auth.credentials.Credentials" - ) - - project_id = project_id or loaded_project_id - - if project_id is None: - raise models.SDKError("project_id must be provided") - - def auth_token() -> str: - if access_token: - return access_token - - credentials.refresh(google.auth.transport.requests.Request()) - token = credentials.token - if not token: - raise models.SDKError("Failed to get token from credentials") - return token - - client_supplied = True - if client is None: - client = httpx.Client() - client_supplied = False - - assert issubclass( - type(client), HttpClient - ), "The provided client must implement the HttpClient protocol." - - async_client_supplied = True - if async_client is None: - async_client = httpx.AsyncClient() - async_client_supplied = False - - if debug_logger is None: - debug_logger = get_default_logger() - - assert issubclass( - type(async_client), AsyncHttpClient - ), "The provided async_client must implement the AsyncHttpClient protocol." - - security: Any = None - if callable(auth_token): - security = lambda: models.Security( # pylint: disable=unnecessary-lambda-assignment - api_key=auth_token() - ) - else: - security = models.Security(api_key=auth_token) - - BaseSDK.__init__( - self, - SDKConfiguration( - client=client, - client_supplied=client_supplied, - async_client=async_client, - async_client_supplied=async_client_supplied, - security=security, - server_url=f"https://{region}-aiplatform.googleapis.com", - server=None, - retry_config=retry_config, - timeout_ms=timeout_ms, - debug_logger=debug_logger, - ), - ) - - hooks = SDKHooks() - hook = GoogleCloudBeforeRequestHook(region, project_id) - hooks.register_before_request_hook(hook) - current_server_url, *_ = self.sdk_configuration.get_server_details() - server_url, self.sdk_configuration.client = hooks.sdk_init( - current_server_url, client - ) - if current_server_url != server_url: - self.sdk_configuration.server_url = server_url - - # pylint: disable=protected-access - self.sdk_configuration.__dict__["_hooks"] = hooks - - weakref.finalize( - self, - close_clients, - cast(ClientOwner, self.sdk_configuration), - self.sdk_configuration.client, - self.sdk_configuration.client_supplied, - self.sdk_configuration.async_client, - self.sdk_configuration.async_client_supplied, - ) - - self._init_sdks() - - def _init_sdks(self): - self.chat = Chat(self.sdk_configuration) - self.fim = Fim(self.sdk_configuration) - - def __enter__(self): - return self - - async def __aenter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - if ( - self.sdk_configuration.client is not None - and not self.sdk_configuration.client_supplied - ): - self.sdk_configuration.client.close() - self.sdk_configuration.client = None - - async def __aexit__(self, exc_type, exc_val, exc_tb): - if ( - self.sdk_configuration.async_client is not None - and not self.sdk_configuration.async_client_supplied - ): - await self.sdk_configuration.async_client.aclose() - self.sdk_configuration.async_client = None - - -class GoogleCloudBeforeRequestHook(BeforeRequestHook): - def __init__(self, region: str, project_id: str): - self.region = region - self.project_id = project_id - - def before_request( - self, hook_ctx, request: httpx.Request - ) -> httpx.Request | Exception: - # The goal of this function is to template in the region, project and model into the URL path - # We do this here so that the API remains more user-friendly - model_id = None - new_content = None - if request.content: - parsed = json.loads(request.content.decode("utf-8")) - model_raw = parsed.get("model") - model_name, model_id = get_model_info(model_raw) - parsed["model"] = model_name - new_content = json.dumps(parsed).encode("utf-8") - - if model_id == "": - raise models.SDKError("model must be provided") - - stream = "streamRawPredict" in request.url.path - specifier = "streamRawPredict" if stream else "rawPredict" - url = f"/v1/projects/{self.project_id}/locations/{self.region}/publishers/mistralai/models/{model_id}:{specifier}" - - headers = dict(request.headers) - # Delete content-length header as it will need to be recalculated - headers.pop("content-length", None) - - next_request = httpx.Request( - method=request.method, - url=request.url.copy_with(path=url), - headers=headers, - content=new_content, - stream=None, - ) - - return next_request diff --git a/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py b/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py deleted file mode 100644 index c373d27d..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py +++ /dev/null @@ -1,60 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from ._hooks import SDKHooks -from ._version import ( - __gen_version__, - __openapi_doc_version__, - __user_agent__, - __version__, -) -from .httpclient import AsyncHttpClient, HttpClient -from .utils import Logger, RetryConfig, remove_suffix -from dataclasses import dataclass -from mistralai_gcp import models -from mistralai_gcp.types import OptionalNullable, UNSET -from pydantic import Field -from typing import Callable, Dict, Optional, Tuple, Union - - -SERVER_EU = "eu" -r"""EU Production server""" -SERVERS = { - SERVER_EU: "https://api.mistral.ai", -} -"""Contains the list of servers available to the SDK""" - - -@dataclass -class SDKConfiguration: - client: Union[HttpClient, None] - client_supplied: bool - async_client: Union[AsyncHttpClient, None] - async_client_supplied: bool - debug_logger: Logger - security: Optional[Union[models.Security, Callable[[], models.Security]]] = None - server_url: Optional[str] = "" - server: Optional[str] = "" - language: str = "python" - openapi_doc_version: str = __openapi_doc_version__ - sdk_version: str = __version__ - gen_version: str = __gen_version__ - user_agent: str = __user_agent__ - retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) - timeout_ms: Optional[int] = None - - def __post_init__(self): - self._hooks = SDKHooks() - - def get_server_details(self) -> Tuple[str, Dict[str, str]]: - if self.server_url is not None and self.server_url: - return remove_suffix(self.server_url, "/"), {} - if not self.server: - self.server = SERVER_EU - - if self.server not in SERVERS: - raise ValueError(f'Invalid server "{self.server}"') - - return SERVERS[self.server], {} - - def get_hooks(self) -> SDKHooks: - return self._hooks diff --git a/packages/mistralai_gcp/src/mistralai_gcp/types/basemodel.py b/packages/mistralai_gcp/src/mistralai_gcp/types/basemodel.py deleted file mode 100644 index a6187efa..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/types/basemodel.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from pydantic import ConfigDict, model_serializer -from pydantic import BaseModel as PydanticBaseModel -from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType -from typing_extensions import TypeAliasType, TypeAlias - - -class BaseModel(PydanticBaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() - ) - - -class Unset(BaseModel): - @model_serializer(mode="plain") - def serialize_model(self): - return UNSET_SENTINEL - - def __bool__(self) -> Literal[False]: - return False - - -UNSET = Unset() -UNSET_SENTINEL = "~?~unset~?~sentinel~?~" - - -T = TypeVar("T") -if TYPE_CHECKING: - Nullable: TypeAlias = Union[T, None] - OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] -else: - Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) - OptionalNullable = TypeAliasType( - "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) - ) - -UnrecognizedInt = NewType("UnrecognizedInt", int) -UnrecognizedStr = NewType("UnrecognizedStr", str) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py deleted file mode 100644 index 3cded8fe..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py +++ /dev/null @@ -1,99 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .annotations import get_discriminator -from .enums import OpenEnumMeta -from .headers import get_headers, get_response_headers -from .metadata import ( - FieldMetadata, - find_metadata, - FormMetadata, - HeaderMetadata, - MultipartFormMetadata, - PathParamMetadata, - QueryParamMetadata, - RequestMetadata, - SecurityMetadata, -) -from .queryparams import get_query_params -from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig -from .requestbodies import serialize_request_body, SerializedRequestBody -from .security import get_security -from .serializers import ( - get_pydantic_model, - marshal_json, - unmarshal, - unmarshal_json, - serialize_decimal, - serialize_float, - serialize_int, - stream_to_text, - stream_to_text_async, - stream_to_bytes, - stream_to_bytes_async, - validate_const, - validate_decimal, - validate_float, - validate_int, - validate_open_enum, -) -from .url import generate_url, template_url, remove_suffix -from .values import ( - get_global_from_env, - match_content_type, - match_status_codes, - match_response, - cast_partial, -) -from .logger import Logger, get_body_content, get_default_logger - -__all__ = [ - "BackoffStrategy", - "FieldMetadata", - "find_metadata", - "FormMetadata", - "generate_url", - "get_body_content", - "get_default_logger", - "get_discriminator", - "get_global_from_env", - "get_headers", - "get_pydantic_model", - "get_query_params", - "get_response_headers", - "get_security", - "HeaderMetadata", - "Logger", - "marshal_json", - "match_content_type", - "match_status_codes", - "match_response", - "MultipartFormMetadata", - "OpenEnumMeta", - "PathParamMetadata", - "QueryParamMetadata", - "remove_suffix", - "Retries", - "retry", - "retry_async", - "RetryConfig", - "RequestMetadata", - "SecurityMetadata", - "serialize_decimal", - "serialize_float", - "serialize_int", - "serialize_request_body", - "SerializedRequestBody", - "stream_to_text", - "stream_to_text_async", - "stream_to_bytes", - "stream_to_bytes_async", - "template_url", - "unmarshal", - "unmarshal_json", - "validate_decimal", - "validate_const", - "validate_float", - "validate_int", - "validate_open_enum", - "cast_partial", -] diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py deleted file mode 100644 index 387874ed..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from enum import Enum -from typing import Any, Optional - -def get_discriminator(model: Any, fieldname: str, key: str) -> str: - """ - Recursively search for the discriminator attribute in a model. - - Args: - model (Any): The model to search within. - fieldname (str): The name of the field to search for. - key (str): The key to search for in dictionaries. - - Returns: - str: The name of the discriminator attribute. - - Raises: - ValueError: If the discriminator attribute is not found. - """ - upper_fieldname = fieldname.upper() - - def get_field_discriminator(field: Any) -> Optional[str]: - """Search for the discriminator attribute in a given field.""" - - if isinstance(field, dict): - if key in field: - return f'{field[key]}' - - if hasattr(field, fieldname): - attr = getattr(field, fieldname) - if isinstance(attr, Enum): - return f'{attr.value}' - return f'{attr}' - - if hasattr(field, upper_fieldname): - attr = getattr(field, upper_fieldname) - if isinstance(attr, Enum): - return f'{attr.value}' - return f'{attr}' - - return None - - - if isinstance(model, list): - for field in model: - discriminator = get_field_discriminator(field) - if discriminator is not None: - return discriminator - - discriminator = get_field_discriminator(model) - if discriminator is not None: - return discriminator - - raise ValueError(f'Could not find discriminator field {fieldname} in {model}') diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py deleted file mode 100644 index c650b10c..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import enum - - -class OpenEnumMeta(enum.EnumMeta): - def __call__( - cls, value, names=None, *, module=None, qualname=None, type=None, start=1 - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin - - if names is not None: - return super().__call__( - value, - names=names, - module=module, - qualname=qualname, - type=type, - start=start, - ) - - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - module=module, - qualname=qualname, - type=type, - start=start, - ) - except ValueError: - return value diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/eventstreaming.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/eventstreaming.py deleted file mode 100644 index 74a63f75..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/eventstreaming.py +++ /dev/null @@ -1,238 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import re -import json -from typing import ( - Callable, - Generic, - TypeVar, - Optional, - Generator, - AsyncGenerator, - Tuple, -) -import httpx - -T = TypeVar("T") - - -class EventStream(Generic[T]): - response: httpx.Response - generator: Generator[T, None, None] - - def __init__( - self, - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, - ): - self.response = response - self.generator = stream_events(response, decoder, sentinel) - - def __iter__(self): - return self - - def __next__(self): - return next(self.generator) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - self.response.close() - - -class EventStreamAsync(Generic[T]): - response: httpx.Response - generator: AsyncGenerator[T, None] - - def __init__( - self, - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, - ): - self.response = response - self.generator = stream_events_async(response, decoder, sentinel) - - def __aiter__(self): - return self - - async def __anext__(self): - return await self.generator.__anext__() - - async def __aenter__(self): - return self - - async def __aexit__(self, exc_type, exc_val, exc_tb): - await self.response.aclose() - - -class ServerEvent: - id: Optional[str] = None - event: Optional[str] = None - data: Optional[str] = None - retry: Optional[int] = None - - -MESSAGE_BOUNDARIES = [ - b"\r\n\r\n", - b"\n\n", - b"\r\r", -] - - -async def stream_events_async( - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, -) -> AsyncGenerator[T, None]: - buffer = bytearray() - position = 0 - discard = False - async for chunk in response.aiter_bytes(): - # We've encountered the sentinel value and should no longer process - # incoming data. Instead we throw new data away until the server closes - # the connection. - if discard: - continue - - buffer += chunk - for i in range(position, len(buffer)): - char = buffer[i : i + 1] - seq: Optional[bytes] = None - if char in [b"\r", b"\n"]: - for boundary in MESSAGE_BOUNDARIES: - seq = _peek_sequence(i, buffer, boundary) - if seq is not None: - break - if seq is None: - continue - - block = buffer[position:i] - position = i + len(seq) - event, discard = _parse_event(block, decoder, sentinel) - if event is not None: - yield event - - if position > 0: - buffer = buffer[position:] - position = 0 - - event, discard = _parse_event(buffer, decoder, sentinel) - if event is not None: - yield event - - -def stream_events( - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, -) -> Generator[T, None, None]: - buffer = bytearray() - position = 0 - discard = False - for chunk in response.iter_bytes(): - # We've encountered the sentinel value and should no longer process - # incoming data. Instead we throw new data away until the server closes - # the connection. - if discard: - continue - - buffer += chunk - for i in range(position, len(buffer)): - char = buffer[i : i + 1] - seq: Optional[bytes] = None - if char in [b"\r", b"\n"]: - for boundary in MESSAGE_BOUNDARIES: - seq = _peek_sequence(i, buffer, boundary) - if seq is not None: - break - if seq is None: - continue - - block = buffer[position:i] - position = i + len(seq) - event, discard = _parse_event(block, decoder, sentinel) - if event is not None: - yield event - - if position > 0: - buffer = buffer[position:] - position = 0 - - event, discard = _parse_event(buffer, decoder, sentinel) - if event is not None: - yield event - - -def _parse_event( - raw: bytearray, decoder: Callable[[str], T], sentinel: Optional[str] = None -) -> Tuple[Optional[T], bool]: - block = raw.decode() - lines = re.split(r"\r?\n|\r", block) - publish = False - event = ServerEvent() - data = "" - for line in lines: - if not line: - continue - - delim = line.find(":") - if delim <= 0: - continue - - field = line[0:delim] - value = line[delim + 1 :] if delim < len(line) - 1 else "" - if len(value) and value[0] == " ": - value = value[1:] - - if field == "event": - event.event = value - publish = True - elif field == "data": - data += value + "\n" - publish = True - elif field == "id": - event.id = value - publish = True - elif field == "retry": - event.retry = int(value) if value.isdigit() else None - publish = True - - if sentinel and data == f"{sentinel}\n": - return None, True - - if data: - data = data[:-1] - event.data = data - - data_is_primitive = ( - data.isnumeric() or data == "true" or data == "false" or data == "null" - ) - data_is_json = ( - data.startswith("{") or data.startswith("[") or data.startswith('"') - ) - - if data_is_primitive or data_is_json: - try: - event.data = json.loads(data) - except Exception: - pass - - out = None - if publish: - out = decoder(json.dumps(event.__dict__)) - - return out, False - - -def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): - if len(sequence) > (len(buffer) - position): - return None - - for i, seq in enumerate(sequence): - if buffer[position + i] != seq: - return None - - return sequence diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py deleted file mode 100644 index 0472aba8..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py +++ /dev/null @@ -1,202 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import ( - Any, - Dict, - get_type_hints, - List, - Tuple, -) -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .serializers import marshal_json - -from .metadata import ( - FormMetadata, - MultipartFormMetadata, - find_field_metadata, -) -from .values import _is_set, _val_to_string - - -def _populate_form( - field_name: str, - explode: bool, - obj: Any, - delimiter: str, - form: Dict[str, List[str]], -): - if not _is_set(obj): - return form - - if isinstance(obj, BaseModel): - items = [] - - obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields - for name in obj_fields: - obj_field = obj_fields[name] - obj_field_name = obj_field.alias if obj_field.alias is not None else name - if obj_field_name == "": - continue - - val = getattr(obj, name) - if not _is_set(val): - continue - - if explode: - form[obj_field_name] = [_val_to_string(val)] - else: - items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, Dict): - items = [] - for key, value in obj.items(): - if not _is_set(value): - continue - - if explode: - form[key] = [_val_to_string(value)] - else: - items.append(f"{key}{delimiter}{_val_to_string(value)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, List): - items = [] - - for value in obj: - if not _is_set(value): - continue - - if explode: - if not field_name in form: - form[field_name] = [] - form[field_name].append(_val_to_string(value)) - else: - items.append(_val_to_string(value)) - - if len(items) > 0: - form[field_name] = [delimiter.join([str(item) for item in items])] - else: - form[field_name] = [_val_to_string(obj)] - - return form - - -def serialize_multipart_form( - media_type: str, request: Any -) -> Tuple[str, Dict[str, Any], Dict[str, Any]]: - form: Dict[str, Any] = {} - files: Dict[str, Any] = {} - - if not isinstance(request, BaseModel): - raise TypeError("invalid request body type") - - request_fields: Dict[str, FieldInfo] = request.__class__.model_fields - request_field_types = get_type_hints(request.__class__) - - for name in request_fields: - field = request_fields[name] - - val = getattr(request, name) - if not _is_set(val): - continue - - field_metadata = find_field_metadata(field, MultipartFormMetadata) - if not field_metadata: - continue - - f_name = field.alias if field.alias else name - - if field_metadata.file: - file_fields: Dict[str, FieldInfo] = val.__class__.model_fields - - file_name = "" - content = None - content_type = None - - for file_field_name in file_fields: - file_field = file_fields[file_field_name] - - file_metadata = find_field_metadata(file_field, MultipartFormMetadata) - if file_metadata is None: - continue - - if file_metadata.content: - content = getattr(val, file_field_name, None) - elif file_field_name == "content_type": - content_type = getattr(val, file_field_name, None) - else: - file_name = getattr(val, file_field_name) - - if file_name == "" or content is None: - raise ValueError("invalid multipart/form-data file") - - if content_type is not None: - files[f_name] = (file_name, content, content_type) - else: - files[f_name] = (file_name, content) - elif field_metadata.json: - files[f_name] = ( - None, - marshal_json(val, request_field_types[name]), - "application/json", - ) - else: - if isinstance(val, List): - values = [] - - for value in val: - if not _is_set(value): - continue - values.append(_val_to_string(value)) - - form[f_name + "[]"] = values - else: - form[f_name] = _val_to_string(val) - return media_type, form, files - - -def serialize_form_data(data: Any) -> Dict[str, Any]: - form: Dict[str, List[str]] = {} - - if isinstance(data, BaseModel): - data_fields: Dict[str, FieldInfo] = data.__class__.model_fields - data_field_types = get_type_hints(data.__class__) - for name in data_fields: - field = data_fields[name] - - val = getattr(data, name) - if not _is_set(val): - continue - - metadata = find_field_metadata(field, FormMetadata) - if metadata is None: - continue - - f_name = field.alias if field.alias is not None else name - - if metadata.json: - form[f_name] = [marshal_json(val, data_field_types[name])] - else: - if metadata.style == "form": - _populate_form( - f_name, - metadata.explode, - val, - ",", - form, - ) - else: - raise ValueError(f"Invalid form style for field {name}") - elif isinstance(data, Dict): - for key, value in data.items(): - if _is_set(value): - form[key] = [_val_to_string(value)] - else: - raise TypeError(f"Invalid request body type {type(data)} for form data") - - return form diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py deleted file mode 100644 index 37a6e7f9..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py +++ /dev/null @@ -1,205 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import ( - Any, - Dict, - get_type_hints, - List, - Optional, -) - -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .metadata import ( - QueryParamMetadata, - find_field_metadata, -) -from .values import ( - _get_serialized_params, - _is_set, - _populate_from_globals, - _val_to_string, -) -from .forms import _populate_form - - -def get_query_params( - query_params: Any, - gbls: Optional[Any] = None, -) -> Dict[str, List[str]]: - params: Dict[str, List[str]] = {} - - globals_already_populated = _populate_query_params(query_params, gbls, params, []) - if _is_set(gbls): - _populate_query_params(gbls, None, params, globals_already_populated) - - return params - - -def _populate_query_params( - query_params: Any, - gbls: Any, - query_param_values: Dict[str, List[str]], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - if not isinstance(query_params, BaseModel): - return globals_already_populated - - param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields - param_field_types = get_type_hints(query_params.__class__) - for name in param_fields: - if name in skip_fields: - continue - - field = param_fields[name] - - metadata = find_field_metadata(field, QueryParamMetadata) - if not metadata: - continue - - value = getattr(query_params, name) if _is_set(query_params) else None - - value, global_found = _populate_from_globals( - name, value, QueryParamMetadata, gbls - ) - if global_found: - globals_already_populated.append(name) - - f_name = field.alias if field.alias is not None else name - serialization = metadata.serialization - if serialization is not None: - serialized_parms = _get_serialized_params( - metadata, f_name, value, param_field_types[name] - ) - for key, value in serialized_parms.items(): - if key in query_param_values: - query_param_values[key].extend(value) - else: - query_param_values[key] = [value] - else: - style = metadata.style - if style == "deepObject": - _populate_deep_object_query_params(f_name, value, query_param_values) - elif style == "form": - _populate_delimited_query_params( - metadata, f_name, value, ",", query_param_values - ) - elif style == "pipeDelimited": - _populate_delimited_query_params( - metadata, f_name, value, "|", query_param_values - ) - else: - raise NotImplementedError( - f"query param style {style} not yet supported" - ) - - return globals_already_populated - - -def _populate_deep_object_query_params( - field_name: str, - obj: Any, - params: Dict[str, List[str]], -): - if not _is_set(obj): - return - - if isinstance(obj, BaseModel): - _populate_deep_object_query_params_basemodel(field_name, obj, params) - elif isinstance(obj, Dict): - _populate_deep_object_query_params_dict(field_name, obj, params) - - -def _populate_deep_object_query_params_basemodel( - prior_params_key: str, - obj: Any, - params: Dict[str, List[str]], -): - if not _is_set(obj) or not isinstance(obj, BaseModel): - return - - obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields - for name in obj_fields: - obj_field = obj_fields[name] - - f_name = obj_field.alias if obj_field.alias is not None else name - - params_key = f"{prior_params_key}[{f_name}]" - - obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) - if not _is_set(obj_param_metadata): - continue - - obj_val = getattr(obj, name) - if not _is_set(obj_val): - continue - - if isinstance(obj_val, BaseModel): - _populate_deep_object_query_params_basemodel(params_key, obj_val, params) - elif isinstance(obj_val, Dict): - _populate_deep_object_query_params_dict(params_key, obj_val, params) - elif isinstance(obj_val, List): - _populate_deep_object_query_params_list(params_key, obj_val, params) - else: - params[params_key] = [_val_to_string(obj_val)] - - -def _populate_deep_object_query_params_dict( - prior_params_key: str, - value: Dict, - params: Dict[str, List[str]], -): - if not _is_set(value): - return - - for key, val in value.items(): - if not _is_set(val): - continue - - params_key = f"{prior_params_key}[{key}]" - - if isinstance(val, BaseModel): - _populate_deep_object_query_params_basemodel(params_key, val, params) - elif isinstance(val, Dict): - _populate_deep_object_query_params_dict(params_key, val, params) - elif isinstance(val, List): - _populate_deep_object_query_params_list(params_key, val, params) - else: - params[params_key] = [_val_to_string(val)] - - -def _populate_deep_object_query_params_list( - params_key: str, - value: List, - params: Dict[str, List[str]], -): - if not _is_set(value): - return - - for val in value: - if not _is_set(val): - continue - - if params.get(params_key) is None: - params[params_key] = [] - - params[params_key].append(_val_to_string(val)) - - -def _populate_delimited_query_params( - metadata: QueryParamMetadata, - field_name: str, - obj: Any, - delimiter: str, - query_param_values: Dict[str, List[str]], -): - _populate_form( - field_name, - metadata.explode, - obj, - delimiter, - query_param_values, - ) diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py deleted file mode 100644 index d5240dd5..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py +++ /dev/null @@ -1,66 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import io -from dataclasses import dataclass -import re -from typing import ( - Any, - Optional, -) - -from .forms import serialize_form_data, serialize_multipart_form - -from .serializers import marshal_json - -SERIALIZATION_METHOD_TO_CONTENT_TYPE = { - "json": "application/json", - "form": "application/x-www-form-urlencoded", - "multipart": "multipart/form-data", - "raw": "application/octet-stream", - "string": "text/plain", -} - - -@dataclass -class SerializedRequestBody: - media_type: Optional[str] = None - content: Optional[Any] = None - data: Optional[Any] = None - files: Optional[Any] = None - - -def serialize_request_body( - request_body: Any, - nullable: bool, - optional: bool, - serialization_method: str, - request_body_type, -) -> Optional[SerializedRequestBody]: - if request_body is None: - if not nullable and optional: - return None - - media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] - - serialized_request_body = SerializedRequestBody(media_type) - - if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None: - serialized_request_body.content = marshal_json(request_body, request_body_type) - elif re.match(r"multipart\/.*", media_type) is not None: - ( - serialized_request_body.media_type, - serialized_request_body.data, - serialized_request_body.files, - ) = serialize_multipart_form(media_type, request_body) - elif re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None: - serialized_request_body.data = serialize_form_data(request_body) - elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): - serialized_request_body.content = request_body - elif isinstance(request_body, str): - serialized_request_body.content = request_body - else: - raise TypeError( - f"invalid request body type {type(request_body)} for mediaType {media_type}" - ) - - return serialized_request_body diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/retries.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/retries.py deleted file mode 100644 index 4d608671..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/retries.py +++ /dev/null @@ -1,217 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import asyncio -import random -import time -from typing import List - -import httpx - - -class BackoffStrategy: - initial_interval: int - max_interval: int - exponent: float - max_elapsed_time: int - - def __init__( - self, - initial_interval: int, - max_interval: int, - exponent: float, - max_elapsed_time: int, - ): - self.initial_interval = initial_interval - self.max_interval = max_interval - self.exponent = exponent - self.max_elapsed_time = max_elapsed_time - - -class RetryConfig: - strategy: str - backoff: BackoffStrategy - retry_connection_errors: bool - - def __init__( - self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool - ): - self.strategy = strategy - self.backoff = backoff - self.retry_connection_errors = retry_connection_errors - - -class Retries: - config: RetryConfig - status_codes: List[str] - - def __init__(self, config: RetryConfig, status_codes: List[str]): - self.config = config - self.status_codes = status_codes - - -class TemporaryError(Exception): - response: httpx.Response - - def __init__(self, response: httpx.Response): - self.response = response - - -class PermanentError(Exception): - inner: Exception - - def __init__(self, inner: Exception): - self.inner = inner - - -def retry(func, retries: Retries): - if retries.config.strategy == "backoff": - - def do_request() -> httpx.Response: - res: httpx.Response - try: - res = func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if code_range <= status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except httpx.ConnectError as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except httpx.TimeoutException as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return retry_with_backoff( - do_request, - retries.config.backoff.initial_interval, - retries.config.backoff.max_interval, - retries.config.backoff.exponent, - retries.config.backoff.max_elapsed_time, - ) - - return func() - - -async def retry_async(func, retries: Retries): - if retries.config.strategy == "backoff": - - async def do_request() -> httpx.Response: - res: httpx.Response - try: - res = await func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if code_range <= status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except httpx.ConnectError as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except httpx.TimeoutException as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return await retry_with_backoff_async( - do_request, - retries.config.backoff.initial_interval, - retries.config.backoff.max_interval, - retries.config.backoff.exponent, - retries.config.backoff.max_elapsed_time, - ) - - return await func() - - -def retry_with_backoff( - func, - initial_interval=500, - max_interval=60000, - exponent=1.5, - max_elapsed_time=3600000, -): - start = round(time.time() * 1000) - retries = 0 - - while True: - try: - return func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time() * 1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) - sleep = min(sleep, max_interval / 1000) - time.sleep(sleep) - retries += 1 - - -async def retry_with_backoff_async( - func, - initial_interval=500, - max_interval=60000, - exponent=1.5, - max_elapsed_time=3600000, -): - start = round(time.time() * 1000) - retries = 0 - - while True: - try: - return await func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time() * 1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) - sleep = min(sleep, max_interval / 1000) - await asyncio.sleep(sleep) - retries += 1 diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/security.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/security.py deleted file mode 100644 index 295a3f40..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/security.py +++ /dev/null @@ -1,174 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import base64 -from typing import ( - Any, - Dict, - List, - Tuple, -) -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .metadata import ( - SecurityMetadata, - find_field_metadata, -) - - -def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: - headers: Dict[str, str] = {} - query_params: Dict[str, List[str]] = {} - - if security is None: - return headers, query_params - - if not isinstance(security, BaseModel): - raise TypeError("security must be a pydantic model") - - sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields - for name in sec_fields: - sec_field = sec_fields[name] - - value = getattr(security, name) - if value is None: - continue - - metadata = find_field_metadata(sec_field, SecurityMetadata) - if metadata is None: - continue - if metadata.option: - _parse_security_option(headers, query_params, value) - return headers, query_params - if metadata.scheme: - # Special case for basic auth or custom auth which could be a flattened model - if metadata.sub_type in ["basic", "custom"] and not isinstance( - value, BaseModel - ): - _parse_security_scheme(headers, query_params, metadata, name, security) - else: - _parse_security_scheme(headers, query_params, metadata, name, value) - - return headers, query_params - - -def _parse_security_option( - headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any -): - if not isinstance(option, BaseModel): - raise TypeError("security option must be a pydantic model") - - opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields - for name in opt_fields: - opt_field = opt_fields[name] - - metadata = find_field_metadata(opt_field, SecurityMetadata) - if metadata is None or not metadata.scheme: - continue - _parse_security_scheme( - headers, query_params, metadata, name, getattr(option, name) - ) - - -def _parse_security_scheme( - headers: Dict[str, str], - query_params: Dict[str, List[str]], - scheme_metadata: SecurityMetadata, - field_name: str, - scheme: Any, -): - scheme_type = scheme_metadata.scheme_type - sub_type = scheme_metadata.sub_type - - if isinstance(scheme, BaseModel): - if scheme_type == "http": - if sub_type == "basic": - _parse_basic_auth_scheme(headers, scheme) - return - if sub_type == "custom": - return - - scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields - for name in scheme_fields: - scheme_field = scheme_fields[name] - - metadata = find_field_metadata(scheme_field, SecurityMetadata) - if metadata is None or metadata.field_name is None: - continue - - value = getattr(scheme, name) - - _parse_security_scheme_value( - headers, query_params, scheme_metadata, metadata, name, value - ) - else: - _parse_security_scheme_value( - headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme - ) - - -def _parse_security_scheme_value( - headers: Dict[str, str], - query_params: Dict[str, List[str]], - scheme_metadata: SecurityMetadata, - security_metadata: SecurityMetadata, - field_name: str, - value: Any, -): - scheme_type = scheme_metadata.scheme_type - sub_type = scheme_metadata.sub_type - - header_name = security_metadata.get_field_name(field_name) - - if scheme_type == "apiKey": - if sub_type == "header": - headers[header_name] = value - elif sub_type == "query": - query_params[header_name] = [value] - else: - raise ValueError("sub type {sub_type} not supported") - elif scheme_type == "openIdConnect": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "oauth2": - if sub_type != "client_credentials": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "http": - if sub_type == "bearer": - headers[header_name] = _apply_bearer(value) - elif sub_type == "custom": - return - else: - raise ValueError("sub type {sub_type} not supported") - else: - raise ValueError("scheme type {scheme_type} not supported") - - -def _apply_bearer(token: str) -> str: - return token.lower().startswith("bearer ") and token or f"Bearer {token}" - - -def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): - username = "" - password = "" - - if not isinstance(scheme, BaseModel): - raise TypeError("basic auth scheme must be a pydantic model") - - scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields - for name in scheme_fields: - scheme_field = scheme_fields[name] - - metadata = find_field_metadata(scheme_field, SecurityMetadata) - if metadata is None or metadata.field_name is None: - continue - - field_name = metadata.field_name - value = getattr(scheme, name) - - if field_name == "username": - username = value - if field_name == "password": - password = value - - data = f"{username}:{password}".encode() - headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py b/packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py deleted file mode 100644 index baa41fbd..00000000 --- a/packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py +++ /dev/null @@ -1,219 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from decimal import Decimal -import json -from typing import Any, Dict, List, Union, get_args -import httpx -from typing_extensions import get_origin -from pydantic import ConfigDict, create_model -from pydantic_core import from_json -from typing_inspection.typing_objects import is_union - -from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset - - -def serialize_decimal(as_str: bool): - def serialize(d): - # Optional[T] is a Union[T, None] - if is_union(type(d)) and type(None) in get_args(type(d)) and d is None: - return None - if isinstance(d, Unset): - return d - - if not isinstance(d, Decimal): - raise ValueError("Expected Decimal object") - - return str(d) if as_str else float(d) - - return serialize - - -def validate_decimal(d): - if d is None: - return None - - if isinstance(d, (Decimal, Unset)): - return d - - if not isinstance(d, (str, int, float)): - raise ValueError("Expected string, int or float") - - return Decimal(str(d)) - - -def serialize_float(as_str: bool): - def serialize(f): - # Optional[T] is a Union[T, None] - if is_union(type(f)) and type(None) in get_args(type(f)) and f is None: - return None - if isinstance(f, Unset): - return f - - if not isinstance(f, float): - raise ValueError("Expected float") - - return str(f) if as_str else f - - return serialize - - -def validate_float(f): - if f is None: - return None - - if isinstance(f, (float, Unset)): - return f - - if not isinstance(f, str): - raise ValueError("Expected string") - - return float(f) - - -def serialize_int(as_str: bool): - def serialize(i): - # Optional[T] is a Union[T, None] - if is_union(type(i)) and type(None) in get_args(type(i)) and i is None: - return None - if isinstance(i, Unset): - return i - - if not isinstance(i, int): - raise ValueError("Expected int") - - return str(i) if as_str else i - - return serialize - - -def validate_int(b): - if b is None: - return None - - if isinstance(b, (int, Unset)): - return b - - if not isinstance(b, str): - raise ValueError("Expected string") - - return int(b) - - -def validate_open_enum(is_int: bool): - def validate(e): - if e is None: - return None - - if isinstance(e, Unset): - return e - - if is_int: - if not isinstance(e, int): - raise ValueError("Expected int") - else: - if not isinstance(e, str): - raise ValueError("Expected string") - - return e - - return validate - - -def validate_const(v): - def validate(c): - # Optional[T] is a Union[T, None] - if is_union(type(c)) and type(None) in get_args(type(c)) and c is None: - return None - - if v != c: - raise ValueError(f"Expected {v}") - - return c - - return validate - - -def unmarshal_json(raw, typ: Any) -> Any: - return unmarshal(from_json(raw), typ) - - -def unmarshal(val, typ: Any) -> Any: - unmarshaller = create_model( - "Unmarshaller", - body=(typ, ...), - __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), - ) - - m = unmarshaller(body=val) - - # pyright: ignore[reportAttributeAccessIssue] - return m.body # type: ignore - - -def marshal_json(val, typ): - if is_nullable(typ) and val is None: - return "null" - - marshaller = create_model( - "Marshaller", - body=(typ, ...), - __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), - ) - - m = marshaller(body=val) - - d = m.model_dump(by_alias=True, mode="json", exclude_none=True) - - if len(d) == 0: - return "" - - return json.dumps(d[next(iter(d))], separators=(",", ":")) - - -def is_nullable(field): - origin = get_origin(field) - if origin is Nullable or origin is OptionalNullable: - return True - - if not origin is Union or type(None) not in get_args(field): - return False - - for arg in get_args(field): - if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: - return True - - return False - - -def stream_to_text(stream: httpx.Response) -> str: - return "".join(stream.iter_text()) - - -async def stream_to_text_async(stream: httpx.Response) -> str: - return "".join([chunk async for chunk in stream.aiter_text()]) - - -def stream_to_bytes(stream: httpx.Response) -> bytes: - return stream.content - - -async def stream_to_bytes_async(stream: httpx.Response) -> bytes: - return await stream.aread() - - -def get_pydantic_model(data: Any, typ: Any) -> Any: - if not _contains_pydantic_model(data): - return unmarshal(data, typ) - - return data - - -def _contains_pydantic_model(data: Any) -> bool: - if isinstance(data, BaseModel): - return True - if isinstance(data, List): - return any(_contains_pydantic_model(item) for item in data) - if isinstance(data, Dict): - return any(_contains_pydantic_model(value) for value in data.values()) - - return False diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index e3a652fa..00000000 --- a/poetry.lock +++ /dev/null @@ -1,1518 +0,0 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. - -[[package]] -name = "annotated-types" -version = "0.7.0" -description = "Reusable constraint types to use with typing.Annotated" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, - {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[[package]] -name = "anyio" -version = "4.5.2" -description = "High level compatibility layer for multiple asynchronous event loop implementations" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, - {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[package.dependencies] -exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} -idna = ">=2.8" -sniffio = ">=1.1" -typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} - -[package.extras] -doc = ["Sphinx (>=7.4,<8.0)", "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", "truststore (>=0.9.1) ; python_version >= \"3.10\"", "uvloop (>=0.21.0b1) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""] -trio = ["trio (>=0.26.1)"] - -[[package]] -name = "astroid" -version = "3.2.4" -description = "An abstract syntax tree for Python with inference support." -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, - {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} - -[[package]] -name = "authlib" -version = "1.6.0" -description = "The ultimate Python library in building OAuth and OpenID Connect servers and clients." -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -files = [ - {file = "authlib-1.6.0-py2.py3-none-any.whl", hash = "sha256:91685589498f79e8655e8a8947431ad6288831d643f11c55c2143ffcc738048d"}, - {file = "authlib-1.6.0.tar.gz", hash = "sha256:4367d32031b7af175ad3a323d571dc7257b7099d55978087ceae4a0d88cd3210"}, -] - -[package.dependencies] -cryptography = "*" - -[[package]] -name = "cachetools" -version = "5.5.0" -description = "Extensible memoizing collections and decorators" -optional = true -python-versions = ">=3.7" -groups = ["main"] -markers = "extra == \"gcp\"" -files = [ - {file = "cachetools-5.5.0-py3-none-any.whl", hash = "sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292"}, - {file = "cachetools-5.5.0.tar.gz", hash = "sha256:2cc24fb4cbe39633fb7badd9db9ca6295d766d9c2995f245725a46715d050f2a"}, -] - -[[package]] -name = "certifi" -version = "2024.8.30" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.6" -groups = ["main", "dev"] -files = [ - {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, - {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[[package]] -name = "cffi" -version = "1.17.1" -description = "Foreign Function Interface for Python calling C code." -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -markers = "platform_python_implementation != \"PyPy\"" -files = [ - {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, - {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, - {file = "cffi-1.17.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382"}, - {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702"}, - {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3"}, - {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6"}, - {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17"}, - {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8"}, - {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e"}, - {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be"}, - {file = "cffi-1.17.1-cp310-cp310-win32.whl", hash = "sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c"}, - {file = "cffi-1.17.1-cp310-cp310-win_amd64.whl", hash = "sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15"}, - {file = "cffi-1.17.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401"}, - {file = "cffi-1.17.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf"}, - {file = "cffi-1.17.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4"}, - {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41"}, - {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1"}, - {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6"}, - {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d"}, - {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6"}, - {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f"}, - {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b"}, - {file = "cffi-1.17.1-cp311-cp311-win32.whl", hash = "sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655"}, - {file = "cffi-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0"}, - {file = "cffi-1.17.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4"}, - {file = "cffi-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c"}, - {file = "cffi-1.17.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36"}, - {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5"}, - {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff"}, - {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99"}, - {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93"}, - {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3"}, - {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8"}, - {file = "cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65"}, - {file = "cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903"}, - {file = "cffi-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e"}, - {file = "cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4"}, - {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd"}, - {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed"}, - {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9"}, - {file = "cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d"}, - {file = "cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a"}, - {file = "cffi-1.17.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c"}, - {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1"}, - {file = "cffi-1.17.1-cp38-cp38-win32.whl", hash = "sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8"}, - {file = "cffi-1.17.1-cp38-cp38-win_amd64.whl", hash = "sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1"}, - {file = "cffi-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16"}, - {file = "cffi-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0"}, - {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3"}, - {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595"}, - {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a"}, - {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e"}, - {file = "cffi-1.17.1-cp39-cp39-win32.whl", hash = "sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7"}, - {file = "cffi-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662"}, - {file = "cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"}, -] - -[package.dependencies] -pycparser = "*" - -[[package]] -name = "charset-normalizer" -version = "3.4.0" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -optional = true -python-versions = ">=3.7.0" -groups = ["main"] -markers = "extra == \"gcp\"" -files = [ - {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-win32.whl", hash = "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc"}, - {file = "charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-win32.whl", hash = "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99"}, - {file = "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-win32.whl", hash = "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7"}, - {file = "charset_normalizer-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-win32.whl", hash = "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67"}, - {file = "charset_normalizer-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-win32.whl", hash = "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149"}, - {file = "charset_normalizer-3.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-win32.whl", hash = "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613"}, - {file = "charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-win32.whl", hash = "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2"}, - {file = "charset_normalizer-3.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca"}, - {file = "charset_normalizer-3.4.0-py3-none-any.whl", hash = "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079"}, - {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"}, -] - -[[package]] -name = "click" -version = "8.2.1" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.10" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "click-8.2.1-py3-none-any.whl", hash = "sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b"}, - {file = "click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["main", "dev"] -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "cryptography" -version = "43.0.3" -description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -optional = false -python-versions = ">=3.7" -groups = ["main", "dev"] -markers = "python_version == \"3.9\"" -files = [ - {file = "cryptography-43.0.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:bf7a1932ac4176486eab36a19ed4c0492da5d97123f1406cf15e41b05e787d2e"}, - {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63efa177ff54aec6e1c0aefaa1a241232dcd37413835a9b674b6e3f0ae2bfd3e"}, - {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e1ce50266f4f70bf41a2c6dc4358afadae90e2a1e5342d3c08883df1675374f"}, - {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:443c4a81bb10daed9a8f334365fe52542771f25aedaf889fd323a853ce7377d6"}, - {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:74f57f24754fe349223792466a709f8e0c093205ff0dca557af51072ff47ab18"}, - {file = "cryptography-43.0.3-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9762ea51a8fc2a88b70cf2995e5675b38d93bf36bd67d91721c309df184f49bd"}, - {file = "cryptography-43.0.3-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:81ef806b1fef6b06dcebad789f988d3b37ccaee225695cf3e07648eee0fc6b73"}, - {file = "cryptography-43.0.3-cp37-abi3-win32.whl", hash = "sha256:cbeb489927bd7af4aa98d4b261af9a5bc025bd87f0e3547e11584be9e9427be2"}, - {file = "cryptography-43.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:f46304d6f0c6ab8e52770addfa2fc41e6629495548862279641972b6215451cd"}, - {file = "cryptography-43.0.3-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:8ac43ae87929a5982f5948ceda07001ee5e83227fd69cf55b109144938d96984"}, - {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:846da004a5804145a5f441b8530b4bf35afbf7da70f82409f151695b127213d5"}, - {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f996e7268af62598f2fc1204afa98a3b5712313a55c4c9d434aef49cadc91d4"}, - {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f7b178f11ed3664fd0e995a47ed2b5ff0a12d893e41dd0494f406d1cf555cab7"}, - {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:c2e6fc39c4ab499049df3bdf567f768a723a5e8464816e8f009f121a5a9f4405"}, - {file = "cryptography-43.0.3-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e1be4655c7ef6e1bbe6b5d0403526601323420bcf414598955968c9ef3eb7d16"}, - {file = "cryptography-43.0.3-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:df6b6c6d742395dd77a23ea3728ab62f98379eff8fb61be2744d4679ab678f73"}, - {file = "cryptography-43.0.3-cp39-abi3-win32.whl", hash = "sha256:d56e96520b1020449bbace2b78b603442e7e378a9b3bd68de65c782db1507995"}, - {file = "cryptography-43.0.3-cp39-abi3-win_amd64.whl", hash = "sha256:0c580952eef9bf68c4747774cde7ec1d85a6e61de97281f2dba83c7d2c806362"}, - {file = "cryptography-43.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d03b5621a135bffecad2c73e9f4deb1a0f977b9a8ffe6f8e002bf6c9d07b918c"}, - {file = "cryptography-43.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:a2a431ee15799d6db9fe80c82b055bae5a752bef645bba795e8e52687c69efe3"}, - {file = "cryptography-43.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:281c945d0e28c92ca5e5930664c1cefd85efe80e5c0d2bc58dd63383fda29f83"}, - {file = "cryptography-43.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:f18c716be16bc1fea8e95def49edf46b82fccaa88587a45f8dc0ff6ab5d8e0a7"}, - {file = "cryptography-43.0.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4a02ded6cd4f0a5562a8887df8b3bd14e822a90f97ac5e544c162899bc467664"}, - {file = "cryptography-43.0.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:53a583b6637ab4c4e3591a15bc9db855b8d9dee9a669b550f311480acab6eb08"}, - {file = "cryptography-43.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1ec0bcf7e17c0c5669d881b1cd38c4972fade441b27bda1051665faaa89bdcaa"}, - {file = "cryptography-43.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2ce6fae5bdad59577b44e4dfed356944fbf1d925269114c28be377692643b4ff"}, - {file = "cryptography-43.0.3.tar.gz", hash = "sha256:315b9001266a492a6ff443b61238f956b214dbec9910a081ba5b6646a055a805"}, -] - -[package.dependencies] -cffi = {version = ">=1.12", markers = "platform_python_implementation != \"PyPy\""} - -[package.extras] -docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] -docstest = ["pyenchant (>=1.6.11)", "readme-renderer", "sphinxcontrib-spelling (>=4.0.1)"] -nox = ["nox"] -pep8test = ["check-sdist", "click", "mypy", "ruff"] -sdist = ["build"] -ssh = ["bcrypt (>=3.1.5)"] -test = ["certifi", "cryptography-vectors (==43.0.3)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] -test-randomorder = ["pytest-randomly"] - -[[package]] -name = "cryptography" -version = "45.0.3" -description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -optional = false -python-versions = "!=3.9.0,!=3.9.1,>=3.7" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "cryptography-45.0.3-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:7573d9eebaeceeb55285205dbbb8753ac1e962af3d9640791d12b36864065e71"}, - {file = "cryptography-45.0.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d377dde61c5d67eb4311eace661c3efda46c62113ff56bf05e2d679e02aebb5b"}, - {file = "cryptography-45.0.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fae1e637f527750811588e4582988932c222f8251f7b7ea93739acb624e1487f"}, - {file = "cryptography-45.0.3-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ca932e11218bcc9ef812aa497cdf669484870ecbcf2d99b765d6c27a86000942"}, - {file = "cryptography-45.0.3-cp311-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:af3f92b1dc25621f5fad065288a44ac790c5798e986a34d393ab27d2b27fcff9"}, - {file = "cryptography-45.0.3-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:2f8f8f0b73b885ddd7f3d8c2b2234a7d3ba49002b0223f58cfde1bedd9563c56"}, - {file = "cryptography-45.0.3-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:9cc80ce69032ffa528b5e16d217fa4d8d4bb7d6ba8659c1b4d74a1b0f4235fca"}, - {file = "cryptography-45.0.3-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:c824c9281cb628015bfc3c59335163d4ca0540d49de4582d6c2637312907e4b1"}, - {file = "cryptography-45.0.3-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:5833bb4355cb377ebd880457663a972cd044e7f49585aee39245c0d592904578"}, - {file = "cryptography-45.0.3-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9bb5bf55dcb69f7067d80354d0a348368da907345a2c448b0babc4215ccd3497"}, - {file = "cryptography-45.0.3-cp311-abi3-win32.whl", hash = "sha256:3ad69eeb92a9de9421e1f6685e85a10fbcfb75c833b42cc9bc2ba9fb00da4710"}, - {file = "cryptography-45.0.3-cp311-abi3-win_amd64.whl", hash = "sha256:97787952246a77d77934d41b62fb1b6f3581d83f71b44796a4158d93b8f5c490"}, - {file = "cryptography-45.0.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:c92519d242703b675ccefd0f0562eb45e74d438e001f8ab52d628e885751fb06"}, - {file = "cryptography-45.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5edcb90da1843df85292ef3a313513766a78fbbb83f584a5a58fb001a5a9d57"}, - {file = "cryptography-45.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:38deed72285c7ed699864f964a3f4cf11ab3fb38e8d39cfcd96710cd2b5bb716"}, - {file = "cryptography-45.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:5555365a50efe1f486eed6ac7062c33b97ccef409f5970a0b6f205a7cfab59c8"}, - {file = "cryptography-45.0.3-cp37-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:9e4253ed8f5948a3589b3caee7ad9a5bf218ffd16869c516535325fece163dcc"}, - {file = "cryptography-45.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:cfd84777b4b6684955ce86156cfb5e08d75e80dc2585e10d69e47f014f0a5342"}, - {file = "cryptography-45.0.3-cp37-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:a2b56de3417fd5f48773ad8e91abaa700b678dc7fe1e0c757e1ae340779acf7b"}, - {file = "cryptography-45.0.3-cp37-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:57a6500d459e8035e813bd8b51b671977fb149a8c95ed814989da682314d0782"}, - {file = "cryptography-45.0.3-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:f22af3c78abfbc7cbcdf2c55d23c3e022e1a462ee2481011d518c7fb9c9f3d65"}, - {file = "cryptography-45.0.3-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:232954730c362638544758a8160c4ee1b832dc011d2c41a306ad8f7cccc5bb0b"}, - {file = "cryptography-45.0.3-cp37-abi3-win32.whl", hash = "sha256:cb6ab89421bc90e0422aca911c69044c2912fc3debb19bb3c1bfe28ee3dff6ab"}, - {file = "cryptography-45.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:d54ae41e6bd70ea23707843021c778f151ca258081586f0cfa31d936ae43d1b2"}, - {file = "cryptography-45.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ed43d396f42028c1f47b5fec012e9e12631266e3825e95c00e3cf94d472dac49"}, - {file = "cryptography-45.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:fed5aaca1750e46db870874c9c273cd5182a9e9deb16f06f7bdffdb5c2bde4b9"}, - {file = "cryptography-45.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:00094838ecc7c6594171e8c8a9166124c1197b074cfca23645cee573910d76bc"}, - {file = "cryptography-45.0.3-pp310-pypy310_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:92d5f428c1a0439b2040435a1d6bc1b26ebf0af88b093c3628913dd464d13fa1"}, - {file = "cryptography-45.0.3-pp310-pypy310_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:ec64ee375b5aaa354b2b273c921144a660a511f9df8785e6d1c942967106438e"}, - {file = "cryptography-45.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:71320fbefd05454ef2d457c481ba9a5b0e540f3753354fff6f780927c25d19b0"}, - {file = "cryptography-45.0.3-pp311-pypy311_pp73-macosx_10_9_x86_64.whl", hash = "sha256:edd6d51869beb7f0d472e902ef231a9b7689508e83880ea16ca3311a00bf5ce7"}, - {file = "cryptography-45.0.3-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:555e5e2d3a53b4fabeca32835878b2818b3f23966a4efb0d566689777c5a12c8"}, - {file = "cryptography-45.0.3-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:25286aacb947286620a31f78f2ed1a32cded7be5d8b729ba3fb2c988457639e4"}, - {file = "cryptography-45.0.3-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:050ce5209d5072472971e6efbfc8ec5a8f9a841de5a4db0ebd9c2e392cb81972"}, - {file = "cryptography-45.0.3-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:dc10ec1e9f21f33420cc05214989544727e776286c1c16697178978327b95c9c"}, - {file = "cryptography-45.0.3-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:9eda14f049d7f09c2e8fb411dda17dd6b16a3c76a1de5e249188a32aeb92de19"}, - {file = "cryptography-45.0.3.tar.gz", hash = "sha256:ec21313dd335c51d7877baf2972569f40a4291b76a0ce51391523ae358d05899"}, -] - -[package.dependencies] -cffi = {version = ">=1.14", markers = "platform_python_implementation != \"PyPy\""} - -[package.extras] -docs = ["sphinx (>=5.3.0)", "sphinx-inline-tabs ; python_full_version >= \"3.8.0\"", "sphinx-rtd-theme (>=3.0.0) ; python_full_version >= \"3.8.0\""] -docstest = ["pyenchant (>=3)", "readme-renderer (>=30.0)", "sphinxcontrib-spelling (>=7.3.1)"] -nox = ["nox (>=2024.4.15)", "nox[uv] (>=2024.3.2) ; python_full_version >= \"3.8.0\""] -pep8test = ["check-sdist ; python_full_version >= \"3.8.0\"", "click (>=8.0.1)", "mypy (>=1.4)", "ruff (>=0.3.6)"] -sdist = ["build (>=1.0.0)"] -ssh = ["bcrypt (>=3.1.5)"] -test = ["certifi (>=2024)", "cryptography-vectors (==45.0.3)", "pretend (>=0.7)", "pytest (>=7.4.0)", "pytest-benchmark (>=4.0)", "pytest-cov (>=2.10.1)", "pytest-xdist (>=3.5.0)"] -test-randomorder = ["pytest-randomly"] - -[[package]] -name = "dill" -version = "0.3.9" -description = "serialize all of Python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, - {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, -] - -[package.extras] -graph = ["objgraph (>=1.7.2)"] -profile = ["gprof2dot (>=2022.7.29)"] - -[[package]] -name = "eval-type-backport" -version = "0.2.0" -description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, - {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, -] - -[package.extras] -tests = ["pytest"] - -[[package]] -name = "exceptiongroup" -version = "1.2.2" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -groups = ["main", "dev"] -markers = "python_version < \"3.11\"" -files = [ - {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, - {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, -] - -[package.extras] -test = ["pytest (>=6)"] - -[[package]] -name = "google-auth" -version = "2.27.0" -description = "Google Authentication Library" -optional = true -python-versions = ">=3.7" -groups = ["main"] -markers = "extra == \"gcp\"" -files = [ - {file = "google-auth-2.27.0.tar.gz", hash = "sha256:e863a56ccc2d8efa83df7a80272601e43487fa9a728a376205c86c26aaefa821"}, - {file = "google_auth-2.27.0-py2.py3-none-any.whl", hash = "sha256:8e4bad367015430ff253fe49d500fdc3396c1a434db5740828c728e45bcce245"}, -] - -[package.dependencies] -cachetools = ">=2.0.0,<6.0" -pyasn1-modules = ">=0.2.1" -rsa = ">=3.1.4,<5" - -[package.extras] -aiohttp = ["aiohttp (>=3.6.2,<4.0.0.dev0)", "requests (>=2.20.0,<3.0.0.dev0)"] -enterprise-cert = ["cryptography (==36.0.2)", "pyopenssl (==22.0.0)"] -pyopenssl = ["cryptography (>=38.0.3)", "pyopenssl (>=20.0.0)"] -reauth = ["pyu2f (>=0.1.5)"] -requests = ["requests (>=2.20.0,<3.0.0.dev0)"] - -[[package]] -name = "griffe" -version = "1.7.3" -description = "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API." -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -files = [ - {file = "griffe-1.7.3-py3-none-any.whl", hash = "sha256:c6b3ee30c2f0f17f30bcdef5068d6ab7a2a4f1b8bf1a3e74b56fffd21e1c5f75"}, - {file = "griffe-1.7.3.tar.gz", hash = "sha256:52ee893c6a3a968b639ace8015bec9d36594961e156e23315c8e8e51401fa50b"}, -] - -[package.dependencies] -colorama = ">=0.4" - -[[package]] -name = "h11" -version = "0.14.0" -description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -optional = false -python-versions = ">=3.7" -groups = ["main", "dev"] -files = [ - {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, - {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[[package]] -name = "httpcore" -version = "1.0.7" -description = "A minimal low-level HTTP client." -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, - {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[package.dependencies] -certifi = "*" -h11 = ">=0.13,<0.15" - -[package.extras] -asyncio = ["anyio (>=4.0,<5.0)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<1.0)"] - -[[package]] -name = "httpx" -version = "0.28.1" -description = "The next generation HTTP client." -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, - {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[package.dependencies] -anyio = "*" -certifi = "*" -httpcore = "==1.*" -idna = "*" - -[package.extras] -brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "httpx-sse" -version = "0.4.0" -description = "Consume Server-Sent Event (SSE) messages with HTTPX." -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "httpx-sse-0.4.0.tar.gz", hash = "sha256:1e81a3a3070ce322add1d3529ed42eb5f70817f45ed6ec915ab753f961139721"}, - {file = "httpx_sse-0.4.0-py3-none-any.whl", hash = "sha256:f329af6eae57eaa2bdfd962b42524764af68075ea87370a2de920af5341e318f"}, -] - -[[package]] -name = "idna" -version = "3.10" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.6" -groups = ["main", "dev"] -files = [ - {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, - {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[package.extras] -all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] - -[[package]] -name = "iniconfig" -version = "2.0.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.7" -groups = ["dev"] -files = [ - {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, - {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, -] - -[[package]] -name = "invoke" -version = "2.2.0" -description = "Pythonic task execution" -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "invoke-2.2.0-py3-none-any.whl", hash = "sha256:6ea924cc53d4f78e3d98bc436b08069a03077e6f85ad1ddaa8a116d7dad15820"}, - {file = "invoke-2.2.0.tar.gz", hash = "sha256:ee6cbb101af1a859c7fe84f2a264c059020b0cb7fe3535f9424300ab568f6bd5"}, -] - -[[package]] -name = "isort" -version = "5.13.2" -description = "A Python utility / library to sort Python imports." -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, - {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, -] - -[package.extras] -colors = ["colorama (>=0.4.6)"] - -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = false -python-versions = ">=3.6" -groups = ["dev"] -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - -[[package]] -name = "mcp" -version = "1.9.1" -description = "Model Context Protocol SDK" -optional = false -python-versions = ">=3.10" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "mcp-1.9.1-py3-none-any.whl", hash = "sha256:2900ded8ffafc3c8a7bfcfe8bc5204037e988e753ec398f371663e6a06ecd9a9"}, - {file = "mcp-1.9.1.tar.gz", hash = "sha256:19879cd6dde3d763297617242888c2f695a95dfa854386a6a68676a646ce75e4"}, -] - -[package.dependencies] -anyio = ">=4.5" -httpx = ">=0.27" -httpx-sse = ">=0.4" -pydantic = ">=2.7.2,<3.0.0" -pydantic-settings = ">=2.5.2" -python-multipart = ">=0.0.9" -sse-starlette = ">=1.6.1" -starlette = ">=0.27" -uvicorn = {version = ">=0.23.1", markers = "sys_platform != \"emscripten\""} - -[package.extras] -cli = ["python-dotenv (>=1.0.0)", "typer (>=0.12.4)"] -rich = ["rich (>=13.9.4)"] -ws = ["websockets (>=15.0.1)"] - -[[package]] -name = "mypy" -version = "1.15.0" -description = "Optional static typing for Python" -optional = false -python-versions = ">=3.9" -groups = ["dev", "lint"] -files = [ - {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, - {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, - {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b"}, - {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3"}, - {file = "mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b"}, - {file = "mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828"}, - {file = "mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f"}, - {file = "mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5"}, - {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e"}, - {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c"}, - {file = "mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f"}, - {file = "mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f"}, - {file = "mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd"}, - {file = "mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f"}, - {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464"}, - {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee"}, - {file = "mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e"}, - {file = "mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22"}, - {file = "mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445"}, - {file = "mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d"}, - {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5"}, - {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036"}, - {file = "mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357"}, - {file = "mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf"}, - {file = "mypy-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078"}, - {file = "mypy-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba"}, - {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5"}, - {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b"}, - {file = "mypy-1.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2"}, - {file = "mypy-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980"}, - {file = "mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e"}, - {file = "mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43"}, -] - -[package.dependencies] -mypy_extensions = ">=1.0.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing_extensions = ">=4.6.0" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -faster-cache = ["orjson"] -install-types = ["pip"] -mypyc = ["setuptools (>=50)"] -reports = ["lxml"] - -[[package]] -name = "mypy-extensions" -version = "1.0.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.5" -groups = ["dev", "lint"] -files = [ - {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, - {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, -] - -[[package]] -name = "nodeenv" -version = "1.9.1" -description = "Node.js virtual environment builder" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["lint"] -files = [ - {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, - {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, -] - -[[package]] -name = "packaging" -version = "24.2" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, - {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, -] - -[[package]] -name = "platformdirs" -version = "4.3.6" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, - {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, -] - -[package.extras] -docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] -type = ["mypy (>=1.11.2)"] - -[[package]] -name = "pluggy" -version = "1.5.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, - {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] - -[[package]] -name = "pyasn1" -version = "0.6.1" -description = "Pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208)" -optional = true -python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"gcp\"" -files = [ - {file = "pyasn1-0.6.1-py3-none-any.whl", hash = "sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629"}, - {file = "pyasn1-0.6.1.tar.gz", hash = "sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034"}, -] - -[[package]] -name = "pyasn1-modules" -version = "0.4.1" -description = "A collection of ASN.1-based protocols modules" -optional = true -python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"gcp\"" -files = [ - {file = "pyasn1_modules-0.4.1-py3-none-any.whl", hash = "sha256:49bfa96b45a292b711e986f222502c1c9a5e1f4e568fc30e2574a6c7d07838fd"}, - {file = "pyasn1_modules-0.4.1.tar.gz", hash = "sha256:c28e2dbf9c06ad61c71a075c7e0f9fd0f1b0bb2d2ad4377f240d33ac2ab60a7c"}, -] - -[package.dependencies] -pyasn1 = ">=0.4.6,<0.7.0" - -[[package]] -name = "pycparser" -version = "2.22" -description = "C parser in Python" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -markers = "platform_python_implementation != \"PyPy\"" -files = [ - {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, - {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, -] - -[[package]] -name = "pydantic" -version = "2.10.6" -description = "Data validation using Python type hints" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, - {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[package.dependencies] -annotated-types = ">=0.6.0" -pydantic-core = "2.27.2" -typing-extensions = ">=4.12.2" - -[package.extras] -email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] - -[[package]] -name = "pydantic-core" -version = "2.27.2" -description = "Core functionality for Pydantic validation and serialization" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -files = [ - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, - {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[package.dependencies] -typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" - -[[package]] -name = "pydantic-settings" -version = "2.9.1" -description = "Settings management using Pydantic" -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "pydantic_settings-2.9.1-py3-none-any.whl", hash = "sha256:59b4f431b1defb26fe620c71a7d3968a710d719f5f4cdbbdb7926edeb770f6ef"}, - {file = "pydantic_settings-2.9.1.tar.gz", hash = "sha256:c509bf79d27563add44e8446233359004ed85066cd096d8b510f715e6ef5d268"}, -] - -[package.dependencies] -pydantic = ">=2.7.0" -python-dotenv = ">=0.21.0" -typing-inspection = ">=0.4.0" - -[package.extras] -aws-secrets-manager = ["boto3 (>=1.35.0)", "boto3-stubs[secretsmanager]"] -azure-key-vault = ["azure-identity (>=1.16.0)", "azure-keyvault-secrets (>=4.8.0)"] -gcp-secret-manager = ["google-cloud-secret-manager (>=2.23.1)"] -toml = ["tomli (>=2.0.1)"] -yaml = ["pyyaml (>=6.0.1)"] - -[[package]] -name = "pylint" -version = "3.2.3" -description = "python code static checker" -optional = false -python-versions = ">=3.8.0" -groups = ["dev"] -files = [ - {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, - {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, -] - -[package.dependencies] -astroid = ">=3.2.2,<=3.3.0-dev0" -colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -dill = [ - {version = ">=0.2", markers = "python_version < \"3.11\""}, - {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version == \"3.11\""}, -] -isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" -mccabe = ">=0.6,<0.8" -platformdirs = ">=2.2.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -tomlkit = ">=0.10.1" -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} - -[package.extras] -spelling = ["pyenchant (>=3.2,<4.0)"] -testutils = ["gitpython (>3)"] - -[[package]] -name = "pyright" -version = "1.1.401" -description = "Command line wrapper for pyright" -optional = false -python-versions = ">=3.7" -groups = ["lint"] -files = [ - {file = "pyright-1.1.401-py3-none-any.whl", hash = "sha256:6fde30492ba5b0d7667c16ecaf6c699fab8d7a1263f6a18549e0b00bf7724c06"}, - {file = "pyright-1.1.401.tar.gz", hash = "sha256:788a82b6611fa5e34a326a921d86d898768cddf59edde8e93e56087d277cc6f1"}, -] - -[package.dependencies] -nodeenv = ">=1.6.0" -typing-extensions = ">=4.1" - -[package.extras] -all = ["nodejs-wheel-binaries", "twine (>=3.4.1)"] -dev = ["twine (>=3.4.1)"] -nodejs = ["nodejs-wheel-binaries"] - -[[package]] -name = "pytest" -version = "8.3.4" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6"}, - {file = "pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=1.5,<2" -tomli = {version = ">=1", markers = "python_version < \"3.11\""} - -[package.extras] -dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-asyncio" -version = "0.23.8" -description = "Pytest support for asyncio" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, - {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, -] - -[package.dependencies] -pytest = ">=7.0.0,<9" - -[package.extras] -docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] -testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] - -[[package]] -name = "python-dateutil" -version = "2.9.0.post0" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -groups = ["main"] -files = [ - {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, - {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "python-dotenv" -version = "1.1.0" -description = "Read key-value pairs from a .env file and set them as environment variables" -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "python_dotenv-1.1.0-py3-none-any.whl", hash = "sha256:d7c01d9e2293916c18baf562d95698754b0dbbb5e74d457c45d4f6561fb9d55d"}, - {file = "python_dotenv-1.1.0.tar.gz", hash = "sha256:41f90bc6f5f177fb41f53e87666db362025010eb28f60a01c9143bfa33a2b2d5"}, -] - -[package.extras] -cli = ["click (>=5.0)"] - -[[package]] -name = "python-multipart" -version = "0.0.20" -description = "A streaming multipart parser for Python" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "python_multipart-0.0.20-py3-none-any.whl", hash = "sha256:8a62d3a8335e06589fe01f2a3e178cdcc632f3fbe0d492ad9ee0ec35aab1f104"}, - {file = "python_multipart-0.0.20.tar.gz", hash = "sha256:8dd0cab45b8e23064ae09147625994d090fa46f5b0d1e13af944c331a7fa9d13"}, -] - -[[package]] -name = "pyyaml" -version = "6.0.2" -description = "YAML parser and emitter for Python" -optional = false -python-versions = ">=3.8" -groups = ["main"] -files = [ - {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, - {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, - {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, - {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, - {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, - {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, - {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, - {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, - {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, - {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, - {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, - {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, - {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, - {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, - {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, - {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, - {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, - {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, - {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, - {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, - {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, - {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, - {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, - {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, - {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, - {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, - {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, - {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, - {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, - {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, - {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, - {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, - {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, - {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, - {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, - {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, - {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, - {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, - {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, - {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, - {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, - {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, - {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, - {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, - {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, - {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, - {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, - {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, - {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, - {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, - {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, - {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, - {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, -] - -[[package]] -name = "requests" -version = "2.32.3" -description = "Python HTTP for Humans." -optional = true -python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"gcp\"" -files = [ - {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, - {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, -] - -[package.dependencies] -certifi = ">=2017.4.17" -charset-normalizer = ">=2,<4" -idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<3" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)"] -use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] - -[[package]] -name = "rsa" -version = "4.2" -description = "Pure-Python RSA implementation" -optional = true -python-versions = "*" -groups = ["main"] -markers = "extra == \"gcp\"" -files = [ - {file = "rsa-4.2.tar.gz", hash = "sha256:aaefa4b84752e3e99bd8333a2e1e3e7a7da64614042bd66f775573424370108a"}, -] - -[package.dependencies] -pyasn1 = ">=0.1.3" - -[[package]] -name = "ruff" -version = "0.11.11" -description = "An extremely fast Python linter and code formatter, written in Rust." -optional = false -python-versions = ">=3.7" -groups = ["lint"] -files = [ - {file = "ruff-0.11.11-py3-none-linux_armv6l.whl", hash = "sha256:9924e5ae54125ed8958a4f7de320dab7380f6e9fa3195e3dc3b137c6842a0092"}, - {file = "ruff-0.11.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:c8a93276393d91e952f790148eb226658dd275cddfde96c6ca304873f11d2ae4"}, - {file = "ruff-0.11.11-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d6e333dbe2e6ae84cdedefa943dfd6434753ad321764fd937eef9d6b62022bcd"}, - {file = "ruff-0.11.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7885d9a5e4c77b24e8c88aba8c80be9255fa22ab326019dac2356cff42089fc6"}, - {file = "ruff-0.11.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1b5ab797fcc09121ed82e9b12b6f27e34859e4227080a42d090881be888755d4"}, - {file = "ruff-0.11.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e231ff3132c1119ece836487a02785f099a43992b95c2f62847d29bace3c75ac"}, - {file = "ruff-0.11.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:a97c9babe1d4081037a90289986925726b802d180cca784ac8da2bbbc335f709"}, - {file = "ruff-0.11.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d8c4ddcbe8a19f59f57fd814b8b117d4fcea9bee7c0492e6cf5fdc22cfa563c8"}, - {file = "ruff-0.11.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6224076c344a7694c6fbbb70d4f2a7b730f6d47d2a9dc1e7f9d9bb583faf390b"}, - {file = "ruff-0.11.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:882821fcdf7ae8db7a951df1903d9cb032bbe838852e5fc3c2b6c3ab54e39875"}, - {file = "ruff-0.11.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:dcec2d50756463d9df075a26a85a6affbc1b0148873da3997286caf1ce03cae1"}, - {file = "ruff-0.11.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:99c28505ecbaeb6594701a74e395b187ee083ee26478c1a795d35084d53ebd81"}, - {file = "ruff-0.11.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9263f9e5aa4ff1dec765e99810f1cc53f0c868c5329b69f13845f699fe74f639"}, - {file = "ruff-0.11.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:64ac6f885e3ecb2fdbb71de2701d4e34526651f1e8503af8fb30d4915a3fe345"}, - {file = "ruff-0.11.11-py3-none-win32.whl", hash = "sha256:1adcb9a18802268aaa891ffb67b1c94cd70578f126637118e8099b8e4adcf112"}, - {file = "ruff-0.11.11-py3-none-win_amd64.whl", hash = "sha256:748b4bb245f11e91a04a4ff0f96e386711df0a30412b9fe0c74d5bdc0e4a531f"}, - {file = "ruff-0.11.11-py3-none-win_arm64.whl", hash = "sha256:6c51f136c0364ab1b774767aa8b86331bd8e9d414e2d107db7a2189f35ea1f7b"}, - {file = "ruff-0.11.11.tar.gz", hash = "sha256:7774173cc7c1980e6bf67569ebb7085989a78a103922fb83ef3dfe230cd0687d"}, -] - -[[package]] -name = "six" -version = "1.16.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -groups = ["main"] -files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, -] - -[[package]] -name = "sniffio" -version = "1.3.1" -description = "Sniff out which async library your code is running under" -optional = false -python-versions = ">=3.7" -groups = ["main", "dev"] -files = [ - {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, - {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[[package]] -name = "sse-starlette" -version = "2.1.3" -description = "SSE plugin for Starlette" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "sse_starlette-2.1.3-py3-none-any.whl", hash = "sha256:8ec846438b4665b9e8c560fcdea6bc8081a3abf7942faa95e5a744999d219772"}, - {file = "sse_starlette-2.1.3.tar.gz", hash = "sha256:9cd27eb35319e1414e3d2558ee7414487f9529ce3b3cf9b21434fd110e017169"}, -] - -[package.dependencies] -anyio = "*" -starlette = "*" -uvicorn = "*" - -[package.extras] -examples = ["fastapi"] - -[[package]] -name = "starlette" -version = "0.46.2" -description = "The little ASGI library that shines." -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "starlette-0.46.2-py3-none-any.whl", hash = "sha256:595633ce89f8ffa71a015caed34a5b2dc1c0cdb3f0f1fbd1e69339cf2abeec35"}, - {file = "starlette-0.46.2.tar.gz", hash = "sha256:7f7361f34eed179294600af672f565727419830b54b7b084efe44bb82d2fccd5"}, -] - -[package.dependencies] -anyio = ">=3.6.2,<5" - -[package.extras] -full = ["httpx (>=0.27.0,<0.29.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.18)", "pyyaml"] - -[[package]] -name = "tomli" -version = "2.2.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.8" -groups = ["dev", "lint"] -markers = "python_version < \"3.11\"" -files = [ - {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, - {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, - {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, - {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, - {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, - {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, - {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, - {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, - {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, - {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, -] - -[[package]] -name = "tomlkit" -version = "0.13.2" -description = "Style preserving TOML library" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, - {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, -] - -[[package]] -name = "types-authlib" -version = "1.5.0.20250516" -description = "Typing stubs for Authlib" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "types_authlib-1.5.0.20250516-py3-none-any.whl", hash = "sha256:c553659ba00b7e5f98d1bc183a47224a882de5d32c07917b1587a6a22ddd2583"}, - {file = "types_authlib-1.5.0.20250516.tar.gz", hash = "sha256:6d11b46622c4c338087d059e9036887408c788cf254f0fb11ff69f2a85ca7231"}, -] - -[package.dependencies] -cryptography = "*" - -[[package]] -name = "types-python-dateutil" -version = "2.9.0.20241003" -description = "Typing stubs for python-dateutil" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "types-python-dateutil-2.9.0.20241003.tar.gz", hash = "sha256:58cb85449b2a56d6684e41aeefb4c4280631246a0da1a719bdbe6f3fb0317446"}, - {file = "types_python_dateutil-2.9.0.20241003-py3-none-any.whl", hash = "sha256:250e1d8e80e7bbc3a6c99b907762711d1a1cdd00e978ad39cb5940f6f0a87f3d"}, -] - -[[package]] -name = "types-pyyaml" -version = "6.0.12.20250516" -description = "Typing stubs for PyYAML" -optional = false -python-versions = ">=3.9" -groups = ["dev"] -files = [ - {file = "types_pyyaml-6.0.12.20250516-py3-none-any.whl", hash = "sha256:8478208feaeb53a34cb5d970c56a7cd76b72659442e733e268a94dc72b2d0530"}, - {file = "types_pyyaml-6.0.12.20250516.tar.gz", hash = "sha256:9f21a70216fc0fa1b216a8176db5f9e0af6eb35d2f2932acb87689d03a5bf6ba"}, -] - -[[package]] -name = "typing-extensions" -version = "4.12.2" -description = "Backported and Experimental Type Hints for Python 3.8+" -optional = false -python-versions = ">=3.8" -groups = ["main", "dev", "lint"] -files = [ - {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, - {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, -] - -[[package]] -name = "typing-inspection" -version = "0.4.0" -description = "Runtime typing introspection tools" -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -files = [ - {file = "typing_inspection-0.4.0-py3-none-any.whl", hash = "sha256:50e72559fcd2a6367a19f7a7e610e6afcb9fac940c650290eed893d61386832f"}, - {file = "typing_inspection-0.4.0.tar.gz", hash = "sha256:9765c87de36671694a67904bf2c96e395be9c6439bb6c87b5142569dcdd65122"}, -] -markers = {dev = "python_version >= \"3.10\""} - -[package.dependencies] -typing-extensions = ">=4.12.0" - -[[package]] -name = "urllib3" -version = "2.2.3" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = true -python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"gcp\"" -files = [ - {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, - {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, -] - -[package.extras] -brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] -h2 = ["h2 (>=4,<5)"] -socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "uvicorn" -version = "0.34.2" -description = "The lightning-fast ASGI server." -optional = false -python-versions = ">=3.9" -groups = ["main", "dev"] -markers = "python_version >= \"3.10\"" -files = [ - {file = "uvicorn-0.34.2-py3-none-any.whl", hash = "sha256:deb49af569084536d269fe0a6d67e3754f104cf03aba7c11c40f01aadf33c403"}, - {file = "uvicorn-0.34.2.tar.gz", hash = "sha256:0e929828f6186353a80b58ea719861d2629d766293b6d19baf086ba31d4f3328"}, -] - -[package.dependencies] -click = ">=7.0" -h11 = ">=0.8" -typing-extensions = {version = ">=4.0", markers = "python_version < \"3.11\""} - -[package.extras] -standard = ["colorama (>=0.4) ; sys_platform == \"win32\"", "httptools (>=0.6.3)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1) ; sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\"", "watchfiles (>=0.13)", "websockets (>=10.4)"] - -[extras] -agents = ["authlib", "griffe", "mcp"] -gcp = ["google-auth", "requests"] - -[metadata] -lock-version = "2.1" -python-versions = ">=3.9" -content-hash = "84dda1a6ae0a8491ec9f64e6500480e7ef2e177812a624e388127f354c8e844c" diff --git a/poetry.toml b/poetry.toml deleted file mode 100644 index cd3492ac..00000000 --- a/poetry.toml +++ /dev/null @@ -1,3 +0,0 @@ - -[virtualenvs] -in-project = true diff --git a/pylintrc b/pylintrc index 29202a96..d1653ae1 100644 --- a/pylintrc +++ b/pylintrc @@ -90,7 +90,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.9 +py-version=3.10 # Discover python modules and packages in the file system subtree. recursive=no @@ -103,7 +103,7 @@ source-roots=src # When enabled, pylint would attempt to guess common misconfiguration and emit # user-friendly hints instead of false-positive error messages. -suggestion-mode=yes +# Note: suggestion-mode was removed in pylint 3.0 # Allow loading of arbitrary C extensions. Extensions are imported into the # active Python interpreter and may run arbitrary code. @@ -641,7 +641,7 @@ additional-builtins= allow-global-unused-variables=yes # List of names allowed to shadow builtins -allowed-redefined-builtins=id,object +allowed-redefined-builtins=id,object,input,dir # List of strings which can identify a callback function by name. A callback # name must start or end with one of those strings. diff --git a/pyproject.toml b/pyproject.toml index 087b5703..f79b279f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,71 +1,132 @@ [project] name = "mistralai" -version = "1.9.11" +version = "2.4.5" description = "Python Client SDK for the Mistral AI API." -authors = [{ name = "Mistral" },] +authors = [{ name = "Mistral" }] +requires-python = ">=3.10" readme = "README-PYPI.md" -requires-python = ">=3.9" dependencies = [ "eval-type-backport >=0.2.0", "httpx >=0.28.1", - "pydantic >=2.10.3", + "pydantic >=2.11.2", "python-dateutil >=2.8.2", "typing-inspection >=0.4.0", - "pyyaml (>=6.0.2,<7.0.0)", - "invoke (>=2.2.0,<3.0.0)", + "opentelemetry-api (>=1.33.1,<2.0.0)", + "opentelemetry-semantic-conventions (>=0.60b1,<0.61)", + "jsonpath-python >=1.0.6", # required for speakeasy generated path with pagination ] -[tool.poetry] -repository = "https://github.com/mistralai/client-python.git" -packages = [ - { include = "mistralai", from = "src" }, - { include = "mistralai_azure", from = "packages/mistralai_azure/src" }, - { include = "mistralai_gcp", from = "packages/mistralai_gcp/src" }, -] -include = ["py.typed", "src/mistralai/py.typed"] - -[tool.setuptools.package-data] -"*" = ["py.typed", "src/mistralai/py.typed"] - -[tool.poetry.group.dev.dependencies] -mypy = "==1.15.0" -pylint = "==3.2.3" -pytest = "^8.2.2" -pytest-asyncio = "^0.23.7" -types-python-dateutil = "^2.9.0.20240316" -types-authlib = "^1.5.0.20250516" -types-pyyaml = "^6.0.12.20250516" -mcp = { version = "^1.0", python = ">=3.10" } -griffe = "^1.7.3" -authlib = "^1.5.2" - -[tool.poetry.group.lint.dependencies] -ruff = "^0.11.10" -pyright = "^1.1.401" -mypy = "==1.15.0" - - [project.optional-dependencies] gcp = [ "google-auth >=2.27.0", - "requests >=2.32.3" + "requests >=2.32.3", ] agents = [ - "mcp >=1.0,<2.0; python_version >= '3.10'", + "mcp >=1.0,<2.0", "griffe >=1.7.3,<2.0", "authlib >=1.5.2,<2.0", ] +realtime = [ + "websockets >=13.0", +] + +workflow_payload_offloading_azure = [ + "azure-storage-blob[aio]>=12.28.0,<13.0.0", +] +workflow_payload_offloading_gcs = [ + "gcloud-aio-storage>=9.3.0,<10.0.0", +] +workflow_payload_offloading_s3 = [ + "aioboto3>=12.4.0,<13.0.0", +] + +workflow_payload_offloading = [ + "mistralai[workflow_payload_offloading_azure]", + "mistralai[workflow_payload_offloading_gcs]", + "mistralai[workflow_payload_offloading_s3]", +] +workflow_payload_encryption = [ + "cryptography>=41.0.0,<47.0.0", +] + + +[project.urls] +Repository = "https://github.com/mistralai/client-python.git" + +[dependency-groups] +dev = [ + "invoke>=2.2.0,<3", + "pyyaml>=6.0.2,<7", + "mypy==1.15.0", + "opentelemetry-sdk (>=1.33.1,<2.0.0)", + "pylint==3.2.3", + "pytest>=8.2.2,<9", + "pytest-asyncio>=0.23.7,<0.24", + "types-python-dateutil>=2.9.0.20240316,<3", + "types-authlib>=1.5.0.20250516,<2", + "types-pyyaml>=6.0.12.20250516,<7", + "mcp>=1.0,<2", + "griffe>=1.7.3,<2", + "authlib>=1.5.2,<2", + "websockets >=13.0", +] +lint = [ + "ruff>=0.11.10,<0.12", + "pyright>=1.1.401,<2", + "mypy==1.15.0", +] + +[tool.uv] +default-groups = [ + "dev", + "lint", +] + +[tool.setuptools.package-data] +"*" = ["py.typed", "src/mistralai/client/py.typed"] + +[tool.hatch.build] +dev-mode-dirs = [ + "src", + "packages/azure/src", + "packages/gcp/src", +] + +[tool.hatch.build.targets.sdist] +include = [ + "src/mistralai", + "packages/azure/src/mistralai", + "packages/gcp/src/mistralai", +] + +[tool.hatch.build.targets.sdist.force-include] +"py.typed" = "py.typed" +"src/mistralai/client/py.typed" = "src/mistralai/client/py.typed" + +[tool.hatch.build.targets.wheel] +include = [ + "src/mistralai", + "packages/azure/src/mistralai", + "packages/gcp/src/mistralai", +] + +[tool.hatch.build.targets.wheel.sources] +"src/mistralai" = "mistralai" +"packages/azure/src/mistralai/azure" = "mistralai/azure" +"packages/gcp/src/mistralai/gcp" = "mistralai/gcp" [build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +requires = ["hatchling"] +build-backend = "hatchling.build" [tool.pytest.ini_options] -asyncio_default_fixture_loop_scope = "function" -pythonpath = ["src"] +pythonpath = ["src", "packages/azure/src", "packages/gcp/src"] [tool.mypy] disable_error_code = "misc" +namespace_packages = true +explicit_package_bases = true +mypy_path = "src:packages/azure/src:packages/gcp/src" [[tool.mypy.overrides]] module = "typing_inspect" @@ -76,8 +137,10 @@ module = [ "jsonpath.*", "typing_inspect.*", "authlib.*", + "websockets.*", "mcp.*", - "griffe.*" + "griffe.*", + "google.*" ] ignore_missing_imports = true diff --git a/scripts/lint_custom_code.sh b/scripts/lint_custom_code.sh index 163bb3a6..872e2551 100755 --- a/scripts/lint_custom_code.sh +++ b/scripts/lint_custom_code.sh @@ -1,38 +1,91 @@ #!/usr/bin/env bash -set -e - ERRORS=0 +echo "Checking PEP 420 namespace integrity..." +if [ -f src/mistralai/__init__.py ]; then + echo "ERROR: PEP 420 violation - src/mistralai/__init__.py must not exist" + ERRORS=1 +else + echo "-> PEP 420 namespace OK (core)" +fi +if [ -f packages/azure/src/mistralai/__init__.py ]; then + echo "ERROR: PEP 420 violation - packages/azure/src/mistralai/__init__.py must not exist" + ERRORS=1 +else + echo "-> PEP 420 namespace OK (azure)" +fi +if [ -f packages/gcp/src/mistralai/__init__.py ]; then + echo "ERROR: PEP 420 violation - packages/gcp/src/mistralai/__init__.py must not exist" + ERRORS=1 +else + echo "-> PEP 420 namespace OK (gcp)" +fi + echo "Running mypy..." -# TODO: Uncomment once the examples are fixed -# poetry run mypy examples/ || ERRORS=1 +echo "-> running on examples" +uv run mypy examples/ \ + --exclude 'audio/' || ERRORS=1 echo "-> running on extra" -poetry run mypy src/mistralai/extra/ || ERRORS=1 +uv run --all-extras mypy src/mistralai/extra/ || ERRORS=1 echo "-> running on hooks" -poetry run mypy src/mistralai/_hooks/ \ ---exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1 +uv run mypy src/mistralai/client/_hooks/ \ + --exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1 +echo "-> running on azure hooks" +uv run mypy packages/azure/src/mistralai/azure/client/_hooks/ \ + --exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1 +echo "-> running on azure sdk" +uv run mypy packages/azure/src/mistralai/azure/client/sdk.py || ERRORS=1 +echo "-> running on gcp hooks" +uv run mypy packages/gcp/src/mistralai/gcp/client/_hooks/ \ + --exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1 +echo "-> running on gcp sdk" +uv run mypy packages/gcp/src/mistralai/gcp/client/sdk.py || ERRORS=1 +echo "-> running on scripts" +uv run mypy scripts/ || ERRORS=1 echo "Running pyright..." # TODO: Uncomment once the examples are fixed -# poetry run pyright examples/ || ERRORS=1 +# uv run pyright examples/ || ERRORS=1 echo "-> running on extra" -poetry run pyright src/mistralai/extra/ || ERRORS=1 +uv run --all-extras pyright src/mistralai/extra/ || ERRORS=1 echo "-> running on hooks" -poetry run pyright src/mistralai/_hooks/ || ERRORS=1 +uv run pyright src/mistralai/client/_hooks/ || ERRORS=1 +echo "-> running on azure hooks" +uv run pyright packages/azure/src/mistralai/azure/client/_hooks/ || ERRORS=1 +echo "-> running on azure sdk" +uv run pyright packages/azure/src/mistralai/azure/client/sdk.py || ERRORS=1 +echo "-> running on gcp hooks" +uv run pyright packages/gcp/src/mistralai/gcp/client/_hooks/ || ERRORS=1 +echo "-> running on gcp sdk" +uv run pyright packages/gcp/src/mistralai/gcp/client/sdk.py || ERRORS=1 +echo "-> running on scripts" +uv run pyright scripts/ || ERRORS=1 echo "Running ruff..." echo "-> running on examples" -poetry run ruff check examples/ || ERRORS=1 +uv run ruff check examples/ || ERRORS=1 echo "-> running on extra" -poetry run ruff check src/mistralai/extra/ || ERRORS=1 +uv run ruff check src/mistralai/extra/ || ERRORS=1 echo "-> running on hooks" -poetry run ruff check src/mistralai/_hooks/ \ ---exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1 +uv run ruff check src/mistralai/client/_hooks/ \ + --exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1 +echo "-> running on azure hooks" +uv run ruff check packages/azure/src/mistralai/azure/client/_hooks/ \ + --exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1 +echo "-> running on azure sdk" +uv run ruff check packages/azure/src/mistralai/azure/client/sdk.py || ERRORS=1 +echo "-> running on gcp hooks" +uv run ruff check packages/gcp/src/mistralai/gcp/client/_hooks/ \ + --exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1 +echo "-> running on gcp sdk" +uv run ruff check packages/gcp/src/mistralai/gcp/client/sdk.py || ERRORS=1 +echo "-> running on scripts" +uv run ruff check scripts/ || ERRORS=1 if [ "$ERRORS" -ne 0 ]; then -echo "❌ One or more linters failed" -exit 1 + echo "❌ One or more linters failed" + exit 1 else -echo "✅ All linters passed" + echo "✅ All linters passed" fi diff --git a/scripts/prepare_readme.py b/scripts/prepare_readme.py index 1b0a56ec..7f7cfe74 100644 --- a/scripts/prepare_readme.py +++ b/scripts/prepare_readme.py @@ -1,30 +1,45 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - import re import shutil +import sys + +GITHUB_URL = "https://github.com/mistralai/client-python.git" +BRANCH = "main" +REPO_SUBDIR = "" +LINK_PATTERN = re.compile(r"(\[[^\]]+\]\()((?![a-zA-Z][a-zA-Z0-9+.-]*:|#)[^\)]+)(\))") + + +def _build_base_url(repo_url: str, branch: str, repo_subdir: str) -> str: + normalized = repo_url[:-4] if repo_url.endswith(".git") else repo_url + subdir = repo_subdir.strip("/") + if subdir: + subdir = f"{subdir}/" + return f"{normalized}/blob/{branch}/{subdir}" + + +def _normalize_relative_path(path: str) -> str: + if path.startswith("./"): + path = path[2:] + elif path.startswith("/"): + path = path[1:] + return path + + +def _rewrite_relative_links(contents: str, base_url: str) -> str: + return LINK_PATTERN.sub( + lambda m: f"{m.group(1)}{base_url}{_normalize_relative_path(m.group(2))}{m.group(3)}", + contents, + ) + try: - with open("README.md", "r", encoding="utf-8") as rh: - readme_contents = rh.read() - GITHUB_URL = "https://github.com/mistralai/client-python.git" - GITHUB_URL = ( - GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL - ) - REPO_SUBDIR = "" - # links on PyPI should have absolute URLs - readme_contents = re.sub( - r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))", - lambda m: m.group(1) - + GITHUB_URL - + "/blob/master/" - + REPO_SUBDIR - + m.group(2) - + m.group(3), - readme_contents, - ) - - with open("README-PYPI.md", "w", encoding="utf-8") as wh: - wh.write(readme_contents) + with open("README.md", "r", encoding="utf-8") as fh: + readme_contents = fh.read() + + base_url = _build_base_url(GITHUB_URL, BRANCH, REPO_SUBDIR) + readme_contents = _rewrite_relative_links(readme_contents, base_url) + + with open("README-PYPI.md", "w", encoding="utf-8") as fh: + fh.write(readme_contents) except Exception as e: try: print("Failed to rewrite README.md to README-PYPI.md, copying original instead") @@ -33,3 +48,4 @@ except Exception as ie: print("Failed to copy README.md to README-PYPI.md") print(ie) + sys.exit(1) diff --git a/scripts/publish.sh b/scripts/publish.sh index 2a3ead70..c35748f3 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} -poetry run python scripts/prepare_readme.py +uv run python scripts/prepare_readme.py -poetry publish --build --skip-existing +uv build +uv publish --token $PYPI_TOKEN diff --git a/scripts/run_examples.sh b/scripts/run_examples.sh index d9ff43b2..3411fef8 100755 --- a/scripts/run_examples.sh +++ b/scripts/run_examples.sh @@ -1,7 +1,8 @@ #!/bin/bash -# Default retry count +# Defaults RETRY_COUNT=3 +NO_EXTRA_DEP=false # Parse command line arguments while [[ $# -gt 0 ]]; do @@ -29,31 +30,54 @@ while [[ $# -gt 0 ]]; do esac done -# List of files to exclude +# List of files to always exclude exclude_files=( "examples/mistral/chat/chatbot_with_streaming.py" "examples/mistral/agents/async_conversation_run_mcp_remote_auth.py" - "examples/mistral/jobs/async_jobs_chat.py" + "examples/mistral/jobs/async_fine_tuning.py" + "examples/mistral/jobs/async_fine_tuning_chat.py" + "examples/mistral/jobs/fine_tuning.py" + "examples/mistral/jobs/fine_tuning_dry_run.py" + "examples/mistral/jobs/async_jobs_ocr_batch_annotation.py" "examples/mistral/classifier/async_classifier.py" "examples/mistral/mcp_servers/sse_server.py" "examples/mistral/mcp_servers/stdio_server.py" + "examples/mistral/agents/async_conversation_run_code_interpreter.py" "examples/mistral/agents/async_conversation_run_stream.py" "examples/mistral/agents/async_conversation_run_mcp.py" "examples/mistral/agents/async_conversation_run_mcp_remote.py" + "examples/mistral/agents/async_agents_no_streaming.py" + "examples/mistral/audio/async_realtime_transcription_microphone.py" + "examples/mistral/audio/async_realtime_transcription_stream.py" + "examples/mistral/audio/async_realtime_transcription_dual_delay_microphone.py" + "examples/mistral/workflows/workflow_execute_and_wait.py" + "examples/mistral/workflows/async_workflow_execute_and_wait.py" + "examples/mistral/workflows/workflow_execute.py" + "examples/mistral/workflows/async_workflow_execute.py" +) + +# Files that require extra dependencies (agents, mcp, audio, etc.) +extra_dep_files=( + "examples/mistral/agents/" + "examples/mistral/mcp_servers/" + "examples/mistral/audio/" ) -# Check if the no-extra-dep flag is set if [ "$NO_EXTRA_DEP" = true ]; then - # Add more files to the exclude list - exclude_files+=( - "examples/mistral/agents/async_conversation_run_mcp_remote.py" - "examples/mistral/agents/async_conversation_run_stream.py" - "examples/mistral/agents/async_conversation_run.py" - ) + for pattern in "${extra_dep_files[@]}"; do + for f in ${pattern}*.py; do + [ -f "$f" ] && exclude_files+=("$f") + done + done fi failed=0 +echo "Skipping scripts" +for file in "${exclude_files[@]}"; do + echo "$file" +done + # Function to run a test with retries run_test_with_retries() { local file="$1" @@ -64,8 +88,8 @@ run_test_with_retries() { echo "Running $file (attempt $attempt/$RETRY_COUNT)" # Run the script and capture both exit status and error output - local current_output=$(python3 "$file" 2>&1) - local exit_code=$? + current_output=$(python3 "$file" 2>&1) + exit_code=$? if [ $exit_code -eq 0 ]; then echo "Success" diff --git a/src/mistralai/__init__.py b/src/mistralai/__init__.py deleted file mode 100644 index dd02e42e..00000000 --- a/src/mistralai/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from ._version import ( - __title__, - __version__, - __openapi_doc_version__, - __gen_version__, - __user_agent__, -) -from .sdk import * -from .sdkconfiguration import * -from .models import * - - -VERSION: str = __version__ -OPENAPI_DOC_VERSION = __openapi_doc_version__ -SPEAKEASY_GENERATOR_VERSION = __gen_version__ -USER_AGENT = __user_agent__ diff --git a/src/mistralai/_hooks/__init__.py b/src/mistralai/_hooks/__init__.py deleted file mode 100644 index 2ee66cdd..00000000 --- a/src/mistralai/_hooks/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .sdkhooks import * -from .types import * -from .registration import * diff --git a/src/mistralai/_hooks/registration.py b/src/mistralai/_hooks/registration.py deleted file mode 100644 index fc3ae79b..00000000 --- a/src/mistralai/_hooks/registration.py +++ /dev/null @@ -1,17 +0,0 @@ -from .custom_user_agent import CustomUserAgentHook -from .deprecation_warning import DeprecationWarningHook -from .types import Hooks - -# This file is only ever generated once on the first generation and then is free to be modified. -# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them -# in this file or in separate files in the hooks folder. - - -def init_hooks(hooks: Hooks): - # pylint: disable=unused-argument - """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook - with an instance of a hook that implements that specific Hook interface - Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance - """ - hooks.register_before_request_hook(CustomUserAgentHook()) - hooks.register_after_success_hook(DeprecationWarningHook()) diff --git a/src/mistralai/_hooks/sdkhooks.py b/src/mistralai/_hooks/sdkhooks.py deleted file mode 100644 index 1f9a9316..00000000 --- a/src/mistralai/_hooks/sdkhooks.py +++ /dev/null @@ -1,76 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import httpx -from .types import ( - SDKInitHook, - BeforeRequestContext, - BeforeRequestHook, - AfterSuccessContext, - AfterSuccessHook, - AfterErrorContext, - AfterErrorHook, - Hooks, -) -from .registration import init_hooks -from typing import List, Optional, Tuple -from mistralai.httpclient import HttpClient - - -class SDKHooks(Hooks): - def __init__(self) -> None: - self.sdk_init_hooks: List[SDKInitHook] = [] - self.before_request_hooks: List[BeforeRequestHook] = [] - self.after_success_hooks: List[AfterSuccessHook] = [] - self.after_error_hooks: List[AfterErrorHook] = [] - init_hooks(self) - - def register_sdk_init_hook(self, hook: SDKInitHook) -> None: - self.sdk_init_hooks.append(hook) - - def register_before_request_hook(self, hook: BeforeRequestHook) -> None: - self.before_request_hooks.append(hook) - - def register_after_success_hook(self, hook: AfterSuccessHook) -> None: - self.after_success_hooks.append(hook) - - def register_after_error_hook(self, hook: AfterErrorHook) -> None: - self.after_error_hooks.append(hook) - - def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: - for hook in self.sdk_init_hooks: - base_url, client = hook.sdk_init(base_url, client) - return base_url, client - - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> httpx.Request: - for hook in self.before_request_hooks: - out = hook.before_request(hook_ctx, request) - if isinstance(out, Exception): - raise out - request = out - - return request - - def after_success( - self, hook_ctx: AfterSuccessContext, response: httpx.Response - ) -> httpx.Response: - for hook in self.after_success_hooks: - out = hook.after_success(hook_ctx, response) - if isinstance(out, Exception): - raise out - response = out - return response - - def after_error( - self, - hook_ctx: AfterErrorContext, - response: Optional[httpx.Response], - error: Optional[Exception], - ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: - for hook in self.after_error_hooks: - result = hook.after_error(hook_ctx, response, error) - if isinstance(result, Exception): - raise result - response, error = result - return response, error diff --git a/src/mistralai/_hooks/types.py b/src/mistralai/_hooks/types.py deleted file mode 100644 index 6d0f3e11..00000000 --- a/src/mistralai/_hooks/types.py +++ /dev/null @@ -1,113 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from abc import ABC, abstractmethod -import httpx -from mistralai.httpclient import HttpClient -from mistralai.sdkconfiguration import SDKConfiguration -from typing import Any, Callable, List, Optional, Tuple, Union - - -class HookContext: - config: SDKConfiguration - base_url: str - operation_id: str - oauth2_scopes: Optional[List[str]] = None - security_source: Optional[Union[Any, Callable[[], Any]]] = None - - def __init__( - self, - config: SDKConfiguration, - base_url: str, - operation_id: str, - oauth2_scopes: Optional[List[str]], - security_source: Optional[Union[Any, Callable[[], Any]]], - ): - self.config = config - self.base_url = base_url - self.operation_id = operation_id - self.oauth2_scopes = oauth2_scopes - self.security_source = security_source - - -class BeforeRequestContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.config, - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class AfterSuccessContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.config, - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class AfterErrorContext(HookContext): - def __init__(self, hook_ctx: HookContext): - super().__init__( - hook_ctx.config, - hook_ctx.base_url, - hook_ctx.operation_id, - hook_ctx.oauth2_scopes, - hook_ctx.security_source, - ) - - -class SDKInitHook(ABC): - @abstractmethod - def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: - pass - - -class BeforeRequestHook(ABC): - @abstractmethod - def before_request( - self, hook_ctx: BeforeRequestContext, request: httpx.Request - ) -> Union[httpx.Request, Exception]: - pass - - -class AfterSuccessHook(ABC): - @abstractmethod - def after_success( - self, hook_ctx: AfterSuccessContext, response: httpx.Response - ) -> Union[httpx.Response, Exception]: - pass - - -class AfterErrorHook(ABC): - @abstractmethod - def after_error( - self, - hook_ctx: AfterErrorContext, - response: Optional[httpx.Response], - error: Optional[Exception], - ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: - pass - - -class Hooks(ABC): - @abstractmethod - def register_sdk_init_hook(self, hook: SDKInitHook): - pass - - @abstractmethod - def register_before_request_hook(self, hook: BeforeRequestHook): - pass - - @abstractmethod - def register_after_success_hook(self, hook: AfterSuccessHook): - pass - - @abstractmethod - def register_after_error_hook(self, hook: AfterErrorHook): - pass diff --git a/src/mistralai/_version.py b/src/mistralai/_version.py deleted file mode 100644 index fa0b5e7d..00000000 --- a/src/mistralai/_version.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import importlib.metadata - -__title__: str = "mistralai" -__version__: str = "1.9.11" -__openapi_doc_version__: str = "1.0.0" -__gen_version__: str = "2.687.13" -__user_agent__: str = "speakeasy-sdk/python 1.9.11 2.687.13 1.0.0 mistralai" - -try: - if __package__ is not None: - __version__ = importlib.metadata.version(__package__) -except importlib.metadata.PackageNotFoundError: - pass diff --git a/src/mistralai/agents.py b/src/mistralai/agents.py deleted file mode 100644 index b220ca5b..00000000 --- a/src/mistralai/agents.py +++ /dev/null @@ -1,669 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import eventstreaming, get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, List, Mapping, Optional, Union - - -class Agents(BaseSDK): - r"""Agents API.""" - - def complete( - self, - *, - messages: Union[ - List[models.AgentsCompletionRequestMessages], - List[models.AgentsCompletionRequestMessagesTypedDict], - ], - agent_id: str, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.AgentsCompletionRequestStop, - models.AgentsCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.AgentsCompletionRequestToolChoice, - models.AgentsCompletionRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ChatCompletionResponse: - r"""Agents Completion - - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param agent_id: The ID of the agent to use for this completion. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsCompletionRequest( - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.AgentsCompletionRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.AgentsCompletionRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - agent_id=agent_id, - ) - - req = self._build_request( - method="POST", - path="/v1/agents/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.AgentsCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_completion_v1_agents_completions_post", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ChatCompletionResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def complete_async( - self, - *, - messages: Union[ - List[models.AgentsCompletionRequestMessages], - List[models.AgentsCompletionRequestMessagesTypedDict], - ], - agent_id: str, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.AgentsCompletionRequestStop, - models.AgentsCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.AgentsCompletionRequestToolChoice, - models.AgentsCompletionRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ChatCompletionResponse: - r"""Agents Completion - - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param agent_id: The ID of the agent to use for this completion. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsCompletionRequest( - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.AgentsCompletionRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.AgentsCompletionRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - agent_id=agent_id, - ) - - req = self._build_request_async( - method="POST", - path="/v1/agents/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.AgentsCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_completion_v1_agents_completions_post", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ChatCompletionResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def stream( - self, - *, - messages: Union[ - List[models.AgentsCompletionStreamRequestMessages], - List[models.AgentsCompletionStreamRequestMessagesTypedDict], - ], - agent_id: str, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[ - Union[ - models.AgentsCompletionStreamRequestStop, - models.AgentsCompletionStreamRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.AgentsCompletionStreamRequestToolChoice, - models.AgentsCompletionStreamRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStream[models.CompletionEvent]: - r"""Stream Agents completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param agent_id: The ID of the agent to use for this completion. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsCompletionStreamRequest( - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.AgentsCompletionStreamRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.AgentsCompletionStreamRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - agent_id=agent_id, - ) - - req = self._build_request( - method="POST", - path="/v1/agents/completions#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.AgentsCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="stream_agents", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) - - async def stream_async( - self, - *, - messages: Union[ - List[models.AgentsCompletionStreamRequestMessages], - List[models.AgentsCompletionStreamRequestMessagesTypedDict], - ], - agent_id: str, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[ - Union[ - models.AgentsCompletionStreamRequestStop, - models.AgentsCompletionStreamRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.AgentsCompletionStreamRequestToolChoice, - models.AgentsCompletionStreamRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: - r"""Stream Agents completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param agent_id: The ID of the agent to use for this completion. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsCompletionStreamRequest( - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.AgentsCompletionStreamRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.AgentsCompletionStreamRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - agent_id=agent_id, - ) - - req = self._build_request_async( - method="POST", - path="/v1/agents/completions#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.AgentsCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="stream_agents", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/async_client.py b/src/mistralai/async_client.py deleted file mode 100644 index f9522a28..00000000 --- a/src/mistralai/async_client.py +++ /dev/null @@ -1,15 +0,0 @@ -from typing import Optional - -from .client import MIGRATION_MESSAGE - - -class MistralAsyncClient: - def __init__( - self, - api_key: Optional[str] = None, - endpoint: str = "", - max_retries: int = 5, - timeout: int = 120, - max_concurrent_requests: int = 64, - ): - raise NotImplementedError(MIGRATION_MESSAGE) diff --git a/src/mistralai/audio.py b/src/mistralai/audio.py deleted file mode 100644 index 5687abdb..00000000 --- a/src/mistralai/audio.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from .sdkconfiguration import SDKConfiguration -from mistralai.transcriptions import Transcriptions -from typing import Optional - - -class Audio(BaseSDK): - transcriptions: Transcriptions - r"""API for audio transcription.""" - - def __init__( - self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None - ) -> None: - BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) - self.sdk_configuration = sdk_config - self._init_sdks() - - def _init_sdks(self): - self.transcriptions = Transcriptions( - self.sdk_configuration, parent_ref=self.parent_ref - ) diff --git a/src/mistralai/basesdk.py b/src/mistralai/basesdk.py deleted file mode 100644 index 6b62ddae..00000000 --- a/src/mistralai/basesdk.py +++ /dev/null @@ -1,364 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .sdkconfiguration import SDKConfiguration -import httpx -from mistralai import models, utils -from mistralai._hooks import ( - AfterErrorContext, - AfterSuccessContext, - BeforeRequestContext, -) -from mistralai.utils import RetryConfig, SerializedRequestBody, get_body_content -from typing import Callable, List, Mapping, Optional, Tuple -from urllib.parse import parse_qs, urlparse - - -class BaseSDK: - sdk_configuration: SDKConfiguration - parent_ref: Optional[object] = None - """ - Reference to the root SDK instance, if any. This will prevent it from - being garbage collected while there are active streams. - """ - - def __init__( - self, - sdk_config: SDKConfiguration, - parent_ref: Optional[object] = None, - ) -> None: - self.sdk_configuration = sdk_config - self.parent_ref = parent_ref - - def _get_url(self, base_url, url_variables): - sdk_url, sdk_variables = self.sdk_configuration.get_server_details() - - if base_url is None: - base_url = sdk_url - - if url_variables is None: - url_variables = sdk_variables - - return utils.template_url(base_url, url_variables) - - def _build_request_async( - self, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - client = self.sdk_configuration.async_client - return self._build_request_with_client( - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals, - security, - timeout_ms, - get_serialized_body, - url_override, - http_headers, - ) - - def _build_request( - self, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - client = self.sdk_configuration.client - return self._build_request_with_client( - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals, - security, - timeout_ms, - get_serialized_body, - url_override, - http_headers, - ) - - def _build_request_with_client( - self, - client, - method, - path, - base_url, - url_variables, - request, - request_body_required, - request_has_path_params, - request_has_query_params, - user_agent_header, - accept_header_value, - _globals=None, - security=None, - timeout_ms: Optional[int] = None, - get_serialized_body: Optional[ - Callable[[], Optional[SerializedRequestBody]] - ] = None, - url_override: Optional[str] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Request: - query_params = {} - - url = url_override - if url is None: - url = utils.generate_url( - self._get_url(base_url, url_variables), - path, - request if request_has_path_params else None, - _globals if request_has_path_params else None, - ) - - query_params = utils.get_query_params( - request if request_has_query_params else None, - _globals if request_has_query_params else None, - ) - else: - # Pick up the query parameter from the override so they can be - # preserved when building the request later on (necessary as of - # httpx 0.28). - parsed_override = urlparse(str(url_override)) - query_params = parse_qs(parsed_override.query, keep_blank_values=True) - - headers = utils.get_headers(request, _globals) - headers["Accept"] = accept_header_value - headers[user_agent_header] = self.sdk_configuration.user_agent - - if security is not None: - if callable(security): - security = security() - security = utils.get_security_from_env(security, models.Security) - if security is not None: - security_headers, security_query_params = utils.get_security(security) - headers = {**headers, **security_headers} - query_params = {**query_params, **security_query_params} - - serialized_request_body = SerializedRequestBody() - if get_serialized_body is not None: - rb = get_serialized_body() - if request_body_required and rb is None: - raise ValueError("request body is required") - - if rb is not None: - serialized_request_body = rb - - if ( - serialized_request_body.media_type is not None - and serialized_request_body.media_type - not in ( - "multipart/form-data", - "multipart/mixed", - ) - ): - headers["content-type"] = serialized_request_body.media_type - - if http_headers is not None: - for header, value in http_headers.items(): - headers[header] = value - - timeout = timeout_ms / 1000 if timeout_ms is not None else None - - return client.build_request( - method, - url, - params=query_params, - content=serialized_request_body.content, - data=serialized_request_body.data, - files=serialized_request_body.files, - headers=headers, - timeout=timeout, - ) - - def do_request( - self, - hook_ctx, - request, - error_status_codes, - stream=False, - retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, - ) -> httpx.Response: - client = self.sdk_configuration.client - logger = self.sdk_configuration.debug_logger - - hooks = self.sdk_configuration.__dict__["_hooks"] - - def do(): - http_res = None - try: - req = hooks.before_request(BeforeRequestContext(hook_ctx), request) - logger.debug( - "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", - req.method, - req.url, - req.headers, - get_body_content(req), - ) - - if client is None: - raise ValueError("client is required") - - http_res = client.send(req, stream=stream) - except Exception as e: - _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - logger.debug("Request Exception", exc_info=True) - raise e - - if http_res is None: - logger.debug("Raising no response SDK error") - raise models.NoResponseError("No response received") - - logger.debug( - "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", - http_res.status_code, - http_res.url, - http_res.headers, - "" if stream else http_res.text, - ) - - if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = hooks.after_error( - AfterErrorContext(hook_ctx), http_res, None - ) - if err is not None: - logger.debug("Request Exception", exc_info=True) - raise err - if result is not None: - http_res = result - else: - logger.debug("Raising unexpected SDK error") - raise models.SDKError("Unexpected error occurred", http_res) - - return http_res - - if retry_config is not None: - http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) - else: - http_res = do() - - if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - async def do_request_async( - self, - hook_ctx, - request, - error_status_codes, - stream=False, - retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, - ) -> httpx.Response: - client = self.sdk_configuration.async_client - logger = self.sdk_configuration.debug_logger - - hooks = self.sdk_configuration.__dict__["_hooks"] - - async def do(): - http_res = None - try: - req = hooks.before_request(BeforeRequestContext(hook_ctx), request) - logger.debug( - "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", - req.method, - req.url, - req.headers, - get_body_content(req), - ) - - if client is None: - raise ValueError("client is required") - - http_res = await client.send(req, stream=stream) - except Exception as e: - _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - logger.debug("Request Exception", exc_info=True) - raise e - - if http_res is None: - logger.debug("Raising no response SDK error") - raise models.NoResponseError("No response received") - - logger.debug( - "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", - http_res.status_code, - http_res.url, - http_res.headers, - "" if stream else http_res.text, - ) - - if utils.match_status_codes(error_status_codes, http_res.status_code): - result, err = hooks.after_error( - AfterErrorContext(hook_ctx), http_res, None - ) - if err is not None: - logger.debug("Request Exception", exc_info=True) - raise err - if result is not None: - http_res = result - else: - logger.debug("Raising unexpected SDK error") - raise models.SDKError("Unexpected error occurred", http_res) - - return http_res - - if retry_config is not None: - http_res = await utils.retry_async( - do, utils.Retries(retry_config[0], retry_config[1]) - ) - else: - http_res = await do() - - if not utils.match_status_codes(error_status_codes, http_res.status_code): - http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res diff --git a/src/mistralai/batch.py b/src/mistralai/batch.py deleted file mode 100644 index 7ed7ccef..00000000 --- a/src/mistralai/batch.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from .sdkconfiguration import SDKConfiguration -from mistralai.mistral_jobs import MistralJobs -from typing import Optional - - -class Batch(BaseSDK): - jobs: MistralJobs - - def __init__( - self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None - ) -> None: - BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) - self.sdk_configuration = sdk_config - self._init_sdks() - - def _init_sdks(self): - self.jobs = MistralJobs(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/mistralai/beta.py b/src/mistralai/beta.py deleted file mode 100644 index 4bbf1fa3..00000000 --- a/src/mistralai/beta.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from .sdkconfiguration import SDKConfiguration -from mistralai.conversations import Conversations -from mistralai.libraries import Libraries -from mistralai.mistral_agents import MistralAgents -from typing import Optional - - -class Beta(BaseSDK): - conversations: Conversations - r"""(beta) Conversations API""" - agents: MistralAgents - r"""(beta) Agents API""" - libraries: Libraries - r"""(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities.""" - - def __init__( - self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None - ) -> None: - BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) - self.sdk_configuration = sdk_config - self._init_sdks() - - def _init_sdks(self): - self.conversations = Conversations( - self.sdk_configuration, parent_ref=self.parent_ref - ) - self.agents = MistralAgents(self.sdk_configuration, parent_ref=self.parent_ref) - self.libraries = Libraries(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/mistralai/chat.py b/src/mistralai/chat.py deleted file mode 100644 index 67777a1a..00000000 --- a/src/mistralai/chat.py +++ /dev/null @@ -1,767 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import eventstreaming, get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, List, Mapping, Optional, Union - -# region imports -from typing import Type -from mistralai.extra import ( - convert_to_parsed_chat_completion_response, - response_format_from_pydantic_model, - CustomPydanticModel, - ParsedChatCompletionResponse, -) -# endregion imports - - -class Chat(BaseSDK): - r"""Chat Completion API.""" - - # region sdk-class-body - # Custom .parse methods for the Structure Outputs Feature. - - def parse( - self, response_format: Type[CustomPydanticModel], **kwargs: Any - ) -> ParsedChatCompletionResponse[CustomPydanticModel]: - """ - Parse the response using the provided response format. - :param Type[CustomPydanticModel] response_format: The Pydantic model to parse the response into - :param Any **kwargs Additional keyword arguments to pass to the .complete method - :return: The parsed response - """ - # Convert the input Pydantic Model to a strict JSON ready to be passed to chat.complete - json_response_format = response_format_from_pydantic_model(response_format) - # Run the inference - response = self.complete(**kwargs, response_format=json_response_format) - # Parse response back to the input pydantic model - parsed_response = convert_to_parsed_chat_completion_response( - response, response_format - ) - return parsed_response - - async def parse_async( - self, response_format: Type[CustomPydanticModel], **kwargs - ) -> ParsedChatCompletionResponse[CustomPydanticModel]: - """ - Asynchronously parse the response using the provided response format. - :param Type[CustomPydanticModel] response_format: The Pydantic model to parse the response into - :param Any **kwargs Additional keyword arguments to pass to the .complete method - :return: The parsed response - """ - json_response_format = response_format_from_pydantic_model(response_format) - response = await self.complete_async( # pylint: disable=E1125 - **kwargs, response_format=json_response_format - ) - parsed_response = convert_to_parsed_chat_completion_response( - response, response_format - ) - return parsed_response - - def parse_stream( - self, response_format: Type[CustomPydanticModel], **kwargs - ) -> eventstreaming.EventStream[models.CompletionEvent]: - """ - Parse the response using the provided response format. - For now the response will be in JSON format not in the input Pydantic model. - :param Type[CustomPydanticModel] response_format: The Pydantic model to parse the response into - :param Any **kwargs Additional keyword arguments to pass to the .stream method - :return: The JSON parsed response - """ - json_response_format = response_format_from_pydantic_model(response_format) - response = self.stream(**kwargs, response_format=json_response_format) - return response - - async def parse_stream_async( - self, response_format: Type[CustomPydanticModel], **kwargs - ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: - """ - Asynchronously parse the response using the provided response format. - For now the response will be in JSON format not in the input Pydantic model. - :param Type[CustomPydanticModel] response_format: The Pydantic model to parse the response into - :param Any **kwargs Additional keyword arguments to pass to the .stream method - :return: The JSON parsed response - """ - json_response_format = response_format_from_pydantic_model(response_format) - response = await self.stream_async( # pylint: disable=E1125 - **kwargs, response_format=json_response_format - ) - return response - - # endregion sdk-class-body - - def complete( - self, - *, - model: str, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionRequestToolChoice, - models.ChatCompletionRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - safe_prompt: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ChatCompletionResponse: - r"""Chat Completion - - :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model(messages, List[models.Messages]), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - safe_prompt=safe_prompt, - ) - - req = self._build_request( - method="POST", - path="/v1/chat/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="chat_completion_v1_chat_completions_post", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ChatCompletionResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def complete_async( - self, - *, - model: str, - messages: Union[List[models.Messages], List[models.MessagesTypedDict]], - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[Union[models.Stop, models.StopTypedDict]] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionRequestToolChoice, - models.ChatCompletionRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - safe_prompt: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ChatCompletionResponse: - r"""Chat Completion - - :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model(messages, List[models.Messages]), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - safe_prompt=safe_prompt, - ) - - req = self._build_request_async( - method="POST", - path="/v1/chat/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="chat_completion_v1_chat_completions_post", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ChatCompletionResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def stream( - self, - *, - model: str, - messages: Union[ - List[models.ChatCompletionStreamRequestMessages], - List[models.ChatCompletionStreamRequestMessagesTypedDict], - ], - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[ - Union[ - models.ChatCompletionStreamRequestStop, - models.ChatCompletionStreamRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionStreamRequestToolChoice, - models.ChatCompletionStreamRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - safe_prompt: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStream[models.CompletionEvent]: - r"""Stream chat completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionStreamRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - safe_prompt=safe_prompt, - ) - - req = self._build_request( - method="POST", - path="/v1/chat/completions#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="stream_chat", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) - - async def stream_async( - self, - *, - model: str, - messages: Union[ - List[models.ChatCompletionStreamRequestMessages], - List[models.ChatCompletionStreamRequestMessagesTypedDict], - ], - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = None, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[ - Union[ - models.ChatCompletionStreamRequestStop, - models.ChatCompletionStreamRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - response_format: Optional[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = None, - tools: OptionalNullable[ - Union[List[models.Tool], List[models.ToolTypedDict]] - ] = UNSET, - tool_choice: Optional[ - Union[ - models.ChatCompletionStreamRequestToolChoice, - models.ChatCompletionStreamRequestToolChoiceTypedDict, - ] - ] = None, - presence_penalty: Optional[float] = None, - frequency_penalty: Optional[float] = None, - n: OptionalNullable[int] = UNSET, - prediction: Optional[ - Union[models.Prediction, models.PredictionTypedDict] - ] = None, - parallel_tool_calls: Optional[bool] = None, - prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, - safe_prompt: Optional[bool] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: - r"""Stream chat completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. - :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param response_format: - :param tools: - :param tool_choice: - :param presence_penalty: presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. - :param frequency_penalty: frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. - :param n: Number of completions to return for each request, input tokens are only billed once. - :param prediction: - :param parallel_tool_calls: - :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. - :param safe_prompt: Whether to inject a safety prompt before all conversations. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ChatCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - messages=utils.get_pydantic_model( - messages, List[models.ChatCompletionStreamRequestMessages] - ), - response_format=utils.get_pydantic_model( - response_format, Optional[models.ResponseFormat] - ), - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tool]]), - tool_choice=utils.get_pydantic_model( - tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] - ), - presence_penalty=presence_penalty, - frequency_penalty=frequency_penalty, - n=n, - prediction=utils.get_pydantic_model( - prediction, Optional[models.Prediction] - ), - parallel_tool_calls=parallel_tool_calls, - prompt_mode=prompt_mode, - safe_prompt=safe_prompt, - ) - - req = self._build_request_async( - method="POST", - path="/v1/chat/completions#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ChatCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="stream_chat", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/client.py b/src/mistralai/client.py deleted file mode 100644 index d3582f77..00000000 --- a/src/mistralai/client.py +++ /dev/null @@ -1,14 +0,0 @@ -from typing import Optional - -MIGRATION_MESSAGE = "This client is deprecated. To migrate to the new client, please refer to this guide: https://github.com/mistralai/client-python/blob/main/MIGRATION.md. If you need to use this client anyway, pin your version to 0.4.2." - - -class MistralClient: - def __init__( - self, - api_key: Optional[str] = None, - endpoint: str = "", - max_retries: int = 5, - timeout: int = 120, - ): - raise NotImplementedError(MIGRATION_MESSAGE) diff --git a/src/mistralai/client/__init__.py b/src/mistralai/client/__init__.py new file mode 100644 index 00000000..4b79610a --- /dev/null +++ b/src/mistralai/client/__init__.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f1b791f9d2a5 + +from ._version import ( + __title__, + __version__, + __openapi_doc_version__, + __gen_version__, + __user_agent__, +) +from .sdk import * +from .sdkconfiguration import * + + +VERSION: str = __version__ +OPENAPI_DOC_VERSION = __openapi_doc_version__ +SPEAKEASY_GENERATOR_VERSION = __gen_version__ +USER_AGENT = __user_agent__ diff --git a/src/mistralai/client/_hooks/__init__.py b/src/mistralai/client/_hooks/__init__.py new file mode 100644 index 00000000..66a04e37 --- /dev/null +++ b/src/mistralai/client/_hooks/__init__.py @@ -0,0 +1,6 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cef9ff97efd7 + +from .sdkhooks import * +from .types import * +from .registration import * diff --git a/src/mistralai/_hooks/custom_user_agent.py b/src/mistralai/client/_hooks/custom_user_agent.py similarity index 100% rename from src/mistralai/_hooks/custom_user_agent.py rename to src/mistralai/client/_hooks/custom_user_agent.py diff --git a/src/mistralai/_hooks/deprecation_warning.py b/src/mistralai/client/_hooks/deprecation_warning.py similarity index 100% rename from src/mistralai/_hooks/deprecation_warning.py rename to src/mistralai/client/_hooks/deprecation_warning.py diff --git a/src/mistralai/client/_hooks/registration.py b/src/mistralai/client/_hooks/registration.py new file mode 100644 index 00000000..4da6eb7c --- /dev/null +++ b/src/mistralai/client/_hooks/registration.py @@ -0,0 +1,28 @@ +from .custom_user_agent import CustomUserAgentHook +from .deprecation_warning import DeprecationWarningHook +from .traceparent import TraceparentInjectionHook +from .tracing import TracingHook +from .types import Hooks +from .workflow_encoding_hook import WorkflowEncodingHook + +# This file is only ever generated once on the first generation and then is free to be modified. +# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them +# in this file or in separate files in the hooks folder. + + +def init_hooks(hooks: Hooks): + # pylint: disable=unused-argument + """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook + with an instance of a hook that implements that specific Hook interface + Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance + """ + tracing_hook = TracingHook() + workflow_encoding_hook = WorkflowEncodingHook() + hooks.register_before_request_hook(CustomUserAgentHook()) + hooks.register_before_request_hook(TraceparentInjectionHook()) + hooks.register_after_success_hook(DeprecationWarningHook()) + hooks.register_after_success_hook(tracing_hook) + hooks.register_before_request_hook(tracing_hook) + hooks.register_after_error_hook(tracing_hook) + hooks.register_before_request_hook(workflow_encoding_hook) + hooks.register_after_success_hook(workflow_encoding_hook) diff --git a/src/mistralai/client/_hooks/sdkhooks.py b/src/mistralai/client/_hooks/sdkhooks.py new file mode 100644 index 00000000..ecf94240 --- /dev/null +++ b/src/mistralai/client/_hooks/sdkhooks.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ed1e485b2153 + +import httpx +from .types import ( + SDKInitHook, + BeforeRequestContext, + BeforeRequestHook, + AfterSuccessContext, + AfterSuccessHook, + AfterErrorContext, + AfterErrorHook, + Hooks, +) +from .registration import init_hooks +from typing import List, Optional, Tuple +from mistralai.client.httpclient import HttpClient + + +class SDKHooks(Hooks): + def __init__(self) -> None: + self.sdk_init_hooks: List[SDKInitHook] = [] + self.before_request_hooks: List[BeforeRequestHook] = [] + self.after_success_hooks: List[AfterSuccessHook] = [] + self.after_error_hooks: List[AfterErrorHook] = [] + init_hooks(self) + + def register_sdk_init_hook(self, hook: SDKInitHook) -> None: + self.sdk_init_hooks.append(hook) + + def register_before_request_hook(self, hook: BeforeRequestHook) -> None: + self.before_request_hooks.append(hook) + + def register_after_success_hook(self, hook: AfterSuccessHook) -> None: + self.after_success_hooks.append(hook) + + def register_after_error_hook(self, hook: AfterErrorHook) -> None: + self.after_error_hooks.append(hook) + + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: + for hook in self.sdk_init_hooks: + base_url, client = hook.sdk_init(base_url, client) + return base_url, client + + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> httpx.Request: + for hook in self.before_request_hooks: + out = hook.before_request(hook_ctx, request) + if isinstance(out, Exception): + raise out + request = out + + return request + + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> httpx.Response: + for hook in self.after_success_hooks: + out = hook.after_success(hook_ctx, response) + if isinstance(out, Exception): + raise out + response = out + return response + + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: + for hook in self.after_error_hooks: + result = hook.after_error(hook_ctx, response, error) + if isinstance(result, Exception): + raise result + response, error = result + return response, error diff --git a/src/mistralai/client/_hooks/traceparent.py b/src/mistralai/client/_hooks/traceparent.py new file mode 100644 index 00000000..a8ddedf4 --- /dev/null +++ b/src/mistralai/client/_hooks/traceparent.py @@ -0,0 +1,38 @@ +import random +from typing import Dict, Union + +import httpx +from opentelemetry.propagate import inject + +from .types import BeforeRequestContext, BeforeRequestHook + + +_EXECUTE_OPERATION_IDS = { + "execute_workflow_v1_workflows__workflow_identifier__execute_post", + "execute_workflow_registration_v1_workflows_registrations__workflow_registration_id__execute_post", +} + + +class TraceparentInjectionHook(BeforeRequestHook): + """Inject a sampled traceparent on /execute requests so worker traces are always recorded.""" + + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> Union[httpx.Request, Exception]: + if hook_ctx.operation_id not in _EXECUTE_OPERATION_IDS: + return request + + # Don't overwrite an explicitly provided traceparent. + if "traceparent" in request.headers: + return request + + carrier: Dict[str, str] = {} + inject(carrier) + traceparent = carrier.get("traceparent", "") + if not traceparent.endswith("-01"): + trace_id = random.getrandbits(128) + span_id = random.getrandbits(64) + traceparent = f"00-{trace_id:032x}-{span_id:016x}-01" + + request.headers["traceparent"] = traceparent + return request diff --git a/src/mistralai/client/_hooks/tracing.py b/src/mistralai/client/_hooks/tracing.py new file mode 100644 index 00000000..14c8cffc --- /dev/null +++ b/src/mistralai/client/_hooks/tracing.py @@ -0,0 +1,88 @@ +import logging +from typing import Optional, Tuple, Union + +import httpx +from opentelemetry import trace +from opentelemetry.trace import Span + +from mistralai.extra.observability.otel import ( + get_or_create_otel_tracer, + get_response_and_error, + get_traced_request_and_span, + get_traced_response, +) +from .types import ( + AfterErrorContext, + AfterErrorHook, + AfterSuccessContext, + AfterSuccessHook, + BeforeRequestContext, + BeforeRequestHook, +) + +logger = logging.getLogger(__name__) + + +_SPAN_EXT_KEY = "_tracing_span" + + +class TracingHook(BeforeRequestHook, AfterSuccessHook, AfterErrorHook): + def __init__(self) -> None: + self.tracer_provider: Optional[trace.TracerProvider] = None + self.tracing_enabled, self.tracer = get_or_create_otel_tracer() + + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> Union[httpx.Request, Exception]: + # Refresh tracer/provider per request so tracing can be enabled if the + # application configures OpenTelemetry after the client is instantiated. + self.tracing_enabled, self.tracer = get_or_create_otel_tracer( + provider=self.tracer_provider, + ) + request, span = get_traced_request_and_span( + tracing_enabled=self.tracing_enabled, + tracer=self.tracer, + span=None, + operation_id=hook_ctx.operation_id, + request=request, + ) + request.extensions[_SPAN_EXT_KEY] = span + return request + + @staticmethod + def _get_span(response: Optional[httpx.Response]) -> Optional[Span]: + try: + return response.request.extensions.get(_SPAN_EXT_KEY) if response is not None else None + except RuntimeError: + return None + + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> Union[httpx.Response, Exception]: + span = self._get_span(response) + response = get_traced_response( + tracing_enabled=self.tracing_enabled, + tracer=self.tracer, + span=span, + operation_id=hook_ctx.operation_id, + response=response, + ) + return response + + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: + if response: + span = self._get_span(response) + response, error = get_response_and_error( + tracing_enabled=self.tracing_enabled, + tracer=self.tracer, + span=span, + operation_id=hook_ctx.operation_id, + response=response, + error=error, + ) + return response, error diff --git a/src/mistralai/client/_hooks/types.py b/src/mistralai/client/_hooks/types.py new file mode 100644 index 00000000..036d44b8 --- /dev/null +++ b/src/mistralai/client/_hooks/types.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 85cfedfb7582 + +from abc import ABC, abstractmethod +import httpx +from mistralai.client.httpclient import HttpClient +from mistralai.client.sdkconfiguration import SDKConfiguration +from typing import Any, Callable, List, Optional, Tuple, Union + + +class HookContext: + config: SDKConfiguration + base_url: str + operation_id: str + oauth2_scopes: Optional[List[str]] = None + security_source: Optional[Union[Any, Callable[[], Any]]] = None + + def __init__( + self, + config: SDKConfiguration, + base_url: str, + operation_id: str, + oauth2_scopes: Optional[List[str]], + security_source: Optional[Union[Any, Callable[[], Any]]], + ): + self.config = config + self.base_url = base_url + self.operation_id = operation_id + self.oauth2_scopes = oauth2_scopes + self.security_source = security_source + + +class BeforeRequestContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class AfterSuccessContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class AfterErrorContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.config, + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, + ) + + +class SDKInitHook(ABC): + @abstractmethod + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: + pass + + +class BeforeRequestHook(ABC): + @abstractmethod + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> Union[httpx.Request, Exception]: + pass + + +class AfterSuccessHook(ABC): + @abstractmethod + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> Union[httpx.Response, Exception]: + pass + + +class AfterErrorHook(ABC): + @abstractmethod + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: + pass + + +class Hooks(ABC): + @abstractmethod + def register_sdk_init_hook(self, hook: SDKInitHook): + pass + + @abstractmethod + def register_before_request_hook(self, hook: BeforeRequestHook): + pass + + @abstractmethod + def register_after_success_hook(self, hook: AfterSuccessHook): + pass + + @abstractmethod + def register_after_error_hook(self, hook: AfterErrorHook): + pass diff --git a/src/mistralai/client/_hooks/workflow_encoding_hook.py b/src/mistralai/client/_hooks/workflow_encoding_hook.py new file mode 100644 index 00000000..d65c3ff4 --- /dev/null +++ b/src/mistralai/client/_hooks/workflow_encoding_hook.py @@ -0,0 +1,453 @@ +import asyncio +import concurrent.futures +import json +import logging +import re +import uuid +import weakref +from typing import Any, AsyncIterator, Coroutine, Dict, Optional, TypeVar, Union + +import httpx +from httpx._types import AsyncByteStream + +from .types import ( + AfterSuccessContext, + AfterSuccessHook, + BeforeRequestContext, + BeforeRequestHook, +) +from mistralai.client.sdkconfiguration import SDKConfiguration +from mistralai.extra.workflows.encoding.config import WorkflowEncodingConfig +from mistralai.extra.workflows.encoding.helpers import generate_two_part_id +from mistralai.extra.workflows.encoding.models import WorkflowContext +from mistralai.extra.workflows.encoding.payload_encoder import PayloadEncoder + +logger = logging.getLogger(__name__) + +# Attribute name for storing config ID on SDKConfiguration +_ENCODING_CONFIG_ID_ATTR = "_workflow_encoding_config_id" + + +class _WorkflowEncodingConfig: + def __init__(self, payload_encoder: PayloadEncoder, namespace: str) -> None: + self.payload_encoder = payload_encoder + self.namespace = namespace + + +# Per-client configs keyed by UUID +_workflow_configs: Dict[str, _WorkflowEncodingConfig] = {} + + +def _cleanup_config(config_id: str) -> None: + """Remove config when client is garbage collected.""" + _workflow_configs.pop(config_id, None) + + +def configure_workflow_encoding( + config: WorkflowEncodingConfig, + namespace: str, + sdk_config: SDKConfiguration, +) -> None: + """Configure workflow payload encoding for a specific client.""" + # Get or create config ID for this client + config_id = getattr(sdk_config, _ENCODING_CONFIG_ID_ATTR, None) + if config_id is None: + config_id = str(uuid.uuid4()) + setattr(sdk_config, _ENCODING_CONFIG_ID_ATTR, config_id) + # Register cleanup when SDKConfiguration is garbage collected + weakref.finalize(sdk_config, _cleanup_config, config_id) + + _workflow_configs[config_id] = _WorkflowEncodingConfig( + payload_encoder=PayloadEncoder(encoding_config=config), + namespace=namespace, + ) + + +def _get_encoding_config( + sdk_config: SDKConfiguration, +) -> Optional[_WorkflowEncodingConfig]: + """Get workflow encoding config for a client.""" + config_id = getattr(sdk_config, _ENCODING_CONFIG_ID_ATTR, None) + if config_id is None: + return None + return _workflow_configs.get(config_id) + + +EXECUTE_WORKFLOW_OPERATION_ID = ( + "execute_workflow_v1_workflows__workflow_identifier__execute_post" +) +EXECUTE_WORKFLOW_REGISTRATION_OPERATION_ID = "execute_workflow_registration_v1_workflows_registrations__workflow_registration_id__execute_post" +SCHEDULE_WORKFLOW_OPERATION_ID = "schedule_workflow_v1_workflows_schedules_post" + +EXECUTE_OPERATIONS = { + EXECUTE_WORKFLOW_OPERATION_ID, + EXECUTE_WORKFLOW_REGISTRATION_OPERATION_ID, +} + +OPERATIONS_ENCODE_INPUT = { + EXECUTE_WORKFLOW_OPERATION_ID, + EXECUTE_WORKFLOW_REGISTRATION_OPERATION_ID, + "signal_workflow_execution_v1_workflows_executions__execution_id__signals_post", + "query_workflow_execution_v1_workflows_executions__execution_id__queries_post", + "update_workflow_execution_v1_workflows_executions__execution_id__updates_post", + SCHEDULE_WORKFLOW_OPERATION_ID, +} + +OPERATIONS_DECODE_RESULT = { + EXECUTE_WORKFLOW_OPERATION_ID, + EXECUTE_WORKFLOW_REGISTRATION_OPERATION_ID, + "get_workflow_execution_v1_workflows_executions__execution_id__get", + "query_workflow_execution_v1_workflows_executions__execution_id__queries_post", + "update_workflow_execution_v1_workflows_executions__execution_id__updates_post", +} + +# Operations that return event data that may need decryption +OPERATIONS_DECODE_EVENTS = { + "get_workflow_events_v1_workflows_events_list_get", +} + +# Streaming operations that return SSE event data that may need decryption +OPERATIONS_DECODE_EVENTS_STREAM = { + "get_stream_events_v1_workflows_events_stream_get", + "stream_v1_workflows_executions__execution_id__stream_get", +} + +SCHEDULE_CORRELATION_ID_PLACEHOLDER = "__scheduled_workflow__" + + +def _is_payload_type(value: Any) -> bool: + """Check if a value is a JSONPayload or JSONPatchPayload by its structure. + + Payload types have: {"type": "json" | "json_patch", "value": ...} + """ + if not isinstance(value, dict): + return False + payload_type = value.get("type") + return payload_type in ("json", "json_patch") and "value" in value + + +_T = TypeVar("_T") + + +def _run_async(coro: Coroutine[Any, Any, _T]) -> _T: + """Run an async coroutine in a sync context.""" + try: + asyncio.get_running_loop() + # Already in async context - run in a separate thread with new loop + with concurrent.futures.ThreadPoolExecutor() as pool: + future: concurrent.futures.Future[_T] = pool.submit(asyncio.run, coro) + return future.result() + except RuntimeError: + # No running loop - safe to use asyncio.run + return asyncio.run(coro) + + +def _extract_execution_id_from_url(url: str) -> Optional[str]: + """Extract execution_id from URL path like /v1/workflows/executions/{execution_id}/...""" + match = re.search(r"/executions/([^/]+)", str(url)) + if match: + return match.group(1) + return None + + +def _extract_workflow_identifier_from_execute_url(url: str) -> Optional[str]: + """Extract workflow identifier from execute URLs. + + Handles: + - /v1/workflows/{workflow_identifier}/execute + - /v1/workflows/registrations/{workflow_registration_id}/execute + """ + match = re.search(r"/(?:workflows|registrations)/([^/]+)/execute", str(url)) + return match.group(1) if match else None + + +def _extract_execution_id_from_body(body: Dict[str, Any]) -> Optional[str]: + """Extract execution_id from request body.""" + return body.get("execution_id") + + +async def _decrypt_event_attributes( + attributes: Dict[str, Any], + payload_encoder: PayloadEncoder, +) -> Dict[str, Any]: + """Decrypt payload fields in event attributes.""" + for field_name, field_value in attributes.items(): + if not _is_payload_type(field_value): + continue + + # Check if it has encoding_options (meaning it's encrypted) + if not field_value.get("encoding_options"): + continue + + # Decrypt the payload + decrypted = await payload_encoder.decode_event_payload(field_value) + attributes[field_name] = decrypted + + return attributes + + +async def _decrypt_events_in_response( + body: Dict[str, Any], + payload_encoder: PayloadEncoder, +) -> Dict[str, Any]: + """Decrypt payload fields in events within a response body.""" + events = body.get("events", []) + if not events: + return body + + for event in events: + attributes = event.get("attributes") + if isinstance(attributes, dict): + event["attributes"] = await _decrypt_event_attributes( + attributes, payload_encoder + ) + + return body + + +def _decrypt_sse_line(line: bytes, payload_encoder: PayloadEncoder) -> bytes: + """Decrypt event payloads in an SSE data line.""" + if not line.startswith(b"data:"): + return line + + try: + data_part = line[5:].strip() + if not data_part: + return line + + event_wrapper = json.loads(data_part) + data = event_wrapper.get("data") + if not isinstance(data, dict): + return line + + attributes = data.get("attributes") + if not isinstance(attributes, dict): + return line + + # Decrypt in place - _decrypt_event_attributes modifies attributes dict + _run_async(_decrypt_event_attributes(attributes, payload_encoder)) + + return b"data: " + json.dumps(event_wrapper).encode("utf-8") + except (json.JSONDecodeError, Exception) as e: + logger.debug("SSE line decryption failed: %s", e) + return line + + +class _DecryptingAsyncByteStream(AsyncByteStream): + """Async byte stream wrapper that decrypts SSE event payloads.""" + + def __init__(self, original_stream: Any, payload_encoder: PayloadEncoder): + self._original = original_stream + self._payload_encoder = payload_encoder + self._buffer = b"" + + async def __aiter__(self) -> AsyncIterator[bytes]: + async for chunk in self._original: + for processed in self._process_chunk(chunk): + yield processed + # Flush remaining buffer + if self._buffer: + yield _decrypt_sse_line(self._buffer, self._payload_encoder) + + def _process_chunk(self, chunk: bytes): + self._buffer += chunk + lines = self._buffer.split(b"\n") + # Keep last incomplete line in buffer + self._buffer = lines[-1] + for line in lines[:-1]: + yield _decrypt_sse_line(line, self._payload_encoder) + b"\n" + + async def aclose(self) -> None: + if hasattr(self._original, "aclose"): + await self._original.aclose() + + +def _wrap_sse_response_with_decryption( + response: httpx.Response, + payload_encoder: PayloadEncoder, +) -> httpx.Response: + """Wrap an SSE response to decrypt event payloads as they stream. + + Creates a new response with a custom stream that decrypts payloads on-the-fly. + """ + # Get the original stream from the response + original_stream = response.stream + + # Create wrapped stream + decrypting_stream = _DecryptingAsyncByteStream(original_stream, payload_encoder) + + # Create new response with wrapped stream + # Use internal _content to avoid reading stream + new_response = httpx.Response( + status_code=response.status_code, + headers=response.headers, + stream=decrypting_stream, + request=response.request, + extensions=response.extensions, + ) + + return new_response + + +class WorkflowEncodingHook(BeforeRequestHook, AfterSuccessHook): + """Hook for encoding/decoding workflow event payloads. + + This hook intercepts workflow requests to encode input payloads (encryption, + blob storage offloading) and decodes result fields in responses. + + Configuration is set via Mistral.configure_workflow_encoding() which initializes + the PayloadEncoder and stores it at module level. + """ + + def before_request( + self, + hook_ctx: BeforeRequestContext, + request: httpx.Request, + ) -> Union[httpx.Request, Exception]: + """Intercept requests to encode workflow input payloads.""" + encoding_config = _get_encoding_config(hook_ctx.config) + if not encoding_config: + return request + + if hook_ctx.operation_id not in OPERATIONS_ENCODE_INPUT: + return request + + content_type = request.headers.get("content-type", "") + if "application/json" not in content_type: + return request + + try: + body = json.loads(request.content) + input_data = body.get("input") + if input_data is None: + return request + + execution_id = _extract_execution_id_from_body( + body + ) or _extract_execution_id_from_url(str(request.url)) + + if not execution_id and hook_ctx.operation_id in EXECUTE_OPERATIONS: + seed = _extract_workflow_identifier_from_execute_url(str(request.url)) + execution_id = generate_two_part_id(seed) + body["execution_id"] = execution_id + + if ( + not execution_id + and hook_ctx.operation_id == SCHEDULE_WORKFLOW_OPERATION_ID + ): + execution_id = SCHEDULE_CORRELATION_ID_PLACEHOLDER + + if not execution_id: + raise ValueError( + f"WorkflowEncoding: Could not extract execution_id for {hook_ctx.operation_id}" + ) + + context = WorkflowContext( + namespace=encoding_config.namespace, + execution_id=execution_id, + ) + + encoded_input = _run_async( + encoding_config.payload_encoder.encode_network_input( + input_data, context + ) + ) + + # Update body based on operation type: + # - Execute operations: use separate `encoded_input` field and set `input` to None + # - Signal/Query/Update: put encoded input directly in `input` field + if hook_ctx.operation_id in EXECUTE_OPERATIONS: + body["encoded_input"] = encoded_input.model_dump(mode="json") + body["input"] = None + else: + body["input"] = encoded_input.model_dump(mode="json") + + new_content = json.dumps(body).encode("utf-8") + new_headers = httpx.Headers(request.headers) + new_headers["content-length"] = str(len(new_content)) + + return httpx.Request( + method=request.method, + url=request.url, + headers=new_headers, + content=new_content, + extensions=request.extensions, + ) + + except Exception as e: + logger.error("WorkflowEncodingHook: Failed to encode input: %s", e) + raise + + def after_success( + self, + hook_ctx: AfterSuccessContext, + response: httpx.Response, + ) -> Union[httpx.Response, Exception]: + """Intercept responses to decode workflow result payloads and event payloads.""" + encoding_config = _get_encoding_config(hook_ctx.config) + if not encoding_config: + return response + + content_type = response.headers.get("content-type", "") + + # Handle SSE stream decryption + if hook_ctx.operation_id in OPERATIONS_DECODE_EVENTS_STREAM: + if "text/event-stream" in content_type: + return _wrap_sse_response_with_decryption( + response, encoding_config.payload_encoder + ) + return response + + if "application/json" not in content_type: + return response + + # Handle workflow result decoding + if hook_ctx.operation_id in OPERATIONS_DECODE_RESULT: + try: + body = json.loads(response.content) + result = body.get("result") + if ( + result is not None + and encoding_config.payload_encoder.check_is_payload_encoded( + result + ) + ): + decoded_result = _run_async( + encoding_config.payload_encoder.decode_network_result(result) + ) + + body["result"] = decoded_result + new_content = json.dumps(body).encode("utf-8") + + response = httpx.Response( + status_code=response.status_code, + headers=response.headers, + content=new_content, + request=response.request, + extensions=response.extensions, + ) + except Exception as e: + logger.error("WorkflowEncodingHook: Failed to decode result: %s", e) + raise + + # Handle event payload decoding + elif hook_ctx.operation_id in OPERATIONS_DECODE_EVENTS: + try: + body = json.loads(response.content) + body = _run_async( + _decrypt_events_in_response(body, encoding_config.payload_encoder) + ) + new_content = json.dumps(body).encode("utf-8") + + response = httpx.Response( + status_code=response.status_code, + headers=response.headers, + content=new_content, + request=response.request, + extensions=response.extensions, + ) + except Exception as e: + logger.error("WorkflowEncodingHook: Failed to decode events: %s", e) + raise + + return response diff --git a/src/mistralai/client/_version.py b/src/mistralai/client/_version.py new file mode 100644 index 00000000..9f9ae8c6 --- /dev/null +++ b/src/mistralai/client/_version.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cc807b30de19 + +import importlib.metadata + +__title__: str = "mistralai" +__version__: str = "2.4.5" +__openapi_doc_version__: str = "1.0.0" +__gen_version__: str = "2.879.6" +__user_agent__: str = "speakeasy-sdk/python 2.4.5 2.879.6 1.0.0 mistralai" + +try: + if __package__ is not None: + __version__ = importlib.metadata.version(__package__) +except importlib.metadata.PackageNotFoundError: + pass diff --git a/src/mistralai/accesses.py b/src/mistralai/client/accesses.py similarity index 84% rename from src/mistralai/accesses.py rename to src/mistralai/client/accesses.py index ea33517b..5d859a39 100644 --- a/src/mistralai/accesses.py +++ b/src/mistralai/client/accesses.py @@ -1,11 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 76fc53bfcf59 from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -20,7 +21,7 @@ def list( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListSharingOut: + ) -> models.ListSharingResponse: r"""List all of the access to this library. Given a library, list all of the Entity that have access and to what level. @@ -36,6 +37,9 @@ def list( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -58,6 +62,7 @@ def list( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -74,7 +79,7 @@ def list( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_share_list_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -86,20 +91,20 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListSharingOut, http_res) + return unmarshal_json_response(models.ListSharingResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, @@ -109,7 +114,7 @@ async def list_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListSharingOut: + ) -> models.ListSharingResponse: r"""List all of the access to this library. Given a library, list all of the Entity that have access and to what level. @@ -125,6 +130,9 @@ async def list_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -147,6 +155,7 @@ async def list_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -163,7 +172,7 @@ async def list_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_share_list_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -175,43 +184,43 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListSharingOut, http_res) + return unmarshal_json_response(models.ListSharingResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def update_or_create( self, *, library_id: str, - org_id: str, level: models.ShareEnum, share_with_uuid: str, share_with_type: models.EntityType, + org_id: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.SharingOut: + ) -> models.Sharing: r"""Create or update an access level. Given a library id, you can create or update the access level of an entity. You have to be owner of the library to share a library. An owner cannot change their own role. A library cannot be shared outside of the organization. :param library_id: - :param org_id: :param level: :param share_with_uuid: The id of the entity (user, workspace or organization) to share with :param share_with_type: The type of entity, used to share a library. + :param org_id: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -222,6 +231,9 @@ def update_or_create( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -229,7 +241,7 @@ def update_or_create( request = models.LibrariesShareCreateV1Request( library_id=library_id, - sharing_in=models.SharingIn( + sharing_request=models.SharingRequest( org_id=org_id, level=level, share_with_uuid=share_with_uuid, @@ -251,8 +263,9 @@ def update_or_create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.sharing_in, False, False, "json", models.SharingIn + request.sharing_request, False, False, "json", models.SharingRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -269,7 +282,7 @@ def update_or_create( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_share_create_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -281,43 +294,43 @@ def update_or_create( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.SharingOut, http_res) + return unmarshal_json_response(models.Sharing, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def update_or_create_async( self, *, library_id: str, - org_id: str, level: models.ShareEnum, share_with_uuid: str, share_with_type: models.EntityType, + org_id: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.SharingOut: + ) -> models.Sharing: r"""Create or update an access level. Given a library id, you can create or update the access level of an entity. You have to be owner of the library to share a library. An owner cannot change their own role. A library cannot be shared outside of the organization. :param library_id: - :param org_id: :param level: :param share_with_uuid: The id of the entity (user, workspace or organization) to share with :param share_with_type: The type of entity, used to share a library. + :param org_id: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -328,6 +341,9 @@ async def update_or_create_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -335,7 +351,7 @@ async def update_or_create_async( request = models.LibrariesShareCreateV1Request( library_id=library_id, - sharing_in=models.SharingIn( + sharing_request=models.SharingRequest( org_id=org_id, level=level, share_with_uuid=share_with_uuid, @@ -357,8 +373,9 @@ async def update_or_create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.sharing_in, False, False, "json", models.SharingIn + request.sharing_request, False, False, "json", models.SharingRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -375,7 +392,7 @@ async def update_or_create_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_share_create_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -387,41 +404,41 @@ async def update_or_create_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.SharingOut, http_res) + return unmarshal_json_response(models.Sharing, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def delete( self, *, library_id: str, - org_id: str, share_with_uuid: str, share_with_type: models.EntityType, + org_id: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.SharingOut: + ) -> models.Sharing: r"""Delete an access level. Given a library id, you can delete the access level of an entity. An owner cannot delete it's own access. You have to be the owner of the library to delete an acces other than yours. :param library_id: - :param org_id: :param share_with_uuid: The id of the entity (user, workspace or organization) to share with :param share_with_type: The type of entity, used to share a library. + :param org_id: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -432,6 +449,9 @@ def delete( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -462,6 +482,7 @@ def delete( get_serialized_body=lambda: utils.serialize_request_body( request.sharing_delete, False, False, "json", models.SharingDelete ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -478,7 +499,7 @@ def delete( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_share_delete_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -490,41 +511,41 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.SharingOut, http_res) + return unmarshal_json_response(models.Sharing, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def delete_async( self, *, library_id: str, - org_id: str, share_with_uuid: str, share_with_type: models.EntityType, + org_id: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.SharingOut: + ) -> models.Sharing: r"""Delete an access level. Given a library id, you can delete the access level of an entity. An owner cannot delete it's own access. You have to be the owner of the library to delete an acces other than yours. :param library_id: - :param org_id: :param share_with_uuid: The id of the entity (user, workspace or organization) to share with :param share_with_type: The type of entity, used to share a library. + :param org_id: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -535,6 +556,9 @@ async def delete_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -565,6 +589,7 @@ async def delete_async( get_serialized_body=lambda: utils.serialize_request_body( request.sharing_delete, False, False, "json", models.SharingDelete ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -581,7 +606,7 @@ async def delete_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_share_delete_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -593,17 +618,17 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.SharingOut, http_res) + return unmarshal_json_response(models.Sharing, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/agents.py b/src/mistralai/client/agents.py new file mode 100644 index 00000000..1bcd8c54 --- /dev/null +++ b/src/mistralai/client/agents.py @@ -0,0 +1,770 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e946546e3eaa + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class Agents(BaseSDK): + r"""Agents API.""" + + def complete( + self, + *, + messages: Union[ + List[models.AgentsCompletionRequestMessage], + List[models.AgentsCompletionRequestMessageTypedDict], + ], + agent_id: str, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: OptionalNullable[ + Union[ + models.AgentsCompletionRequestStop, + models.AgentsCompletionRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[ + List[models.AgentsCompletionRequestTool], + List[models.AgentsCompletionRequestToolTypedDict], + ] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.AgentsCompletionRequestToolChoice, + models.AgentsCompletionRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: OptionalNullable[float] = UNSET, + frequency_penalty: OptionalNullable[float] = UNSET, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionResponse: + r"""Agents Completion + + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param agent_id: The ID of the agent to use for this completion. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: + :param tool_choice: + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: + :param reasoning_effort: + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param guardrails: + :param prompt_cache_key: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsCompletionRequest( + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.AgentsCompletionRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.AgentsCompletionRequestTool]] + ), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.AgentsCompletionRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + reasoning_effort=reasoning_effort, + prompt_mode=prompt_mode, + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + prompt_cache_key=prompt_cache_key, + agent_id=agent_id, + ) + + req = self._build_request( + method="POST", + path="/v1/agents/completions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.AgentsCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_completion_v1_agents_completions_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def complete_async( + self, + *, + messages: Union[ + List[models.AgentsCompletionRequestMessage], + List[models.AgentsCompletionRequestMessageTypedDict], + ], + agent_id: str, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: OptionalNullable[ + Union[ + models.AgentsCompletionRequestStop, + models.AgentsCompletionRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[ + List[models.AgentsCompletionRequestTool], + List[models.AgentsCompletionRequestToolTypedDict], + ] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.AgentsCompletionRequestToolChoice, + models.AgentsCompletionRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: OptionalNullable[float] = UNSET, + frequency_penalty: OptionalNullable[float] = UNSET, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionResponse: + r"""Agents Completion + + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param agent_id: The ID of the agent to use for this completion. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: + :param tool_choice: + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: + :param reasoning_effort: + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param guardrails: + :param prompt_cache_key: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsCompletionRequest( + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.AgentsCompletionRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.AgentsCompletionRequestTool]] + ), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.AgentsCompletionRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + reasoning_effort=reasoning_effort, + prompt_mode=prompt_mode, + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + prompt_cache_key=prompt_cache_key, + agent_id=agent_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/agents/completions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.AgentsCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_completion_v1_agents_completions_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def stream( + self, + *, + messages: Union[ + List[models.AgentsCompletionStreamRequestMessage], + List[models.AgentsCompletionStreamRequestMessageTypedDict], + ], + agent_id: str, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: OptionalNullable[ + Union[ + models.AgentsCompletionStreamRequestStop, + models.AgentsCompletionStreamRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[ + List[models.AgentsCompletionStreamRequestTool], + List[models.AgentsCompletionStreamRequestToolTypedDict], + ] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.AgentsCompletionStreamRequestToolChoice, + models.AgentsCompletionStreamRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: OptionalNullable[float] = UNSET, + frequency_penalty: OptionalNullable[float] = UNSET, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.CompletionEvent]: + r"""Stream Agents completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param agent_id: The ID of the agent to use for this completion. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: + :param tool_choice: + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: + :param reasoning_effort: + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param guardrails: + :param prompt_cache_key: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsCompletionStreamRequest( + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.AgentsCompletionStreamRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.AgentsCompletionStreamRequestTool]] + ), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.AgentsCompletionStreamRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + reasoning_effort=reasoning_effort, + prompt_mode=prompt_mode, + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + prompt_cache_key=prompt_cache_key, + agent_id=agent_id, + ) + + req = self._build_request( + method="POST", + path="/v1/agents/completions#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.AgentsCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_agents", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def stream_async( + self, + *, + messages: Union[ + List[models.AgentsCompletionStreamRequestMessage], + List[models.AgentsCompletionStreamRequestMessageTypedDict], + ], + agent_id: str, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: OptionalNullable[ + Union[ + models.AgentsCompletionStreamRequestStop, + models.AgentsCompletionStreamRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[ + List[models.AgentsCompletionStreamRequestTool], + List[models.AgentsCompletionStreamRequestToolTypedDict], + ] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.AgentsCompletionStreamRequestToolChoice, + models.AgentsCompletionStreamRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: OptionalNullable[float] = UNSET, + frequency_penalty: OptionalNullable[float] = UNSET, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: + r"""Stream Agents completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param agent_id: The ID of the agent to use for this completion. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: + :param tool_choice: + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: + :param reasoning_effort: + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param guardrails: + :param prompt_cache_key: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsCompletionStreamRequest( + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.AgentsCompletionStreamRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.AgentsCompletionStreamRequestTool]] + ), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.AgentsCompletionStreamRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + reasoning_effort=reasoning_effort, + prompt_mode=prompt_mode, + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + prompt_cache_key=prompt_cache_key, + agent_id=agent_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/agents/completions#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.AgentsCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_agents", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/client/audio.py b/src/mistralai/client/audio.py new file mode 100644 index 00000000..597954e4 --- /dev/null +++ b/src/mistralai/client/audio.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7a8ed2e90d61 + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from mistralai.client.speech import Speech +from mistralai.client.transcriptions import Transcriptions +from mistralai.client.voices import Voices +from typing import Optional + +# region imports +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from mistralai.extra.realtime import RealtimeTranscription +# endregion imports + + +class Audio(BaseSDK): + speech: Speech + transcriptions: Transcriptions + r"""API for audio transcription.""" + voices: Voices + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.speech = Speech(self.sdk_configuration, parent_ref=self.parent_ref) + self.transcriptions = Transcriptions( + self.sdk_configuration, parent_ref=self.parent_ref + ) + self.voices = Voices(self.sdk_configuration, parent_ref=self.parent_ref) + + # region sdk-class-body + @property + def realtime(self) -> "RealtimeTranscription": + """Returns a client for real-time audio transcription via WebSocket.""" + if not hasattr(self, "_realtime"): + from mistralai.extra.realtime import RealtimeTranscription # pylint: disable=import-outside-toplevel + + self._realtime = RealtimeTranscription(self.sdk_configuration) # pylint: disable=attribute-defined-outside-init + + return self._realtime + + # endregion sdk-class-body diff --git a/src/mistralai/client/basesdk.py b/src/mistralai/client/basesdk.py new file mode 100644 index 00000000..4a27eb2f --- /dev/null +++ b/src/mistralai/client/basesdk.py @@ -0,0 +1,396 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7518c67b81ea + +from .sdkconfiguration import SDKConfiguration +import httpx +from mistralai.client import errors, models, utils +from mistralai.client._hooks import ( + AfterErrorContext, + AfterSuccessContext, + BeforeRequestContext, +) +from mistralai.client.utils import ( + RetryConfig, + SerializedRequestBody, + get_body_content, + run_sync_in_thread, +) +from typing import Callable, List, Mapping, Optional, Tuple +from urllib.parse import parse_qs, urlparse + + +class BaseSDK: + sdk_configuration: SDKConfiguration + parent_ref: Optional[object] = None + """ + Reference to the root SDK instance, if any. This will prevent it from + being garbage collected while there are active streams. + """ + + def __init__( + self, + sdk_config: SDKConfiguration, + parent_ref: Optional[object] = None, + ) -> None: + self.sdk_configuration = sdk_config + self.parent_ref = parent_ref + + def _get_url(self, base_url, url_variables): + sdk_url, sdk_variables = self.sdk_configuration.get_server_details() + + if base_url is None: + base_url = sdk_url + + if url_variables is None: + url_variables = sdk_variables + + return utils.template_url(base_url, url_variables) + + def _build_request_async( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + allowed_fields: Optional[List[str]] = None, + ) -> httpx.Request: + client = self.sdk_configuration.async_client + return self._build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + http_headers, + allow_empty_value, + allowed_fields, + ) + + def _build_request( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + allowed_fields: Optional[List[str]] = None, + ) -> httpx.Request: + client = self.sdk_configuration.client + return self._build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + http_headers, + allow_empty_value, + allowed_fields, + ) + + def _build_request_with_client( + self, + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, + allow_empty_value: Optional[List[str]] = None, + allowed_fields: Optional[List[str]] = None, + ) -> httpx.Request: + query_params = {} + + url = url_override + if url is None: + url = utils.generate_url( + self._get_url(base_url, url_variables), + path, + request if request_has_path_params else None, + _globals if request_has_path_params else None, + ) + + query_params = utils.get_query_params( + request if request_has_query_params else None, + _globals if request_has_query_params else None, + allow_empty_value, + ) + else: + # Pick up the query parameter from the override so they can be + # preserved when building the request later on (necessary as of + # httpx 0.28). + parsed_override = urlparse(str(url_override)) + query_params = parse_qs(parsed_override.query, keep_blank_values=True) + + headers = utils.get_headers(request, _globals) + headers["Accept"] = accept_header_value + headers[user_agent_header] = self.sdk_configuration.user_agent + + if security is not None: + if callable(security): + security = security() + security = utils.get_security_from_env(security, models.Security) + if security is not None: + security_headers, security_query_params = utils.get_security( + security, allowed_fields + ) + headers = {**headers, **security_headers} + query_params = {**query_params, **security_query_params} + + serialized_request_body = SerializedRequestBody() + if get_serialized_body is not None: + rb = get_serialized_body() + if request_body_required and rb is None: + raise ValueError("request body is required") + + if rb is not None: + serialized_request_body = rb + + if ( + serialized_request_body.media_type is not None + and serialized_request_body.media_type + not in ( + "multipart/form-data", + "multipart/mixed", + ) + ): + headers["content-type"] = serialized_request_body.media_type + + if http_headers is not None: + for header, value in http_headers.items(): + headers[header] = value + + timeout = timeout_ms / 1000 if timeout_ms is not None else None + + return client.build_request( + method, + url, + params=query_params, + content=serialized_request_body.content, + data=serialized_request_body.data, + files=serialized_request_body.files, + headers=headers, + timeout=timeout if timeout is not None else httpx.USE_CLIENT_DEFAULT, + ) + + def do_request( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.client + logger = self.sdk_configuration.debug_logger + + hooks = self.sdk_configuration.__dict__["_hooks"] + + def do(): + http_res = None + try: + req = hooks.before_request(BeforeRequestContext(hook_ctx), request) + if "timeout" in request.extensions and "timeout" not in req.extensions: + req.extensions["timeout"] = request.extensions["timeout"] + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + + if client is None: + raise ValueError("client is required") + + http_res = client.send(req, stream=stream) + except Exception as e: + _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e) + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.NoResponseError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = hooks.after_error( + AfterErrorContext(hook_ctx), http_res, None + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred", http_res) + + return http_res + + if retry_config is not None: + http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) + else: + http_res = do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res) + + return http_res + + async def do_request_async( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.async_client + logger = self.sdk_configuration.debug_logger + + hooks = self.sdk_configuration.__dict__["_hooks"] + + async def do(): + http_res = None + try: + req = await run_sync_in_thread( + hooks.before_request, BeforeRequestContext(hook_ctx), request + ) + + if "timeout" in request.extensions and "timeout" not in req.extensions: + req.extensions["timeout"] = request.extensions["timeout"] + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + + if client is None: + raise ValueError("client is required") + + http_res = await client.send(req, stream=stream) + except Exception as e: + _, e = await run_sync_in_thread( + hooks.after_error, AfterErrorContext(hook_ctx), None, e + ) + + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.NoResponseError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = await run_sync_in_thread( + hooks.after_error, AfterErrorContext(hook_ctx), http_res, None + ) + + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred", http_res) + + return http_res + + if retry_config is not None: + http_res = await utils.retry_async( + do, utils.Retries(retry_config[0], retry_config[1]) + ) + else: + http_res = await do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = await run_sync_in_thread( + hooks.after_success, AfterSuccessContext(hook_ctx), http_res + ) + + return http_res diff --git a/src/mistralai/client/batch.py b/src/mistralai/client/batch.py new file mode 100644 index 00000000..7e36fd0d --- /dev/null +++ b/src/mistralai/client/batch.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cffe114c7ac7 + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from mistralai.client.batch_jobs import BatchJobs +from typing import Optional + + +class Batch(BaseSDK): + jobs: BatchJobs + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.jobs = BatchJobs(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/mistralai/client/batch_jobs.py b/src/mistralai/client/batch_jobs.py new file mode 100644 index 00000000..2bf50fd3 --- /dev/null +++ b/src/mistralai/client/batch_jobs.py @@ -0,0 +1,1003 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3423fec25840 + +from .basesdk import BaseSDK +from datetime import datetime +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class BatchJobs(BaseSDK): + def list( + self, + *, + page: Optional[int] = 0, + page_size: Optional[int] = 100, + model: OptionalNullable[str] = UNSET, + agent_id: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + created_after: OptionalNullable[datetime] = UNSET, + created_by_me: Optional[bool] = False, + status: OptionalNullable[List[models.BatchJobStatus]] = UNSET, + order_by: Optional[models.OrderBy] = "-created", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListBatchJobsResponse: + r"""Get Batch Jobs + + Get a list of batch jobs for your organization and user. + + :param page: + :param page_size: + :param model: + :param agent_id: + :param metadata: + :param created_after: + :param created_by_me: + :param status: + :param order_by: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesBatchGetBatchJobsRequest( + page=page, + page_size=page_size, + model=model, + agent_id=agent_id, + metadata=metadata, + created_after=created_after, + created_by_me=created_by_me, + status=status, + order_by=order_by, + ) + + req = self._build_request( + method="GET", + path="/v1/batch/jobs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_get_batch_jobs", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListBatchJobsResponse, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + page: Optional[int] = 0, + page_size: Optional[int] = 100, + model: OptionalNullable[str] = UNSET, + agent_id: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + created_after: OptionalNullable[datetime] = UNSET, + created_by_me: Optional[bool] = False, + status: OptionalNullable[List[models.BatchJobStatus]] = UNSET, + order_by: Optional[models.OrderBy] = "-created", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListBatchJobsResponse: + r"""Get Batch Jobs + + Get a list of batch jobs for your organization and user. + + :param page: + :param page_size: + :param model: + :param agent_id: + :param metadata: + :param created_after: + :param created_by_me: + :param status: + :param order_by: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesBatchGetBatchJobsRequest( + page=page, + page_size=page_size, + model=model, + agent_id=agent_id, + metadata=metadata, + created_after=created_after, + created_by_me=created_by_me, + status=status, + order_by=order_by, + ) + + req = self._build_request_async( + method="GET", + path="/v1/batch/jobs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_get_batch_jobs", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListBatchJobsResponse, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create( + self, + *, + endpoint: models.APIEndpoint, + input_files: OptionalNullable[List[str]] = UNSET, + requests: OptionalNullable[ + Union[List[models.BatchRequest], List[models.BatchRequestTypedDict]] + ] = UNSET, + model: OptionalNullable[str] = UNSET, + agent_id: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, str]] = UNSET, + timeout_hours: Optional[int] = 24, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchJob: + r"""Create Batch Job + + Create a new batch job, it will be queued for processing. + + :param endpoint: + :param input_files: A list of `.jsonl` files for batch inference. + Each line must be a JSON object with a `body` field containing the request payload: + ```json + {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} + {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} + ``` + :param requests: + :param model: The model to be used for batch inference. + :param agent_id: In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here. + :param metadata: The metadata of your choice to be associated with the batch inference job. + :param timeout_hours: The timeout in hours for the batch inference job. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateBatchJobRequest( + input_files=input_files, + requests=utils.get_pydantic_model( + requests, OptionalNullable[List[models.BatchRequest]] + ), + endpoint=endpoint, + model=model, + agent_id=agent_id, + metadata=metadata, + timeout_hours=timeout_hours, + ) + + req = self._build_request( + method="POST", + path="/v1/batch/jobs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateBatchJobRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_create_batch_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchJob, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + endpoint: models.APIEndpoint, + input_files: OptionalNullable[List[str]] = UNSET, + requests: OptionalNullable[ + Union[List[models.BatchRequest], List[models.BatchRequestTypedDict]] + ] = UNSET, + model: OptionalNullable[str] = UNSET, + agent_id: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, str]] = UNSET, + timeout_hours: Optional[int] = 24, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchJob: + r"""Create Batch Job + + Create a new batch job, it will be queued for processing. + + :param endpoint: + :param input_files: A list of `.jsonl` files for batch inference. + Each line must be a JSON object with a `body` field containing the request payload: + ```json + {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} + {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} + ``` + :param requests: + :param model: The model to be used for batch inference. + :param agent_id: In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here. + :param metadata: The metadata of your choice to be associated with the batch inference job. + :param timeout_hours: The timeout in hours for the batch inference job. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateBatchJobRequest( + input_files=input_files, + requests=utils.get_pydantic_model( + requests, OptionalNullable[List[models.BatchRequest]] + ), + endpoint=endpoint, + model=model, + agent_id=agent_id, + metadata=metadata, + timeout_hours=timeout_hours, + ) + + req = self._build_request_async( + method="POST", + path="/v1/batch/jobs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateBatchJobRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_create_batch_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchJob, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get( + self, + *, + job_id: str, + inline: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchJob: + r"""Get Batch Job + + Get a batch job details by its UUID. + + Args: + inline: If True, return results inline in the response. + + :param job_id: + :param inline: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesBatchGetBatchJobRequest( + job_id=job_id, + inline=inline, + ) + + req = self._build_request( + method="GET", + path="/v1/batch/jobs/{job_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_get_batch_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchJob, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_async( + self, + *, + job_id: str, + inline: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchJob: + r"""Get Batch Job + + Get a batch job details by its UUID. + + Args: + inline: If True, return results inline in the response. + + :param job_id: + :param inline: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesBatchGetBatchJobRequest( + job_id=job_id, + inline=inline, + ) + + req = self._build_request_async( + method="GET", + path="/v1/batch/jobs/{job_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_get_batch_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchJob, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DeleteBatchJobResponse: + r"""Delete Batch Job + + Request the deletion of a batch job. + + :param job_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesBatchDeleteBatchJobRequest( + job_id=job_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/batch/jobs/{job_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_delete_batch_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DeleteBatchJobResponse, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DeleteBatchJobResponse: + r"""Delete Batch Job + + Request the deletion of a batch job. + + :param job_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesBatchDeleteBatchJobRequest( + job_id=job_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/batch/jobs/{job_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_delete_batch_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DeleteBatchJobResponse, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def cancel( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchJob: + r"""Cancel Batch Job + + Request the cancellation of a batch job. + + :param job_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesBatchCancelBatchJobRequest( + job_id=job_id, + ) + + req = self._build_request( + method="POST", + path="/v1/batch/jobs/{job_id}/cancel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_cancel_batch_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchJob, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def cancel_async( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchJob: + r"""Cancel Batch Job + + Request the cancellation of a batch job. + + :param job_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesBatchCancelBatchJobRequest( + job_id=job_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/batch/jobs/{job_id}/cancel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_batch_cancel_batch_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchJob, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/beta.py b/src/mistralai/client/beta.py new file mode 100644 index 00000000..f9bbb5ae --- /dev/null +++ b/src/mistralai/client/beta.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 981417f45147 + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from mistralai.client.beta_agents import BetaAgents +from mistralai.client.connectors import Connectors +from mistralai.client.conversations import Conversations +from mistralai.client.libraries import Libraries +from mistralai.client.observability import Observability +from mistralai.client.rag import Rag +from typing import Optional + + +class Beta(BaseSDK): + conversations: Conversations + r"""(beta) Conversations API""" + agents: BetaAgents + r"""(beta) Agents API""" + libraries: Libraries + r"""(beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities.""" + observability: Observability + connectors: Connectors + r"""(beta) Connectors API - manage your connectors""" + rag: Rag + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.conversations = Conversations( + self.sdk_configuration, parent_ref=self.parent_ref + ) + self.agents = BetaAgents(self.sdk_configuration, parent_ref=self.parent_ref) + self.libraries = Libraries(self.sdk_configuration, parent_ref=self.parent_ref) + self.observability = Observability( + self.sdk_configuration, parent_ref=self.parent_ref + ) + self.connectors = Connectors(self.sdk_configuration, parent_ref=self.parent_ref) + self.rag = Rag(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/mistralai/client/beta_agents.py b/src/mistralai/client/beta_agents.py new file mode 100644 index 00000000..64baf53b --- /dev/null +++ b/src/mistralai/client/beta_agents.py @@ -0,0 +1,2360 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b64ad29b7174 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class BetaAgents(BaseSDK): + r"""(beta) Agents API""" + + def create( + self, + *, + model: str, + name: str, + instructions: OptionalNullable[str] = UNSET, + tools: Optional[ + Union[ + List[models.CreateAgentRequestTool], + List[models.CreateAgentRequestToolTypedDict], + ] + ] = None, + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + description: OptionalNullable[str] = UNSET, + handoffs: OptionalNullable[List[str]] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + version_message: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Create a agent that can be used within a conversation. + + Create a new agent giving it instructions, tools, description. The agent is then available to be used as a regular assistant in a conversation or as part of an agent pool from which it can be used. + + :param model: + :param name: + :param instructions: Instruction prompt the model will follow during the conversation. + :param tools: List of tools which are available to the model during the conversation. + :param completion_args: White-listed arguments from the completion API + :param guardrails: + :param description: + :param handoffs: + :param metadata: + :param version_message: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateAgentRequest( + instructions=instructions, + tools=utils.get_pydantic_model( + tools, Optional[List[models.CreateAgentRequestTool]] + ), + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + model=model, + name=name, + description=description, + handoffs=handoffs, + metadata=metadata, + version_message=version_message, + ) + + req = self._build_request( + method="POST", + path="/v1/agents", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateAgentRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_create", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + model: str, + name: str, + instructions: OptionalNullable[str] = UNSET, + tools: Optional[ + Union[ + List[models.CreateAgentRequestTool], + List[models.CreateAgentRequestToolTypedDict], + ] + ] = None, + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + description: OptionalNullable[str] = UNSET, + handoffs: OptionalNullable[List[str]] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + version_message: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Create a agent that can be used within a conversation. + + Create a new agent giving it instructions, tools, description. The agent is then available to be used as a regular assistant in a conversation or as part of an agent pool from which it can be used. + + :param model: + :param name: + :param instructions: Instruction prompt the model will follow during the conversation. + :param tools: List of tools which are available to the model during the conversation. + :param completion_args: White-listed arguments from the completion API + :param guardrails: + :param description: + :param handoffs: + :param metadata: + :param version_message: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateAgentRequest( + instructions=instructions, + tools=utils.get_pydantic_model( + tools, Optional[List[models.CreateAgentRequestTool]] + ), + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + model=model, + name=name, + description=description, + handoffs=handoffs, + metadata=metadata, + version_message=version_message, + ) + + req = self._build_request_async( + method="POST", + path="/v1/agents", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateAgentRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_create", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list( + self, + *, + page: Optional[int] = 0, + page_size: Optional[int] = 20, + deployment_chat: OptionalNullable[bool] = UNSET, + sources: OptionalNullable[List[models.RequestSource]] = UNSET, + name: OptionalNullable[str] = UNSET, + search: OptionalNullable[str] = UNSET, + id: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.Agent]: + r"""List agent entities. + + Retrieve a list of agent entities sorted by creation time. + + :param page: Page number (0-indexed) + :param page_size: Number of agents per page + :param deployment_chat: + :param sources: + :param name: Filter by agent name + :param search: Search agents by name or ID + :param id: + :param metadata: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsListRequest( + page=page, + page_size=page_size, + deployment_chat=deployment_chat, + sources=sources, + name=name, + search=search, + id=id, + metadata=metadata, + ) + + req = self._build_request( + method="GET", + path="/v1/agents", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_list", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(List[models.Agent], http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + page: Optional[int] = 0, + page_size: Optional[int] = 20, + deployment_chat: OptionalNullable[bool] = UNSET, + sources: OptionalNullable[List[models.RequestSource]] = UNSET, + name: OptionalNullable[str] = UNSET, + search: OptionalNullable[str] = UNSET, + id: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.Agent]: + r"""List agent entities. + + Retrieve a list of agent entities sorted by creation time. + + :param page: Page number (0-indexed) + :param page_size: Number of agents per page + :param deployment_chat: + :param sources: + :param name: Filter by agent name + :param search: Search agents by name or ID + :param id: + :param metadata: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsListRequest( + page=page, + page_size=page_size, + deployment_chat=deployment_chat, + sources=sources, + name=name, + search=search, + id=id, + metadata=metadata, + ) + + req = self._build_request_async( + method="GET", + path="/v1/agents", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_list", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(List[models.Agent], http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get( + self, + *, + agent_id: str, + agent_version: OptionalNullable[ + Union[ + models.AgentsAPIV1AgentsGetAgentVersion, + models.AgentsAPIV1AgentsGetAgentVersionTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Retrieve an agent entity. + + Given an agent, retrieve an agent entity with its attributes. The agent_version parameter can be an integer version number or a string alias. + + :param agent_id: + :param agent_version: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsGetRequest( + agent_id=agent_id, + agent_version=agent_version, + ) + + req = self._build_request( + method="GET", + path="/v1/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_async( + self, + *, + agent_id: str, + agent_version: OptionalNullable[ + Union[ + models.AgentsAPIV1AgentsGetAgentVersion, + models.AgentsAPIV1AgentsGetAgentVersionTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Retrieve an agent entity. + + Given an agent, retrieve an agent entity with its attributes. The agent_version parameter can be an integer version number or a string alias. + + :param agent_id: + :param agent_version: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsGetRequest( + agent_id=agent_id, + agent_version=agent_version, + ) + + req = self._build_request_async( + method="GET", + path="/v1/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update( + self, + *, + agent_id: str, + instructions: OptionalNullable[str] = UNSET, + tools: Optional[ + Union[ + List[models.UpdateAgentRequestTool], + List[models.UpdateAgentRequestToolTypedDict], + ] + ] = None, + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + model: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + handoffs: OptionalNullable[List[str]] = UNSET, + deployment_chat: OptionalNullable[bool] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + version_message: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Update an agent entity. + + Update an agent attributes and create a new version. + + :param agent_id: + :param instructions: Instruction prompt the model will follow during the conversation. + :param tools: List of tools which are available to the model during the conversation. + :param completion_args: White-listed arguments from the completion API + :param guardrails: + :param model: + :param name: + :param description: + :param handoffs: + :param deployment_chat: + :param metadata: + :param version_message: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsUpdateRequest( + agent_id=agent_id, + update_agent_request=models.UpdateAgentRequest( + instructions=instructions, + tools=utils.get_pydantic_model( + tools, Optional[List[models.UpdateAgentRequestTool]] + ), + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + model=model, + name=name, + description=description, + handoffs=handoffs, + deployment_chat=deployment_chat, + metadata=metadata, + version_message=version_message, + ), + ) + + req = self._build_request( + method="PATCH", + path="/v1/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_agent_request, + False, + False, + "json", + models.UpdateAgentRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_update", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_async( + self, + *, + agent_id: str, + instructions: OptionalNullable[str] = UNSET, + tools: Optional[ + Union[ + List[models.UpdateAgentRequestTool], + List[models.UpdateAgentRequestToolTypedDict], + ] + ] = None, + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + model: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + handoffs: OptionalNullable[List[str]] = UNSET, + deployment_chat: OptionalNullable[bool] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + version_message: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Update an agent entity. + + Update an agent attributes and create a new version. + + :param agent_id: + :param instructions: Instruction prompt the model will follow during the conversation. + :param tools: List of tools which are available to the model during the conversation. + :param completion_args: White-listed arguments from the completion API + :param guardrails: + :param model: + :param name: + :param description: + :param handoffs: + :param deployment_chat: + :param metadata: + :param version_message: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsUpdateRequest( + agent_id=agent_id, + update_agent_request=models.UpdateAgentRequest( + instructions=instructions, + tools=utils.get_pydantic_model( + tools, Optional[List[models.UpdateAgentRequestTool]] + ), + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + model=model, + name=name, + description=description, + handoffs=handoffs, + deployment_chat=deployment_chat, + metadata=metadata, + version_message=version_message, + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_agent_request, + False, + False, + "json", + models.UpdateAgentRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_update", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + agent_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete an agent entity. + + :param agent_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsDeleteRequest( + agent_id=agent_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + agent_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete an agent entity. + + :param agent_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsDeleteRequest( + agent_id=agent_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/agents/{agent_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update_version( + self, + *, + agent_id: str, + version: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Update an agent version. + + Switch the version of an agent. + + :param agent_id: + :param version: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsUpdateVersionRequest( + agent_id=agent_id, + version=version, + ) + + req = self._build_request( + method="PATCH", + path="/v1/agents/{agent_id}/version", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_update_version", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_version_async( + self, + *, + agent_id: str, + version: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Update an agent version. + + Switch the version of an agent. + + :param agent_id: + :param version: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsUpdateVersionRequest( + agent_id=agent_id, + version=version, + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/agents/{agent_id}/version", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_update_version", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_versions( + self, + *, + agent_id: str, + page: Optional[int] = 0, + page_size: Optional[int] = 20, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.Agent]: + r"""List all versions of an agent. + + Retrieve all versions for a specific agent with full agent context. Supports pagination. + + :param agent_id: + :param page: Page number (0-indexed) + :param page_size: Number of versions per page + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsListVersionsRequest( + agent_id=agent_id, + page=page, + page_size=page_size, + ) + + req = self._build_request( + method="GET", + path="/v1/agents/{agent_id}/versions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_list_versions", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(List[models.Agent], http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_versions_async( + self, + *, + agent_id: str, + page: Optional[int] = 0, + page_size: Optional[int] = 20, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.Agent]: + r"""List all versions of an agent. + + Retrieve all versions for a specific agent with full agent context. Supports pagination. + + :param agent_id: + :param page: Page number (0-indexed) + :param page_size: Number of versions per page + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsListVersionsRequest( + agent_id=agent_id, + page=page, + page_size=page_size, + ) + + req = self._build_request_async( + method="GET", + path="/v1/agents/{agent_id}/versions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_list_versions", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(List[models.Agent], http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_version( + self, + *, + agent_id: str, + version: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Retrieve a specific version of an agent. + + Get a specific agent version by version number. + + :param agent_id: + :param version: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsGetVersionRequest( + agent_id=agent_id, + version=version, + ) + + req = self._build_request( + method="GET", + path="/v1/agents/{agent_id}/versions/{version}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_get_version", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_version_async( + self, + *, + agent_id: str, + version: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Agent: + r"""Retrieve a specific version of an agent. + + Get a specific agent version by version number. + + :param agent_id: + :param version: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsGetVersionRequest( + agent_id=agent_id, + version=version, + ) + + req = self._build_request_async( + method="GET", + path="/v1/agents/{agent_id}/versions/{version}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_get_version", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Agent, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create_version_alias( + self, + *, + agent_id: str, + alias: str, + version: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AgentAliasResponse: + r"""Create or update an agent version alias. + + Create a new alias or update an existing alias to point to a specific version. Aliases are unique per agent and can be reassigned to different versions. + + :param agent_id: + :param alias: + :param version: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsCreateOrUpdateAliasRequest( + agent_id=agent_id, + alias=alias, + version=version, + ) + + req = self._build_request( + method="PUT", + path="/v1/agents/{agent_id}/aliases", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_create_or_update_alias", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.AgentAliasResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_version_alias_async( + self, + *, + agent_id: str, + alias: str, + version: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AgentAliasResponse: + r"""Create or update an agent version alias. + + Create a new alias or update an existing alias to point to a specific version. Aliases are unique per agent and can be reassigned to different versions. + + :param agent_id: + :param alias: + :param version: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsCreateOrUpdateAliasRequest( + agent_id=agent_id, + alias=alias, + version=version, + ) + + req = self._build_request_async( + method="PUT", + path="/v1/agents/{agent_id}/aliases", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_create_or_update_alias", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.AgentAliasResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_version_aliases( + self, + *, + agent_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.AgentAliasResponse]: + r"""List all aliases for an agent. + + Retrieve all version aliases for a specific agent. + + :param agent_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsListVersionAliasesRequest( + agent_id=agent_id, + ) + + req = self._build_request( + method="GET", + path="/v1/agents/{agent_id}/aliases", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_list_version_aliases", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(List[models.AgentAliasResponse], http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_version_aliases_async( + self, + *, + agent_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.AgentAliasResponse]: + r"""List all aliases for an agent. + + Retrieve all version aliases for a specific agent. + + :param agent_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsListVersionAliasesRequest( + agent_id=agent_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/agents/{agent_id}/aliases", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_list_version_aliases", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(List[models.AgentAliasResponse], http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete_version_alias( + self, + *, + agent_id: str, + alias: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete an agent version alias. + + Delete an existing alias for an agent. + + :param agent_id: + :param alias: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsDeleteAliasRequest( + agent_id=agent_id, + alias=alias, + ) + + req = self._build_request( + method="DELETE", + path="/v1/agents/{agent_id}/aliases", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_delete_alias", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_version_alias_async( + self, + *, + agent_id: str, + alias: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete an agent version alias. + + Delete an existing alias for an agent. + + :param agent_id: + :param alias: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1AgentsDeleteAliasRequest( + agent_id=agent_id, + alias=alias, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/agents/{agent_id}/aliases", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_agents_delete_alias", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/campaigns.py b/src/mistralai/client/campaigns.py new file mode 100644 index 00000000..c9f28794 --- /dev/null +++ b/src/mistralai/client/campaigns.py @@ -0,0 +1,1186 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9e64fcf4e60e + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional, Union + + +class Campaigns(BaseSDK): + def create( + self, + *, + search_params: Union[models.FilterPayload, models.FilterPayloadTypedDict], + judge_id: str, + name: str, + description: str, + max_nb_events: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Campaign: + r"""Create and start a new campaign + + :param search_params: + :param judge_id: + :param name: + :param description: + :param max_nb_events: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateCampaignRequest( + search_params=utils.get_pydantic_model(search_params, models.FilterPayload), + judge_id=judge_id, + name=name, + description=description, + max_nb_events=max_nb_events, + ) + + req = self._build_request( + method="POST", + path="/v1/observability/campaigns", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateCampaignRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_campaign_v1_observability_campaigns_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Campaign, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + search_params: Union[models.FilterPayload, models.FilterPayloadTypedDict], + judge_id: str, + name: str, + description: str, + max_nb_events: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Campaign: + r"""Create and start a new campaign + + :param search_params: + :param judge_id: + :param name: + :param description: + :param max_nb_events: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateCampaignRequest( + search_params=utils.get_pydantic_model(search_params, models.FilterPayload), + judge_id=judge_id, + name=name, + description=description, + max_nb_events=max_nb_events, + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/campaigns", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateCampaignRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_campaign_v1_observability_campaigns_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Campaign, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list( + self, + *, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + q: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListCampaignsResponse: + r"""Get all campaigns + + :param page_size: + :param page: + :param q: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCampaignsV1ObservabilityCampaignsGetRequest( + page_size=page_size, + page=page, + q=q, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/campaigns", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_campaigns_v1_observability_campaigns_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListCampaignsResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + q: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListCampaignsResponse: + r"""Get all campaigns + + :param page_size: + :param page: + :param q: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCampaignsV1ObservabilityCampaignsGetRequest( + page_size=page_size, + page=page, + q=q, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/campaigns", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_campaigns_v1_observability_campaigns_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListCampaignsResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch( + self, + *, + campaign_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Campaign: + r"""Get campaign by id + + :param campaign_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequest( + campaign_id=campaign_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/campaigns/{campaign_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_campaign_by_id_v1_observability_campaigns__campaign_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Campaign, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_async( + self, + *, + campaign_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Campaign: + r"""Get campaign by id + + :param campaign_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequest( + campaign_id=campaign_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/campaigns/{campaign_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_campaign_by_id_v1_observability_campaigns__campaign_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Campaign, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + campaign_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a campaign + + :param campaign_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequest( + campaign_id=campaign_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/observability/campaigns/{campaign_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_campaign_v1_observability_campaigns__campaign_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + campaign_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a campaign + + :param campaign_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequest( + campaign_id=campaign_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/observability/campaigns/{campaign_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_campaign_v1_observability_campaigns__campaign_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch_status( + self, + *, + campaign_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FetchCampaignStatusResponse: + r"""Get campaign status by campaign id + + :param campaign_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequest( + campaign_id=campaign_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/campaigns/{campaign_id}/status", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_campaign_status_by_id_v1_observability_campaigns__campaign_id__status_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.FetchCampaignStatusResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_status_async( + self, + *, + campaign_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FetchCampaignStatusResponse: + r"""Get campaign status by campaign id + + :param campaign_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequest( + campaign_id=campaign_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/campaigns/{campaign_id}/status", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_campaign_status_by_id_v1_observability_campaigns__campaign_id__status_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.FetchCampaignStatusResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_events( + self, + *, + campaign_id: str, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListCampaignSelectedEventsResponse: + r"""Get event ids that were selected by the given campaign + + :param campaign_id: + :param page_size: + :param page: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequest( + campaign_id=campaign_id, + page_size=page_size, + page=page, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/campaigns/{campaign_id}/selected-events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_campaign_selected_events_v1_observability_campaigns__campaign_id__selected_events_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ListCampaignSelectedEventsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_events_async( + self, + *, + campaign_id: str, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListCampaignSelectedEventsResponse: + r"""Get event ids that were selected by the given campaign + + :param campaign_id: + :param page_size: + :param page: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequest( + campaign_id=campaign_id, + page_size=page_size, + page=page, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/campaigns/{campaign_id}/selected-events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_campaign_selected_events_v1_observability_campaigns__campaign_id__selected_events_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ListCampaignSelectedEventsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/chat.py b/src/mistralai/client/chat.py new file mode 100644 index 00000000..9deff9a0 --- /dev/null +++ b/src/mistralai/client/chat.py @@ -0,0 +1,891 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7eba0f088d47 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + +# region imports +from typing import Type + +from mistralai.extra.struct_chat import ( + ParsedChatCompletionResponse, + convert_to_parsed_chat_completion_response, +) +from mistralai.extra.utils.response_format import ( + CustomPydanticModel, + response_format_from_pydantic_model, +) +# endregion imports + + +class Chat(BaseSDK): + r"""Chat Completion API.""" + + # region sdk-class-body + # Custom .parse methods for the Structure Outputs Feature. + + def parse( + self, response_format: Type[CustomPydanticModel], **kwargs: Any + ) -> ParsedChatCompletionResponse[CustomPydanticModel]: + """ + Parse the response using the provided response format. + :param Type[CustomPydanticModel] response_format: The Pydantic model to parse the response into + :param Any **kwargs Additional keyword arguments to pass to the .complete method + :return: The parsed response + """ + # Convert the input Pydantic Model to a strict JSON ready to be passed to chat.complete + json_response_format = response_format_from_pydantic_model(response_format) + # Run the inference + response = self.complete(**kwargs, response_format=json_response_format) + # Parse response back to the input pydantic model + parsed_response = convert_to_parsed_chat_completion_response( + response, response_format + ) + return parsed_response + + async def parse_async( + self, response_format: Type[CustomPydanticModel], **kwargs + ) -> ParsedChatCompletionResponse[CustomPydanticModel]: + """ + Asynchronously parse the response using the provided response format. + :param Type[CustomPydanticModel] response_format: The Pydantic model to parse the response into + :param Any **kwargs Additional keyword arguments to pass to the .complete method + :return: The parsed response + """ + json_response_format = response_format_from_pydantic_model(response_format) + response = await self.complete_async( # pylint: disable=E1125 + **kwargs, response_format=json_response_format + ) + parsed_response = convert_to_parsed_chat_completion_response( + response, response_format + ) + return parsed_response + + def parse_stream( + self, response_format: Type[CustomPydanticModel], **kwargs + ) -> eventstreaming.EventStream[models.CompletionEvent]: + """ + Parse the response using the provided response format. + For now the response will be in JSON format not in the input Pydantic model. + :param Type[CustomPydanticModel] response_format: The Pydantic model to parse the response into + :param Any **kwargs Additional keyword arguments to pass to the .stream method + :return: The JSON parsed response + """ + json_response_format = response_format_from_pydantic_model(response_format) + response = self.stream(**kwargs, response_format=json_response_format) + return response + + async def parse_stream_async( + self, response_format: Type[CustomPydanticModel], **kwargs + ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: + """ + Asynchronously parse the response using the provided response format. + For now the response will be in JSON format not in the input Pydantic model. + :param Type[CustomPydanticModel] response_format: The Pydantic model to parse the response into + :param Any **kwargs Additional keyword arguments to pass to the .stream method + :return: The JSON parsed response + """ + json_response_format = response_format_from_pydantic_model(response_format) + response = await self.stream_async( # pylint: disable=E1125 + **kwargs, response_format=json_response_format + ) + return response + + # endregion sdk-class-body + + def complete( + self, + *, + model: str, + messages: Union[ + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], + ], + temperature: OptionalNullable[float] = UNSET, + top_p: OptionalNullable[float] = UNSET, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: OptionalNullable[ + Union[ + models.ChatCompletionRequestStop, + models.ChatCompletionRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[ + List[models.ChatCompletionRequestTool], + List[models.ChatCompletionRequestToolTypedDict], + ] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionRequestToolChoice, + models.ChatCompletionRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: OptionalNullable[float] = UNSET, + frequency_penalty: OptionalNullable[float] = UNSET, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + safe_prompt: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionResponse: + r"""Chat Completion + + :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param reasoning_effort: + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param guardrails: + :param prompt_cache_key: + :param safe_prompt: Whether to inject a safety prompt before all conversations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionRequestTool]] + ), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + reasoning_effort=reasoning_effort, + prompt_mode=prompt_mode, + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + prompt_cache_key=prompt_cache_key, + safe_prompt=safe_prompt, + ) + + req = self._build_request( + method="POST", + path="/v1/chat/completions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="chat_completion_v1_chat_completions_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def complete_async( + self, + *, + model: str, + messages: Union[ + List[models.ChatCompletionRequestMessage], + List[models.ChatCompletionRequestMessageTypedDict], + ], + temperature: OptionalNullable[float] = UNSET, + top_p: OptionalNullable[float] = UNSET, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: OptionalNullable[ + Union[ + models.ChatCompletionRequestStop, + models.ChatCompletionRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[ + List[models.ChatCompletionRequestTool], + List[models.ChatCompletionRequestToolTypedDict], + ] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionRequestToolChoice, + models.ChatCompletionRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: OptionalNullable[float] = UNSET, + frequency_penalty: OptionalNullable[float] = UNSET, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + safe_prompt: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionResponse: + r"""Chat Completion + + :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param reasoning_effort: + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param guardrails: + :param prompt_cache_key: + :param safe_prompt: Whether to inject a safety prompt before all conversations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionRequestTool]] + ), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + reasoning_effort=reasoning_effort, + prompt_mode=prompt_mode, + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + prompt_cache_key=prompt_cache_key, + safe_prompt=safe_prompt, + ) + + req = self._build_request_async( + method="POST", + path="/v1/chat/completions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="chat_completion_v1_chat_completions_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def stream( + self, + *, + model: str, + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], + temperature: OptionalNullable[float] = UNSET, + top_p: OptionalNullable[float] = UNSET, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: OptionalNullable[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[ + List[models.ChatCompletionStreamRequestTool], + List[models.ChatCompletionStreamRequestToolTypedDict], + ] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionStreamRequestToolChoice, + models.ChatCompletionStreamRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: OptionalNullable[float] = UNSET, + frequency_penalty: OptionalNullable[float] = UNSET, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + safe_prompt: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.CompletionEvent]: + r"""Stream chat completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param reasoning_effort: + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param guardrails: + :param prompt_cache_key: + :param safe_prompt: Whether to inject a safety prompt before all conversations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionStreamRequestTool]] + ), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + reasoning_effort=reasoning_effort, + prompt_mode=prompt_mode, + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + prompt_cache_key=prompt_cache_key, + safe_prompt=safe_prompt, + ) + + req = self._build_request( + method="POST", + path="/v1/chat/completions#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_chat", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def stream_async( + self, + *, + model: str, + messages: Union[ + List[models.ChatCompletionStreamRequestMessage], + List[models.ChatCompletionStreamRequestMessageTypedDict], + ], + temperature: OptionalNullable[float] = UNSET, + top_p: OptionalNullable[float] = UNSET, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: OptionalNullable[ + Union[ + models.ChatCompletionStreamRequestStop, + models.ChatCompletionStreamRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + response_format: Optional[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = None, + tools: OptionalNullable[ + Union[ + List[models.ChatCompletionStreamRequestTool], + List[models.ChatCompletionStreamRequestToolTypedDict], + ] + ] = UNSET, + tool_choice: Optional[ + Union[ + models.ChatCompletionStreamRequestToolChoice, + models.ChatCompletionStreamRequestToolChoiceTypedDict, + ] + ] = None, + presence_penalty: OptionalNullable[float] = UNSET, + frequency_penalty: OptionalNullable[float] = UNSET, + n: OptionalNullable[int] = UNSET, + prediction: Optional[ + Union[models.Prediction, models.PredictionTypedDict] + ] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning_effort: OptionalNullable[models.ReasoningEffort] = UNSET, + prompt_mode: OptionalNullable[models.MistralPromptMode] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + safe_prompt: Optional[bool] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: + r"""Stream chat completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param model: ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. + :param messages: The prompt(s) to generate completions for, encoded as a list of dict with role and content. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param response_format: Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide. + :param tools: A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for. + :param tool_choice: Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool. + :param presence_penalty: The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative. + :param frequency_penalty: The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition. + :param n: Number of completions to return for each request, input tokens are only billed once. + :param prediction: Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content. + :param parallel_tool_calls: Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel. + :param reasoning_effort: + :param prompt_mode: Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used. + :param guardrails: + :param prompt_cache_key: + :param safe_prompt: Whether to inject a safety prompt before all conversations. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ChatCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + messages=utils.get_pydantic_model( + messages, List[models.ChatCompletionStreamRequestMessage] + ), + response_format=utils.get_pydantic_model( + response_format, Optional[models.ResponseFormat] + ), + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ChatCompletionStreamRequestTool]] + ), + tool_choice=utils.get_pydantic_model( + tool_choice, Optional[models.ChatCompletionStreamRequestToolChoice] + ), + presence_penalty=presence_penalty, + frequency_penalty=frequency_penalty, + n=n, + prediction=utils.get_pydantic_model( + prediction, Optional[models.Prediction] + ), + parallel_tool_calls=parallel_tool_calls, + reasoning_effort=reasoning_effort, + prompt_mode=prompt_mode, + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + prompt_cache_key=prompt_cache_key, + safe_prompt=safe_prompt, + ) + + req = self._build_request_async( + method="POST", + path="/v1/chat/completions#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ChatCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_chat", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/client/chat_completion_events.py b/src/mistralai/client/chat_completion_events.py new file mode 100644 index 00000000..af4124f0 --- /dev/null +++ b/src/mistralai/client/chat_completion_events.py @@ -0,0 +1,1060 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1813f339625b + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.fields import Fields +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, List, Mapping, Optional, Union + + +class ChatCompletionEvents(BaseSDK): + fields: Fields + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.fields = Fields(self.sdk_configuration, parent_ref=self.parent_ref) + + def search( + self, + *, + search_params: Union[models.FilterPayload, models.FilterPayloadTypedDict], + page_size: Optional[int] = 50, + cursor: OptionalNullable[str] = UNSET, + extra_fields: OptionalNullable[List[str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchChatCompletionEventsResponse: + r"""Get Chat Completion Events + + :param search_params: + :param page_size: + :param cursor: + :param extra_fields: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest( + page_size=page_size, + cursor=cursor, + search_chat_completion_events_request=models.SearchChatCompletionEventsRequest( + search_params=utils.get_pydantic_model( + search_params, models.FilterPayload + ), + extra_fields=extra_fields, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/chat-completion-events/search", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.search_chat_completion_events_request, + False, + False, + "json", + models.SearchChatCompletionEventsRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_events_v1_observability_chat_completion_events_search_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.SearchChatCompletionEventsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def search_async( + self, + *, + search_params: Union[models.FilterPayload, models.FilterPayloadTypedDict], + page_size: Optional[int] = 50, + cursor: OptionalNullable[str] = UNSET, + extra_fields: OptionalNullable[List[str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchChatCompletionEventsResponse: + r"""Get Chat Completion Events + + :param search_params: + :param page_size: + :param cursor: + :param extra_fields: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest( + page_size=page_size, + cursor=cursor, + search_chat_completion_events_request=models.SearchChatCompletionEventsRequest( + search_params=utils.get_pydantic_model( + search_params, models.FilterPayload + ), + extra_fields=extra_fields, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/chat-completion-events/search", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.search_chat_completion_events_request, + False, + False, + "json", + models.SearchChatCompletionEventsRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_events_v1_observability_chat_completion_events_search_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.SearchChatCompletionEventsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def search_ids( + self, + *, + search_params: Union[models.FilterPayload, models.FilterPayloadTypedDict], + extra_fields: OptionalNullable[List[str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchChatCompletionEventIdsResponse: + r"""Alternative to /search that returns only the IDs and that can return many IDs at once + + :param search_params: + :param extra_fields: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.SearchChatCompletionEventIdsRequest( + search_params=utils.get_pydantic_model(search_params, models.FilterPayload), + extra_fields=extra_fields, + ) + + req = self._build_request( + method="POST", + path="/v1/observability/chat-completion-events/search-ids", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + False, + "json", + models.SearchChatCompletionEventIdsRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_event_ids_v1_observability_chat_completion_events_search_ids_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.SearchChatCompletionEventIdsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def search_ids_async( + self, + *, + search_params: Union[models.FilterPayload, models.FilterPayloadTypedDict], + extra_fields: OptionalNullable[List[str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchChatCompletionEventIdsResponse: + r"""Alternative to /search that returns only the IDs and that can return many IDs at once + + :param search_params: + :param extra_fields: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.SearchChatCompletionEventIdsRequest( + search_params=utils.get_pydantic_model(search_params, models.FilterPayload), + extra_fields=extra_fields, + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/chat-completion-events/search-ids", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + False, + "json", + models.SearchChatCompletionEventIdsRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_event_ids_v1_observability_chat_completion_events_search_ids_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.SearchChatCompletionEventIdsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch( + self, + *, + event_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionEvent: + r"""Get Chat Completion Event + + :param event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequest( + event_id=event_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/chat-completion-events/{event_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_event_v1_observability_chat_completion_events__event_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionEvent, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_async( + self, + *, + event_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ChatCompletionEvent: + r"""Get Chat Completion Event + + :param event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequest( + event_id=event_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/chat-completion-events/{event_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_event_v1_observability_chat_completion_events__event_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ChatCompletionEvent, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch_similar_events( + self, + *, + event_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchChatCompletionEventsResponse: + r"""Get Similar Chat Completion Events + + :param event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest( + event_id=event_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/chat-completion-events/{event_id}/similar-events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_similar_chat_completion_events_v1_observability_chat_completion_events__event_id__similar_events_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.SearchChatCompletionEventsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_similar_events_async( + self, + *, + event_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SearchChatCompletionEventsResponse: + r"""Get Similar Chat Completion Events + + :param event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest( + event_id=event_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/chat-completion-events/{event_id}/similar-events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_similar_chat_completion_events_v1_observability_chat_completion_events__event_id__similar_events_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.SearchChatCompletionEventsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def judge( + self, + *, + event_id: str, + judge_definition: Union[ + models.CreateJudgeRequest, models.CreateJudgeRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JudgeOutput: + r"""Run Judge on an event based on the given options + + :param event_id: + :param judge_definition: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequest( + event_id=event_id, + judge_chat_completion_event_request=models.JudgeChatCompletionEventRequest( + judge_definition=utils.get_pydantic_model( + judge_definition, models.CreateJudgeRequest + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/chat-completion-events/{event_id}/live-judging", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.judge_chat_completion_event_request, + False, + False, + "json", + models.JudgeChatCompletionEventRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="judge_chat_completion_event_v1_observability_chat_completion_events__event_id__live_judging_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.JudgeOutput, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def judge_async( + self, + *, + event_id: str, + judge_definition: Union[ + models.CreateJudgeRequest, models.CreateJudgeRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JudgeOutput: + r"""Run Judge on an event based on the given options + + :param event_id: + :param judge_definition: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequest( + event_id=event_id, + judge_chat_completion_event_request=models.JudgeChatCompletionEventRequest( + judge_definition=utils.get_pydantic_model( + judge_definition, models.CreateJudgeRequest + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/chat-completion-events/{event_id}/live-judging", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.judge_chat_completion_event_request, + False, + False, + "json", + models.JudgeChatCompletionEventRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="judge_chat_completion_event_v1_observability_chat_completion_events__event_id__live_judging_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.JudgeOutput, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/classifiers.py b/src/mistralai/client/classifiers.py similarity index 84% rename from src/mistralai/classifiers.py rename to src/mistralai/client/classifiers.py index cd6a9415..ddb2d0b1 100644 --- a/src/mistralai/classifiers.py +++ b/src/mistralai/client/classifiers.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 26e773725732 from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional, Union +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, Mapping, Optional, Union class Classifiers(BaseSDK): @@ -20,6 +21,7 @@ def moderate( models.ClassificationRequestInputs, models.ClassificationRequestInputsTypedDict, ], + metadata: OptionalNullable[Dict[str, Any]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -29,6 +31,7 @@ def moderate( :param model: ID of the model to use. :param inputs: Text to classify. + :param metadata: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -39,6 +42,9 @@ def moderate( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -46,6 +52,7 @@ def moderate( request = models.ClassificationRequest( model=model, + metadata=metadata, inputs=inputs, ) @@ -65,6 +72,7 @@ def moderate( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.ClassificationRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -81,7 +89,7 @@ def moderate( config=self.sdk_configuration, base_url=base_url or "", operation_id="moderations_v1_moderations_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -96,17 +104,17 @@ def moderate( return unmarshal_json_response(models.ModerationResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def moderate_async( self, @@ -116,6 +124,7 @@ async def moderate_async( models.ClassificationRequestInputs, models.ClassificationRequestInputsTypedDict, ], + metadata: OptionalNullable[Dict[str, Any]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -125,6 +134,7 @@ async def moderate_async( :param model: ID of the model to use. :param inputs: Text to classify. + :param metadata: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -135,6 +145,9 @@ async def moderate_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -142,6 +155,7 @@ async def moderate_async( request = models.ClassificationRequest( model=model, + metadata=metadata, inputs=inputs, ) @@ -161,6 +175,7 @@ async def moderate_async( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.ClassificationRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -177,7 +192,7 @@ async def moderate_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="moderations_v1_moderations_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -192,24 +207,24 @@ async def moderate_async( return unmarshal_json_response(models.ModerationResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def moderate_chat( self, *, inputs: Union[ - models.ChatModerationRequestInputs, - models.ChatModerationRequestInputsTypedDict, + models.ChatModerationRequestInputs3, + models.ChatModerationRequestInputs3TypedDict, ], model: str, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -231,13 +246,18 @@ def moderate_chat( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) request = models.ChatModerationRequest( - inputs=utils.get_pydantic_model(inputs, models.ChatModerationRequestInputs), + inputs=utils.get_pydantic_model( + inputs, models.ChatModerationRequestInputs3 + ), model=model, ) @@ -257,6 +277,7 @@ def moderate_chat( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.ChatModerationRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -273,7 +294,7 @@ def moderate_chat( config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_moderations_v1_chat_moderations_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -288,24 +309,24 @@ def moderate_chat( return unmarshal_json_response(models.ModerationResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def moderate_chat_async( self, *, inputs: Union[ - models.ChatModerationRequestInputs, - models.ChatModerationRequestInputsTypedDict, + models.ChatModerationRequestInputs3, + models.ChatModerationRequestInputs3TypedDict, ], model: str, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -327,13 +348,18 @@ async def moderate_chat_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) request = models.ChatModerationRequest( - inputs=utils.get_pydantic_model(inputs, models.ChatModerationRequestInputs), + inputs=utils.get_pydantic_model( + inputs, models.ChatModerationRequestInputs3 + ), model=model, ) @@ -353,6 +379,7 @@ async def moderate_chat_async( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.ChatModerationRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -369,7 +396,7 @@ async def moderate_chat_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_moderations_v1_chat_moderations_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -384,17 +411,17 @@ async def moderate_chat_async( return unmarshal_json_response(models.ModerationResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def classify( self, @@ -404,6 +431,7 @@ def classify( models.ClassificationRequestInputs, models.ClassificationRequestInputsTypedDict, ], + metadata: OptionalNullable[Dict[str, Any]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -413,6 +441,7 @@ def classify( :param model: ID of the model to use. :param inputs: Text to classify. + :param metadata: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -423,6 +452,9 @@ def classify( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -430,6 +462,7 @@ def classify( request = models.ClassificationRequest( model=model, + metadata=metadata, inputs=inputs, ) @@ -449,6 +482,7 @@ def classify( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.ClassificationRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -465,7 +499,7 @@ def classify( config=self.sdk_configuration, base_url=base_url or "", operation_id="classifications_v1_classifications_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -480,17 +514,17 @@ def classify( return unmarshal_json_response(models.ClassificationResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def classify_async( self, @@ -500,6 +534,7 @@ async def classify_async( models.ClassificationRequestInputs, models.ClassificationRequestInputsTypedDict, ], + metadata: OptionalNullable[Dict[str, Any]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -509,6 +544,7 @@ async def classify_async( :param model: ID of the model to use. :param inputs: Text to classify. + :param metadata: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -519,6 +555,9 @@ async def classify_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -526,6 +565,7 @@ async def classify_async( request = models.ClassificationRequest( model=model, + metadata=metadata, inputs=inputs, ) @@ -545,6 +585,7 @@ async def classify_async( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.ClassificationRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -561,7 +602,7 @@ async def classify_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="classifications_v1_classifications_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -576,23 +617,23 @@ async def classify_async( return unmarshal_json_response(models.ClassificationResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def classify_chat( self, *, model: str, - inputs: Union[models.Inputs, models.InputsTypedDict], + input: Union[models.Inputs, models.InputsTypedDict], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -601,7 +642,7 @@ def classify_chat( r"""Chat Classifications :param model: - :param inputs: Chat to classify + :param input: Chat to classify :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -612,6 +653,9 @@ def classify_chat( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -619,7 +663,7 @@ def classify_chat( request = models.ChatClassificationRequest( model=model, - inputs=utils.get_pydantic_model(inputs, models.Inputs), + input=utils.get_pydantic_model(input, models.Inputs), ) req = self._build_request( @@ -638,6 +682,7 @@ def classify_chat( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.ChatClassificationRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -654,7 +699,7 @@ def classify_chat( config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_classifications_v1_chat_classifications_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -669,23 +714,23 @@ def classify_chat( return unmarshal_json_response(models.ClassificationResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def classify_chat_async( self, *, model: str, - inputs: Union[models.Inputs, models.InputsTypedDict], + input: Union[models.Inputs, models.InputsTypedDict], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -694,7 +739,7 @@ async def classify_chat_async( r"""Chat Classifications :param model: - :param inputs: Chat to classify + :param input: Chat to classify :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -705,6 +750,9 @@ async def classify_chat_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -712,7 +760,7 @@ async def classify_chat_async( request = models.ChatClassificationRequest( model=model, - inputs=utils.get_pydantic_model(inputs, models.Inputs), + input=utils.get_pydantic_model(input, models.Inputs), ) req = self._build_request_async( @@ -731,6 +779,7 @@ async def classify_chat_async( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.ChatClassificationRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -747,7 +796,7 @@ async def classify_chat_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="chat_classifications_v1_chat_classifications_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -762,14 +811,14 @@ async def classify_chat_async( return unmarshal_json_response(models.ClassificationResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/connectors.py b/src/mistralai/client/connectors.py new file mode 100644 index 00000000..793c9f8a --- /dev/null +++ b/src/mistralai/client/connectors.py @@ -0,0 +1,3802 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 39da03126050 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class Connectors(BaseSDK): + r"""(beta) Connectors API - manage your connectors""" + + def create( + self, + *, + name: str, + description: str, + server: str, + title: OptionalNullable[str] = UNSET, + icon_url: OptionalNullable[str] = UNSET, + visibility: Optional[models.ResourceVisibility] = None, + headers: OptionalNullable[Dict[str, Any]] = UNSET, + auth_data: OptionalNullable[ + Union[models.AuthData, models.AuthDataTypedDict] + ] = UNSET, + system_prompt: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Connector: + r"""Create a new connector. + + Create a new MCP connector. You can customize its visibility, url and auth type. + + :param name: The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes. + :param description: The description of the connector. + :param server: The url of the MCP server. + :param title: Optional human-readable title for the connector. + :param icon_url: The optional url of the icon you want to associate to the connector. + :param visibility: + :param headers: Optional organization-level headers to be sent with the request to the mcp server. + :param auth_data: Optional additional authentication data for the connector. + :param system_prompt: Optional system prompt for the connector. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateConnectorRequest( + name=name, + title=title, + description=description, + icon_url=icon_url, + visibility=visibility, + server=server, + headers=headers, + auth_data=utils.get_pydantic_model( + auth_data, OptionalNullable[models.AuthData] + ), + system_prompt=system_prompt, + ) + + req = self._build_request( + method="POST", + path="/v1/connectors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateConnectorRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_create_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Connector, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + name: str, + description: str, + server: str, + title: OptionalNullable[str] = UNSET, + icon_url: OptionalNullable[str] = UNSET, + visibility: Optional[models.ResourceVisibility] = None, + headers: OptionalNullable[Dict[str, Any]] = UNSET, + auth_data: OptionalNullable[ + Union[models.AuthData, models.AuthDataTypedDict] + ] = UNSET, + system_prompt: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Connector: + r"""Create a new connector. + + Create a new MCP connector. You can customize its visibility, url and auth type. + + :param name: The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes. + :param description: The description of the connector. + :param server: The url of the MCP server. + :param title: Optional human-readable title for the connector. + :param icon_url: The optional url of the icon you want to associate to the connector. + :param visibility: + :param headers: Optional organization-level headers to be sent with the request to the mcp server. + :param auth_data: Optional additional authentication data for the connector. + :param system_prompt: Optional system prompt for the connector. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateConnectorRequest( + name=name, + title=title, + description=description, + icon_url=icon_url, + visibility=visibility, + server=server, + headers=headers, + auth_data=utils.get_pydantic_model( + auth_data, OptionalNullable[models.AuthData] + ), + system_prompt=system_prompt, + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateConnectorRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_create_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Connector, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list( + self, + *, + query_filters: Optional[ + Union[models.ConnectorsQueryFilters, models.ConnectorsQueryFiltersTypedDict] + ] = None, + cursor: OptionalNullable[str] = UNSET, + page_size: Optional[int] = 100, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PaginatedConnectors: + r"""List all connectors. + + List all your custom connectors with keyset pagination and filters. + + :param query_filters: + :param cursor: + :param page_size: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListV1Request( + query_filters=utils.get_pydantic_model( + query_filters, Optional[models.ConnectorsQueryFilters] + ), + cursor=cursor, + page_size=page_size, + ) + + req = self._build_request( + method="GET", + path="/v1/connectors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PaginatedConnectors, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + query_filters: Optional[ + Union[models.ConnectorsQueryFilters, models.ConnectorsQueryFiltersTypedDict] + ] = None, + cursor: OptionalNullable[str] = UNSET, + page_size: Optional[int] = 100, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.PaginatedConnectors: + r"""List all connectors. + + List all your custom connectors with keyset pagination and filters. + + :param query_filters: + :param cursor: + :param page_size: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListV1Request( + query_filters=utils.get_pydantic_model( + query_filters, Optional[models.ConnectorsQueryFilters] + ), + cursor=cursor, + page_size=page_size, + ) + + req = self._build_request_async( + method="GET", + path="/v1/connectors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.PaginatedConnectors, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_auth_url( + self, + *, + connector_id_or_name: str, + app_return_url: OptionalNullable[str] = UNSET, + credentials_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AuthURLResponse: + r"""Get the auth URL for a connector. + + Get the OAuth2 authorization URL for a connector to initiate user authentication. + + :param connector_id_or_name: + :param app_return_url: + :param credentials_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorGetAuthURLV1Request( + app_return_url=app_return_url, + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="GET", + path="/v1/connectors/{connector_id_or_name}/auth_url", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_get_auth_url_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.AuthURLResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_auth_url_async( + self, + *, + connector_id_or_name: str, + app_return_url: OptionalNullable[str] = UNSET, + credentials_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AuthURLResponse: + r"""Get the auth URL for a connector. + + Get the OAuth2 authorization URL for a connector to initiate user authentication. + + :param connector_id_or_name: + :param app_return_url: + :param credentials_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorGetAuthURLV1Request( + app_return_url=app_return_url, + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/connectors/{connector_id_or_name}/auth_url", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_get_auth_url_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.AuthURLResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def call_tool( + self, + *, + tool_name: str, + connector_id_or_name: str, + credentials_name: OptionalNullable[str] = UNSET, + arguments: Optional[Dict[str, Any]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConnectorToolCallResponse: + r"""Call Connector Tool + + Call a tool on an MCP connector. + + :param tool_name: + :param connector_id_or_name: + :param credentials_name: + :param arguments: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorCallToolV1Request( + tool_name=tool_name, + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + connector_call_tool_request=models.ConnectorCallToolRequest( + arguments=arguments, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id_or_name}/tools/{tool_name}/call", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.connector_call_tool_request, + False, + False, + "json", + models.ConnectorCallToolRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_call_tool_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConnectorToolCallResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def call_tool_async( + self, + *, + tool_name: str, + connector_id_or_name: str, + credentials_name: OptionalNullable[str] = UNSET, + arguments: Optional[Dict[str, Any]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConnectorToolCallResponse: + r"""Call Connector Tool + + Call a tool on an MCP connector. + + :param tool_name: + :param connector_id_or_name: + :param credentials_name: + :param arguments: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorCallToolV1Request( + tool_name=tool_name, + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + connector_call_tool_request=models.ConnectorCallToolRequest( + arguments=arguments, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id_or_name}/tools/{tool_name}/call", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.connector_call_tool_request, + False, + False, + "json", + models.ConnectorCallToolRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_call_tool_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConnectorToolCallResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_tools( + self, + *, + connector_id_or_name: str, + page: Optional[int] = 1, + page_size: Optional[int] = 100, + refresh: Optional[bool] = False, + pretty: Optional[bool] = False, + credentials_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResponseConnectorListToolsV1: + r"""List tools for a connector. + + List all tools available for an MCP connector. + + :param connector_id_or_name: + :param page: + :param page_size: + :param refresh: + :param pretty: Return a simplified payload with only name, description, annotations, and a compact inputSchema. + :param credentials_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListToolsV1Request( + page=page, + page_size=page_size, + refresh=refresh, + pretty=pretty, + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="GET", + path="/v1/connectors/{connector_id_or_name}/tools", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_tools_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ResponseConnectorListToolsV1, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_tools_async( + self, + *, + connector_id_or_name: str, + page: Optional[int] = 1, + page_size: Optional[int] = 100, + refresh: Optional[bool] = False, + pretty: Optional[bool] = False, + credentials_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResponseConnectorListToolsV1: + r"""List tools for a connector. + + List all tools available for an MCP connector. + + :param connector_id_or_name: + :param page: + :param page_size: + :param refresh: + :param pretty: Return a simplified payload with only name, description, annotations, and a compact inputSchema. + :param credentials_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListToolsV1Request( + page=page, + page_size=page_size, + refresh=refresh, + pretty=pretty, + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/connectors/{connector_id_or_name}/tools", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_tools_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ResponseConnectorListToolsV1, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_authentication_methods( + self, + *, + connector_id_or_name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.PublicAuthenticationMethod]: + r"""Get authentication methods for a connector. + + Get the authentication schema for a connector. Returns the list of supported authentication methods and their required headers. + + :param connector_id_or_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorGetAuthenticationMethodsV1Request( + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="GET", + path="/v1/connectors/{connector_id_or_name}/authentication_methods", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_get_authentication_methods_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + List[models.PublicAuthenticationMethod], http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_authentication_methods_async( + self, + *, + connector_id_or_name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.PublicAuthenticationMethod]: + r"""Get authentication methods for a connector. + + Get the authentication schema for a connector. Returns the list of supported authentication methods and their required headers. + + :param connector_id_or_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorGetAuthenticationMethodsV1Request( + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/connectors/{connector_id_or_name}/authentication_methods", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_get_authentication_methods_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + List[models.PublicAuthenticationMethod], http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_organization_credentials( + self, + *, + connector_id_or_name: str, + auth_type: OptionalNullable[models.OutboundAuthenticationType] = UNSET, + fetch_default: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CredentialsResponse: + r"""List organization credentials for a connector. + + List all credentials configured at the organization level for a given connector. + + :param connector_id_or_name: + :param auth_type: + :param fetch_default: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListOrganizationCredentialsV1Request( + auth_type=auth_type, + fetch_default=fetch_default, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="GET", + path="/v1/connectors/{connector_id_or_name}/organization/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_organization_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CredentialsResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_organization_credentials_async( + self, + *, + connector_id_or_name: str, + auth_type: OptionalNullable[models.OutboundAuthenticationType] = UNSET, + fetch_default: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CredentialsResponse: + r"""List organization credentials for a connector. + + List all credentials configured at the organization level for a given connector. + + :param connector_id_or_name: + :param auth_type: + :param fetch_default: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListOrganizationCredentialsV1Request( + auth_type=auth_type, + fetch_default=fetch_default, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/connectors/{connector_id_or_name}/organization/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_organization_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CredentialsResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create_or_update_organization_credentials( + self, + *, + connector_id_or_name: str, + name: str, + is_default: OptionalNullable[bool] = UNSET, + credentials: OptionalNullable[ + Union[models.ConnectionCredentials, models.ConnectionCredentialsTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Create or update organization credentials for a connector. + + Create or update credentials at the organization level for a given connector. + + :param connector_id_or_name: + :param name: Name of the credentials. Use this name to access or modify your credentials. + :param is_default: Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. + :param credentials: The credential data (headers, bearer_token). + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorCreateOrUpdateOrganizationCredentialsV1Request( + connector_id_or_name=connector_id_or_name, + credentials_create_or_update=models.CredentialsCreateOrUpdate( + name=name, + is_default=is_default, + credentials=utils.get_pydantic_model( + credentials, OptionalNullable[models.ConnectionCredentials] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id_or_name}/organization/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.credentials_create_or_update, + False, + False, + "json", + models.CredentialsCreateOrUpdate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_create_or_update_organization_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_or_update_organization_credentials_async( + self, + *, + connector_id_or_name: str, + name: str, + is_default: OptionalNullable[bool] = UNSET, + credentials: OptionalNullable[ + Union[models.ConnectionCredentials, models.ConnectionCredentialsTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Create or update organization credentials for a connector. + + Create or update credentials at the organization level for a given connector. + + :param connector_id_or_name: + :param name: Name of the credentials. Use this name to access or modify your credentials. + :param is_default: Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. + :param credentials: The credential data (headers, bearer_token). + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorCreateOrUpdateOrganizationCredentialsV1Request( + connector_id_or_name=connector_id_or_name, + credentials_create_or_update=models.CredentialsCreateOrUpdate( + name=name, + is_default=is_default, + credentials=utils.get_pydantic_model( + credentials, OptionalNullable[models.ConnectionCredentials] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id_or_name}/organization/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.credentials_create_or_update, + False, + False, + "json", + models.CredentialsCreateOrUpdate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_create_or_update_organization_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_workspace_credentials( + self, + *, + connector_id_or_name: str, + auth_type: OptionalNullable[models.OutboundAuthenticationType] = UNSET, + fetch_default: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CredentialsResponse: + r"""List workspace credentials for a connector. + + List all credentials configured at the workspace level for a given connector. + + :param connector_id_or_name: + :param auth_type: + :param fetch_default: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListWorkspaceCredentialsV1Request( + auth_type=auth_type, + fetch_default=fetch_default, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="GET", + path="/v1/connectors/{connector_id_or_name}/workspace/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_workspace_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CredentialsResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_workspace_credentials_async( + self, + *, + connector_id_or_name: str, + auth_type: OptionalNullable[models.OutboundAuthenticationType] = UNSET, + fetch_default: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CredentialsResponse: + r"""List workspace credentials for a connector. + + List all credentials configured at the workspace level for a given connector. + + :param connector_id_or_name: + :param auth_type: + :param fetch_default: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListWorkspaceCredentialsV1Request( + auth_type=auth_type, + fetch_default=fetch_default, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/connectors/{connector_id_or_name}/workspace/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_workspace_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CredentialsResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create_or_update_workspace_credentials( + self, + *, + connector_id_or_name: str, + name: str, + is_default: OptionalNullable[bool] = UNSET, + credentials: OptionalNullable[ + Union[models.ConnectionCredentials, models.ConnectionCredentialsTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Create or update workspace credentials for a connector. + + Create or update credentials at the workspace level for a given connector. + + :param connector_id_or_name: + :param name: Name of the credentials. Use this name to access or modify your credentials. + :param is_default: Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. + :param credentials: The credential data (headers, bearer_token). + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorCreateOrUpdateWorkspaceCredentialsV1Request( + connector_id_or_name=connector_id_or_name, + credentials_create_or_update=models.CredentialsCreateOrUpdate( + name=name, + is_default=is_default, + credentials=utils.get_pydantic_model( + credentials, OptionalNullable[models.ConnectionCredentials] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id_or_name}/workspace/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.credentials_create_or_update, + False, + False, + "json", + models.CredentialsCreateOrUpdate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_create_or_update_workspace_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_or_update_workspace_credentials_async( + self, + *, + connector_id_or_name: str, + name: str, + is_default: OptionalNullable[bool] = UNSET, + credentials: OptionalNullable[ + Union[models.ConnectionCredentials, models.ConnectionCredentialsTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Create or update workspace credentials for a connector. + + Create or update credentials at the workspace level for a given connector. + + :param connector_id_or_name: + :param name: Name of the credentials. Use this name to access or modify your credentials. + :param is_default: Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. + :param credentials: The credential data (headers, bearer_token). + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorCreateOrUpdateWorkspaceCredentialsV1Request( + connector_id_or_name=connector_id_or_name, + credentials_create_or_update=models.CredentialsCreateOrUpdate( + name=name, + is_default=is_default, + credentials=utils.get_pydantic_model( + credentials, OptionalNullable[models.ConnectionCredentials] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id_or_name}/workspace/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.credentials_create_or_update, + False, + False, + "json", + models.CredentialsCreateOrUpdate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_create_or_update_workspace_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_user_credentials( + self, + *, + connector_id_or_name: str, + auth_type: OptionalNullable[models.OutboundAuthenticationType] = UNSET, + fetch_default: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CredentialsResponse: + r"""List user credentials for a connector. + + List all credentials configured at the user level for a given connector. + + :param connector_id_or_name: + :param auth_type: + :param fetch_default: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListUserCredentialsV1Request( + auth_type=auth_type, + fetch_default=fetch_default, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="GET", + path="/v1/connectors/{connector_id_or_name}/user/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_user_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CredentialsResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_user_credentials_async( + self, + *, + connector_id_or_name: str, + auth_type: OptionalNullable[models.OutboundAuthenticationType] = UNSET, + fetch_default: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CredentialsResponse: + r"""List user credentials for a connector. + + List all credentials configured at the user level for a given connector. + + :param connector_id_or_name: + :param auth_type: + :param fetch_default: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorListUserCredentialsV1Request( + auth_type=auth_type, + fetch_default=fetch_default, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/connectors/{connector_id_or_name}/user/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_list_user_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.CredentialsResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create_or_update_user_credentials( + self, + *, + connector_id_or_name: str, + name: str, + is_default: OptionalNullable[bool] = UNSET, + credentials: OptionalNullable[ + Union[models.ConnectionCredentials, models.ConnectionCredentialsTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Create or update user credentials for a connector. + + Create or update credentials at the user level for a given connector. + + :param connector_id_or_name: + :param name: Name of the credentials. Use this name to access or modify your credentials. + :param is_default: Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. + :param credentials: The credential data (headers, bearer_token). + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorCreateOrUpdateUserCredentialsV1Request( + connector_id_or_name=connector_id_or_name, + credentials_create_or_update=models.CredentialsCreateOrUpdate( + name=name, + is_default=is_default, + credentials=utils.get_pydantic_model( + credentials, OptionalNullable[models.ConnectionCredentials] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/connectors/{connector_id_or_name}/user/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.credentials_create_or_update, + False, + False, + "json", + models.CredentialsCreateOrUpdate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_create_or_update_user_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_or_update_user_credentials_async( + self, + *, + connector_id_or_name: str, + name: str, + is_default: OptionalNullable[bool] = UNSET, + credentials: OptionalNullable[ + Union[models.ConnectionCredentials, models.ConnectionCredentialsTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Create or update user credentials for a connector. + + Create or update credentials at the user level for a given connector. + + :param connector_id_or_name: + :param name: Name of the credentials. Use this name to access or modify your credentials. + :param is_default: Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged. + :param credentials: The credential data (headers, bearer_token). + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorCreateOrUpdateUserCredentialsV1Request( + connector_id_or_name=connector_id_or_name, + credentials_create_or_update=models.CredentialsCreateOrUpdate( + name=name, + is_default=is_default, + credentials=utils.get_pydantic_model( + credentials, OptionalNullable[models.ConnectionCredentials] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/connectors/{connector_id_or_name}/user/credentials", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.credentials_create_or_update, + False, + False, + "json", + models.CredentialsCreateOrUpdate, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_create_or_update_user_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete_organization_credentials( + self, + *, + credentials_name: str, + connector_id_or_name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Delete organization credentials for a connector. + + Delete credentials at the organization level for a given connector. + + :param credentials_name: + :param connector_id_or_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorDeleteOrganizationCredentialsV1Request( + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="DELETE", + path="/v1/connectors/{connector_id_or_name}/organization/credentials/{credentials_name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_delete_organization_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_organization_credentials_async( + self, + *, + credentials_name: str, + connector_id_or_name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Delete organization credentials for a connector. + + Delete credentials at the organization level for a given connector. + + :param credentials_name: + :param connector_id_or_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorDeleteOrganizationCredentialsV1Request( + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/connectors/{connector_id_or_name}/organization/credentials/{credentials_name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_delete_organization_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete_workspace_credentials( + self, + *, + credentials_name: str, + connector_id_or_name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Delete workspace credentials for a connector. + + Delete credentials at the workspace level for a given connector. + + :param credentials_name: + :param connector_id_or_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorDeleteWorkspaceCredentialsV1Request( + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="DELETE", + path="/v1/connectors/{connector_id_or_name}/workspace/credentials/{credentials_name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_delete_workspace_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_workspace_credentials_async( + self, + *, + credentials_name: str, + connector_id_or_name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Delete workspace credentials for a connector. + + Delete credentials at the workspace level for a given connector. + + :param credentials_name: + :param connector_id_or_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorDeleteWorkspaceCredentialsV1Request( + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/connectors/{connector_id_or_name}/workspace/credentials/{credentials_name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_delete_workspace_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete_user_credentials( + self, + *, + credentials_name: str, + connector_id_or_name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Delete user credentials for a connector. + + Delete credentials at the user level for a given connector. + + :param credentials_name: + :param connector_id_or_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorDeleteUserCredentialsV1Request( + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="DELETE", + path="/v1/connectors/{connector_id_or_name}/user/credentials/{credentials_name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_delete_user_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_user_credentials_async( + self, + *, + credentials_name: str, + connector_id_or_name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Delete user credentials for a connector. + + Delete credentials at the user level for a given connector. + + :param credentials_name: + :param connector_id_or_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorDeleteUserCredentialsV1Request( + credentials_name=credentials_name, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/connectors/{connector_id_or_name}/user/credentials/{credentials_name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_delete_user_credentials_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get( + self, + *, + connector_id_or_name: str, + fetch_customer_data: Optional[bool] = False, + fetch_connection_secrets: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Connector: + r"""Get a connector. + + Get a connector by its ID or name. + + :param connector_id_or_name: + :param fetch_customer_data: Fetch the customer data associated with the connector (e.g. customer secrets / config). + :param fetch_connection_secrets: Fetch the general connection secrets associated with the connector. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorGetV1Request( + fetch_customer_data=fetch_customer_data, + fetch_connection_secrets=fetch_connection_secrets, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request( + method="GET", + path="/v1/connectors/{connector_id_or_name}#idOrName", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_get_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Connector, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_async( + self, + *, + connector_id_or_name: str, + fetch_customer_data: Optional[bool] = False, + fetch_connection_secrets: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Connector: + r"""Get a connector. + + Get a connector by its ID or name. + + :param connector_id_or_name: + :param fetch_customer_data: Fetch the customer data associated with the connector (e.g. customer secrets / config). + :param fetch_connection_secrets: Fetch the general connection secrets associated with the connector. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorGetV1Request( + fetch_customer_data=fetch_customer_data, + fetch_connection_secrets=fetch_connection_secrets, + connector_id_or_name=connector_id_or_name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/connectors/{connector_id_or_name}#idOrName", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_get_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Connector, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update( + self, + *, + connector_id: str, + title: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + icon_url: OptionalNullable[str] = UNSET, + system_prompt: OptionalNullable[str] = UNSET, + connection_config: OptionalNullable[Dict[str, Any]] = UNSET, + connection_secrets: OptionalNullable[Dict[str, Any]] = UNSET, + server: OptionalNullable[str] = UNSET, + headers: OptionalNullable[Dict[str, Any]] = UNSET, + auth_data: OptionalNullable[ + Union[models.AuthData, models.AuthDataTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Connector: + r"""Update a connector. + + Update a connector by its ID. + + :param connector_id: + :param title: Optional human-readable title for the connector. + :param name: The name of the connector. + :param description: The description of the connector. + :param icon_url: The optional url of the icon you want to associate to the connector. + :param system_prompt: Optional system prompt for the connector. + :param connection_config: Optional new connection config. + :param connection_secrets: Optional new connection secrets + :param server: New server url for your mcp connector. + :param headers: New headers for your mcp connector. + :param auth_data: New authentication data for your mcp connector. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorUpdateV1Request( + connector_id=connector_id, + update_connector_request=models.UpdateConnectorRequest( + title=title, + name=name, + description=description, + icon_url=icon_url, + system_prompt=system_prompt, + connection_config=connection_config, + connection_secrets=connection_secrets, + server=server, + headers=headers, + auth_data=utils.get_pydantic_model( + auth_data, OptionalNullable[models.AuthData] + ), + ), + ) + + req = self._build_request( + method="PATCH", + path="/v1/connectors/{connector_id}#id", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_connector_request, + False, + False, + "json", + models.UpdateConnectorRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_update_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Connector, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_async( + self, + *, + connector_id: str, + title: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + icon_url: OptionalNullable[str] = UNSET, + system_prompt: OptionalNullable[str] = UNSET, + connection_config: OptionalNullable[Dict[str, Any]] = UNSET, + connection_secrets: OptionalNullable[Dict[str, Any]] = UNSET, + server: OptionalNullable[str] = UNSET, + headers: OptionalNullable[Dict[str, Any]] = UNSET, + auth_data: OptionalNullable[ + Union[models.AuthData, models.AuthDataTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Connector: + r"""Update a connector. + + Update a connector by its ID. + + :param connector_id: + :param title: Optional human-readable title for the connector. + :param name: The name of the connector. + :param description: The description of the connector. + :param icon_url: The optional url of the icon you want to associate to the connector. + :param system_prompt: Optional system prompt for the connector. + :param connection_config: Optional new connection config. + :param connection_secrets: Optional new connection secrets + :param server: New server url for your mcp connector. + :param headers: New headers for your mcp connector. + :param auth_data: New authentication data for your mcp connector. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorUpdateV1Request( + connector_id=connector_id, + update_connector_request=models.UpdateConnectorRequest( + title=title, + name=name, + description=description, + icon_url=icon_url, + system_prompt=system_prompt, + connection_config=connection_config, + connection_secrets=connection_secrets, + server=server, + headers=headers, + auth_data=utils.get_pydantic_model( + auth_data, OptionalNullable[models.AuthData] + ), + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/connectors/{connector_id}#id", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_connector_request, + False, + False, + "json", + models.UpdateConnectorRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_update_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Connector, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + connector_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Delete a connector. + + Delete a connector by its ID. + + :param connector_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorDeleteV1Request( + connector_id=connector_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/connectors/{connector_id}#id", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_delete_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + connector_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.MessageResponse: + r"""Delete a connector. + + Delete a connector by its ID. + + :param connector_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConnectorDeleteV1Request( + connector_id=connector_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/connectors/{connector_id}#id", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="connector_delete_v1", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.MessageResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/conversations.py b/src/mistralai/client/conversations.py new file mode 100644 index 00000000..0e0bca0d --- /dev/null +++ b/src/mistralai/client/conversations.py @@ -0,0 +1,3097 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 40692a878064 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + +# region imports +import typing +from typing import AsyncGenerator +import logging +from collections import defaultdict + +from mistralai.client.models import ( + ResponseStartedEvent, + ConversationEventsData, + InputEntries, +) +from mistralai.extra.run.result import ( + RunResult, + RunResultEvents, + FunctionResultEvent, + reconstitue_entries, +) +from mistralai.extra.run.utils import run_requirements +from mistralai.extra.observability.otel import GenAISpanEnum, get_or_create_otel_tracer +from mistralai.extra.exceptions import ( + DeferralReason, + DeferredToolCallsException, + DeferredToolCallEntry, + DeferredToolCallResponse, +) +from mistralai.extra.run.deferred import ( + _is_deferred_response, + _is_server_deferred, + _process_deferred_responses, +) + +logger = logging.getLogger(__name__) +tracing_enabled, tracer = get_or_create_otel_tracer() + +if typing.TYPE_CHECKING: + from mistralai.extra.run.context import RunContext + +# endregion imports + + +class Conversations(BaseSDK): + r"""(beta) Conversations API""" + + # region sdk-class-body + # Custom run code allowing client side execution of code + + @run_requirements + async def run_async( + self, + run_ctx: "RunContext", + inputs: Union[ + models.ConversationInputs, + models.ConversationInputsTypedDict, + List[DeferredToolCallResponse], + ], + instructions: OptionalNullable[str] = UNSET, + tools: OptionalNullable[ + Union[ + List[models.ConversationRequestTool], + List[models.ConversationRequestToolTypedDict], + ] + ] = UNSET, + completion_args: OptionalNullable[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> RunResult: + """Run a conversation with the given inputs and context. + + The execution of a run will only stop when no required local execution can be done. + + Inputs can be: + - Regular conversation inputs (messages, function results, etc.) + - DeferredToolResponse objects (from deferred.confirm(), reject()) + + When passing DeferredToolResponse objects, the SDK will: + - Execute confirmed tools automatically + - Convert rejections to function results with the rejection message + """ + from mistralai.client.beta import Beta # pylint: disable=import-outside-toplevel + from mistralai.extra.run.context import _validate_run # pylint: disable=import-outside-toplevel + from mistralai.extra.run.tools import get_function_calls # pylint: disable=import-outside-toplevel + + # Check if inputs contain deferred responses - process them + pending_tool_confirmations = None + if inputs and isinstance(inputs, list): + deferred_inputs = typing.cast( + List[DeferredToolCallResponse], + [i for i in inputs if _is_deferred_response(i)], + ) + other_inputs = typing.cast( + List[InputEntries], [i for i in inputs if not _is_deferred_response(i)] + ) + if deferred_inputs: + ( + processed, + pending_tool_confirmations, + ) = await _process_deferred_responses(run_ctx, deferred_inputs) + inputs = other_inputs + processed + if not pending_tool_confirmations: + pending_tool_confirmations = None + + with tracer.start_as_current_span(GenAISpanEnum.VALIDATE_RUN.value): + req, run_result, input_entries = await _validate_run( + beta_client=Beta(self.sdk_configuration), + run_ctx=run_ctx, + inputs=typing.cast(List[InputEntries], inputs), + instructions=instructions, + tools=tools, + completion_args=completion_args, + ) + + with tracer.start_as_current_span(GenAISpanEnum.CONVERSATION.value): + while True: + if run_ctx.conversation_id is None: + res = await self.start_async( + inputs=input_entries, + http_headers=http_headers, + name=name, + description=description, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + **req, # type: ignore + ) + run_result.conversation_id = res.conversation_id + run_ctx.conversation_id = res.conversation_id + logger.info( # pylint: disable=logging-fstring-interpolation + f"Started Run with conversation with id {res.conversation_id}" + ) + else: + res = await self.append_async( + conversation_id=run_ctx.conversation_id, + inputs=input_entries, + tool_confirmations=pending_tool_confirmations, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + # Clear after first use + pending_tool_confirmations = None + run_ctx.request_count += 1 + run_result.output_entries.extend(res.outputs) + fcalls = get_function_calls(res.outputs) + if not fcalls: + logger.debug("No more function calls to execute") + break + + # Partition by permission: include server-side deferred calls + to_defer = [ + fc + for fc in fcalls + if run_ctx.requires_confirmation(fc.name) or _is_server_deferred(fc) + ] + to_execute = [fc for fc in fcalls if fc not in to_defer] + + # Execute approved + fresults = [] + if to_execute: + fresults = await run_ctx.execute_function_calls(to_execute) + run_result.output_entries.extend(fresults) + input_entries = typing.cast(list[InputEntries], fresults) + + # Defer the rest - include executed_results so user can pass them back + if to_defer: + deferred_objects = [ + DeferredToolCallEntry( + fc, + reason=DeferralReason.SERVER_SIDE_CONFIRMATION_REQUIRED + if _is_server_deferred(fc) + else DeferralReason.CONFIRMATION_REQUIRED, + ) + for fc in to_defer + ] + raise DeferredToolCallsException( + run_ctx.conversation_id, + deferred_objects, + run_result.output_entries, + executed_results=fresults, + ) + + # If we only executed tools (none deferred), continue the loop + if not to_execute: + break + return run_result + + @run_requirements + async def run_stream_async( + self, + run_ctx: "RunContext", + inputs: Union[ + models.ConversationInputs, + models.ConversationInputsTypedDict, + List[DeferredToolCallResponse], + ], + instructions: OptionalNullable[str] = UNSET, + tools: OptionalNullable[ + Union[ + List[models.ConversationRequestTool], + List[models.ConversationRequestToolTypedDict], + ] + ] = UNSET, + completion_args: OptionalNullable[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> AsyncGenerator[Union[RunResultEvents, RunResult], None]: + """Similar to `run_async` but returns a generator which streams events. + + The last streamed object is the RunResult object which summarises what happened in the run. + + Inputs can be: + - Regular conversation inputs (messages, function results, etc.) + - DeferredToolResponse objects (from deferred.confirm(), reject()) + """ + from mistralai.client.beta import Beta # pylint: disable=import-outside-toplevel + from mistralai.extra.run.context import _validate_run # pylint: disable=import-outside-toplevel + from mistralai.extra.run.tools import get_function_calls # pylint: disable=import-outside-toplevel + + # Check if inputs contain deferred responses - process them + pending_tool_confirmations = None + if inputs and isinstance(inputs, list): + deferred_inputs = typing.cast( + List[DeferredToolCallResponse], + [i for i in inputs if _is_deferred_response(i)], + ) + other_inputs = typing.cast( + List[InputEntries], [i for i in inputs if not _is_deferred_response(i)] + ) + if deferred_inputs: + ( + processed, + pending_tool_confirmations, + ) = await _process_deferred_responses(run_ctx, deferred_inputs) + inputs = other_inputs + processed + if not pending_tool_confirmations: + pending_tool_confirmations = None + + req, run_result, input_entries = await _validate_run( + beta_client=Beta(self.sdk_configuration), + run_ctx=run_ctx, + inputs=typing.cast(List[InputEntries], inputs), + instructions=instructions, + tools=tools, + completion_args=completion_args, + ) + + async def run_generator() -> AsyncGenerator[ + Union[RunResultEvents, RunResult], None + ]: + nonlocal pending_tool_confirmations + current_entries = input_entries + while True: + received_event_tracker: defaultdict[ + int, list[ConversationEventsData] + ] = defaultdict(list) + if run_ctx.conversation_id is None: + res = await self.start_stream_async( + inputs=current_entries, + http_headers=http_headers, + name=name, + description=description, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + **req, # type: ignore + ) + else: + res = await self.append_stream_async( + conversation_id=run_ctx.conversation_id, + inputs=current_entries, + tool_confirmations=pending_tool_confirmations, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + ) + # Clear after first use + pending_tool_confirmations = None + async for event in res: + if ( + isinstance(event.data, ResponseStartedEvent) + and run_ctx.conversation_id is None + ): + run_result.conversation_id = event.data.conversation_id + run_ctx.conversation_id = event.data.conversation_id + logger.info( # pylint: disable=logging-fstring-interpolation + f"Started Run with conversation with id {run_ctx.conversation_id}" + ) + if ( + output_index := getattr(event.data, "output_index", None) + ) is not None: + received_event_tracker[output_index].append(event.data) + yield typing.cast(RunResultEvents, event) + run_ctx.request_count += 1 + outputs = reconstitue_entries(received_event_tracker) + run_result.output_entries.extend(outputs) + fcalls = get_function_calls(outputs) + if not fcalls: + logger.debug("No more function calls to execute") + break + + # Partition by permission: include server-side deferred calls + to_defer = [ + fc + for fc in fcalls + if run_ctx.requires_confirmation(fc.name) or _is_server_deferred(fc) + ] + to_execute = [fc for fc in fcalls if fc not in to_defer] + + # Execute approved + fresults = [] + if to_execute: + fresults = await run_ctx.execute_function_calls(to_execute) + run_result.output_entries.extend(fresults) + for fresult in fresults: + yield RunResultEvents( + event="function.result", + data=FunctionResultEvent( + type="function.result", + result=fresult.result, + tool_call_id=fresult.tool_call_id, + ), + ) + current_entries = typing.cast(list[InputEntries], fresults) + + # Defer the rest - include executed_results so user can pass them back + if to_defer: + deferred_objects = [ + DeferredToolCallEntry( + fc, + reason=DeferralReason.SERVER_SIDE_CONFIRMATION_REQUIRED + if _is_server_deferred(fc) + else DeferralReason.CONFIRMATION_REQUIRED, + ) + for fc in to_defer + ] + raise DeferredToolCallsException( + run_ctx.conversation_id, + deferred_objects, + run_result.output_entries, + executed_results=fresults, + ) + + # If we only executed tools (none deferred), continue the loop + if not to_execute: + break + yield run_result + + return run_generator() + + # endregion sdk-class-body + + def start( + self, + *, + inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], + store: OptionalNullable[bool] = UNSET, + handoff_execution: OptionalNullable[ + models.ConversationRequestHandoffExecution + ] = UNSET, + instructions: OptionalNullable[str] = UNSET, + tools: OptionalNullable[ + Union[ + List[models.ConversationRequestTool], + List[models.ConversationRequestToolTypedDict], + ] + ] = UNSET, + completion_args: OptionalNullable[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + agent_id: OptionalNullable[str] = UNSET, + agent_version: OptionalNullable[ + Union[ + models.ConversationRequestAgentVersion, + models.ConversationRequestAgentVersionTypedDict, + ] + ] = UNSET, + model: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationResponse: + r"""Create a conversation and append entries to it. + + Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation. + + :param inputs: + :param store: + :param handoff_execution: + :param instructions: + :param tools: + :param completion_args: + :param guardrails: + :param name: + :param description: + :param metadata: + :param agent_id: + :param agent_version: + :param model: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConversationRequest( + inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), + store=store, + handoff_execution=handoff_execution, + instructions=instructions, + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ConversationRequestTool]] + ), + completion_args=utils.get_pydantic_model( + completion_args, OptionalNullable[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + name=name, + description=description, + metadata=metadata, + agent_id=agent_id, + agent_version=agent_version, + model=model, + ) + + req = self._build_request( + method="POST", + path="/v1/conversations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ConversationRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_start", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def start_async( + self, + *, + inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], + store: OptionalNullable[bool] = UNSET, + handoff_execution: OptionalNullable[ + models.ConversationRequestHandoffExecution + ] = UNSET, + instructions: OptionalNullable[str] = UNSET, + tools: OptionalNullable[ + Union[ + List[models.ConversationRequestTool], + List[models.ConversationRequestToolTypedDict], + ] + ] = UNSET, + completion_args: OptionalNullable[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + agent_id: OptionalNullable[str] = UNSET, + agent_version: OptionalNullable[ + Union[ + models.ConversationRequestAgentVersion, + models.ConversationRequestAgentVersionTypedDict, + ] + ] = UNSET, + model: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationResponse: + r"""Create a conversation and append entries to it. + + Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation. + + :param inputs: + :param store: + :param handoff_execution: + :param instructions: + :param tools: + :param completion_args: + :param guardrails: + :param name: + :param description: + :param metadata: + :param agent_id: + :param agent_version: + :param model: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConversationRequest( + inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), + store=store, + handoff_execution=handoff_execution, + instructions=instructions, + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ConversationRequestTool]] + ), + completion_args=utils.get_pydantic_model( + completion_args, OptionalNullable[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + name=name, + description=description, + metadata=metadata, + agent_id=agent_id, + agent_version=agent_version, + model=model, + ) + + req = self._build_request_async( + method="POST", + path="/v1/conversations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ConversationRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_start", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list( + self, + *, + page: Optional[int] = 0, + page_size: Optional[int] = 100, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.AgentsAPIV1ConversationsListResponse]: + r"""List all created conversations. + + Retrieve a list of conversation entities sorted by creation time. + + :param page: + :param page_size: + :param metadata: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsListRequest( + page=page, + page_size=page_size, + metadata=metadata, + ) + + req = self._build_request( + method="GET", + path="/v1/conversations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_list", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + List[models.AgentsAPIV1ConversationsListResponse], http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + page: Optional[int] = 0, + page_size: Optional[int] = 100, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.AgentsAPIV1ConversationsListResponse]: + r"""List all created conversations. + + Retrieve a list of conversation entities sorted by creation time. + + :param page: + :param page_size: + :param metadata: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsListRequest( + page=page, + page_size=page_size, + metadata=metadata, + ) + + req = self._build_request_async( + method="GET", + path="/v1/conversations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_list", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + List[models.AgentsAPIV1ConversationsListResponse], http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get( + self, + *, + conversation_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResponseV1ConversationsGet: + r"""Retrieve a conversation information. + + Given a conversation_id retrieve a conversation entity with its attributes. + + :param conversation_id: ID of the conversation from which we are fetching metadata. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsGetRequest( + conversation_id=conversation_id, + ) + + req = self._build_request( + method="GET", + path="/v1/conversations/{conversation_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ResponseV1ConversationsGet, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_async( + self, + *, + conversation_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResponseV1ConversationsGet: + r"""Retrieve a conversation information. + + Given a conversation_id retrieve a conversation entity with its attributes. + + :param conversation_id: ID of the conversation from which we are fetching metadata. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsGetRequest( + conversation_id=conversation_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/conversations/{conversation_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ResponseV1ConversationsGet, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + conversation_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a conversation. + + Delete a conversation given a conversation_id. + + :param conversation_id: ID of the conversation from which we are fetching metadata. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsDeleteRequest( + conversation_id=conversation_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/conversations/{conversation_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + conversation_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a conversation. + + Delete a conversation given a conversation_id. + + :param conversation_id: ID of the conversation from which we are fetching metadata. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsDeleteRequest( + conversation_id=conversation_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/conversations/{conversation_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def append( + self, + *, + conversation_id: str, + inputs: Optional[ + Union[models.ConversationInputs, models.ConversationInputsTypedDict] + ] = None, + store: Optional[bool] = True, + handoff_execution: Optional[ + models.ConversationAppendRequestHandoffExecution + ] = "server", + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + tool_confirmations: OptionalNullable[ + Union[ + List[models.ToolCallConfirmation], + List[models.ToolCallConfirmationTypedDict], + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationResponse: + r"""Append new entries to an existing conversation. + + Run completion on the history of the conversation and the user entries. Return the new created entries. + + :param conversation_id: ID of the conversation to which we append entries. + :param inputs: + :param store: Whether to store the results into our servers or not. + :param handoff_execution: + :param completion_args: White-listed arguments from the completion API + :param tool_confirmations: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsAppendRequest( + conversation_id=conversation_id, + conversation_append_request=models.ConversationAppendRequest( + inputs=utils.get_pydantic_model( + inputs, Optional[models.ConversationInputs] + ), + store=store, + handoff_execution=handoff_execution, + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + tool_confirmations=utils.get_pydantic_model( + tool_confirmations, + OptionalNullable[List[models.ToolCallConfirmation]], + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/conversations/{conversation_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.conversation_append_request, + False, + False, + "json", + models.ConversationAppendRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_append", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def append_async( + self, + *, + conversation_id: str, + inputs: Optional[ + Union[models.ConversationInputs, models.ConversationInputsTypedDict] + ] = None, + store: Optional[bool] = True, + handoff_execution: Optional[ + models.ConversationAppendRequestHandoffExecution + ] = "server", + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + tool_confirmations: OptionalNullable[ + Union[ + List[models.ToolCallConfirmation], + List[models.ToolCallConfirmationTypedDict], + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationResponse: + r"""Append new entries to an existing conversation. + + Run completion on the history of the conversation and the user entries. Return the new created entries. + + :param conversation_id: ID of the conversation to which we append entries. + :param inputs: + :param store: Whether to store the results into our servers or not. + :param handoff_execution: + :param completion_args: White-listed arguments from the completion API + :param tool_confirmations: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsAppendRequest( + conversation_id=conversation_id, + conversation_append_request=models.ConversationAppendRequest( + inputs=utils.get_pydantic_model( + inputs, Optional[models.ConversationInputs] + ), + store=store, + handoff_execution=handoff_execution, + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + tool_confirmations=utils.get_pydantic_model( + tool_confirmations, + OptionalNullable[List[models.ToolCallConfirmation]], + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/conversations/{conversation_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.conversation_append_request, + False, + False, + "json", + models.ConversationAppendRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_append", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_history( + self, + *, + conversation_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationHistory: + r"""Retrieve all entries in a conversation. + + Given a conversation_id retrieve all the entries belonging to that conversation. The entries are sorted in the order they were appended, those can be messages, connectors or function_call. + + :param conversation_id: ID of the conversation from which we are fetching entries. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsHistoryRequest( + conversation_id=conversation_id, + ) + + req = self._build_request( + method="GET", + path="/v1/conversations/{conversation_id}/history", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_history", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationHistory, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_history_async( + self, + *, + conversation_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationHistory: + r"""Retrieve all entries in a conversation. + + Given a conversation_id retrieve all the entries belonging to that conversation. The entries are sorted in the order they were appended, those can be messages, connectors or function_call. + + :param conversation_id: ID of the conversation from which we are fetching entries. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsHistoryRequest( + conversation_id=conversation_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/conversations/{conversation_id}/history", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_history", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationHistory, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_messages( + self, + *, + conversation_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationMessages: + r"""Retrieve all messages in a conversation. + + Given a conversation_id retrieve all the messages belonging to that conversation. This is similar to retrieving all entries except we filter the messages only. + + :param conversation_id: ID of the conversation from which we are fetching messages. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsMessagesRequest( + conversation_id=conversation_id, + ) + + req = self._build_request( + method="GET", + path="/v1/conversations/{conversation_id}/messages", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_messages", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationMessages, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_messages_async( + self, + *, + conversation_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationMessages: + r"""Retrieve all messages in a conversation. + + Given a conversation_id retrieve all the messages belonging to that conversation. This is similar to retrieving all entries except we filter the messages only. + + :param conversation_id: ID of the conversation from which we are fetching messages. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsMessagesRequest( + conversation_id=conversation_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/conversations/{conversation_id}/messages", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_messages", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationMessages, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def restart( + self, + *, + conversation_id: str, + from_entry_id: str, + inputs: Optional[ + Union[models.ConversationInputs, models.ConversationInputsTypedDict] + ] = None, + store: Optional[bool] = True, + handoff_execution: Optional[ + models.ConversationRestartRequestHandoffExecution + ] = "server", + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + agent_version: OptionalNullable[ + Union[ + models.ConversationRestartRequestAgentVersion, + models.ConversationRestartRequestAgentVersionTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationResponse: + r"""Restart a conversation starting from a given entry. + + Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned. + + :param conversation_id: ID of the original conversation which is being restarted. + :param from_entry_id: + :param inputs: + :param store: Whether to store the results into our servers or not. + :param handoff_execution: + :param completion_args: White-listed arguments from the completion API + :param guardrails: + :param metadata: Custom metadata for the conversation. + :param agent_version: Specific version of the agent to use when restarting. If not provided, uses the current version. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsRestartRequest( + conversation_id=conversation_id, + conversation_restart_request=models.ConversationRestartRequest( + inputs=utils.get_pydantic_model( + inputs, Optional[models.ConversationInputs] + ), + store=store, + handoff_execution=handoff_execution, + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + metadata=metadata, + from_entry_id=from_entry_id, + agent_version=agent_version, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/conversations/{conversation_id}/restart", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.conversation_restart_request, + False, + False, + "json", + models.ConversationRestartRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_restart", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def restart_async( + self, + *, + conversation_id: str, + from_entry_id: str, + inputs: Optional[ + Union[models.ConversationInputs, models.ConversationInputsTypedDict] + ] = None, + store: Optional[bool] = True, + handoff_execution: Optional[ + models.ConversationRestartRequestHandoffExecution + ] = "server", + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + agent_version: OptionalNullable[ + Union[ + models.ConversationRestartRequestAgentVersion, + models.ConversationRestartRequestAgentVersionTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ConversationResponse: + r"""Restart a conversation starting from a given entry. + + Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned. + + :param conversation_id: ID of the original conversation which is being restarted. + :param from_entry_id: + :param inputs: + :param store: Whether to store the results into our servers or not. + :param handoff_execution: + :param completion_args: White-listed arguments from the completion API + :param guardrails: + :param metadata: Custom metadata for the conversation. + :param agent_version: Specific version of the agent to use when restarting. If not provided, uses the current version. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsRestartRequest( + conversation_id=conversation_id, + conversation_restart_request=models.ConversationRestartRequest( + inputs=utils.get_pydantic_model( + inputs, Optional[models.ConversationInputs] + ), + store=store, + handoff_execution=handoff_execution, + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + metadata=metadata, + from_entry_id=from_entry_id, + agent_version=agent_version, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/conversations/{conversation_id}/restart", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.conversation_restart_request, + False, + False, + "json", + models.ConversationRestartRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_restart", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ConversationResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def start_stream( + self, + *, + inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], + store: OptionalNullable[bool] = UNSET, + handoff_execution: OptionalNullable[ + models.ConversationStreamRequestHandoffExecution + ] = UNSET, + instructions: OptionalNullable[str] = UNSET, + tools: OptionalNullable[ + Union[ + List[models.ConversationStreamRequestTool], + List[models.ConversationStreamRequestToolTypedDict], + ] + ] = UNSET, + completion_args: OptionalNullable[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + agent_id: OptionalNullable[str] = UNSET, + agent_version: OptionalNullable[ + Union[ + models.ConversationStreamRequestAgentVersion, + models.ConversationStreamRequestAgentVersionTypedDict, + ] + ] = UNSET, + model: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.ConversationEvents]: + r"""Create a conversation and append entries to it. + + Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation. + + :param inputs: + :param store: + :param handoff_execution: + :param instructions: + :param tools: + :param completion_args: + :param guardrails: + :param name: + :param description: + :param metadata: + :param agent_id: + :param agent_version: + :param model: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConversationStreamRequest( + inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), + store=store, + handoff_execution=handoff_execution, + instructions=instructions, + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ConversationStreamRequestTool]] + ), + completion_args=utils.get_pydantic_model( + completion_args, OptionalNullable[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + name=name, + description=description, + metadata=metadata, + agent_id=agent_id, + agent_version=agent_version, + model=model, + ) + + req = self._build_request( + method="POST", + path="/v1/conversations#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ConversationStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_start_stream", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def start_stream_async( + self, + *, + inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], + store: OptionalNullable[bool] = UNSET, + handoff_execution: OptionalNullable[ + models.ConversationStreamRequestHandoffExecution + ] = UNSET, + instructions: OptionalNullable[str] = UNSET, + tools: OptionalNullable[ + Union[ + List[models.ConversationStreamRequestTool], + List[models.ConversationStreamRequestToolTypedDict], + ] + ] = UNSET, + completion_args: OptionalNullable[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = UNSET, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + agent_id: OptionalNullable[str] = UNSET, + agent_version: OptionalNullable[ + Union[ + models.ConversationStreamRequestAgentVersion, + models.ConversationStreamRequestAgentVersionTypedDict, + ] + ] = UNSET, + model: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.ConversationEvents]: + r"""Create a conversation and append entries to it. + + Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation. + + :param inputs: + :param store: + :param handoff_execution: + :param instructions: + :param tools: + :param completion_args: + :param guardrails: + :param name: + :param description: + :param metadata: + :param agent_id: + :param agent_version: + :param model: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ConversationStreamRequest( + inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), + store=store, + handoff_execution=handoff_execution, + instructions=instructions, + tools=utils.get_pydantic_model( + tools, OptionalNullable[List[models.ConversationStreamRequestTool]] + ), + completion_args=utils.get_pydantic_model( + completion_args, OptionalNullable[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + name=name, + description=description, + metadata=metadata, + agent_id=agent_id, + agent_version=agent_version, + model=model, + ) + + req = self._build_request_async( + method="POST", + path="/v1/conversations#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.ConversationStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_start_stream", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + def append_stream( + self, + *, + conversation_id: str, + inputs: Optional[ + Union[models.ConversationInputs, models.ConversationInputsTypedDict] + ] = None, + store: Optional[bool] = True, + handoff_execution: Optional[ + models.ConversationAppendStreamRequestHandoffExecution + ] = "server", + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + tool_confirmations: OptionalNullable[ + Union[ + List[models.ToolCallConfirmation], + List[models.ToolCallConfirmationTypedDict], + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.ConversationEvents]: + r"""Append new entries to an existing conversation. + + Run completion on the history of the conversation and the user entries. Return the new created entries. + + :param conversation_id: ID of the conversation to which we append entries. + :param inputs: + :param store: Whether to store the results into our servers or not. + :param handoff_execution: + :param completion_args: White-listed arguments from the completion API + :param tool_confirmations: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsAppendStreamRequest( + conversation_id=conversation_id, + conversation_append_stream_request=models.ConversationAppendStreamRequest( + inputs=utils.get_pydantic_model( + inputs, Optional[models.ConversationInputs] + ), + store=store, + handoff_execution=handoff_execution, + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + tool_confirmations=utils.get_pydantic_model( + tool_confirmations, + OptionalNullable[List[models.ToolCallConfirmation]], + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/conversations/{conversation_id}#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.conversation_append_stream_request, + False, + False, + "json", + models.ConversationAppendStreamRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_append_stream", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def append_stream_async( + self, + *, + conversation_id: str, + inputs: Optional[ + Union[models.ConversationInputs, models.ConversationInputsTypedDict] + ] = None, + store: Optional[bool] = True, + handoff_execution: Optional[ + models.ConversationAppendStreamRequestHandoffExecution + ] = "server", + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + tool_confirmations: OptionalNullable[ + Union[ + List[models.ToolCallConfirmation], + List[models.ToolCallConfirmationTypedDict], + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.ConversationEvents]: + r"""Append new entries to an existing conversation. + + Run completion on the history of the conversation and the user entries. Return the new created entries. + + :param conversation_id: ID of the conversation to which we append entries. + :param inputs: + :param store: Whether to store the results into our servers or not. + :param handoff_execution: + :param completion_args: White-listed arguments from the completion API + :param tool_confirmations: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsAppendStreamRequest( + conversation_id=conversation_id, + conversation_append_stream_request=models.ConversationAppendStreamRequest( + inputs=utils.get_pydantic_model( + inputs, Optional[models.ConversationInputs] + ), + store=store, + handoff_execution=handoff_execution, + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + tool_confirmations=utils.get_pydantic_model( + tool_confirmations, + OptionalNullable[List[models.ToolCallConfirmation]], + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/conversations/{conversation_id}#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.conversation_append_stream_request, + False, + False, + "json", + models.ConversationAppendStreamRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_append_stream", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + def restart_stream( + self, + *, + conversation_id: str, + from_entry_id: str, + inputs: Optional[ + Union[models.ConversationInputs, models.ConversationInputsTypedDict] + ] = None, + store: Optional[bool] = True, + handoff_execution: Optional[ + models.ConversationRestartStreamRequestHandoffExecution + ] = "server", + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + agent_version: OptionalNullable[ + Union[ + models.ConversationRestartStreamRequestAgentVersion, + models.ConversationRestartStreamRequestAgentVersionTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.ConversationEvents]: + r"""Restart a conversation starting from a given entry. + + Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned. + + :param conversation_id: ID of the original conversation which is being restarted. + :param from_entry_id: + :param inputs: + :param store: Whether to store the results into our servers or not. + :param handoff_execution: + :param completion_args: White-listed arguments from the completion API + :param guardrails: + :param metadata: Custom metadata for the conversation. + :param agent_version: Specific version of the agent to use when restarting. If not provided, uses the current version. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsRestartStreamRequest( + conversation_id=conversation_id, + conversation_restart_stream_request=models.ConversationRestartStreamRequest( + inputs=utils.get_pydantic_model( + inputs, Optional[models.ConversationInputs] + ), + store=store, + handoff_execution=handoff_execution, + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + metadata=metadata, + from_entry_id=from_entry_id, + agent_version=agent_version, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/conversations/{conversation_id}/restart#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.conversation_restart_stream_request, + False, + False, + "json", + models.ConversationRestartStreamRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_restart_stream", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def restart_stream_async( + self, + *, + conversation_id: str, + from_entry_id: str, + inputs: Optional[ + Union[models.ConversationInputs, models.ConversationInputsTypedDict] + ] = None, + store: Optional[bool] = True, + handoff_execution: Optional[ + models.ConversationRestartStreamRequestHandoffExecution + ] = "server", + completion_args: Optional[ + Union[models.CompletionArgs, models.CompletionArgsTypedDict] + ] = None, + guardrails: OptionalNullable[ + Union[List[models.GuardrailConfig], List[models.GuardrailConfigTypedDict]] + ] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + agent_version: OptionalNullable[ + Union[ + models.ConversationRestartStreamRequestAgentVersion, + models.ConversationRestartStreamRequestAgentVersionTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.ConversationEvents]: + r"""Restart a conversation starting from a given entry. + + Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned. + + :param conversation_id: ID of the original conversation which is being restarted. + :param from_entry_id: + :param inputs: + :param store: Whether to store the results into our servers or not. + :param handoff_execution: + :param completion_args: White-listed arguments from the completion API + :param guardrails: + :param metadata: Custom metadata for the conversation. + :param agent_version: Specific version of the agent to use when restarting. If not provided, uses the current version. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AgentsAPIV1ConversationsRestartStreamRequest( + conversation_id=conversation_id, + conversation_restart_stream_request=models.ConversationRestartStreamRequest( + inputs=utils.get_pydantic_model( + inputs, Optional[models.ConversationInputs] + ), + store=store, + handoff_execution=handoff_execution, + completion_args=utils.get_pydantic_model( + completion_args, Optional[models.CompletionArgs] + ), + guardrails=utils.get_pydantic_model( + guardrails, OptionalNullable[List[models.GuardrailConfig]] + ), + metadata=metadata, + from_entry_id=from_entry_id, + agent_version=agent_version, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/conversations/{conversation_id}/restart#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.conversation_restart_stream_request, + False, + False, + "json", + models.ConversationRestartStreamRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="agents_api_v1_conversations_restart_stream", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/client/datasets.py b/src/mistralai/client/datasets.py new file mode 100644 index 00000000..437b42fd --- /dev/null +++ b/src/mistralai/client/datasets.py @@ -0,0 +1,3062 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e5a6ae2a2d85 + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.records import Records +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class Datasets(BaseSDK): + records: Records + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.records = Records(self.sdk_configuration, parent_ref=self.parent_ref) + + def create( + self, + *, + name: str, + description: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Dataset: + r"""Create a new empty dataset + + :param name: + :param description: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateDatasetRequest( + name=name, + description=description, + ) + + req = self._build_request( + method="POST", + path="/v1/observability/datasets", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateDatasetRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_dataset_v1_observability_datasets_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Dataset, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + name: str, + description: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Dataset: + r"""Create a new empty dataset + + :param name: + :param description: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateDatasetRequest( + name=name, + description=description, + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/datasets", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateDatasetRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_dataset_v1_observability_datasets_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Dataset, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list( + self, + *, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + q: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListDatasetsResponse: + r"""List existing datasets + + :param page_size: + :param page: + :param q: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDatasetsV1ObservabilityDatasetsGetRequest( + page_size=page_size, + page=page, + q=q, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/datasets", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_datasets_v1_observability_datasets_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListDatasetsResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + q: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListDatasetsResponse: + r"""List existing datasets + + :param page_size: + :param page: + :param q: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDatasetsV1ObservabilityDatasetsGetRequest( + page_size=page_size, + page=page, + q=q, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/datasets", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_datasets_v1_observability_datasets_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListDatasetsResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch( + self, + *, + dataset_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetPreview: + r"""Get dataset by id + + :param dataset_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequest( + dataset_id=dataset_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/datasets/{dataset_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_by_id_v1_observability_datasets__dataset_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DatasetPreview, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_async( + self, + *, + dataset_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetPreview: + r"""Get dataset by id + + :param dataset_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequest( + dataset_id=dataset_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/datasets/{dataset_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_by_id_v1_observability_datasets__dataset_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DatasetPreview, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + dataset_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a dataset + + :param dataset_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequest( + dataset_id=dataset_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/observability/datasets/{dataset_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_dataset_v1_observability_datasets__dataset_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + dataset_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a dataset + + :param dataset_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequest( + dataset_id=dataset_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/observability/datasets/{dataset_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_dataset_v1_observability_datasets__dataset_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update( + self, + *, + dataset_id: str, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetPreview: + r"""Patch dataset + + :param dataset_id: + :param name: + :param description: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequest( + dataset_id=dataset_id, + update_dataset_request=models.UpdateDatasetRequest( + name=name, + description=description, + ), + ) + + req = self._build_request( + method="PATCH", + path="/v1/observability/datasets/{dataset_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_dataset_request, + False, + False, + "json", + models.UpdateDatasetRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_dataset_v1_observability_datasets__dataset_id__patch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DatasetPreview, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_async( + self, + *, + dataset_id: str, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetPreview: + r"""Patch dataset + + :param dataset_id: + :param name: + :param description: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequest( + dataset_id=dataset_id, + update_dataset_request=models.UpdateDatasetRequest( + name=name, + description=description, + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/observability/datasets/{dataset_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_dataset_request, + False, + False, + "json", + models.UpdateDatasetRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_dataset_v1_observability_datasets__dataset_id__patch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DatasetPreview, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_records( + self, + *, + dataset_id: str, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListDatasetRecordsResponse: + r"""List existing records in the dataset + + :param dataset_id: + :param page_size: + :param page: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequest( + dataset_id=dataset_id, + page_size=page_size, + page=page, + ) + ) + + req = self._build_request( + method="GET", + path="/v1/observability/datasets/{dataset_id}/records", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_records_v1_observability_datasets__dataset_id__records_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListDatasetRecordsResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_records_async( + self, + *, + dataset_id: str, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListDatasetRecordsResponse: + r"""List existing records in the dataset + + :param dataset_id: + :param page_size: + :param page: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequest( + dataset_id=dataset_id, + page_size=page_size, + page=page, + ) + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/datasets/{dataset_id}/records", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_records_v1_observability_datasets__dataset_id__records_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListDatasetRecordsResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create_record( + self, + *, + dataset_id: str, + payload: Union[models.ConversationPayload, models.ConversationPayloadTypedDict], + properties: Dict[str, Any], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetRecord: + r"""Add a conversation to the dataset + + :param dataset_id: + :param payload: + :param properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequest( + dataset_id=dataset_id, + create_dataset_record_request=models.CreateDatasetRecordRequest( + payload=utils.get_pydantic_model(payload, models.ConversationPayload), + properties=properties, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/datasets/{dataset_id}/records", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.create_dataset_record_request, + False, + False, + "json", + models.CreateDatasetRecordRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_dataset_record_v1_observability_datasets__dataset_id__records_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.DatasetRecord, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_record_async( + self, + *, + dataset_id: str, + payload: Union[models.ConversationPayload, models.ConversationPayloadTypedDict], + properties: Dict[str, Any], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetRecord: + r"""Add a conversation to the dataset + + :param dataset_id: + :param payload: + :param properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequest( + dataset_id=dataset_id, + create_dataset_record_request=models.CreateDatasetRecordRequest( + payload=utils.get_pydantic_model(payload, models.ConversationPayload), + properties=properties, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/datasets/{dataset_id}/records", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.create_dataset_record_request, + False, + False, + "json", + models.CreateDatasetRecordRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_dataset_record_v1_observability_datasets__dataset_id__records_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.DatasetRecord, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def import_from_campaign( + self, + *, + dataset_id: str, + campaign_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with a campaign + + :param dataset_id: + :param campaign_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequest( + dataset_id=dataset_id, + import_dataset_from_campaign_request=models.ImportDatasetFromCampaignRequest( + campaign_id=campaign_id, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-campaign", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_campaign_request, + False, + False, + "json", + models.ImportDatasetFromCampaignRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_campaign_v1_observability_datasets__dataset_id__imports_from_campaign_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def import_from_campaign_async( + self, + *, + dataset_id: str, + campaign_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with a campaign + + :param dataset_id: + :param campaign_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequest( + dataset_id=dataset_id, + import_dataset_from_campaign_request=models.ImportDatasetFromCampaignRequest( + campaign_id=campaign_id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-campaign", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_campaign_request, + False, + False, + "json", + models.ImportDatasetFromCampaignRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_campaign_v1_observability_datasets__dataset_id__imports_from_campaign_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def import_from_explorer( + self, + *, + dataset_id: str, + completion_event_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with samples from the explorer + + :param dataset_id: + :param completion_event_ids: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequest( + dataset_id=dataset_id, + import_dataset_from_explorer_request=models.ImportDatasetFromExplorerRequest( + completion_event_ids=completion_event_ids, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-explorer", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_explorer_request, + False, + False, + "json", + models.ImportDatasetFromExplorerRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_explorer_v1_observability_datasets__dataset_id__imports_from_explorer_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def import_from_explorer_async( + self, + *, + dataset_id: str, + completion_event_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with samples from the explorer + + :param dataset_id: + :param completion_event_ids: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequest( + dataset_id=dataset_id, + import_dataset_from_explorer_request=models.ImportDatasetFromExplorerRequest( + completion_event_ids=completion_event_ids, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-explorer", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_explorer_request, + False, + False, + "json", + models.ImportDatasetFromExplorerRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_explorer_v1_observability_datasets__dataset_id__imports_from_explorer_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def import_from_file( + self, + *, + dataset_id: str, + file_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with samples from an uploaded file + + :param dataset_id: + :param file_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequest( + dataset_id=dataset_id, + import_dataset_from_file_request=models.ImportDatasetFromFileRequest( + file_id=file_id, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-file", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_file_request, + False, + False, + "json", + models.ImportDatasetFromFileRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_file_v1_observability_datasets__dataset_id__imports_from_file_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def import_from_file_async( + self, + *, + dataset_id: str, + file_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with samples from an uploaded file + + :param dataset_id: + :param file_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequest( + dataset_id=dataset_id, + import_dataset_from_file_request=models.ImportDatasetFromFileRequest( + file_id=file_id, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-file", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_file_request, + False, + False, + "json", + models.ImportDatasetFromFileRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_file_v1_observability_datasets__dataset_id__imports_from_file_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def import_from_playground( + self, + *, + dataset_id: str, + conversation_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with samples from the playground + + :param dataset_id: + :param conversation_ids: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequest( + dataset_id=dataset_id, + import_dataset_from_playground_request=models.ImportDatasetFromPlaygroundRequest( + conversation_ids=conversation_ids, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-playground", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_playground_request, + False, + False, + "json", + models.ImportDatasetFromPlaygroundRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_playground_v1_observability_datasets__dataset_id__imports_from_playground_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def import_from_playground_async( + self, + *, + dataset_id: str, + conversation_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with samples from the playground + + :param dataset_id: + :param conversation_ids: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequest( + dataset_id=dataset_id, + import_dataset_from_playground_request=models.ImportDatasetFromPlaygroundRequest( + conversation_ids=conversation_ids, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-playground", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_playground_request, + False, + False, + "json", + models.ImportDatasetFromPlaygroundRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_playground_v1_observability_datasets__dataset_id__imports_from_playground_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def import_from_dataset_records( + self, + *, + dataset_id: str, + dataset_record_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with samples from another dataset + + :param dataset_id: + :param dataset_record_ids: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequest( + dataset_id=dataset_id, + import_dataset_from_dataset_request=models.ImportDatasetFromDatasetRequest( + dataset_record_ids=dataset_record_ids, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-dataset", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_dataset_request, + False, + False, + "json", + models.ImportDatasetFromDatasetRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_dataset_v1_observability_datasets__dataset_id__imports_from_dataset_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def import_from_dataset_records_async( + self, + *, + dataset_id: str, + dataset_record_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Populate the dataset with samples from another dataset + + :param dataset_id: + :param dataset_record_ids: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequest( + dataset_id=dataset_id, + import_dataset_from_dataset_request=models.ImportDatasetFromDatasetRequest( + dataset_record_ids=dataset_record_ids, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/datasets/{dataset_id}/imports/from-dataset", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.import_dataset_from_dataset_request, + False, + False, + "json", + models.ImportDatasetFromDatasetRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="post_dataset_records_from_dataset_v1_observability_datasets__dataset_id__imports_from_dataset_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def export_to_jsonl( + self, + *, + dataset_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ExportDatasetResponse: + r"""Export to the Files API and retrieve presigned URL to download the resulting JSONL file + + :param dataset_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequest( + dataset_id=dataset_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/datasets/{dataset_id}/exports/to-jsonl", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="export_dataset_to_jsonl_v1_observability_datasets__dataset_id__exports_to_jsonl_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ExportDatasetResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def export_to_jsonl_async( + self, + *, + dataset_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ExportDatasetResponse: + r"""Export to the Files API and retrieve presigned URL to download the resulting JSONL file + + :param dataset_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequest( + dataset_id=dataset_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/datasets/{dataset_id}/exports/to-jsonl", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="export_dataset_to_jsonl_v1_observability_datasets__dataset_id__exports_to_jsonl_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ExportDatasetResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch_task( + self, + *, + dataset_id: str, + task_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Get status of a dataset import task + + :param dataset_id: + :param task_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequest( + dataset_id=dataset_id, + task_id=task_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/datasets/{dataset_id}/tasks/{task_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_import_task_v1_observability_datasets__dataset_id__tasks__task_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_task_async( + self, + *, + dataset_id: str, + task_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetImportTask: + r"""Get status of a dataset import task + + :param dataset_id: + :param task_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequest( + dataset_id=dataset_id, + task_id=task_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/datasets/{dataset_id}/tasks/{task_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_import_task_v1_observability_datasets__dataset_id__tasks__task_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DatasetImportTask, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list_tasks( + self, + *, + dataset_id: str, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListDatasetImportTasksResponse: + r"""List import tasks for the given dataset + + :param dataset_id: + :param page_size: + :param page: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequest( + dataset_id=dataset_id, + page_size=page_size, + page=page, + ) + ) + + req = self._build_request( + method="GET", + path="/v1/observability/datasets/{dataset_id}/tasks", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_import_tasks_v1_observability_datasets__dataset_id__tasks_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ListDatasetImportTasksResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_tasks_async( + self, + *, + dataset_id: str, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListDatasetImportTasksResponse: + r"""List import tasks for the given dataset + + :param dataset_id: + :param page_size: + :param page: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequest( + dataset_id=dataset_id, + page_size=page_size, + page=page, + ) + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/datasets/{dataset_id}/tasks", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_import_tasks_v1_observability_datasets__dataset_id__tasks_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ListDatasetImportTasksResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/deployments.py b/src/mistralai/client/deployments.py new file mode 100644 index 00000000..26e9c565 --- /dev/null +++ b/src/mistralai/client/deployments.py @@ -0,0 +1,382 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a874b267fcb9 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional + + +class Deployments(BaseSDK): + def list_deployments( + self, + *, + active_only: Optional[bool] = True, + workflow_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DeploymentListResponse: + r"""List Deployments + + :param active_only: + :param workflow_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListDeploymentsV1WorkflowsDeploymentsGetRequest( + active_only=active_only, + workflow_name=workflow_name, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/deployments", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="list_deployments_v1_workflows_deployments_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DeploymentListResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_deployments_async( + self, + *, + active_only: Optional[bool] = True, + workflow_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DeploymentListResponse: + r"""List Deployments + + :param active_only: + :param workflow_name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListDeploymentsV1WorkflowsDeploymentsGetRequest( + active_only=active_only, + workflow_name=workflow_name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/deployments", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="list_deployments_v1_workflows_deployments_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DeploymentListResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_deployment( + self, + *, + name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DeploymentDetailResponse: + r"""Get Deployment + + :param name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDeploymentV1WorkflowsDeploymentsNameGetRequest( + name=name, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/deployments/{name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_deployment_v1_workflows_deployments__name__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DeploymentDetailResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_deployment_async( + self, + *, + name: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DeploymentDetailResponse: + r"""Get Deployment + + :param name: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDeploymentV1WorkflowsDeploymentsNameGetRequest( + name=name, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/deployments/{name}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_deployment_v1_workflows_deployments__name__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DeploymentDetailResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/documents.py b/src/mistralai/client/documents.py similarity index 84% rename from src/mistralai/documents.py rename to src/mistralai/client/documents.py index 5f8c6b9f..2a555d3e 100644 --- a/src/mistralai/documents.py +++ b/src/mistralai/client/documents.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bcc17286c31c from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional, Union +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, Mapping, Optional, Union class Documents(BaseSDK): @@ -19,14 +20,15 @@ def list( search: OptionalNullable[str] = UNSET, page_size: Optional[int] = 100, page: Optional[int] = 0, + filters_attributes: OptionalNullable[str] = UNSET, sort_by: Optional[str] = "created_at", sort_order: Optional[str] = "desc", retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListDocumentOut: - r"""List document in a given library. + ) -> models.ListDocumentsResponse: + r"""List documents in a given library. Given a library, lists the document that have been uploaded to that library. @@ -34,6 +36,7 @@ def list( :param search: :param page_size: :param page: + :param filters_attributes: :param sort_by: :param sort_order: :param retries: Override the default retry configuration for this method @@ -46,6 +49,9 @@ def list( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -56,6 +62,7 @@ def list( search=search, page_size=page_size, page=page, + filters_attributes=filters_attributes, sort_by=sort_by, sort_order=sort_order, ) @@ -73,6 +80,7 @@ def list( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -89,7 +97,7 @@ def list( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_list_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -101,20 +109,20 @@ def list( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListDocumentOut, http_res) + return unmarshal_json_response(models.ListDocumentsResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, @@ -123,14 +131,15 @@ async def list_async( search: OptionalNullable[str] = UNSET, page_size: Optional[int] = 100, page: Optional[int] = 0, + filters_attributes: OptionalNullable[str] = UNSET, sort_by: Optional[str] = "created_at", sort_order: Optional[str] = "desc", retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListDocumentOut: - r"""List document in a given library. + ) -> models.ListDocumentsResponse: + r"""List documents in a given library. Given a library, lists the document that have been uploaded to that library. @@ -138,6 +147,7 @@ async def list_async( :param search: :param page_size: :param page: + :param filters_attributes: :param sort_by: :param sort_order: :param retries: Override the default retry configuration for this method @@ -150,6 +160,9 @@ async def list_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -160,6 +173,7 @@ async def list_async( search=search, page_size=page_size, page=page, + filters_attributes=filters_attributes, sort_by=sort_by, sort_order=sort_order, ) @@ -177,6 +191,7 @@ async def list_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -193,7 +208,7 @@ async def list_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_list_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -205,20 +220,20 @@ async def list_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListDocumentOut, http_res) + return unmarshal_json_response(models.ListDocumentsResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def upload( self, @@ -229,13 +244,21 @@ def upload( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DocumentOut: + ) -> models.Document: r"""Upload a new document. Given a library, upload a new document to that library. It is queued for processing, it status will change it has been processed. The processing has to be completed in order be discoverable for the library search :param library_id: - :param file: The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such: ```bash file=@path/to/your/file.jsonl;filename=custom_name.jsonl ``` Otherwise, you can just keep the original file name: ```bash file=@path/to/your/file.jsonl ``` + :param file: The File object (not file name) to be uploaded. + To upload a file and specify a custom file name you should format your request as such: + ```bash + file=@path/to/your/file.jsonl;filename=custom_name.jsonl + ``` + Otherwise, you can just keep the original file name: + ```bash + file=@path/to/your/file.jsonl + ``` :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -246,6 +269,9 @@ def upload( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -253,7 +279,7 @@ def upload( request = models.LibrariesDocumentsUploadV1Request( library_id=library_id, - request_body=models.LibrariesDocumentsUploadV1DocumentUpload( + request_body=models.DocumentUpload( file=utils.get_pydantic_model(file, models.File), ), ) @@ -272,12 +298,9 @@ def upload( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.request_body, - False, - False, - "multipart", - models.LibrariesDocumentsUploadV1DocumentUpload, + request.request_body, False, False, "multipart", models.DocumentUpload ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -294,7 +317,7 @@ def upload( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_upload_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -306,20 +329,20 @@ def upload( response_data: Any = None if utils.match_response(http_res, ["200", "201"], "application/json"): - return unmarshal_json_response(models.DocumentOut, http_res) + return unmarshal_json_response(models.Document, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def upload_async( self, @@ -330,13 +353,21 @@ async def upload_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DocumentOut: + ) -> models.Document: r"""Upload a new document. Given a library, upload a new document to that library. It is queued for processing, it status will change it has been processed. The processing has to be completed in order be discoverable for the library search :param library_id: - :param file: The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such: ```bash file=@path/to/your/file.jsonl;filename=custom_name.jsonl ``` Otherwise, you can just keep the original file name: ```bash file=@path/to/your/file.jsonl ``` + :param file: The File object (not file name) to be uploaded. + To upload a file and specify a custom file name you should format your request as such: + ```bash + file=@path/to/your/file.jsonl;filename=custom_name.jsonl + ``` + Otherwise, you can just keep the original file name: + ```bash + file=@path/to/your/file.jsonl + ``` :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -347,6 +378,9 @@ async def upload_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -354,7 +388,7 @@ async def upload_async( request = models.LibrariesDocumentsUploadV1Request( library_id=library_id, - request_body=models.LibrariesDocumentsUploadV1DocumentUpload( + request_body=models.DocumentUpload( file=utils.get_pydantic_model(file, models.File), ), ) @@ -373,12 +407,9 @@ async def upload_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.request_body, - False, - False, - "multipart", - models.LibrariesDocumentsUploadV1DocumentUpload, + request.request_body, False, False, "multipart", models.DocumentUpload ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -395,7 +426,7 @@ async def upload_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_upload_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -407,20 +438,20 @@ async def upload_async( response_data: Any = None if utils.match_response(http_res, ["200", "201"], "application/json"): - return unmarshal_json_response(models.DocumentOut, http_res) + return unmarshal_json_response(models.Document, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def get( self, @@ -431,7 +462,7 @@ def get( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DocumentOut: + ) -> models.Document: r"""Retrieve the metadata of a specific document. Given a library and a document in this library, you can retrieve the metadata of that document. @@ -448,6 +479,9 @@ def get( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -471,6 +505,7 @@ def get( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -487,7 +522,7 @@ def get( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -499,20 +534,20 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.DocumentOut, http_res) + return unmarshal_json_response(models.Document, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def get_async( self, @@ -523,7 +558,7 @@ async def get_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DocumentOut: + ) -> models.Document: r"""Retrieve the metadata of a specific document. Given a library and a document in this library, you can retrieve the metadata of that document. @@ -540,6 +575,9 @@ async def get_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -563,6 +601,7 @@ async def get_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -579,7 +618,7 @@ async def get_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -591,32 +630,35 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.DocumentOut, http_res) + return unmarshal_json_response(models.Document, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def update( self, *, library_id: str, document_id: str, - name: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + attributes: OptionalNullable[ + Union[Dict[str, models.Attributes], Dict[str, models.AttributesTypedDict]] + ] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DocumentOut: + ) -> models.Document: r"""Update the metadata of a specific document. Given a library and a document in that library, update the name of that document. @@ -624,6 +666,7 @@ def update( :param library_id: :param document_id: :param name: + :param attributes: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -634,6 +677,9 @@ def update( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -642,8 +688,9 @@ def update( request = models.LibrariesDocumentsUpdateV1Request( library_id=library_id, document_id=document_id, - document_update_in=models.DocumentUpdateIn( + update_document_request=models.UpdateDocumentRequest( name=name, + attributes=attributes, ), ) @@ -661,12 +708,13 @@ def update( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.document_update_in, + request.update_document_request, False, False, "json", - models.DocumentUpdateIn, + models.UpdateDocumentRequest, ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -683,7 +731,7 @@ def update( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_update_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -695,32 +743,35 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.DocumentOut, http_res) + return unmarshal_json_response(models.Document, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def update_async( self, *, library_id: str, document_id: str, - name: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + attributes: OptionalNullable[ + Union[Dict[str, models.Attributes], Dict[str, models.AttributesTypedDict]] + ] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DocumentOut: + ) -> models.Document: r"""Update the metadata of a specific document. Given a library and a document in that library, update the name of that document. @@ -728,6 +779,7 @@ async def update_async( :param library_id: :param document_id: :param name: + :param attributes: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -738,6 +790,9 @@ async def update_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -746,8 +801,9 @@ async def update_async( request = models.LibrariesDocumentsUpdateV1Request( library_id=library_id, document_id=document_id, - document_update_in=models.DocumentUpdateIn( + update_document_request=models.UpdateDocumentRequest( name=name, + attributes=attributes, ), ) @@ -765,12 +821,13 @@ async def update_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.document_update_in, + request.update_document_request, False, False, "json", - models.DocumentUpdateIn, + models.UpdateDocumentRequest, ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -787,7 +844,7 @@ async def update_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_update_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -799,20 +856,20 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.DocumentOut, http_res) + return unmarshal_json_response(models.Document, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def delete( self, @@ -840,6 +897,9 @@ def delete( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -863,6 +923,7 @@ def delete( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -879,7 +940,7 @@ def delete( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_delete_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -894,17 +955,17 @@ def delete( return if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def delete_async( self, @@ -932,6 +993,9 @@ async def delete_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -955,6 +1019,7 @@ async def delete_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -971,7 +1036,7 @@ async def delete_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_delete_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -986,23 +1051,25 @@ async def delete_async( return if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def text_content( self, *, library_id: str, document_id: str, + page_start: OptionalNullable[int] = UNSET, + page_end: OptionalNullable[int] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1014,6 +1081,8 @@ def text_content( :param library_id: :param document_id: + :param page_start: + :param page_end: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1024,6 +1093,9 @@ def text_content( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1032,6 +1104,8 @@ def text_content( request = models.LibrariesDocumentsGetTextContentV1Request( library_id=library_id, document_id=document_id, + page_start=page_start, + page_end=page_end, ) req = self._build_request( @@ -1047,6 +1121,7 @@ def text_content( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1063,7 +1138,7 @@ def text_content( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_text_content_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1078,23 +1153,25 @@ def text_content( return unmarshal_json_response(models.DocumentTextContent, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def text_content_async( self, *, library_id: str, document_id: str, + page_start: OptionalNullable[int] = UNSET, + page_end: OptionalNullable[int] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1106,6 +1183,8 @@ async def text_content_async( :param library_id: :param document_id: + :param page_start: + :param page_end: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1116,6 +1195,9 @@ async def text_content_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1124,6 +1206,8 @@ async def text_content_async( request = models.LibrariesDocumentsGetTextContentV1Request( library_id=library_id, document_id=document_id, + page_start=page_start, + page_end=page_end, ) req = self._build_request_async( @@ -1139,6 +1223,7 @@ async def text_content_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1155,7 +1240,7 @@ async def text_content_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_text_content_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1170,17 +1255,17 @@ async def text_content_async( return unmarshal_json_response(models.DocumentTextContent, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def status( self, @@ -1191,7 +1276,7 @@ def status( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ProcessingStatusOut: + ) -> models.ProcessingStatus: r"""Retrieve the processing status of a specific document. Given a library and a document in that library, retrieve the processing status of that document. @@ -1208,6 +1293,9 @@ def status( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1231,6 +1319,7 @@ def status( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1247,7 +1336,7 @@ def status( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_status_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1259,20 +1348,20 @@ def status( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ProcessingStatusOut, http_res) + return unmarshal_json_response(models.ProcessingStatus, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def status_async( self, @@ -1283,7 +1372,7 @@ async def status_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ProcessingStatusOut: + ) -> models.ProcessingStatus: r"""Retrieve the processing status of a specific document. Given a library and a document in that library, retrieve the processing status of that document. @@ -1300,6 +1389,9 @@ async def status_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1323,6 +1415,7 @@ async def status_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1339,7 +1432,7 @@ async def status_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_status_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1351,20 +1444,20 @@ async def status_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ProcessingStatusOut, http_res) + return unmarshal_json_response(models.ProcessingStatus, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def get_signed_url( self, @@ -1392,6 +1485,9 @@ def get_signed_url( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1415,6 +1511,7 @@ def get_signed_url( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1431,7 +1528,7 @@ def get_signed_url( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_signed_url_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1446,17 +1543,17 @@ def get_signed_url( return unmarshal_json_response(str, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def get_signed_url_async( self, @@ -1484,6 +1581,9 @@ async def get_signed_url_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1507,6 +1607,7 @@ async def get_signed_url_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1523,7 +1624,7 @@ async def get_signed_url_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_signed_url_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1538,17 +1639,17 @@ async def get_signed_url_async( return unmarshal_json_response(str, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def extracted_text_signed_url( self, @@ -1576,6 +1677,9 @@ def extracted_text_signed_url( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1599,6 +1703,7 @@ def extracted_text_signed_url( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1615,7 +1720,7 @@ def extracted_text_signed_url( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_extracted_text_signed_url_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1630,17 +1735,17 @@ def extracted_text_signed_url( return unmarshal_json_response(str, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def extracted_text_signed_url_async( self, @@ -1668,6 +1773,9 @@ async def extracted_text_signed_url_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1691,6 +1799,7 @@ async def extracted_text_signed_url_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1707,7 +1816,7 @@ async def extracted_text_signed_url_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_get_extracted_text_signed_url_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1722,17 +1831,17 @@ async def extracted_text_signed_url_async( return unmarshal_json_response(str, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def reprocess( self, @@ -1760,6 +1869,9 @@ def reprocess( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1783,6 +1895,7 @@ def reprocess( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1799,7 +1912,7 @@ def reprocess( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_reprocess_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1814,17 +1927,17 @@ def reprocess( return if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def reprocess_async( self, @@ -1852,6 +1965,9 @@ async def reprocess_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1875,6 +1991,7 @@ async def reprocess_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1891,7 +2008,7 @@ async def reprocess_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_documents_reprocess_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1906,14 +2023,14 @@ async def reprocess_async( return if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/embeddings.py b/src/mistralai/client/embeddings.py similarity index 82% rename from src/mistralai/embeddings.py rename to src/mistralai/client/embeddings.py index 1822a1ec..64337b4f 100644 --- a/src/mistralai/embeddings.py +++ b/src/mistralai/client/embeddings.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f9c17258207e from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional, Union +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, Mapping, Optional, Union class Embeddings(BaseSDK): @@ -19,6 +20,7 @@ def create( inputs: Union[ models.EmbeddingRequestInputs, models.EmbeddingRequestInputsTypedDict ], + metadata: OptionalNullable[Dict[str, Any]] = UNSET, output_dimension: OptionalNullable[int] = UNSET, output_dtype: Optional[models.EmbeddingDtype] = None, encoding_format: Optional[models.EncodingFormat] = None, @@ -33,7 +35,8 @@ def create( :param model: ID of the model to use. :param inputs: Text to embed. - :param output_dimension: The dimension of the output embeddings. + :param metadata: + :param output_dimension: The dimension of the output embeddings when feature available. If not provided, a default output dimension will be used. :param output_dtype: :param encoding_format: :param retries: Override the default retry configuration for this method @@ -46,6 +49,9 @@ def create( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -53,6 +59,7 @@ def create( request = models.EmbeddingRequest( model=model, + metadata=metadata, inputs=inputs, output_dimension=output_dimension, output_dtype=output_dtype, @@ -75,6 +82,7 @@ def create( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.EmbeddingRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -91,7 +99,7 @@ def create( config=self.sdk_configuration, base_url=base_url or "", operation_id="embeddings_v1_embeddings_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -106,17 +114,17 @@ def create( return unmarshal_json_response(models.EmbeddingResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -125,6 +133,7 @@ async def create_async( inputs: Union[ models.EmbeddingRequestInputs, models.EmbeddingRequestInputsTypedDict ], + metadata: OptionalNullable[Dict[str, Any]] = UNSET, output_dimension: OptionalNullable[int] = UNSET, output_dtype: Optional[models.EmbeddingDtype] = None, encoding_format: Optional[models.EncodingFormat] = None, @@ -139,7 +148,8 @@ async def create_async( :param model: ID of the model to use. :param inputs: Text to embed. - :param output_dimension: The dimension of the output embeddings. + :param metadata: + :param output_dimension: The dimension of the output embeddings when feature available. If not provided, a default output dimension will be used. :param output_dtype: :param encoding_format: :param retries: Override the default retry configuration for this method @@ -152,6 +162,9 @@ async def create_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -159,6 +172,7 @@ async def create_async( request = models.EmbeddingRequest( model=model, + metadata=metadata, inputs=inputs, output_dimension=output_dimension, output_dtype=output_dtype, @@ -181,6 +195,7 @@ async def create_async( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", models.EmbeddingRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -197,7 +212,7 @@ async def create_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="embeddings_v1_embeddings_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -212,14 +227,14 @@ async def create_async( return unmarshal_json_response(models.EmbeddingResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/errors/__init__.py b/src/mistralai/client/errors/__init__.py new file mode 100644 index 00000000..f6fd99a0 --- /dev/null +++ b/src/mistralai/client/errors/__init__.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0b2db51246df + +from .mistralerror import MistralError +from typing import Any, TYPE_CHECKING + +from mistralai.client.utils.dynamic_imports import lazy_getattr, lazy_dir + +if TYPE_CHECKING: + from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData + from .no_response_error import NoResponseError + from .observabilityerror import ObservabilityError, ObservabilityErrorData + from .responsevalidationerror import ResponseValidationError + from .sdkerror import SDKError + +__all__ = [ + "HTTPValidationError", + "HTTPValidationErrorData", + "MistralError", + "NoResponseError", + "ObservabilityError", + "ObservabilityErrorData", + "ResponseValidationError", + "SDKError", +] + +_dynamic_imports: dict[str, str] = { + "HTTPValidationError": ".httpvalidationerror", + "HTTPValidationErrorData": ".httpvalidationerror", + "NoResponseError": ".no_response_error", + "ObservabilityError": ".observabilityerror", + "ObservabilityErrorData": ".observabilityerror", + "ResponseValidationError": ".responsevalidationerror", + "SDKError": ".sdkerror", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/src/mistralai/client/errors/httpvalidationerror.py b/src/mistralai/client/errors/httpvalidationerror.py new file mode 100644 index 00000000..97b16562 --- /dev/null +++ b/src/mistralai/client/errors/httpvalidationerror.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ac3de4a52bb6 + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from mistralai.client.errors import MistralError +from mistralai.client.models import validationerror as models_validationerror +from mistralai.client.types import BaseModel +from typing import List, Optional + + +class HTTPValidationErrorData(BaseModel): + detail: Optional[List[models_validationerror.ValidationError]] = None + + +@dataclass(unsafe_hash=True) +class HTTPValidationError(MistralError): + data: HTTPValidationErrorData = field(hash=False) + + def __init__( + self, + data: HTTPValidationErrorData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + message = body or raw_response.text + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/mistralai/client/errors/mistralerror.py b/src/mistralai/client/errors/mistralerror.py new file mode 100644 index 00000000..eb73040c --- /dev/null +++ b/src/mistralai/client/errors/mistralerror.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d1f57f0ff1e9 + +import httpx +from typing import Optional +from dataclasses import dataclass, field + + +@dataclass(unsafe_hash=True) +class MistralError(Exception): + """The base class for all HTTP error responses.""" + + message: str + status_code: int + body: str + headers: httpx.Headers = field(hash=False) + raw_response: httpx.Response = field(hash=False) + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + object.__setattr__(self, "message", message) + object.__setattr__(self, "status_code", raw_response.status_code) + object.__setattr__( + self, "body", body if body is not None else raw_response.text + ) + object.__setattr__(self, "headers", raw_response.headers) + object.__setattr__(self, "raw_response", raw_response) + + def __str__(self): + return self.message diff --git a/src/mistralai/client/errors/no_response_error.py b/src/mistralai/client/errors/no_response_error.py new file mode 100644 index 00000000..d71dfa7b --- /dev/null +++ b/src/mistralai/client/errors/no_response_error.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8b469ecb0906 + +from dataclasses import dataclass + + +@dataclass(unsafe_hash=True) +class NoResponseError(Exception): + """Error raised when no HTTP response is received from the server.""" + + message: str + + def __init__(self, message: str = "No response received"): + object.__setattr__(self, "message", message) + super().__init__(message) + + def __str__(self): + return self.message diff --git a/src/mistralai/client/errors/observabilityerror.py b/src/mistralai/client/errors/observabilityerror.py new file mode 100644 index 00000000..a360bac4 --- /dev/null +++ b/src/mistralai/client/errors/observabilityerror.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4946ae06717e + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from mistralai.client.errors import MistralError +from mistralai.client.models import ( + observabilityerrordetail as models_observabilityerrordetail, +) +from mistralai.client.types import BaseModel +from typing import Optional + + +class ObservabilityErrorData(BaseModel): + detail: models_observabilityerrordetail.ObservabilityErrorDetail + + +@dataclass(unsafe_hash=True) +class ObservabilityError(MistralError): + data: ObservabilityErrorData = field(hash=False) + + def __init__( + self, + data: ObservabilityErrorData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.detail.message) or fallback + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/mistralai/client/errors/responsevalidationerror.py b/src/mistralai/client/errors/responsevalidationerror.py new file mode 100644 index 00000000..a7b3b9f0 --- /dev/null +++ b/src/mistralai/client/errors/responsevalidationerror.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6cfaa3147abe + +import httpx +from typing import Optional +from dataclasses import dataclass + +from mistralai.client.errors import MistralError + + +@dataclass(unsafe_hash=True) +class ResponseValidationError(MistralError): + """Error raised when there is a type mismatch between the response data and the expected Pydantic model.""" + + def __init__( + self, + message: str, + raw_response: httpx.Response, + cause: Exception, + body: Optional[str] = None, + ): + message = f"{message}: {cause}" + super().__init__(message, raw_response, body) + + @property + def cause(self): + """Normally the Pydantic ValidationError""" + return self.__cause__ diff --git a/src/mistralai/client/errors/sdkerror.py b/src/mistralai/client/errors/sdkerror.py new file mode 100644 index 00000000..25b87255 --- /dev/null +++ b/src/mistralai/client/errors/sdkerror.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c489ffe1e9ca + +import httpx +from typing import Optional +from dataclasses import dataclass + +from mistralai.client.errors import MistralError + +MAX_MESSAGE_LEN = 10_000 + + +@dataclass(unsafe_hash=True) +class SDKError(MistralError): + """The fallback error class if no more specific error class is matched.""" + + def __init__( + self, message: str, raw_response: httpx.Response, body: Optional[str] = None + ): + body_display = body or raw_response.text or '""' + + if message: + message += ": " + message += f"Status {raw_response.status_code}" + + headers = raw_response.headers + content_type = headers.get("content-type", '""') + if content_type != "application/json": + if " " in content_type: + content_type = f'"{content_type}"' + message += f" Content-Type {content_type}" + + if len(body_display) > MAX_MESSAGE_LEN: + truncated = body_display[:MAX_MESSAGE_LEN] + remaining = len(body_display) - MAX_MESSAGE_LEN + body_display = f"{truncated}...and {remaining} more chars" + + message += f". Body: {body_display}" + message = message.strip() + + super().__init__(message, raw_response, body) diff --git a/src/mistralai/client/events.py b/src/mistralai/client/events.py new file mode 100644 index 00000000..3a4c4722 --- /dev/null +++ b/src/mistralai/client/events.py @@ -0,0 +1,490 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ac9b961cc70d + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional + + +class Events(BaseSDK): + def get_stream_events( + self, + *, + scope: Optional[models.Scope] = "*", + activity_name: Optional[str] = "*", + activity_id: Optional[str] = "*", + workflow_name: Optional[str] = "*", + workflow_exec_id: Optional[str] = "*", + root_workflow_exec_id: Optional[str] = "*", + parent_workflow_exec_id: Optional[str] = "*", + stream: Optional[str] = "*", + start_seq: Optional[int] = 0, + metadata_filters: OptionalNullable[Dict[str, Any]] = UNSET, + workflow_event_types: OptionalNullable[List[models.WorkflowEventType]] = UNSET, + last_event_id: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[ + models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + ]: + r"""Get Stream Events + + :param scope: + :param activity_name: + :param activity_id: + :param workflow_name: + :param workflow_exec_id: + :param root_workflow_exec_id: + :param parent_workflow_exec_id: + :param stream: + :param start_seq: + :param metadata_filters: + :param workflow_event_types: + :param last_event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetStreamEventsV1WorkflowsEventsStreamGetRequest( + scope=scope, + activity_name=activity_name, + activity_id=activity_id, + workflow_name=workflow_name, + workflow_exec_id=workflow_exec_id, + root_workflow_exec_id=root_workflow_exec_id, + parent_workflow_exec_id=parent_workflow_exec_id, + stream=stream, + start_seq=start_seq, + metadata_filters=metadata_filters, + workflow_event_types=workflow_event_types, + last_event_id=last_event_id, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/events/stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_stream_events_v1_workflows_events_stream_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json( + raw, models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + ), + client_ref=self, + data_required=False, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def get_stream_events_async( + self, + *, + scope: Optional[models.Scope] = "*", + activity_name: Optional[str] = "*", + activity_id: Optional[str] = "*", + workflow_name: Optional[str] = "*", + workflow_exec_id: Optional[str] = "*", + root_workflow_exec_id: Optional[str] = "*", + parent_workflow_exec_id: Optional[str] = "*", + stream: Optional[str] = "*", + start_seq: Optional[int] = 0, + metadata_filters: OptionalNullable[Dict[str, Any]] = UNSET, + workflow_event_types: OptionalNullable[List[models.WorkflowEventType]] = UNSET, + last_event_id: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[ + models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + ]: + r"""Get Stream Events + + :param scope: + :param activity_name: + :param activity_id: + :param workflow_name: + :param workflow_exec_id: + :param root_workflow_exec_id: + :param parent_workflow_exec_id: + :param stream: + :param start_seq: + :param metadata_filters: + :param workflow_event_types: + :param last_event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetStreamEventsV1WorkflowsEventsStreamGetRequest( + scope=scope, + activity_name=activity_name, + activity_id=activity_id, + workflow_name=workflow_name, + workflow_exec_id=workflow_exec_id, + root_workflow_exec_id=root_workflow_exec_id, + parent_workflow_exec_id=parent_workflow_exec_id, + stream=stream, + start_seq=start_seq, + metadata_filters=metadata_filters, + workflow_event_types=workflow_event_types, + last_event_id=last_event_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/events/stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_stream_events_v1_workflows_events_stream_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json( + raw, models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + ), + client_ref=self, + data_required=False, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + def get_workflow_events( + self, + *, + root_workflow_exec_id: OptionalNullable[str] = UNSET, + workflow_exec_id: OptionalNullable[str] = UNSET, + workflow_run_id: OptionalNullable[str] = UNSET, + limit: Optional[int] = 100, + cursor: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListWorkflowEventResponse: + r"""Get Workflow Events + + :param root_workflow_exec_id: Execution ID of the root workflow that initiated this execution chain. + :param workflow_exec_id: Execution ID of the workflow that emitted this event. + :param workflow_run_id: Run ID of the workflow that emitted this event. + :param limit: Maximum number of events to return. + :param cursor: Cursor for pagination. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowEventsV1WorkflowsEventsListGetRequest( + root_workflow_exec_id=root_workflow_exec_id, + workflow_exec_id=workflow_exec_id, + workflow_run_id=workflow_run_id, + limit=limit, + cursor=cursor, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/events/list", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_events_v1_workflows_events_list_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListWorkflowEventResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_events_async( + self, + *, + root_workflow_exec_id: OptionalNullable[str] = UNSET, + workflow_exec_id: OptionalNullable[str] = UNSET, + workflow_run_id: OptionalNullable[str] = UNSET, + limit: Optional[int] = 100, + cursor: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListWorkflowEventResponse: + r"""Get Workflow Events + + :param root_workflow_exec_id: Execution ID of the root workflow that initiated this execution chain. + :param workflow_exec_id: Execution ID of the workflow that emitted this event. + :param workflow_run_id: Run ID of the workflow that emitted this event. + :param limit: Maximum number of events to return. + :param cursor: Cursor for pagination. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowEventsV1WorkflowsEventsListGetRequest( + root_workflow_exec_id=root_workflow_exec_id, + workflow_exec_id=workflow_exec_id, + workflow_run_id=workflow_run_id, + limit=limit, + cursor=cursor, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/events/list", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_events_v1_workflows_events_list_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListWorkflowEventResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/executions.py b/src/mistralai/client/executions.py new file mode 100644 index 00000000..e4b9f90b --- /dev/null +++ b/src/mistralai/client/executions.py @@ -0,0 +1,2814 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 974004d347a2 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, List, Mapping, Optional, Union + + +class Executions(BaseSDK): + def get_workflow_execution( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionResponse: + r"""Get Workflow Execution + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequest( + execution_id=execution_id, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/executions/{execution_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_v1_workflows_executions__execution_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowExecutionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_execution_async( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionResponse: + r"""Get Workflow Execution + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequest( + execution_id=execution_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/executions/{execution_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_v1_workflows_executions__execution_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowExecutionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_workflow_execution_history( + self, + *, + execution_id: str, + decode_payloads: Optional[bool] = True, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Any: + r"""Get Workflow Execution History + + :param execution_id: + :param decode_payloads: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequest( + execution_id=execution_id, + decode_payloads=decode_payloads, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/executions/{execution_id}/history", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_history_v1_workflows_executions__execution_id__history_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(Any, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_execution_history_async( + self, + *, + execution_id: str, + decode_payloads: Optional[bool] = True, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Any: + r"""Get Workflow Execution History + + :param execution_id: + :param decode_payloads: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequest( + execution_id=execution_id, + decode_payloads=decode_payloads, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/executions/{execution_id}/history", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_history_v1_workflows_executions__execution_id__history_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(Any, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def signal_workflow_execution( + self, + *, + execution_id: str, + name: str, + input: OptionalNullable[ + Union[ + models.SignalInvocationBodyInput, + models.SignalInvocationBodyInputTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SignalWorkflowResponse: + r"""Signal Workflow Execution + + :param execution_id: + :param name: The name of the signal to send + :param input: Input data for the signal, matching its schema + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequest( + execution_id=execution_id, + signal_invocation_body=models.SignalInvocationBody( + name=name, + input=utils.get_pydantic_model( + input, OptionalNullable[models.SignalInvocationBodyInput] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/executions/{execution_id}/signals", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.signal_invocation_body, + False, + False, + "json", + models.SignalInvocationBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="signal_workflow_execution_v1_workflows_executions__execution_id__signals_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.SignalWorkflowResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def signal_workflow_execution_async( + self, + *, + execution_id: str, + name: str, + input: OptionalNullable[ + Union[ + models.SignalInvocationBodyInput, + models.SignalInvocationBodyInputTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SignalWorkflowResponse: + r"""Signal Workflow Execution + + :param execution_id: + :param name: The name of the signal to send + :param input: Input data for the signal, matching its schema + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequest( + execution_id=execution_id, + signal_invocation_body=models.SignalInvocationBody( + name=name, + input=utils.get_pydantic_model( + input, OptionalNullable[models.SignalInvocationBodyInput] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/executions/{execution_id}/signals", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.signal_invocation_body, + False, + False, + "json", + models.SignalInvocationBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="signal_workflow_execution_v1_workflows_executions__execution_id__signals_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return unmarshal_json_response(models.SignalWorkflowResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def query_workflow_execution( + self, + *, + execution_id: str, + name: str, + input: OptionalNullable[ + Union[ + models.QueryInvocationBodyInput, + models.QueryInvocationBodyInputTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.QueryWorkflowResponse: + r"""Query Workflow Execution + + :param execution_id: + :param name: The name of the query to request + :param input: Input data for the query, matching its schema + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest( + execution_id=execution_id, + query_invocation_body=models.QueryInvocationBody( + name=name, + input=utils.get_pydantic_model( + input, OptionalNullable[models.QueryInvocationBodyInput] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/executions/{execution_id}/queries", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.query_invocation_body, + False, + False, + "json", + models.QueryInvocationBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="query_workflow_execution_v1_workflows_executions__execution_id__queries_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.QueryWorkflowResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def query_workflow_execution_async( + self, + *, + execution_id: str, + name: str, + input: OptionalNullable[ + Union[ + models.QueryInvocationBodyInput, + models.QueryInvocationBodyInputTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.QueryWorkflowResponse: + r"""Query Workflow Execution + + :param execution_id: + :param name: The name of the query to request + :param input: Input data for the query, matching its schema + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest( + execution_id=execution_id, + query_invocation_body=models.QueryInvocationBody( + name=name, + input=utils.get_pydantic_model( + input, OptionalNullable[models.QueryInvocationBodyInput] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/executions/{execution_id}/queries", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.query_invocation_body, + False, + False, + "json", + models.QueryInvocationBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="query_workflow_execution_v1_workflows_executions__execution_id__queries_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.QueryWorkflowResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def terminate_workflow_execution( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Terminate Workflow Execution + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequest( + execution_id=execution_id, + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/executions/{execution_id}/terminate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="terminate_workflow_execution_v1_workflows_executions__execution_id__terminate_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def terminate_workflow_execution_async( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Terminate Workflow Execution + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequest( + execution_id=execution_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/executions/{execution_id}/terminate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="terminate_workflow_execution_v1_workflows_executions__execution_id__terminate_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def batch_terminate_workflow_executions( + self, + *, + execution_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchExecutionResponse: + r"""Batch Terminate Workflow Executions + + :param execution_ids: List of execution IDs to process + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.BatchExecutionBody( + execution_ids=execution_ids, + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/executions/terminate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.BatchExecutionBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="batch_terminate_workflow_executions_v1_workflows_executions_terminate_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchExecutionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def batch_terminate_workflow_executions_async( + self, + *, + execution_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchExecutionResponse: + r"""Batch Terminate Workflow Executions + + :param execution_ids: List of execution IDs to process + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.BatchExecutionBody( + execution_ids=execution_ids, + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/executions/terminate", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.BatchExecutionBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="batch_terminate_workflow_executions_v1_workflows_executions_terminate_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchExecutionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def cancel_workflow_execution( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Cancel Workflow Execution + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequest( + execution_id=execution_id, + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/executions/{execution_id}/cancel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="cancel_workflow_execution_v1_workflows_executions__execution_id__cancel_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def cancel_workflow_execution_async( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Cancel Workflow Execution + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequest( + execution_id=execution_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/executions/{execution_id}/cancel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="cancel_workflow_execution_v1_workflows_executions__execution_id__cancel_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def batch_cancel_workflow_executions( + self, + *, + execution_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchExecutionResponse: + r"""Batch Cancel Workflow Executions + + :param execution_ids: List of execution IDs to process + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.BatchExecutionBody( + execution_ids=execution_ids, + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/executions/cancel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.BatchExecutionBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="batch_cancel_workflow_executions_v1_workflows_executions_cancel_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchExecutionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def batch_cancel_workflow_executions_async( + self, + *, + execution_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.BatchExecutionResponse: + r"""Batch Cancel Workflow Executions + + :param execution_ids: List of execution IDs to process + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.BatchExecutionBody( + execution_ids=execution_ids, + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/executions/cancel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.BatchExecutionBody + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="batch_cancel_workflow_executions_v1_workflows_executions_cancel_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.BatchExecutionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def reset_workflow( + self, + *, + execution_id: str, + event_id: int, + reason: OptionalNullable[str] = UNSET, + exclude_signals: Optional[bool] = False, + exclude_updates: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Reset Workflow + + :param execution_id: + :param event_id: The event ID to reset the workflow execution to + :param reason: Reason for resetting the workflow execution + :param exclude_signals: Whether to exclude signals that happened after the reset point + :param exclude_updates: Whether to exclude updates that happened after the reset point + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequest( + execution_id=execution_id, + reset_invocation_body=models.ResetInvocationBody( + event_id=event_id, + reason=reason, + exclude_signals=exclude_signals, + exclude_updates=exclude_updates, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/executions/{execution_id}/reset", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.reset_invocation_body, + False, + False, + "json", + models.ResetInvocationBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="reset_workflow_v1_workflows_executions__execution_id__reset_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def reset_workflow_async( + self, + *, + execution_id: str, + event_id: int, + reason: OptionalNullable[str] = UNSET, + exclude_signals: Optional[bool] = False, + exclude_updates: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Reset Workflow + + :param execution_id: + :param event_id: The event ID to reset the workflow execution to + :param reason: Reason for resetting the workflow execution + :param exclude_signals: Whether to exclude signals that happened after the reset point + :param exclude_updates: Whether to exclude updates that happened after the reset point + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequest( + execution_id=execution_id, + reset_invocation_body=models.ResetInvocationBody( + event_id=event_id, + reason=reason, + exclude_signals=exclude_signals, + exclude_updates=exclude_updates, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/executions/{execution_id}/reset", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.reset_invocation_body, + False, + False, + "json", + models.ResetInvocationBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="reset_workflow_v1_workflows_executions__execution_id__reset_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update_workflow_execution( + self, + *, + execution_id: str, + name: str, + input: OptionalNullable[ + Union[ + models.UpdateInvocationBodyInput, + models.UpdateInvocationBodyInputTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.UpdateWorkflowResponse: + r"""Update Workflow Execution + + :param execution_id: + :param name: The name of the update to request + :param input: Input data for the update, matching its schema + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequest( + execution_id=execution_id, + update_invocation_body=models.UpdateInvocationBody( + name=name, + input=utils.get_pydantic_model( + input, OptionalNullable[models.UpdateInvocationBodyInput] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/executions/{execution_id}/updates", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_invocation_body, + False, + False, + "json", + models.UpdateInvocationBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_workflow_execution_v1_workflows_executions__execution_id__updates_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.UpdateWorkflowResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_workflow_execution_async( + self, + *, + execution_id: str, + name: str, + input: OptionalNullable[ + Union[ + models.UpdateInvocationBodyInput, + models.UpdateInvocationBodyInputTypedDict, + ] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.UpdateWorkflowResponse: + r"""Update Workflow Execution + + :param execution_id: + :param name: The name of the update to request + :param input: Input data for the update, matching its schema + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequest( + execution_id=execution_id, + update_invocation_body=models.UpdateInvocationBody( + name=name, + input=utils.get_pydantic_model( + input, OptionalNullable[models.UpdateInvocationBodyInput] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/executions/{execution_id}/updates", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_invocation_body, + False, + False, + "json", + models.UpdateInvocationBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_workflow_execution_v1_workflows_executions__execution_id__updates_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.UpdateWorkflowResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_workflow_execution_trace_otel( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionTraceOTelResponse: + r"""Get Workflow Execution Trace Otel + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionTraceOtelRequest( + execution_id=execution_id, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/executions/{execution_id}/trace/otel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_trace_otel", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowExecutionTraceOTelResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_execution_trace_otel_async( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionTraceOTelResponse: + r"""Get Workflow Execution Trace Otel + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionTraceOtelRequest( + execution_id=execution_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/executions/{execution_id}/trace/otel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_trace_otel", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowExecutionTraceOTelResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_workflow_execution_trace_summary( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionTraceSummaryResponse: + r"""Get Workflow Execution Trace Summary + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionTraceSummaryRequest( + execution_id=execution_id, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/executions/{execution_id}/trace/summary", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_trace_summary", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowExecutionTraceSummaryResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_execution_trace_summary_async( + self, + *, + execution_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionTraceSummaryResponse: + r"""Get Workflow Execution Trace Summary + + :param execution_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionTraceSummaryRequest( + execution_id=execution_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/executions/{execution_id}/trace/summary", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_trace_summary", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowExecutionTraceSummaryResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_workflow_execution_trace_events( + self, + *, + execution_id: str, + merge_same_id_events: Optional[bool] = False, + include_internal_events: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionTraceEventsResponse: + r"""Get Workflow Execution Trace Events + + :param execution_id: + :param merge_same_id_events: + :param include_internal_events: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionTraceEventsRequest( + execution_id=execution_id, + merge_same_id_events=merge_same_id_events, + include_internal_events=include_internal_events, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/executions/{execution_id}/trace/events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_trace_events", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowExecutionTraceEventsResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_execution_trace_events_async( + self, + *, + execution_id: str, + merge_same_id_events: Optional[bool] = False, + include_internal_events: Optional[bool] = False, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionTraceEventsResponse: + r"""Get Workflow Execution Trace Events + + :param execution_id: + :param merge_same_id_events: + :param include_internal_events: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowExecutionTraceEventsRequest( + execution_id=execution_id, + merge_same_id_events=merge_same_id_events, + include_internal_events=include_internal_events, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/executions/{execution_id}/trace/events", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_execution_trace_events", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowExecutionTraceEventsResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def stream( + self, + *, + execution_id: str, + event_source: OptionalNullable[models.EventSource] = UNSET, + last_event_id: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[ + models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody + ]: + r"""Stream + + :param execution_id: + :param event_source: + :param last_event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.StreamV1WorkflowsExecutionsExecutionIDStreamGetRequest( + execution_id=execution_id, + event_source=event_source, + last_event_id=last_event_id, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/executions/{execution_id}/stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_v1_workflows_executions__execution_id__stream_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json( + raw, + models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody, + ), + client_ref=self, + data_required=False, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def stream_async( + self, + *, + execution_id: str, + event_source: OptionalNullable[models.EventSource] = UNSET, + last_event_id: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[ + models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody + ]: + r"""Stream + + :param execution_id: + :param event_source: + :param last_event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.StreamV1WorkflowsExecutionsExecutionIDStreamGetRequest( + execution_id=execution_id, + event_source=event_source, + last_event_id=last_event_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/executions/{execution_id}/stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_v1_workflows_executions__execution_id__stream_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json( + raw, + models.StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody, + ), + client_ref=self, + data_required=False, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/client/fields.py b/src/mistralai/client/fields.py new file mode 100644 index 00000000..17441ca6 --- /dev/null +++ b/src/mistralai/client/fields.py @@ -0,0 +1,606 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 862335210b20 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional, Union + + +class Fields(BaseSDK): + def list( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListChatCompletionFieldsResponse: + r"""Get Chat Completion Fields + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( + method="GET", + path="/v1/observability/chat-completion-fields", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_fields_v1_observability_chat_completion_fields_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ListChatCompletionFieldsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListChatCompletionFieldsResponse: + r"""Get Chat Completion Fields + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( + method="GET", + path="/v1/observability/chat-completion-fields", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_fields_v1_observability_chat_completion_fields_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ListChatCompletionFieldsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch_options( + self, + *, + field_name: str, + operator: models.Operator, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FetchChatCompletionFieldOptionsResponse: + r"""Get Chat Completion Field Options + + :param field_name: + :param operator: The operator to use for filtering options + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest( + field_name=field_name, + operator=operator, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/chat-completion-fields/{field_name}/options", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_field_options_v1_observability_chat_completion_fields__field_name__options_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.FetchChatCompletionFieldOptionsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_options_async( + self, + *, + field_name: str, + operator: models.Operator, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FetchChatCompletionFieldOptionsResponse: + r"""Get Chat Completion Field Options + + :param field_name: + :param operator: The operator to use for filtering options + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest( + field_name=field_name, + operator=operator, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/chat-completion-fields/{field_name}/options", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_field_options_v1_observability_chat_completion_fields__field_name__options_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.FetchChatCompletionFieldOptionsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch_option_counts( + self, + *, + field_name: str, + filter_params: OptionalNullable[ + Union[models.FilterPayload, models.FilterPayloadTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FetchFieldOptionCountsResponse: + r"""Get Chat Completion Field Options Counts + + :param field_name: + :param filter_params: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest( + field_name=field_name, + fetch_field_option_counts_request=models.FetchFieldOptionCountsRequest( + filter_params=utils.get_pydantic_model( + filter_params, OptionalNullable[models.FilterPayload] + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/chat-completion-fields/{field_name}/options-counts", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.fetch_field_option_counts_request, + False, + False, + "json", + models.FetchFieldOptionCountsRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_field_options_counts_v1_observability_chat_completion_fields__field_name__options_counts_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.FetchFieldOptionCountsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_option_counts_async( + self, + *, + field_name: str, + filter_params: OptionalNullable[ + Union[models.FilterPayload, models.FilterPayloadTypedDict] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FetchFieldOptionCountsResponse: + r"""Get Chat Completion Field Options Counts + + :param field_name: + :param filter_params: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest( + field_name=field_name, + fetch_field_option_counts_request=models.FetchFieldOptionCountsRequest( + filter_params=utils.get_pydantic_model( + filter_params, OptionalNullable[models.FilterPayload] + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/chat-completion-fields/{field_name}/options-counts", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.fetch_field_option_counts_request, + False, + False, + "json", + models.FetchFieldOptionCountsRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_chat_completion_field_options_counts_v1_observability_chat_completion_fields__field_name__options_counts_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.FetchFieldOptionCountsResponse, http_res + ) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/files.py b/src/mistralai/client/files.py similarity index 82% rename from src/mistralai/files.py rename to src/mistralai/client/files.py index c6e438af..e4549c75 100644 --- a/src/mistralai/files.py +++ b/src/mistralai/client/files.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f12df4b2ce43 from .basesdk import BaseSDK import httpx -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response from typing import List, Mapping, Optional, Union @@ -17,12 +18,16 @@ def upload( self, *, file: Union[models.File, models.FileTypedDict], + expiry: OptionalNullable[int] = UNSET, + visibility: Optional[ + models.FilesAPIRoutesUploadFileFileVisibility + ] = "workspace", purpose: Optional[models.FilePurpose] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.UploadFileOut: + ) -> models.CreateFileResponse: r"""Upload File Upload a file that can be used across various endpoints. @@ -31,7 +36,17 @@ def upload( Please contact us if you need to increase these storage limits. - :param file: The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such: ```bash file=@path/to/your/file.jsonl;filename=custom_name.jsonl ``` Otherwise, you can just keep the original file name: ```bash file=@path/to/your/file.jsonl ``` + :param file: The File object (not file name) to be uploaded. + To upload a file and specify a custom file name you should format your request as such: + ```bash + file=@path/to/your/file.jsonl;filename=custom_name.jsonl + ``` + Otherwise, you can just keep the original file name: + ```bash + file=@path/to/your/file.jsonl + ``` + :param expiry: + :param visibility: :param purpose: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -43,12 +58,17 @@ def upload( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) - request = models.FilesAPIRoutesUploadFileMultiPartBodyParams( + request = models.MultiPartBodyParams( + expiry=expiry, + visibility=visibility, purpose=purpose, file=utils.get_pydantic_model(file, models.File), ) @@ -67,12 +87,9 @@ def upload( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, - False, - False, - "multipart", - models.FilesAPIRoutesUploadFileMultiPartBodyParams, + request, False, False, "multipart", models.MultiPartBodyParams ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -89,7 +106,7 @@ def upload( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_upload_file", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -100,26 +117,30 @@ def upload( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.UploadFileOut, http_res) + return unmarshal_json_response(models.CreateFileResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def upload_async( self, *, file: Union[models.File, models.FileTypedDict], + expiry: OptionalNullable[int] = UNSET, + visibility: Optional[ + models.FilesAPIRoutesUploadFileFileVisibility + ] = "workspace", purpose: Optional[models.FilePurpose] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.UploadFileOut: + ) -> models.CreateFileResponse: r"""Upload File Upload a file that can be used across various endpoints. @@ -128,7 +149,17 @@ async def upload_async( Please contact us if you need to increase these storage limits. - :param file: The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such: ```bash file=@path/to/your/file.jsonl;filename=custom_name.jsonl ``` Otherwise, you can just keep the original file name: ```bash file=@path/to/your/file.jsonl ``` + :param file: The File object (not file name) to be uploaded. + To upload a file and specify a custom file name you should format your request as such: + ```bash + file=@path/to/your/file.jsonl;filename=custom_name.jsonl + ``` + Otherwise, you can just keep the original file name: + ```bash + file=@path/to/your/file.jsonl + ``` + :param expiry: + :param visibility: :param purpose: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -140,12 +171,17 @@ async def upload_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) - request = models.FilesAPIRoutesUploadFileMultiPartBodyParams( + request = models.MultiPartBodyParams( + expiry=expiry, + visibility=visibility, purpose=purpose, file=utils.get_pydantic_model(file, models.File), ) @@ -164,12 +200,9 @@ async def upload_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, - False, - False, - "multipart", - models.FilesAPIRoutesUploadFileMultiPartBodyParams, + request, False, False, "multipart", models.MultiPartBodyParams ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -186,7 +219,7 @@ async def upload_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_upload_file", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -197,40 +230,44 @@ async def upload_async( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.UploadFileOut, http_res) + return unmarshal_json_response(models.CreateFileResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def list( self, *, page: Optional[int] = 0, page_size: Optional[int] = 100, + include_total: Optional[bool] = True, sample_type: OptionalNullable[List[models.SampleType]] = UNSET, source: OptionalNullable[List[models.Source]] = UNSET, search: OptionalNullable[str] = UNSET, purpose: OptionalNullable[models.FilePurpose] = UNSET, + mimetypes: OptionalNullable[List[str]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListFilesOut: + ) -> models.ListFilesResponse: r"""List Files Returns a list of files that belong to the user's organization. :param page: :param page_size: + :param include_total: :param sample_type: :param source: :param search: :param purpose: + :param mimetypes: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -241,6 +278,9 @@ def list( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -249,10 +289,12 @@ def list( request = models.FilesAPIRoutesListFilesRequest( page=page, page_size=page_size, + include_total=include_total, sample_type=sample_type, source=source, search=search, purpose=purpose, + mimetypes=mimetypes, ) req = self._build_request( @@ -268,6 +310,7 @@ def list( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -284,7 +327,7 @@ def list( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_list_files", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -295,40 +338,44 @@ def list( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListFilesOut, http_res) + return unmarshal_json_response(models.ListFilesResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, *, page: Optional[int] = 0, page_size: Optional[int] = 100, + include_total: Optional[bool] = True, sample_type: OptionalNullable[List[models.SampleType]] = UNSET, source: OptionalNullable[List[models.Source]] = UNSET, search: OptionalNullable[str] = UNSET, purpose: OptionalNullable[models.FilePurpose] = UNSET, + mimetypes: OptionalNullable[List[str]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListFilesOut: + ) -> models.ListFilesResponse: r"""List Files Returns a list of files that belong to the user's organization. :param page: :param page_size: + :param include_total: :param sample_type: :param source: :param search: :param purpose: + :param mimetypes: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -339,6 +386,9 @@ async def list_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -347,10 +397,12 @@ async def list_async( request = models.FilesAPIRoutesListFilesRequest( page=page, page_size=page_size, + include_total=include_total, sample_type=sample_type, source=source, search=search, purpose=purpose, + mimetypes=mimetypes, ) req = self._build_request_async( @@ -366,6 +418,7 @@ async def list_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -382,7 +435,7 @@ async def list_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_list_files", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -393,15 +446,15 @@ async def list_async( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListFilesOut, http_res) + return unmarshal_json_response(models.ListFilesResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def retrieve( self, @@ -411,7 +464,7 @@ def retrieve( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.RetrieveFileOut: + ) -> models.GetFileResponse: r"""Retrieve File Returns information about a specific file. @@ -427,6 +480,9 @@ def retrieve( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -449,6 +505,7 @@ def retrieve( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -465,7 +522,7 @@ def retrieve( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_retrieve_file", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -476,15 +533,15 @@ def retrieve( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.RetrieveFileOut, http_res) + return unmarshal_json_response(models.GetFileResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def retrieve_async( self, @@ -494,7 +551,7 @@ async def retrieve_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.RetrieveFileOut: + ) -> models.GetFileResponse: r"""Retrieve File Returns information about a specific file. @@ -510,6 +567,9 @@ async def retrieve_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -532,6 +592,7 @@ async def retrieve_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -548,7 +609,7 @@ async def retrieve_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_retrieve_file", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -559,15 +620,15 @@ async def retrieve_async( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.RetrieveFileOut, http_res) + return unmarshal_json_response(models.GetFileResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def delete( self, @@ -577,7 +638,7 @@ def delete( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DeleteFileOut: + ) -> models.DeleteFileResponse: r"""Delete File Delete a file. @@ -593,6 +654,9 @@ def delete( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -615,6 +679,7 @@ def delete( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -631,7 +696,7 @@ def delete( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_delete_file", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -642,15 +707,15 @@ def delete( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.DeleteFileOut, http_res) + return unmarshal_json_response(models.DeleteFileResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def delete_async( self, @@ -660,7 +725,7 @@ async def delete_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DeleteFileOut: + ) -> models.DeleteFileResponse: r"""Delete File Delete a file. @@ -676,6 +741,9 @@ async def delete_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -698,6 +766,7 @@ async def delete_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -714,7 +783,7 @@ async def delete_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_delete_file", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -725,15 +794,15 @@ async def delete_async( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.DeleteFileOut, http_res) + return unmarshal_json_response(models.DeleteFileResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def download( self, @@ -759,6 +828,9 @@ def download( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -781,6 +853,7 @@ def download( accept_header_value="application/octet-stream", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -797,7 +870,7 @@ def download( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_download_file", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -812,13 +885,13 @@ def download( return http_res if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) async def download_async( self, @@ -844,6 +917,9 @@ async def download_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -866,6 +942,7 @@ async def download_async( accept_header_value="application/octet-stream", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -882,7 +959,7 @@ async def download_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_download_file", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -897,13 +974,13 @@ async def download_async( return http_res if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) def get_signed_url( self, @@ -914,11 +991,11 @@ def get_signed_url( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.FileSignedURL: + ) -> models.GetSignedURLResponse: r"""Get Signed Url :param file_id: - :param expiry: Number of hours before the url becomes invalid. Defaults to 24h + :param expiry: Number of hours before the URL becomes invalid. Defaults to 24h. Must be between 1h and 168h. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -929,6 +1006,9 @@ def get_signed_url( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -952,6 +1032,7 @@ def get_signed_url( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -968,7 +1049,7 @@ def get_signed_url( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_get_signed_url", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -979,15 +1060,15 @@ def get_signed_url( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.FileSignedURL, http_res) + return unmarshal_json_response(models.GetSignedURLResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def get_signed_url_async( self, @@ -998,11 +1079,11 @@ async def get_signed_url_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.FileSignedURL: + ) -> models.GetSignedURLResponse: r"""Get Signed Url :param file_id: - :param expiry: Number of hours before the url becomes invalid. Defaults to 24h + :param expiry: Number of hours before the URL becomes invalid. Defaults to 24h. Must be between 1h and 168h. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1013,6 +1094,9 @@ async def get_signed_url_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1036,6 +1120,7 @@ async def get_signed_url_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1052,7 +1137,7 @@ async def get_signed_url_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="files_api_routes_get_signed_url", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1063,12 +1148,12 @@ async def get_signed_url_async( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.FileSignedURL, http_res) + return unmarshal_json_response(models.GetSignedURLResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/fim.py b/src/mistralai/client/fim.py new file mode 100644 index 00000000..d25f79b1 --- /dev/null +++ b/src/mistralai/client/fim.py @@ -0,0 +1,566 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 217bea5d701d + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, Mapping, Optional, Union + + +class Fim(BaseSDK): + r"""Fill-in-the-middle API.""" + + def complete( + self, + *, + model: str, + prompt: str, + temperature: OptionalNullable[float] = UNSET, + top_p: OptionalNullable[float] = UNSET, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: OptionalNullable[ + Union[ + models.FIMCompletionRequestStop, + models.FIMCompletionRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + min_tokens: OptionalNullable[int] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FIMCompletionResponse: + r"""Fim Completion + + FIM completion. + + :param model: ID of the model with FIM to use. + :param prompt: The text/code to complete. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. + :param min_tokens: The minimum number of tokens to generate in the completion. + :param prompt_cache_key: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FIMCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + prompt=prompt, + suffix=suffix, + min_tokens=min_tokens, + prompt_cache_key=prompt_cache_key, + ) + + req = self._build_request( + method="POST", + path="/v1/fim/completions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.FIMCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="fim_completion_v1_fim_completions_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.FIMCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def complete_async( + self, + *, + model: str, + prompt: str, + temperature: OptionalNullable[float] = UNSET, + top_p: OptionalNullable[float] = UNSET, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = False, + stop: OptionalNullable[ + Union[ + models.FIMCompletionRequestStop, + models.FIMCompletionRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + min_tokens: OptionalNullable[int] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.FIMCompletionResponse: + r"""Fim Completion + + FIM completion. + + :param model: ID of the model with FIM to use. + :param prompt: The text/code to complete. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. + :param min_tokens: The minimum number of tokens to generate in the completion. + :param prompt_cache_key: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FIMCompletionRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + prompt=prompt, + suffix=suffix, + min_tokens=min_tokens, + prompt_cache_key=prompt_cache_key, + ) + + req = self._build_request_async( + method="POST", + path="/v1/fim/completions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.FIMCompletionRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="fim_completion_v1_fim_completions_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.FIMCompletionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def stream( + self, + *, + model: str, + prompt: str, + temperature: OptionalNullable[float] = UNSET, + top_p: OptionalNullable[float] = UNSET, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: OptionalNullable[ + Union[ + models.FIMCompletionStreamRequestStop, + models.FIMCompletionStreamRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + min_tokens: OptionalNullable[int] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.CompletionEvent]: + r"""Stream fim completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param model: ID of the model with FIM to use. + :param prompt: The text/code to complete. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. + :param min_tokens: The minimum number of tokens to generate in the completion. + :param prompt_cache_key: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FIMCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + prompt=prompt, + suffix=suffix, + min_tokens=min_tokens, + prompt_cache_key=prompt_cache_key, + ) + + req = self._build_request( + method="POST", + path="/v1/fim/completions#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.FIMCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_fim", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def stream_async( + self, + *, + model: str, + prompt: str, + temperature: OptionalNullable[float] = UNSET, + top_p: OptionalNullable[float] = UNSET, + max_tokens: OptionalNullable[int] = UNSET, + stream: Optional[bool] = True, + stop: OptionalNullable[ + Union[ + models.FIMCompletionStreamRequestStop, + models.FIMCompletionStreamRequestStopTypedDict, + ] + ] = UNSET, + random_seed: OptionalNullable[int] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + min_tokens: OptionalNullable[int] = UNSET, + prompt_cache_key: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: + r"""Stream fim completion + + Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. + + :param model: ID of the model with FIM to use. + :param prompt: The text/code to complete. + :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. + :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. + :param stream: + :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array + :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. + :param metadata: + :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. + :param min_tokens: The minimum number of tokens to generate in the completion. + :param prompt_cache_key: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.FIMCompletionStreamRequest( + model=model, + temperature=temperature, + top_p=top_p, + max_tokens=max_tokens, + stream=stream, + stop=stop, + random_seed=random_seed, + metadata=metadata, + prompt=prompt, + suffix=suffix, + min_tokens=min_tokens, + prompt_cache_key=prompt_cache_key, + ) + + req = self._build_request_async( + method="POST", + path="/v1/fim/completions#stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.FIMCompletionStreamRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="stream_fim", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), + sentinel="[DONE]", + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/client/fine_tuning.py b/src/mistralai/client/fine_tuning.py new file mode 100644 index 00000000..df6bc564 --- /dev/null +++ b/src/mistralai/client/fine_tuning.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5d5079bbd54e + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from mistralai.client.fine_tuning_jobs import FineTuningJobs +from typing import Optional + + +class FineTuning(BaseSDK): + jobs: FineTuningJobs + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.jobs = FineTuningJobs(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/mistralai/client/fine_tuning_jobs.py b/src/mistralai/client/fine_tuning_jobs.py new file mode 100644 index 00000000..a6bf93a3 --- /dev/null +++ b/src/mistralai/client/fine_tuning_jobs.py @@ -0,0 +1,1075 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fa1ea246e0b2 + +from .basesdk import BaseSDK +from datetime import datetime +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import List, Mapping, Optional, Union + + +class FineTuningJobs(BaseSDK): + def list( + self, + *, + page: Optional[int] = 0, + page_size: Optional[int] = 100, + model: OptionalNullable[str] = UNSET, + created_after: OptionalNullable[datetime] = UNSET, + created_before: OptionalNullable[datetime] = UNSET, + created_by_me: Optional[bool] = False, + status: OptionalNullable[ + models.JobsAPIRoutesFineTuningGetFineTuningJobsStatus + ] = UNSET, + wandb_project: OptionalNullable[str] = UNSET, + wandb_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListFineTuningJobsResponse: + r"""Get Fine Tuning Jobs + + Get a list of fine-tuning jobs for your organization and user. + + :param page: The page number of the results to be returned. + :param page_size: The number of items to return per page. + :param model: The model name used for fine-tuning to filter on. When set, the other results are not displayed. + :param created_after: The date/time to filter on. When set, the results for previous creation times are not displayed. + :param created_before: + :param created_by_me: When set, only return results for jobs created by the API caller. Other results are not displayed. + :param status: The current job state to filter on. When set, the other results are not displayed. + :param wandb_project: The Weights and Biases project to filter on. When set, the other results are not displayed. + :param wandb_name: The Weight and Biases run name to filter on. When set, the other results are not displayed. + :param suffix: The model suffix to filter on. When set, the other results are not displayed. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesFineTuningGetFineTuningJobsRequest( + page=page, + page_size=page_size, + model=model, + created_after=created_after, + created_before=created_before, + created_by_me=created_by_me, + status=status, + wandb_project=wandb_project, + wandb_name=wandb_name, + suffix=suffix, + ) + + req = self._build_request( + method="GET", + path="/v1/fine_tuning/jobs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_jobs", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListFineTuningJobsResponse, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + page: Optional[int] = 0, + page_size: Optional[int] = 100, + model: OptionalNullable[str] = UNSET, + created_after: OptionalNullable[datetime] = UNSET, + created_before: OptionalNullable[datetime] = UNSET, + created_by_me: Optional[bool] = False, + status: OptionalNullable[ + models.JobsAPIRoutesFineTuningGetFineTuningJobsStatus + ] = UNSET, + wandb_project: OptionalNullable[str] = UNSET, + wandb_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListFineTuningJobsResponse: + r"""Get Fine Tuning Jobs + + Get a list of fine-tuning jobs for your organization and user. + + :param page: The page number of the results to be returned. + :param page_size: The number of items to return per page. + :param model: The model name used for fine-tuning to filter on. When set, the other results are not displayed. + :param created_after: The date/time to filter on. When set, the results for previous creation times are not displayed. + :param created_before: + :param created_by_me: When set, only return results for jobs created by the API caller. Other results are not displayed. + :param status: The current job state to filter on. When set, the other results are not displayed. + :param wandb_project: The Weights and Biases project to filter on. When set, the other results are not displayed. + :param wandb_name: The Weight and Biases run name to filter on. When set, the other results are not displayed. + :param suffix: The model suffix to filter on. When set, the other results are not displayed. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesFineTuningGetFineTuningJobsRequest( + page=page, + page_size=page_size, + model=model, + created_after=created_after, + created_before=created_before, + created_by_me=created_by_me, + status=status, + wandb_project=wandb_project, + wandb_name=wandb_name, + suffix=suffix, + ) + + req = self._build_request_async( + method="GET", + path="/v1/fine_tuning/jobs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_jobs", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListFineTuningJobsResponse, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create( + self, + *, + model: str, + hyperparameters: Union[models.Hyperparameters, models.HyperparametersTypedDict], + training_files: Optional[ + Union[List[models.TrainingFile], List[models.TrainingFileTypedDict]] + ] = None, + validation_files: OptionalNullable[List[str]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + integrations: OptionalNullable[ + Union[ + List[models.CreateFineTuningJobRequestIntegration], + List[models.CreateFineTuningJobRequestIntegrationTypedDict], + ] + ] = UNSET, + auto_start: Optional[bool] = None, + invalid_sample_skip_percentage: Optional[float] = 0, + job_type: OptionalNullable[models.FineTuneableModelType] = UNSET, + repositories: OptionalNullable[ + Union[ + List[models.CreateFineTuningJobRequestRepository], + List[models.CreateFineTuningJobRequestRepositoryTypedDict], + ] + ] = UNSET, + classifier_targets: OptionalNullable[ + Union[List[models.ClassifierTarget], List[models.ClassifierTargetTypedDict]] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse: + r"""Create Fine Tuning Job + + Create a new fine-tuning job, it will be queued for processing. + + :param model: + :param hyperparameters: + :param training_files: + :param validation_files: A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. + :param suffix: A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` + :param integrations: A list of integrations to enable for your fine-tuning job. + :param auto_start: This field will be required in a future release. + :param invalid_sample_skip_percentage: + :param job_type: + :param repositories: + :param classifier_targets: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateFineTuningJobRequest( + model=model, + training_files=utils.get_pydantic_model( + training_files, Optional[List[models.TrainingFile]] + ), + validation_files=validation_files, + suffix=suffix, + integrations=utils.get_pydantic_model( + integrations, + OptionalNullable[List[models.CreateFineTuningJobRequestIntegration]], + ), + auto_start=auto_start, + invalid_sample_skip_percentage=invalid_sample_skip_percentage, + job_type=job_type, + hyperparameters=utils.get_pydantic_model( + hyperparameters, models.Hyperparameters + ), + repositories=utils.get_pydantic_model( + repositories, + OptionalNullable[List[models.CreateFineTuningJobRequestRepository]], + ), + classifier_targets=utils.get_pydantic_model( + classifier_targets, OptionalNullable[List[models.ClassifierTarget]] + ), + ) + + req = self._build_request( + method="POST", + path="/v1/fine_tuning/jobs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateFineTuningJobRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_create_fine_tuning_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + model: str, + hyperparameters: Union[models.Hyperparameters, models.HyperparametersTypedDict], + training_files: Optional[ + Union[List[models.TrainingFile], List[models.TrainingFileTypedDict]] + ] = None, + validation_files: OptionalNullable[List[str]] = UNSET, + suffix: OptionalNullable[str] = UNSET, + integrations: OptionalNullable[ + Union[ + List[models.CreateFineTuningJobRequestIntegration], + List[models.CreateFineTuningJobRequestIntegrationTypedDict], + ] + ] = UNSET, + auto_start: Optional[bool] = None, + invalid_sample_skip_percentage: Optional[float] = 0, + job_type: OptionalNullable[models.FineTuneableModelType] = UNSET, + repositories: OptionalNullable[ + Union[ + List[models.CreateFineTuningJobRequestRepository], + List[models.CreateFineTuningJobRequestRepositoryTypedDict], + ] + ] = UNSET, + classifier_targets: OptionalNullable[ + Union[List[models.ClassifierTarget], List[models.ClassifierTargetTypedDict]] + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse: + r"""Create Fine Tuning Job + + Create a new fine-tuning job, it will be queued for processing. + + :param model: + :param hyperparameters: + :param training_files: + :param validation_files: A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. + :param suffix: A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` + :param integrations: A list of integrations to enable for your fine-tuning job. + :param auto_start: This field will be required in a future release. + :param invalid_sample_skip_percentage: + :param job_type: + :param repositories: + :param classifier_targets: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateFineTuningJobRequest( + model=model, + training_files=utils.get_pydantic_model( + training_files, Optional[List[models.TrainingFile]] + ), + validation_files=validation_files, + suffix=suffix, + integrations=utils.get_pydantic_model( + integrations, + OptionalNullable[List[models.CreateFineTuningJobRequestIntegration]], + ), + auto_start=auto_start, + invalid_sample_skip_percentage=invalid_sample_skip_percentage, + job_type=job_type, + hyperparameters=utils.get_pydantic_model( + hyperparameters, models.Hyperparameters + ), + repositories=utils.get_pydantic_model( + repositories, + OptionalNullable[List[models.CreateFineTuningJobRequestRepository]], + ), + classifier_targets=utils.get_pydantic_model( + classifier_targets, OptionalNullable[List[models.ClassifierTarget]] + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/fine_tuning/jobs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateFineTuningJobRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_create_fine_tuning_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JobsAPIRoutesFineTuningGetFineTuningJobResponse: + r"""Get Fine Tuning Job + + Get a fine-tuned job details by its UUID. + + :param job_id: The ID of the job to analyse. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesFineTuningGetFineTuningJobRequest( + job_id=job_id, + ) + + req = self._build_request( + method="GET", + path="/v1/fine_tuning/jobs/{job_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.JobsAPIRoutesFineTuningGetFineTuningJobResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_async( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JobsAPIRoutesFineTuningGetFineTuningJobResponse: + r"""Get Fine Tuning Job + + Get a fine-tuned job details by its UUID. + + :param job_id: The ID of the job to analyse. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesFineTuningGetFineTuningJobRequest( + job_id=job_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/fine_tuning/jobs/{job_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.JobsAPIRoutesFineTuningGetFineTuningJobResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def cancel( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse: + r"""Cancel Fine Tuning Job + + Request the cancellation of a fine tuning job. + + :param job_id: The ID of the job to cancel. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesFineTuningCancelFineTuningJobRequest( + job_id=job_id, + ) + + req = self._build_request( + method="POST", + path="/v1/fine_tuning/jobs/{job_id}/cancel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_cancel_fine_tuning_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def cancel_async( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse: + r"""Cancel Fine Tuning Job + + Request the cancellation of a fine tuning job. + + :param job_id: The ID of the job to cancel. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesFineTuningCancelFineTuningJobRequest( + job_id=job_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/fine_tuning/jobs/{job_id}/cancel", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_cancel_fine_tuning_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def start( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JobsAPIRoutesFineTuningStartFineTuningJobResponse: + r"""Start Fine Tuning Job + + Request the start of a validated fine tuning job. + + :param job_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesFineTuningStartFineTuningJobRequest( + job_id=job_id, + ) + + req = self._build_request( + method="POST", + path="/v1/fine_tuning/jobs/{job_id}/start", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_start_fine_tuning_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.JobsAPIRoutesFineTuningStartFineTuningJobResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def start_async( + self, + *, + job_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JobsAPIRoutesFineTuningStartFineTuningJobResponse: + r"""Start Fine Tuning Job + + Request the start of a validated fine tuning job. + + :param job_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JobsAPIRoutesFineTuningStartFineTuningJobRequest( + job_id=job_id, + ) + + req = self._build_request_async( + method="POST", + path="/v1/fine_tuning/jobs/{job_id}/start", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="jobs_api_routes_fine_tuning_start_fine_tuning_job", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.JobsAPIRoutesFineTuningStartFineTuningJobResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/httpclient.py b/src/mistralai/client/httpclient.py new file mode 100644 index 00000000..544af7f8 --- /dev/null +++ b/src/mistralai/client/httpclient.py @@ -0,0 +1,126 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3e46bde74327 + +# pyright: reportReturnType = false +import asyncio +from typing_extensions import Protocol, runtime_checkable +import httpx +from typing import Any, Optional, Union + + +@runtime_checkable +class HttpClient(Protocol): + def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + def close(self) -> None: + pass + + +@runtime_checkable +class AsyncHttpClient(Protocol): + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + async def aclose(self) -> None: + pass + + +class ClientOwner(Protocol): + client: Union[HttpClient, None] + async_client: Union[AsyncHttpClient, None] + + +def close_clients( + owner: ClientOwner, + sync_client: Union[HttpClient, None], + sync_client_supplied: bool, + async_client: Union[AsyncHttpClient, None], + async_client_supplied: bool, +) -> None: + """ + A finalizer function that is meant to be used with weakref.finalize to close + httpx clients used by an SDK so that underlying resources can be garbage + collected. + """ + + # Unset the client/async_client properties so there are no more references + # to them from the owning SDK instance and they can be reaped. + owner.client = None + owner.async_client = None + if sync_client is not None and not sync_client_supplied: + try: + sync_client.close() + except Exception: + pass + + if async_client is not None and not async_client_supplied: + try: + loop = asyncio.get_running_loop() + asyncio.run_coroutine_threadsafe(async_client.aclose(), loop) + except RuntimeError: + try: + asyncio.run(async_client.aclose()) + except RuntimeError: + # best effort + pass diff --git a/src/mistralai/client/ingestion_pipeline_configurations.py b/src/mistralai/client/ingestion_pipeline_configurations.py new file mode 100644 index 00000000..adef39f9 --- /dev/null +++ b/src/mistralai/client/ingestion_pipeline_configurations.py @@ -0,0 +1,599 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f5a994272058 + +from .basesdk import BaseSDK +from datetime import datetime +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional + + +class IngestionPipelineConfigurations(BaseSDK): + def list( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.IngestionPipelineConfiguration]: + r"""List ingestion pipeline configurations + + For the current workspace, lists all of the registered ingestion pipeline configurations. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( + method="GET", + path="/v1/rag/ingestion_pipeline_configurations", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_configs_v1_rag_ingestion_pipeline_configurations_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + List[models.IngestionPipelineConfiguration], http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.IngestionPipelineConfiguration]: + r"""List ingestion pipeline configurations + + For the current workspace, lists all of the registered ingestion pipeline configurations. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( + method="GET", + path="/v1/rag/ingestion_pipeline_configurations", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_configs_v1_rag_ingestion_pipeline_configurations_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + List[models.IngestionPipelineConfiguration], http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def register( + self, + *, + name: str, + pipeline_composition: OptionalNullable[Dict[str, str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.IngestionPipelineConfiguration: + r"""Register Config + + Register an ingestion configuration. + + :param name: + :param pipeline_composition: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateIngestionPipelineConfigurationRequest( + name=name, + pipeline_composition=pipeline_composition, + ) + + req = self._build_request( + method="PUT", + path="/v1/rag/ingestion_pipeline_configurations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + False, + "json", + models.CreateIngestionPipelineConfigurationRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="register_config_v1_rag_ingestion_pipeline_configurations_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.IngestionPipelineConfiguration, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def register_async( + self, + *, + name: str, + pipeline_composition: OptionalNullable[Dict[str, str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.IngestionPipelineConfiguration: + r"""Register Config + + Register an ingestion configuration. + + :param name: + :param pipeline_composition: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateIngestionPipelineConfigurationRequest( + name=name, + pipeline_composition=pipeline_composition, + ) + + req = self._build_request_async( + method="PUT", + path="/v1/rag/ingestion_pipeline_configurations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + False, + "json", + models.CreateIngestionPipelineConfigurationRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="register_config_v1_rag_ingestion_pipeline_configurations_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.IngestionPipelineConfiguration, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update_run_info( + self, + *, + id: str, + execution_time: datetime, + chunks_count: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.IngestionPipelineConfiguration: + r"""Update Run Info + + :param id: + :param execution_time: + :param chunks_count: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest( + id=id, + update_run_info=models.UpdateRunInfo( + execution_time=execution_time, + chunks_count=chunks_count, + ), + ) + ) + + req = self._build_request( + method="PUT", + path="/v1/rag/ingestion_pipeline_configurations/{id}/run_info", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_run_info, False, False, "json", models.UpdateRunInfo + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_run_info_v1_rag_ingestion_pipeline_configurations__id__run_info_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.IngestionPipelineConfiguration, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_run_info_async( + self, + *, + id: str, + execution_time: datetime, + chunks_count: int, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.IngestionPipelineConfiguration: + r"""Update Run Info + + :param id: + :param execution_time: + :param chunks_count: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest( + id=id, + update_run_info=models.UpdateRunInfo( + execution_time=execution_time, + chunks_count=chunks_count, + ), + ) + ) + + req = self._build_request_async( + method="PUT", + path="/v1/rag/ingestion_pipeline_configurations/{id}/run_info", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_run_info, False, False, "json", models.UpdateRunInfo + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_run_info_v1_rag_ingestion_pipeline_configurations__id__run_info_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.IngestionPipelineConfiguration, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/judges.py b/src/mistralai/client/judges.py new file mode 100644 index 00000000..52c8899e --- /dev/null +++ b/src/mistralai/client/judges.py @@ -0,0 +1,1288 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b6024a41ecb4 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class Judges(BaseSDK): + def create( + self, + *, + name: str, + description: str, + model_name: str, + output: Union[ + models.CreateJudgeRequestOutput, models.CreateJudgeRequestOutputTypedDict + ], + instructions: str, + tools: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Judge: + r"""Create a new judge + + :param name: + :param description: + :param model_name: + :param output: + :param instructions: + :param tools: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateJudgeRequest( + name=name, + description=description, + model_name=model_name, + output=utils.get_pydantic_model(output, models.CreateJudgeRequestOutput), + instructions=instructions, + tools=tools, + ) + + req = self._build_request( + method="POST", + path="/v1/observability/judges", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateJudgeRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_judge_v1_observability_judges_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Judge, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + name: str, + description: str, + model_name: str, + output: Union[ + models.CreateJudgeRequestOutput, models.CreateJudgeRequestOutputTypedDict + ], + instructions: str, + tools: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Judge: + r"""Create a new judge + + :param name: + :param description: + :param model_name: + :param output: + :param instructions: + :param tools: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.CreateJudgeRequest( + name=name, + description=description, + model_name=model_name, + output=utils.get_pydantic_model(output, models.CreateJudgeRequestOutput), + instructions=instructions, + tools=tools, + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/judges", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.CreateJudgeRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_judge_v1_observability_judges_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.Judge, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def list( + self, + *, + type_filter: OptionalNullable[List[models.JudgeOutputType]] = UNSET, + model_filter: OptionalNullable[List[str]] = UNSET, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + q: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListJudgesResponse: + r"""Get judges with optional filtering and search + + :param type_filter: Filter by judge output types + :param model_filter: Filter by model names + :param page_size: + :param page: + :param q: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetJudgesV1ObservabilityJudgesGetRequest( + type_filter=type_filter, + model_filter=model_filter, + page_size=page_size, + page=page, + q=q, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/judges", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_judges_v1_observability_judges_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListJudgesResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + type_filter: OptionalNullable[List[models.JudgeOutputType]] = UNSET, + model_filter: OptionalNullable[List[str]] = UNSET, + page_size: Optional[int] = 50, + page: Optional[int] = 1, + q: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListJudgesResponse: + r"""Get judges with optional filtering and search + + :param type_filter: Filter by judge output types + :param model_filter: Filter by model names + :param page_size: + :param page: + :param q: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetJudgesV1ObservabilityJudgesGetRequest( + type_filter=type_filter, + model_filter=model_filter, + page_size=page_size, + page=page, + q=q, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/judges", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_judges_v1_observability_judges_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListJudgesResponse, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def fetch( + self, + *, + judge_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Judge: + r"""Get judge by id + + :param judge_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequest( + judge_id=judge_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/judges/{judge_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_judge_by_id_v1_observability_judges__judge_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Judge, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_async( + self, + *, + judge_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.Judge: + r"""Get judge by id + + :param judge_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequest( + judge_id=judge_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/judges/{judge_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_judge_by_id_v1_observability_judges__judge_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.Judge, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + judge_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a judge + + :param judge_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequest( + judge_id=judge_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/observability/judges/{judge_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_judge_v1_observability_judges__judge_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + judge_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a judge + + :param judge_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequest( + judge_id=judge_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/observability/judges/{judge_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_judge_v1_observability_judges__judge_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update( + self, + *, + judge_id: str, + name: str, + description: str, + model_name: str, + output: Union[ + models.UpdateJudgeRequestOutput, models.UpdateJudgeRequestOutputTypedDict + ], + instructions: str, + tools: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Update a judge + + :param judge_id: + :param name: + :param description: + :param model_name: + :param output: + :param instructions: + :param tools: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequest( + judge_id=judge_id, + update_judge_request=models.UpdateJudgeRequest( + name=name, + description=description, + model_name=model_name, + output=utils.get_pydantic_model( + output, models.UpdateJudgeRequestOutput + ), + instructions=instructions, + tools=tools, + ), + ) + + req = self._build_request( + method="PUT", + path="/v1/observability/judges/{judge_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_judge_request, + False, + False, + "json", + models.UpdateJudgeRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_judge_v1_observability_judges__judge_id__put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_async( + self, + *, + judge_id: str, + name: str, + description: str, + model_name: str, + output: Union[ + models.UpdateJudgeRequestOutput, models.UpdateJudgeRequestOutputTypedDict + ], + instructions: str, + tools: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Update a judge + + :param judge_id: + :param name: + :param description: + :param model_name: + :param output: + :param instructions: + :param tools: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequest( + judge_id=judge_id, + update_judge_request=models.UpdateJudgeRequest( + name=name, + description=description, + model_name=model_name, + output=utils.get_pydantic_model( + output, models.UpdateJudgeRequestOutput + ), + instructions=instructions, + tools=tools, + ), + ) + + req = self._build_request_async( + method="PUT", + path="/v1/observability/judges/{judge_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_judge_request, + False, + False, + "json", + models.UpdateJudgeRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_judge_v1_observability_judges__judge_id__put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def judge_conversation( + self, + *, + judge_id: str, + messages: List[Dict[str, Any]], + properties: OptionalNullable[Dict[str, Any]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JudgeOutput: + r"""Run a saved judge on a conversation + + :param judge_id: + :param messages: + :param properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequest( + judge_id=judge_id, + judge_conversation_request=models.JudgeConversationRequest( + messages=messages, + properties=properties, + ), + ) + ) + + req = self._build_request( + method="POST", + path="/v1/observability/judges/{judge_id}/live-judging", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.judge_conversation_request, + False, + False, + "json", + models.JudgeConversationRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="judge_conversation_v1_observability_judges__judge_id__live_judging_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.JudgeOutput, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def judge_conversation_async( + self, + *, + judge_id: str, + messages: List[Dict[str, Any]], + properties: OptionalNullable[Dict[str, Any]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JudgeOutput: + r"""Run a saved judge on a conversation + + :param judge_id: + :param messages: + :param properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequest( + judge_id=judge_id, + judge_conversation_request=models.JudgeConversationRequest( + messages=messages, + properties=properties, + ), + ) + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/judges/{judge_id}/live-judging", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.judge_conversation_request, + False, + False, + "json", + models.JudgeConversationRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="judge_conversation_v1_observability_judges__judge_id__live_judging_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.JudgeOutput, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/libraries.py b/src/mistralai/client/libraries.py similarity index 76% rename from src/mistralai/libraries.py rename to src/mistralai/client/libraries.py index e9f19047..928c1ea8 100644 --- a/src/mistralai/libraries.py +++ b/src/mistralai/client/libraries.py @@ -1,14 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d43a5f78045f from .basesdk import BaseSDK from .sdkconfiguration import SDKConfiguration -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.accesses import Accesses -from mistralai.documents import Documents -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.accesses import Accesses +from mistralai.client.documents import Documents +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -34,15 +35,23 @@ def _init_sdks(self): def list( self, *, + page_size: Optional[int] = 100, + page: Optional[int] = 0, + search: OptionalNullable[str] = UNSET, + filter_owned_by_me: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListLibraryOut: + ) -> models.ListLibrariesResponse: r"""List all libraries you have access to. List all libraries that you have created or have been shared with you. + :param page_size: + :param page: + :param search: Case-insensitive search on the library name. + :param filter_owned_by_me: Filter libraries by whether they were created by the current authenticated identity. Set to true for created by me, false for only libraries shared with me, or None to disable this filter. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -53,16 +62,27 @@ def list( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.LibrariesListV1Request( + page_size=page_size, + page=page, + search=search, + filter_owned_by_me=filter_owned_by_me, + ) + req = self._build_request( method="GET", path="/v1/libraries", base_url=base_url, url_variables=url_variables, - request=None, + request=request, request_body_required=False, request_has_path_params=False, request_has_query_params=True, @@ -70,6 +90,7 @@ def list( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -86,39 +107,53 @@ def list( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_list_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), ), request=req, - error_status_codes=["4XX", "5XX"], + error_status_codes=["422", "4XX", "5XX"], retry_config=retry_config, ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListLibraryOut, http_res) + return unmarshal_json_response(models.ListLibrariesResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, *, + page_size: Optional[int] = 100, + page: Optional[int] = 0, + search: OptionalNullable[str] = UNSET, + filter_owned_by_me: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ListLibraryOut: + ) -> models.ListLibrariesResponse: r"""List all libraries you have access to. List all libraries that you have created or have been shared with you. + :param page_size: + :param page: + :param search: Case-insensitive search on the library name. + :param filter_owned_by_me: Filter libraries by whether they were created by the current authenticated identity. Set to true for created by me, false for only libraries shared with me, or None to disable this filter. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -129,16 +164,27 @@ async def list_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.LibrariesListV1Request( + page_size=page_size, + page=page, + search=search, + filter_owned_by_me=filter_owned_by_me, + ) + req = self._build_request_async( method="GET", path="/v1/libraries", base_url=base_url, url_variables=url_variables, - request=None, + request=request, request_body_required=False, request_has_path_params=False, request_has_query_params=True, @@ -146,6 +192,7 @@ async def list_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -162,26 +209,32 @@ async def list_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_list_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), ), request=req, - error_status_codes=["4XX", "5XX"], + error_status_codes=["422", "4XX", "5XX"], retry_config=retry_config, ) + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ListLibraryOut, http_res) + return unmarshal_json_response(models.ListLibrariesResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def create( self, @@ -189,18 +242,20 @@ def create( name: str, description: OptionalNullable[str] = UNSET, chunk_size: OptionalNullable[int] = UNSET, + owner_type: OptionalNullable[models.OwnerType] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.LibraryOut: + ) -> models.Library: r"""Create a new Library. Create a new Library, you will be marked as the owner and only you will have the possibility to share it with others. When first created this will only be accessible by you. :param name: :param description: - :param chunk_size: + :param chunk_size: The size of the chunks (in characters) to split document text into. Must be between 256 and 32768. + :param owner_type: Determines who owns the created library. 'User' creates a private library accessible only to its owner. 'Workspace' creates a library shared with the workspace. Defaults to 'Workspace' for API key sessions. Only API keys with the 'Private and shared connectors' connector access scope can create private, user-owned libraries. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -211,15 +266,19 @@ def create( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) - request = models.LibraryIn( + request = models.CreateLibraryRequest( name=name, description=description, chunk_size=chunk_size, + owner_type=owner_type, ) req = self._build_request( @@ -236,8 +295,9 @@ def create( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.LibraryIn + request, False, False, "json", models.CreateLibraryRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -254,7 +314,7 @@ def create( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_create_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -266,20 +326,20 @@ def create( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return unmarshal_json_response(models.LibraryOut, http_res) + return unmarshal_json_response(models.Library, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def create_async( self, @@ -287,18 +347,20 @@ async def create_async( name: str, description: OptionalNullable[str] = UNSET, chunk_size: OptionalNullable[int] = UNSET, + owner_type: OptionalNullable[models.OwnerType] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.LibraryOut: + ) -> models.Library: r"""Create a new Library. Create a new Library, you will be marked as the owner and only you will have the possibility to share it with others. When first created this will only be accessible by you. :param name: :param description: - :param chunk_size: + :param chunk_size: The size of the chunks (in characters) to split document text into. Must be between 256 and 32768. + :param owner_type: Determines who owns the created library. 'User' creates a private library accessible only to its owner. 'Workspace' creates a library shared with the workspace. Defaults to 'Workspace' for API key sessions. Only API keys with the 'Private and shared connectors' connector access scope can create private, user-owned libraries. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -309,15 +371,19 @@ async def create_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) - request = models.LibraryIn( + request = models.CreateLibraryRequest( name=name, description=description, chunk_size=chunk_size, + owner_type=owner_type, ) req = self._build_request_async( @@ -334,8 +400,9 @@ async def create_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.LibraryIn + request, False, False, "json", models.CreateLibraryRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -352,7 +419,7 @@ async def create_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_create_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -364,20 +431,20 @@ async def create_async( response_data: Any = None if utils.match_response(http_res, "201", "application/json"): - return unmarshal_json_response(models.LibraryOut, http_res) + return unmarshal_json_response(models.Library, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def get( self, @@ -387,7 +454,7 @@ def get( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.LibraryOut: + ) -> models.Library: r"""Detailed information about a specific Library. Given a library id, details information about that Library. @@ -403,6 +470,9 @@ def get( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -425,6 +495,7 @@ def get( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -441,7 +512,7 @@ def get( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_get_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -453,20 +524,20 @@ def get( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.LibraryOut, http_res) + return unmarshal_json_response(models.Library, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def get_async( self, @@ -476,7 +547,7 @@ async def get_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.LibraryOut: + ) -> models.Library: r"""Detailed information about a specific Library. Given a library id, details information about that Library. @@ -492,6 +563,9 @@ async def get_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -514,6 +588,7 @@ async def get_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -530,7 +605,7 @@ async def get_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_get_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -542,20 +617,20 @@ async def get_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.LibraryOut, http_res) + return unmarshal_json_response(models.Library, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def delete( self, @@ -565,7 +640,7 @@ def delete( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.LibraryOut: + ) -> models.Library: r"""Delete a library and all of it's document. Given a library id, deletes it together with all documents that have been uploaded to that library. @@ -581,6 +656,9 @@ def delete( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -603,6 +681,7 @@ def delete( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -619,7 +698,7 @@ def delete( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_delete_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -631,20 +710,20 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.LibraryOut, http_res) + return unmarshal_json_response(models.Library, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def delete_async( self, @@ -654,7 +733,7 @@ async def delete_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.LibraryOut: + ) -> models.Library: r"""Delete a library and all of it's document. Given a library id, deletes it together with all documents that have been uploaded to that library. @@ -670,6 +749,9 @@ async def delete_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -692,6 +774,7 @@ async def delete_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -708,7 +791,7 @@ async def delete_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_delete_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -720,32 +803,32 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.LibraryOut, http_res) + return unmarshal_json_response(models.Library, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def update( self, *, library_id: str, - name: OptionalNullable[str] = UNSET, + name: Optional[str] = None, description: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.LibraryOut: + ) -> models.Library: r"""Update a library. Given a library id, you can update the name and description. @@ -763,6 +846,9 @@ def update( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -770,7 +856,7 @@ def update( request = models.LibrariesUpdateV1Request( library_id=library_id, - library_in_update=models.LibraryInUpdate( + update_library_request=models.UpdateLibraryRequest( name=name, description=description, ), @@ -790,8 +876,13 @@ def update( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.library_in_update, False, False, "json", models.LibraryInUpdate + request.update_library_request, + False, + False, + "json", + models.UpdateLibraryRequest, ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -808,7 +899,7 @@ def update( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_update_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -820,32 +911,32 @@ def update( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.LibraryOut, http_res) + return unmarshal_json_response(models.Library, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def update_async( self, *, library_id: str, - name: OptionalNullable[str] = UNSET, + name: Optional[str] = None, description: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.LibraryOut: + ) -> models.Library: r"""Update a library. Given a library id, you can update the name and description. @@ -863,6 +954,9 @@ async def update_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -870,7 +964,7 @@ async def update_async( request = models.LibrariesUpdateV1Request( library_id=library_id, - library_in_update=models.LibraryInUpdate( + update_library_request=models.UpdateLibraryRequest( name=name, description=description, ), @@ -890,8 +984,13 @@ async def update_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.library_in_update, False, False, "json", models.LibraryInUpdate + request.update_library_request, + False, + False, + "json", + models.UpdateLibraryRequest, ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -908,7 +1007,7 @@ async def update_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="libraries_update_v1", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -920,17 +1019,17 @@ async def update_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.LibraryOut, http_res) + return unmarshal_json_response(models.Library, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/metrics.py b/src/mistralai/client/metrics.py new file mode 100644 index 00000000..60597c40 --- /dev/null +++ b/src/mistralai/client/metrics.py @@ -0,0 +1,249 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 937cb03f8130 + +from .basesdk import BaseSDK +from datetime import datetime +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional + + +class Metrics(BaseSDK): + def get_workflow_metrics( + self, + *, + workflow_name: str, + start_time: OptionalNullable[datetime] = UNSET, + end_time: OptionalNullable[datetime] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowMetrics: + r"""Get Workflow Metrics + + Get comprehensive metrics for a specific workflow. + + Args: + workflow_name: The name of the workflow type to get metrics for + start_time: Optional start time filter (ISO 8601 format) + end_time: Optional end time filter (ISO 8601 format) + + Returns: + WorkflowMetrics: Dictionary containing metrics: + - execution_count: Total number of executions + - success_count: Number of successful executions + - error_count: Number of failed/terminated executions + - average_latency_ms: Average execution duration in milliseconds + - retry_rate: Proportion of workflows with retries + - latency_over_time: Time-series data of execution durations + + Example: + GET /v1/workflows/MyWorkflow/metrics + GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z + GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z&end_time=2025-12-31T23:59:59Z + + :param workflow_name: + :param start_time: Filter workflows started after this time (ISO 8601) + :param end_time: Filter workflows started before this time (ISO 8601) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequest( + workflow_name=workflow_name, + start_time=start_time, + end_time=end_time, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/{workflow_name}/metrics", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_metrics_v1_workflows__workflow_name__metrics_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowMetrics, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_metrics_async( + self, + *, + workflow_name: str, + start_time: OptionalNullable[datetime] = UNSET, + end_time: OptionalNullable[datetime] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowMetrics: + r"""Get Workflow Metrics + + Get comprehensive metrics for a specific workflow. + + Args: + workflow_name: The name of the workflow type to get metrics for + start_time: Optional start time filter (ISO 8601 format) + end_time: Optional end time filter (ISO 8601 format) + + Returns: + WorkflowMetrics: Dictionary containing metrics: + - execution_count: Total number of executions + - success_count: Number of successful executions + - error_count: Number of failed/terminated executions + - average_latency_ms: Average execution duration in milliseconds + - retry_rate: Proportion of workflows with retries + - latency_over_time: Time-series data of execution durations + + Example: + GET /v1/workflows/MyWorkflow/metrics + GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z + GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z&end_time=2025-12-31T23:59:59Z + + :param workflow_name: + :param start_time: Filter workflows started after this time (ISO 8601) + :param end_time: Filter workflows started before this time (ISO 8601) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequest( + workflow_name=workflow_name, + start_time=start_time, + end_time=end_time, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/{workflow_name}/metrics", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_metrics_v1_workflows__workflow_name__metrics_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowMetrics, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/models/__init__.py b/src/mistralai/client/models/__init__.py new file mode 100644 index 00000000..ab36240c --- /dev/null +++ b/src/mistralai/client/models/__init__.py @@ -0,0 +1,5204 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e0e8dad92725 + +from .filtergroup import ( + And, + AndTypedDict, + FilterGroup, + FilterGroupTypedDict, + Or, + OrTypedDict, +) +from typing import Any, TYPE_CHECKING + +from mistralai.client.utils.dynamic_imports import lazy_getattr, lazy_dir + +if TYPE_CHECKING: + from .activitytaskcompletedattributesresponse import ( + ActivityTaskCompletedAttributesResponse, + ActivityTaskCompletedAttributesResponseTypedDict, + ) + from .activitytaskcompletedresponse import ( + ActivityTaskCompletedResponse, + ActivityTaskCompletedResponseTypedDict, + ) + from .activitytaskfailedattributes import ( + ActivityTaskFailedAttributes, + ActivityTaskFailedAttributesTypedDict, + ) + from .activitytaskfailedresponse import ( + ActivityTaskFailedResponse, + ActivityTaskFailedResponseTypedDict, + ) + from .activitytaskretryingattributes import ( + ActivityTaskRetryingAttributes, + ActivityTaskRetryingAttributesTypedDict, + ) + from .activitytaskretryingresponse import ( + ActivityTaskRetryingResponse, + ActivityTaskRetryingResponseTypedDict, + ) + from .activitytaskstartedattributesresponse import ( + ActivityTaskStartedAttributesResponse, + ActivityTaskStartedAttributesResponseTypedDict, + ) + from .activitytaskstartedresponse import ( + ActivityTaskStartedResponse, + ActivityTaskStartedResponseTypedDict, + ) + from .agent import ( + Agent, + AgentTool, + AgentToolTypedDict, + AgentTypedDict, + UnknownAgentTool, + ) + from .agentaliasresponse import AgentAliasResponse, AgentAliasResponseTypedDict + from .agentconversation import ( + AgentConversation, + AgentConversationAgentVersion, + AgentConversationAgentVersionTypedDict, + AgentConversationTypedDict, + ) + from .agenthandoffdoneevent import ( + AgentHandoffDoneEvent, + AgentHandoffDoneEventTypedDict, + ) + from .agenthandoffentry import AgentHandoffEntry, AgentHandoffEntryTypedDict + from .agenthandoffstartedevent import ( + AgentHandoffStartedEvent, + AgentHandoffStartedEventTypedDict, + ) + from .agents_api_v1_agents_create_or_update_aliasop import ( + AgentsAPIV1AgentsCreateOrUpdateAliasRequest, + AgentsAPIV1AgentsCreateOrUpdateAliasRequestTypedDict, + ) + from .agents_api_v1_agents_delete_aliasop import ( + AgentsAPIV1AgentsDeleteAliasRequest, + AgentsAPIV1AgentsDeleteAliasRequestTypedDict, + ) + from .agents_api_v1_agents_deleteop import ( + AgentsAPIV1AgentsDeleteRequest, + AgentsAPIV1AgentsDeleteRequestTypedDict, + ) + from .agents_api_v1_agents_get_versionop import ( + AgentsAPIV1AgentsGetVersionRequest, + AgentsAPIV1AgentsGetVersionRequestTypedDict, + ) + from .agents_api_v1_agents_getop import ( + AgentsAPIV1AgentsGetAgentVersion, + AgentsAPIV1AgentsGetAgentVersionTypedDict, + AgentsAPIV1AgentsGetRequest, + AgentsAPIV1AgentsGetRequestTypedDict, + ) + from .agents_api_v1_agents_list_version_aliasesop import ( + AgentsAPIV1AgentsListVersionAliasesRequest, + AgentsAPIV1AgentsListVersionAliasesRequestTypedDict, + ) + from .agents_api_v1_agents_list_versionsop import ( + AgentsAPIV1AgentsListVersionsRequest, + AgentsAPIV1AgentsListVersionsRequestTypedDict, + ) + from .agents_api_v1_agents_listop import ( + AgentsAPIV1AgentsListRequest, + AgentsAPIV1AgentsListRequestTypedDict, + ) + from .agents_api_v1_agents_update_versionop import ( + AgentsAPIV1AgentsUpdateVersionRequest, + AgentsAPIV1AgentsUpdateVersionRequestTypedDict, + ) + from .agents_api_v1_agents_updateop import ( + AgentsAPIV1AgentsUpdateRequest, + AgentsAPIV1AgentsUpdateRequestTypedDict, + ) + from .agents_api_v1_conversations_append_streamop import ( + AgentsAPIV1ConversationsAppendStreamRequest, + AgentsAPIV1ConversationsAppendStreamRequestTypedDict, + ) + from .agents_api_v1_conversations_appendop import ( + AgentsAPIV1ConversationsAppendRequest, + AgentsAPIV1ConversationsAppendRequestTypedDict, + ) + from .agents_api_v1_conversations_deleteop import ( + AgentsAPIV1ConversationsDeleteRequest, + AgentsAPIV1ConversationsDeleteRequestTypedDict, + ) + from .agents_api_v1_conversations_getop import ( + AgentsAPIV1ConversationsGetRequest, + AgentsAPIV1ConversationsGetRequestTypedDict, + ResponseV1ConversationsGet, + ResponseV1ConversationsGetTypedDict, + ) + from .agents_api_v1_conversations_historyop import ( + AgentsAPIV1ConversationsHistoryRequest, + AgentsAPIV1ConversationsHistoryRequestTypedDict, + ) + from .agents_api_v1_conversations_listop import ( + AgentsAPIV1ConversationsListRequest, + AgentsAPIV1ConversationsListRequestTypedDict, + AgentsAPIV1ConversationsListResponse, + AgentsAPIV1ConversationsListResponseTypedDict, + ) + from .agents_api_v1_conversations_messagesop import ( + AgentsAPIV1ConversationsMessagesRequest, + AgentsAPIV1ConversationsMessagesRequestTypedDict, + ) + from .agents_api_v1_conversations_restart_streamop import ( + AgentsAPIV1ConversationsRestartStreamRequest, + AgentsAPIV1ConversationsRestartStreamRequestTypedDict, + ) + from .agents_api_v1_conversations_restartop import ( + AgentsAPIV1ConversationsRestartRequest, + AgentsAPIV1ConversationsRestartRequestTypedDict, + ) + from .agentscompletionrequest import ( + AgentsCompletionRequest, + AgentsCompletionRequestMessage, + AgentsCompletionRequestMessageTypedDict, + AgentsCompletionRequestStop, + AgentsCompletionRequestStopTypedDict, + AgentsCompletionRequestTool, + AgentsCompletionRequestToolChoice, + AgentsCompletionRequestToolChoiceTypedDict, + AgentsCompletionRequestToolTypedDict, + AgentsCompletionRequestTypedDict, + ) + from .agentscompletionstreamrequest import ( + AgentsCompletionStreamRequest, + AgentsCompletionStreamRequestMessage, + AgentsCompletionStreamRequestMessageTypedDict, + AgentsCompletionStreamRequestStop, + AgentsCompletionStreamRequestStopTypedDict, + AgentsCompletionStreamRequestTool, + AgentsCompletionStreamRequestToolChoice, + AgentsCompletionStreamRequestToolChoiceTypedDict, + AgentsCompletionStreamRequestToolTypedDict, + AgentsCompletionStreamRequestTypedDict, + ) + from .annotations import Annotations, AnnotationsTypedDict, Audience + from .apiendpoint import APIEndpoint + from .apikeyauth import APIKeyAuth, APIKeyAuthTypedDict + from .archive_workflow_v1_workflows_workflow_identifier_archive_putop import ( + ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequest, + ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequestTypedDict, + ) + from .archivemodelresponse import ( + ArchiveModelResponse, + ArchiveModelResponseTypedDict, + ) + from .assistantmessage import ( + AssistantMessage, + AssistantMessageContent, + AssistantMessageContentTypedDict, + AssistantMessageTypedDict, + ) + from .audiochunk import AudioChunk, AudioChunkTypedDict + from .audiocontent import AudioContent, AudioContentTypedDict + from .audioencoding import AudioEncoding + from .audioformat import AudioFormat, AudioFormatTypedDict + from .audiotranscriptionrequest import ( + AudioTranscriptionRequest, + AudioTranscriptionRequestTypedDict, + ) + from .audiotranscriptionrequeststream import ( + AudioTranscriptionRequestStream, + AudioTranscriptionRequestStreamTypedDict, + ) + from .authdata import AuthData, AuthDataTypedDict + from .authenticationconfiguration import ( + AuthenticationConfiguration, + AuthenticationConfigurationTypedDict, + ) + from .authurlresponse import AuthURLResponse, AuthURLResponseTypedDict + from .basefielddefinition import ( + BaseFieldDefinition, + BaseFieldDefinitionType, + BaseFieldDefinitionTypedDict, + SupportedOperator, + ) + from .basemodelcard import BaseModelCard, BaseModelCardTypedDict + from .basetaskstatus import BaseTaskStatus + from .batcherror import BatchError, BatchErrorTypedDict + from .batchexecutionbody import BatchExecutionBody, BatchExecutionBodyTypedDict + from .batchexecutionresponse import ( + BatchExecutionResponse, + BatchExecutionResponseTypedDict, + ) + from .batchexecutionresult import ( + BatchExecutionResult, + BatchExecutionResultTypedDict, + ) + from .batchjob import BatchJob, BatchJobTypedDict + from .batchjobstatus import BatchJobStatus + from .batchrequest import BatchRequest, BatchRequestTypedDict + from .blobresourcecontents import ( + BlobResourceContents, + BlobResourceContentsTypedDict, + ) + from .builtinconnectors import BuiltInConnectors + from .campaign import Campaign, CampaignTypedDict + from .cancel_workflow_execution_v1_workflows_executions_execution_id_cancel_postop import ( + CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequest, + CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequestTypedDict, + ) + from .chatclassificationrequest import ( + ChatClassificationRequest, + ChatClassificationRequestTypedDict, + ) + from .chatcompletionchoice import ( + ChatCompletionChoice, + ChatCompletionChoiceFinishReason, + ChatCompletionChoiceTypedDict, + ) + from .chatcompletionevent import ( + ChatCompletionEvent, + ChatCompletionEventExtraFields, + ChatCompletionEventExtraFieldsTypedDict, + ChatCompletionEventTypedDict, + ) + from .chatcompletioneventpreview import ( + ChatCompletionEventPreview, + ChatCompletionEventPreviewExtraFields, + ChatCompletionEventPreviewExtraFieldsTypedDict, + ChatCompletionEventPreviewTypedDict, + ) + from .chatcompletionrequest import ( + ChatCompletionRequest, + ChatCompletionRequestMessage, + ChatCompletionRequestMessageTypedDict, + ChatCompletionRequestStop, + ChatCompletionRequestStopTypedDict, + ChatCompletionRequestTool, + ChatCompletionRequestToolChoice, + ChatCompletionRequestToolChoiceTypedDict, + ChatCompletionRequestToolTypedDict, + ChatCompletionRequestTypedDict, + ) + from .chatcompletionresponse import ( + ChatCompletionResponse, + ChatCompletionResponseTypedDict, + ) + from .chatcompletionstreamrequest import ( + ChatCompletionStreamRequest, + ChatCompletionStreamRequestMessage, + ChatCompletionStreamRequestMessageTypedDict, + ChatCompletionStreamRequestStop, + ChatCompletionStreamRequestStopTypedDict, + ChatCompletionStreamRequestTool, + ChatCompletionStreamRequestToolChoice, + ChatCompletionStreamRequestToolChoiceTypedDict, + ChatCompletionStreamRequestToolTypedDict, + ChatCompletionStreamRequestTypedDict, + ) + from .chatmoderationrequest import ( + ChatModerationRequest, + ChatModerationRequestInputs1, + ChatModerationRequestInputs1TypedDict, + ChatModerationRequestInputs2, + ChatModerationRequestInputs2TypedDict, + ChatModerationRequestInputs3, + ChatModerationRequestInputs3TypedDict, + ChatModerationRequestTypedDict, + ) + from .chattranscriptionevent import ( + ChatTranscriptionEvent, + ChatTranscriptionEventTypedDict, + ) + from .checkpoint import Checkpoint, CheckpointTypedDict + from .classificationrequest import ( + ClassificationRequest, + ClassificationRequestInputs, + ClassificationRequestInputsTypedDict, + ClassificationRequestTypedDict, + ) + from .classificationresponse import ( + ClassificationResponse, + ClassificationResponseTypedDict, + ) + from .classificationtargetresult import ( + ClassificationTargetResult, + ClassificationTargetResultTypedDict, + ) + from .classifierfinetunedmodel import ( + ClassifierFineTunedModel, + ClassifierFineTunedModelTypedDict, + ) + from .classifierfinetuningjob import ( + ClassifierFineTuningJob, + ClassifierFineTuningJobIntegration, + ClassifierFineTuningJobIntegrationTypedDict, + ClassifierFineTuningJobStatus, + ClassifierFineTuningJobTypedDict, + UnknownClassifierFineTuningJobIntegration, + ) + from .classifierfinetuningjobdetails import ( + ClassifierFineTuningJobDetails, + ClassifierFineTuningJobDetailsIntegration, + ClassifierFineTuningJobDetailsIntegrationTypedDict, + ClassifierFineTuningJobDetailsStatus, + ClassifierFineTuningJobDetailsTypedDict, + UnknownClassifierFineTuningJobDetailsIntegration, + ) + from .classifiertarget import ClassifierTarget, ClassifierTargetTypedDict + from .classifiertargetresult import ( + ClassifierTargetResult, + ClassifierTargetResultTypedDict, + ) + from .classifiertrainingparameters import ( + ClassifierTrainingParameters, + ClassifierTrainingParametersTypedDict, + ) + from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict + from .completionargs import CompletionArgs, CompletionArgsTypedDict + from .completionargsstop import CompletionArgsStop, CompletionArgsStopTypedDict + from .completionchunk import CompletionChunk, CompletionChunkTypedDict + from .completionevent import CompletionEvent, CompletionEventTypedDict + from .completionfinetunedmodel import ( + CompletionFineTunedModel, + CompletionFineTunedModelTypedDict, + ) + from .completionfinetuningjob import ( + CompletionFineTuningJob, + CompletionFineTuningJobIntegration, + CompletionFineTuningJobIntegrationTypedDict, + CompletionFineTuningJobRepository, + CompletionFineTuningJobRepositoryTypedDict, + CompletionFineTuningJobStatus, + CompletionFineTuningJobTypedDict, + UnknownCompletionFineTuningJobIntegration, + UnknownCompletionFineTuningJobRepository, + ) + from .completionfinetuningjobdetails import ( + CompletionFineTuningJobDetails, + CompletionFineTuningJobDetailsIntegration, + CompletionFineTuningJobDetailsIntegrationTypedDict, + CompletionFineTuningJobDetailsRepository, + CompletionFineTuningJobDetailsRepositoryTypedDict, + CompletionFineTuningJobDetailsStatus, + CompletionFineTuningJobDetailsTypedDict, + UnknownCompletionFineTuningJobDetailsIntegration, + UnknownCompletionFineTuningJobDetailsRepository, + ) + from .completionresponsestreamchoice import ( + CompletionResponseStreamChoice, + CompletionResponseStreamChoiceFinishReason, + CompletionResponseStreamChoiceTypedDict, + ) + from .completiontrainingparameters import ( + CompletionTrainingParameters, + CompletionTrainingParametersTypedDict, + ) + from .connectioncredentials import ( + ConnectionCredentials, + ConnectionCredentialsTypedDict, + ) + from .connector import Connector, ConnectorTypedDict + from .connector_call_tool_v1op import ( + ConnectorCallToolV1Request, + ConnectorCallToolV1RequestTypedDict, + ) + from .connector_create_or_update_organization_credentials_v1op import ( + ConnectorCreateOrUpdateOrganizationCredentialsV1Request, + ConnectorCreateOrUpdateOrganizationCredentialsV1RequestTypedDict, + ) + from .connector_create_or_update_user_credentials_v1op import ( + ConnectorCreateOrUpdateUserCredentialsV1Request, + ConnectorCreateOrUpdateUserCredentialsV1RequestTypedDict, + ) + from .connector_create_or_update_workspace_credentials_v1op import ( + ConnectorCreateOrUpdateWorkspaceCredentialsV1Request, + ConnectorCreateOrUpdateWorkspaceCredentialsV1RequestTypedDict, + ) + from .connector_delete_organization_credentials_v1op import ( + ConnectorDeleteOrganizationCredentialsV1Request, + ConnectorDeleteOrganizationCredentialsV1RequestTypedDict, + ) + from .connector_delete_user_credentials_v1op import ( + ConnectorDeleteUserCredentialsV1Request, + ConnectorDeleteUserCredentialsV1RequestTypedDict, + ) + from .connector_delete_v1op import ( + ConnectorDeleteV1Request, + ConnectorDeleteV1RequestTypedDict, + ) + from .connector_delete_workspace_credentials_v1op import ( + ConnectorDeleteWorkspaceCredentialsV1Request, + ConnectorDeleteWorkspaceCredentialsV1RequestTypedDict, + ) + from .connector_get_auth_url_v1op import ( + ConnectorGetAuthURLV1Request, + ConnectorGetAuthURLV1RequestTypedDict, + ) + from .connector_get_authentication_methods_v1op import ( + ConnectorGetAuthenticationMethodsV1Request, + ConnectorGetAuthenticationMethodsV1RequestTypedDict, + ) + from .connector_get_v1op import ( + ConnectorGetV1Request, + ConnectorGetV1RequestTypedDict, + ) + from .connector_list_organization_credentials_v1op import ( + ConnectorListOrganizationCredentialsV1Request, + ConnectorListOrganizationCredentialsV1RequestTypedDict, + ) + from .connector_list_tools_v1op import ( + ConnectorListToolsV1Request, + ConnectorListToolsV1RequestTypedDict, + ResponseConnectorListToolsV1, + ResponseConnectorListToolsV1TypedDict, + ) + from .connector_list_user_credentials_v1op import ( + ConnectorListUserCredentialsV1Request, + ConnectorListUserCredentialsV1RequestTypedDict, + ) + from .connector_list_v1op import ( + ConnectorListV1Request, + ConnectorListV1RequestTypedDict, + ) + from .connector_list_workspace_credentials_v1op import ( + ConnectorListWorkspaceCredentialsV1Request, + ConnectorListWorkspaceCredentialsV1RequestTypedDict, + ) + from .connector_update_v1op import ( + ConnectorUpdateV1Request, + ConnectorUpdateV1RequestTypedDict, + ) + from .connectorauthenticationheader import ( + ConnectorAuthenticationHeader, + ConnectorAuthenticationHeaderTypedDict, + ) + from .connectorcalltoolrequest import ( + ConnectorCallToolRequest, + ConnectorCallToolRequestTypedDict, + ) + from .connectorsqueryfilters import ( + ConnectorsQueryFilters, + ConnectorsQueryFiltersTypedDict, + ) + from .connectortool import ConnectorTool, ConnectorToolTypedDict + from .connectortoolcallmetadata import ( + ConnectorToolCallMetadata, + ConnectorToolCallMetadataTypedDict, + ) + from .connectortoolcallresponse import ( + ConnectorToolCallResponse, + ConnectorToolCallResponseContent, + ConnectorToolCallResponseContentTypedDict, + ConnectorToolCallResponseTypedDict, + UnknownConnectorToolCallResponseContent, + ) + from .connectortoollocale import ConnectorToolLocale, ConnectorToolLocaleTypedDict + from .connectortoolresultmetadata import ( + ConnectorToolResultMetadata, + ConnectorToolResultMetadataTypedDict, + ) + from .contentchunk import ContentChunk, ContentChunkTypedDict, UnknownContentChunk + from .conversationappendrequest import ( + ConversationAppendRequest, + ConversationAppendRequestHandoffExecution, + ConversationAppendRequestTypedDict, + ) + from .conversationappendstreamrequest import ( + ConversationAppendStreamRequest, + ConversationAppendStreamRequestHandoffExecution, + ConversationAppendStreamRequestTypedDict, + ) + from .conversationevents import ( + ConversationEvents, + ConversationEventsData, + ConversationEventsDataTypedDict, + ConversationEventsTypedDict, + UnknownConversationEventsData, + ) + from .conversationhistory import ( + ConversationHistory, + ConversationHistoryTypedDict, + Entry, + EntryTypedDict, + ) + from .conversationinputs import ConversationInputs, ConversationInputsTypedDict + from .conversationmessages import ( + ConversationMessages, + ConversationMessagesTypedDict, + ) + from .conversationpayload import ConversationPayload, ConversationPayloadTypedDict + from .conversationrequest import ( + ConversationRequest, + ConversationRequestAgentVersion, + ConversationRequestAgentVersionTypedDict, + ConversationRequestHandoffExecution, + ConversationRequestTool, + ConversationRequestToolTypedDict, + ConversationRequestTypedDict, + ) + from .conversationresponse import ( + ConversationResponse, + ConversationResponseOutput, + ConversationResponseOutputTypedDict, + ConversationResponseTypedDict, + ) + from .conversationrestartrequest import ( + ConversationRestartRequest, + ConversationRestartRequestAgentVersion, + ConversationRestartRequestAgentVersionTypedDict, + ConversationRestartRequestHandoffExecution, + ConversationRestartRequestTypedDict, + ) + from .conversationrestartstreamrequest import ( + ConversationRestartStreamRequest, + ConversationRestartStreamRequestAgentVersion, + ConversationRestartStreamRequestAgentVersionTypedDict, + ConversationRestartStreamRequestHandoffExecution, + ConversationRestartStreamRequestTypedDict, + ) + from .conversationsource import ConversationSource + from .conversationstreamrequest import ( + ConversationStreamRequest, + ConversationStreamRequestAgentVersion, + ConversationStreamRequestAgentVersionTypedDict, + ConversationStreamRequestHandoffExecution, + ConversationStreamRequestTool, + ConversationStreamRequestToolTypedDict, + ConversationStreamRequestTypedDict, + ) + from .conversationusageinfo import ( + ConversationUsageInfo, + ConversationUsageInfoTypedDict, + ) + from .create_dataset_record_v1_observability_datasets_dataset_id_records_postop import ( + CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequest, + CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequestTypedDict, + ) + from .createagentrequest import ( + CreateAgentRequest, + CreateAgentRequestTool, + CreateAgentRequestToolTypedDict, + CreateAgentRequestTypedDict, + ) + from .createbatchjobrequest import ( + CreateBatchJobRequest, + CreateBatchJobRequestTypedDict, + ) + from .createcampaignrequest import ( + CreateCampaignRequest, + CreateCampaignRequestTypedDict, + ) + from .createconnectorrequest import ( + CreateConnectorRequest, + CreateConnectorRequestTypedDict, + ) + from .createdatasetrecordrequest import ( + CreateDatasetRecordRequest, + CreateDatasetRecordRequestTypedDict, + ) + from .createdatasetrequest import ( + CreateDatasetRequest, + CreateDatasetRequestTypedDict, + ) + from .createfileresponse import CreateFileResponse, CreateFileResponseTypedDict + from .createfinetuningjobrequest import ( + CreateFineTuningJobRequest, + CreateFineTuningJobRequestIntegration, + CreateFineTuningJobRequestIntegrationTypedDict, + CreateFineTuningJobRequestRepository, + CreateFineTuningJobRequestRepositoryTypedDict, + CreateFineTuningJobRequestTypedDict, + Hyperparameters, + HyperparametersTypedDict, + ) + from .creategithubrepositoryrequest import ( + CreateGithubRepositoryRequest, + CreateGithubRepositoryRequestTypedDict, + ) + from .createingestionpipelineconfigurationrequest import ( + CreateIngestionPipelineConfigurationRequest, + CreateIngestionPipelineConfigurationRequestTypedDict, + ) + from .createjudgerequest import ( + CreateJudgeRequest, + CreateJudgeRequestOutput, + CreateJudgeRequestOutputTypedDict, + CreateJudgeRequestTypedDict, + ) + from .createlibraryrequest import ( + CreateLibraryRequest, + CreateLibraryRequestTypedDict, + OwnerType, + ) + from .credentialscreateorupdate import ( + CredentialsCreateOrUpdate, + CredentialsCreateOrUpdateTypedDict, + ) + from .credentialsresponse import CredentialsResponse, CredentialsResponseTypedDict + from .customconnector import ( + Authorization, + AuthorizationTypedDict, + CustomConnector, + CustomConnectorTypedDict, + UnknownAuthorization, + ) + from .customtaskcanceledattributes import ( + CustomTaskCanceledAttributes, + CustomTaskCanceledAttributesTypedDict, + ) + from .customtaskcanceledresponse import ( + CustomTaskCanceledResponse, + CustomTaskCanceledResponseTypedDict, + ) + from .customtaskcompletedattributesresponse import ( + CustomTaskCompletedAttributesResponse, + CustomTaskCompletedAttributesResponseTypedDict, + ) + from .customtaskcompletedresponse import ( + CustomTaskCompletedResponse, + CustomTaskCompletedResponseTypedDict, + ) + from .customtaskfailedattributes import ( + CustomTaskFailedAttributes, + CustomTaskFailedAttributesTypedDict, + ) + from .customtaskfailedresponse import ( + CustomTaskFailedResponse, + CustomTaskFailedResponseTypedDict, + ) + from .customtaskinprogressattributesresponse import ( + CustomTaskInProgressAttributesResponse, + CustomTaskInProgressAttributesResponseTypedDict, + Payload, + PayloadTypedDict, + UnknownPayload, + ) + from .customtaskinprogressresponse import ( + CustomTaskInProgressResponse, + CustomTaskInProgressResponseTypedDict, + ) + from .customtaskstartedattributesresponse import ( + CustomTaskStartedAttributesResponse, + CustomTaskStartedAttributesResponseTypedDict, + ) + from .customtaskstartedresponse import ( + CustomTaskStartedResponse, + CustomTaskStartedResponseTypedDict, + ) + from .customtasktimedoutattributes import ( + CustomTaskTimedOutAttributes, + CustomTaskTimedOutAttributesTypedDict, + ) + from .customtasktimedoutresponse import ( + CustomTaskTimedOutResponse, + CustomTaskTimedOutResponseTypedDict, + ) + from .dataset import Dataset, DatasetTypedDict + from .datasetimporttask import DatasetImportTask, DatasetImportTaskTypedDict + from .datasetpreview import DatasetPreview, DatasetPreviewTypedDict + from .datasetrecord import DatasetRecord, DatasetRecordTypedDict + from .delete_campaign_v1_observability_campaigns_campaign_id_deleteop import ( + DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequest, + DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequestTypedDict, + ) + from .delete_dataset_record_v1_observability_dataset_records_dataset_record_id_deleteop import ( + DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequest, + DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequestTypedDict, + ) + from .delete_dataset_v1_observability_datasets_dataset_id_deleteop import ( + DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequest, + DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequestTypedDict, + ) + from .delete_judge_v1_observability_judges_judge_id_deleteop import ( + DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequest, + DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequestTypedDict, + ) + from .delete_model_v1_models_model_id_deleteop import ( + DeleteModelV1ModelsModelIDDeleteRequest, + DeleteModelV1ModelsModelIDDeleteRequestTypedDict, + ) + from .delete_voice_v1_audio_voices_voice_id_deleteop import ( + DeleteVoiceV1AudioVoicesVoiceIDDeleteRequest, + DeleteVoiceV1AudioVoicesVoiceIDDeleteRequestTypedDict, + ) + from .deletebatchjobresponse import ( + DeleteBatchJobResponse, + DeleteBatchJobResponseTypedDict, + ) + from .deletedatasetrecordsrequest import ( + DeleteDatasetRecordsRequest, + DeleteDatasetRecordsRequestTypedDict, + ) + from .deletefileresponse import DeleteFileResponse, DeleteFileResponseTypedDict + from .deletemodelresponse import DeleteModelResponse, DeleteModelResponseTypedDict + from .deltamessage import ( + DeltaMessage, + DeltaMessageContent, + DeltaMessageContentTypedDict, + DeltaMessageTypedDict, + ) + from .deploymentdetailresponse import ( + DeploymentDetailResponse, + DeploymentDetailResponseTypedDict, + ) + from .deploymentlistresponse import ( + DeploymentListResponse, + DeploymentListResponseTypedDict, + ) + from .deploymentlocation import DeploymentLocation, DeploymentLocationTypedDict + from .deploymentresponse import DeploymentResponse, DeploymentResponseTypedDict + from .deploymentworkerresponse import ( + DeploymentWorkerResponse, + DeploymentWorkerResponseTypedDict, + ) + from .document import Document, DocumentTypedDict + from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict + from .documenttextcontent import DocumentTextContent, DocumentTextContentTypedDict + from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict + from .embeddedresource import ( + EmbeddedResource, + EmbeddedResourceTypedDict, + Resource, + ResourceTypedDict, + ) + from .embeddingdtype import EmbeddingDtype + from .embeddingrequest import ( + EmbeddingRequest, + EmbeddingRequestInputs, + EmbeddingRequestInputsTypedDict, + EmbeddingRequestTypedDict, + ) + from .embeddingresponse import EmbeddingResponse, EmbeddingResponseTypedDict + from .embeddingresponsedata import ( + EmbeddingResponseData, + EmbeddingResponseDataTypedDict, + ) + from .encodedpayloadoptions import EncodedPayloadOptions + from .encodingformat import EncodingFormat + from .entitytype import EntityType + from .event import Event, EventTypedDict + from .eventprogressstatus import EventProgressStatus + from .eventsource import EventSource + from .eventtype import EventType + from .execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop import ( + ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequest, + ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequestTypedDict, + ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost, + ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostTypedDict, + ) + from .execute_workflow_v1_workflows_workflow_identifier_execute_postop import ( + ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequest, + ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequestTypedDict, + ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost, + ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostTypedDict, + ) + from .executionconfig import ExecutionConfig, ExecutionConfigTypedDict + from .export_dataset_to_jsonl_v1_observability_datasets_dataset_id_exports_to_jsonl_getop import ( + ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequest, + ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequestTypedDict, + ) + from .exportdatasetresponse import ( + ExportDatasetResponse, + ExportDatasetResponseTypedDict, + ) + from .failure import Failure, FailureTypedDict + from .feedresultchatcompletioneventpreview import ( + FeedResultChatCompletionEventPreview, + FeedResultChatCompletionEventPreviewTypedDict, + ) + from .fetchcampaignstatusresponse import ( + FetchCampaignStatusResponse, + FetchCampaignStatusResponseTypedDict, + ) + from .fetchchatcompletionfieldoptionsresponse import ( + FetchChatCompletionFieldOptionsResponse, + FetchChatCompletionFieldOptionsResponseTypedDict, + Option, + OptionTypedDict, + ) + from .fetchfieldoptioncountsrequest import ( + FetchFieldOptionCountsRequest, + FetchFieldOptionCountsRequestTypedDict, + ) + from .fetchfieldoptioncountsresponse import ( + FetchFieldOptionCountsResponse, + FetchFieldOptionCountsResponseTypedDict, + ) + from .fieldgroup import FieldGroup, FieldGroupTypedDict + from .fieldoptioncountitem import ( + FieldOptionCountItem, + FieldOptionCountItemTypedDict, + ) + from .file import File, FileTypedDict + from .filechunk import FileChunk, FileChunkTypedDict + from .filepurpose import FilePurpose + from .files_api_routes_delete_fileop import ( + FilesAPIRoutesDeleteFileRequest, + FilesAPIRoutesDeleteFileRequestTypedDict, + ) + from .files_api_routes_download_fileop import ( + FilesAPIRoutesDownloadFileRequest, + FilesAPIRoutesDownloadFileRequestTypedDict, + ) + from .files_api_routes_get_signed_urlop import ( + FilesAPIRoutesGetSignedURLRequest, + FilesAPIRoutesGetSignedURLRequestTypedDict, + ) + from .files_api_routes_list_filesop import ( + FilesAPIRoutesListFilesRequest, + FilesAPIRoutesListFilesRequestTypedDict, + ) + from .files_api_routes_retrieve_fileop import ( + FilesAPIRoutesRetrieveFileRequest, + FilesAPIRoutesRetrieveFileRequestTypedDict, + ) + from .files_api_routes_upload_fileop import ( + FilesAPIRoutesUploadFileFileVisibility, + MultiPartBodyParams, + MultiPartBodyParamsTypedDict, + ) + from .fileschema import FileSchema, FileSchemaTypedDict + from .filevisibility import FileVisibility + from .filtercondition import FilterCondition, FilterConditionTypedDict, Op + from .filterpayload import ( + FilterPayload, + FilterPayloadTypedDict, + Filters, + FiltersTypedDict, + ) + from .fimcompletionrequest import ( + FIMCompletionRequest, + FIMCompletionRequestStop, + FIMCompletionRequestStopTypedDict, + FIMCompletionRequestTypedDict, + ) + from .fimcompletionresponse import ( + FIMCompletionResponse, + FIMCompletionResponseTypedDict, + ) + from .fimcompletionstreamrequest import ( + FIMCompletionStreamRequest, + FIMCompletionStreamRequestStop, + FIMCompletionStreamRequestStopTypedDict, + FIMCompletionStreamRequestTypedDict, + ) + from .finetuneablemodeltype import FineTuneableModelType + from .finetunedmodelcapabilities import ( + FineTunedModelCapabilities, + FineTunedModelCapabilitiesTypedDict, + ) + from .ftclassifierlossfunction import FTClassifierLossFunction + from .ftmodelcard import FTModelCard, FTModelCardTypedDict + from .function import Function, FunctionTypedDict + from .functioncall import ( + Arguments, + ArgumentsTypedDict, + FunctionCall, + FunctionCallTypedDict, + ) + from .functioncallentry import ( + FunctionCallEntry, + FunctionCallEntryConfirmationStatus, + FunctionCallEntryTypedDict, + ) + from .functioncallentryarguments import ( + FunctionCallEntryArguments, + FunctionCallEntryArgumentsTypedDict, + ) + from .functioncallevent import ( + FunctionCallEvent, + FunctionCallEventConfirmationStatus, + FunctionCallEventTypedDict, + ) + from .functionname import FunctionName, FunctionNameTypedDict + from .functionresultentry import FunctionResultEntry, FunctionResultEntryTypedDict + from .functiontool import FunctionTool, FunctionToolTypedDict + from .get_campaign_by_id_v1_observability_campaigns_campaign_id_getop import ( + GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequest, + GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequestTypedDict, + ) + from .get_campaign_selected_events_v1_observability_campaigns_campaign_id_selected_events_getop import ( + GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequest, + GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequestTypedDict, + ) + from .get_campaign_status_by_id_v1_observability_campaigns_campaign_id_status_getop import ( + GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequest, + GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequestTypedDict, + ) + from .get_campaigns_v1_observability_campaigns_getop import ( + GetCampaignsV1ObservabilityCampaignsGetRequest, + GetCampaignsV1ObservabilityCampaignsGetRequestTypedDict, + ) + from .get_chat_completion_event_v1_observability_chat_completion_events_event_id_getop import ( + GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequest, + GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequestTypedDict, + ) + from .get_chat_completion_events_v1_observability_chat_completion_events_search_postop import ( + GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest, + GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequestTypedDict, + ) + from .get_chat_completion_field_options_counts_v1_observability_chat_completion_fields_field_name_options_counts_postop import ( + GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest, + GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequestTypedDict, + ) + from .get_chat_completion_field_options_v1_observability_chat_completion_fields_field_name_options_getop import ( + GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest, + GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequestTypedDict, + Operator, + ) + from .get_dataset_by_id_v1_observability_datasets_dataset_id_getop import ( + GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequest, + GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequestTypedDict, + ) + from .get_dataset_import_task_v1_observability_datasets_dataset_id_tasks_task_id_getop import ( + GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequest, + GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequestTypedDict, + ) + from .get_dataset_import_tasks_v1_observability_datasets_dataset_id_tasks_getop import ( + GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequest, + GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequestTypedDict, + ) + from .get_dataset_record_v1_observability_dataset_records_dataset_record_id_getop import ( + GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequest, + GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequestTypedDict, + ) + from .get_dataset_records_v1_observability_datasets_dataset_id_records_getop import ( + GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequest, + GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequestTypedDict, + ) + from .get_datasets_v1_observability_datasets_getop import ( + GetDatasetsV1ObservabilityDatasetsGetRequest, + GetDatasetsV1ObservabilityDatasetsGetRequestTypedDict, + ) + from .get_deployment_v1_workflows_deployments_name_getop import ( + GetDeploymentV1WorkflowsDeploymentsNameGetRequest, + GetDeploymentV1WorkflowsDeploymentsNameGetRequestTypedDict, + ) + from .get_judge_by_id_v1_observability_judges_judge_id_getop import ( + GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequest, + GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequestTypedDict, + ) + from .get_judges_v1_observability_judges_getop import ( + GetJudgesV1ObservabilityJudgesGetRequest, + GetJudgesV1ObservabilityJudgesGetRequestTypedDict, + ) + from .get_run_history_v1_workflows_runs_run_id_history_getop import ( + GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequest, + GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequestTypedDict, + ) + from .get_run_v1_workflows_runs_run_id_getop import ( + GetRunV1WorkflowsRunsRunIDGetRequest, + GetRunV1WorkflowsRunsRunIDGetRequestTypedDict, + ) + from .get_similar_chat_completion_events_v1_observability_chat_completion_events_event_id_similar_events_getop import ( + GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest, + GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequestTypedDict, + ) + from .get_stream_events_v1_workflows_events_stream_getop import ( + GetStreamEventsV1WorkflowsEventsStreamGetRequest, + GetStreamEventsV1WorkflowsEventsStreamGetRequestTypedDict, + GetStreamEventsV1WorkflowsEventsStreamGetResponseBody, + GetStreamEventsV1WorkflowsEventsStreamGetResponseBodyTypedDict, + Scope, + ) + from .get_voice_sample_audio_v1_audio_voices_voice_id_sample_getop import ( + GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequest, + GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequestTypedDict, + ) + from .get_voice_v1_audio_voices_voice_id_getop import ( + GetVoiceV1AudioVoicesVoiceIDGetRequest, + GetVoiceV1AudioVoicesVoiceIDGetRequestTypedDict, + ) + from .get_workflow_events_v1_workflows_events_list_getop import ( + GetWorkflowEventsV1WorkflowsEventsListGetRequest, + GetWorkflowEventsV1WorkflowsEventsListGetRequestTypedDict, + ) + from .get_workflow_execution_history_v1_workflows_executions_execution_id_history_getop import ( + GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequest, + GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequestTypedDict, + ) + from .get_workflow_execution_trace_eventsop import ( + GetWorkflowExecutionTraceEventsRequest, + GetWorkflowExecutionTraceEventsRequestTypedDict, + ) + from .get_workflow_execution_trace_otelop import ( + GetWorkflowExecutionTraceOtelRequest, + GetWorkflowExecutionTraceOtelRequestTypedDict, + ) + from .get_workflow_execution_trace_summaryop import ( + GetWorkflowExecutionTraceSummaryRequest, + GetWorkflowExecutionTraceSummaryRequestTypedDict, + ) + from .get_workflow_execution_v1_workflows_executions_execution_id_getop import ( + GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequest, + GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequestTypedDict, + ) + from .get_workflow_metrics_v1_workflows_workflow_name_metrics_getop import ( + GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequest, + GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequestTypedDict, + ) + from .get_workflow_registration_v1_workflows_registrations_workflow_registration_id_getop import ( + GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequest, + GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequestTypedDict, + ) + from .get_workflow_registrations_v1_workflows_registrations_getop import ( + GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequest, + GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequestTypedDict, + ) + from .get_workflow_v1_workflows_workflow_identifier_getop import ( + GetWorkflowV1WorkflowsWorkflowIdentifierGetRequest, + GetWorkflowV1WorkflowsWorkflowIdentifierGetRequestTypedDict, + ) + from .get_workflows_v1_workflows_getop import ( + GetWorkflowsV1WorkflowsGetRequest, + GetWorkflowsV1WorkflowsGetRequestTypedDict, + GetWorkflowsV1WorkflowsGetResponse, + GetWorkflowsV1WorkflowsGetResponseTypedDict, + ) + from .getfileresponse import GetFileResponse, GetFileResponseTypedDict + from .getsignedurlresponse import ( + GetSignedURLResponse, + GetSignedURLResponseTypedDict, + ) + from .githubrepository import GithubRepository, GithubRepositoryTypedDict + from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict + from .imagecontent import ImageContent, ImageContentTypedDict + from .imagedetail import ImageDetail + from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict + from .imageurl import ImageURL, ImageURLTypedDict + from .imageurlchunk import ( + ImageURLChunk, + ImageURLChunkTypedDict, + ImageURLUnion, + ImageURLUnionTypedDict, + ) + from .importdatasetfromcampaignrequest import ( + ImportDatasetFromCampaignRequest, + ImportDatasetFromCampaignRequestTypedDict, + ) + from .importdatasetfromdatasetrequest import ( + ImportDatasetFromDatasetRequest, + ImportDatasetFromDatasetRequestTypedDict, + ) + from .importdatasetfromexplorerrequest import ( + ImportDatasetFromExplorerRequest, + ImportDatasetFromExplorerRequestTypedDict, + ) + from .importdatasetfromfilerequest import ( + ImportDatasetFromFileRequest, + ImportDatasetFromFileRequestTypedDict, + ) + from .importdatasetfromplaygroundrequest import ( + ImportDatasetFromPlaygroundRequest, + ImportDatasetFromPlaygroundRequestTypedDict, + ) + from .ingestionpipelineconfiguration import ( + IngestionPipelineConfiguration, + IngestionPipelineConfigurationTypedDict, + ) + from .inputentries import InputEntries, InputEntriesTypedDict + from .inputs import Inputs, InputsTypedDict + from .instructrequest import ( + InstructRequest, + InstructRequestMessage, + InstructRequestMessageTypedDict, + InstructRequestTypedDict, + ) + from .jobmetadata import JobMetadata, JobMetadataTypedDict + from .jobs_api_routes_batch_cancel_batch_jobop import ( + JobsAPIRoutesBatchCancelBatchJobRequest, + JobsAPIRoutesBatchCancelBatchJobRequestTypedDict, + ) + from .jobs_api_routes_batch_delete_batch_jobop import ( + JobsAPIRoutesBatchDeleteBatchJobRequest, + JobsAPIRoutesBatchDeleteBatchJobRequestTypedDict, + ) + from .jobs_api_routes_batch_get_batch_jobop import ( + JobsAPIRoutesBatchGetBatchJobRequest, + JobsAPIRoutesBatchGetBatchJobRequestTypedDict, + ) + from .jobs_api_routes_batch_get_batch_jobsop import ( + JobsAPIRoutesBatchGetBatchJobsRequest, + JobsAPIRoutesBatchGetBatchJobsRequestTypedDict, + OrderBy, + ) + from .jobs_api_routes_fine_tuning_archive_fine_tuned_modelop import ( + JobsAPIRoutesFineTuningArchiveFineTunedModelRequest, + JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict, + ) + from .jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop import ( + JobsAPIRoutesFineTuningCancelFineTuningJobRequest, + JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict, + JobsAPIRoutesFineTuningCancelFineTuningJobResponse, + JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict, + UnknownJobsAPIRoutesFineTuningCancelFineTuningJobResponse, + ) + from .jobs_api_routes_fine_tuning_create_fine_tuning_jobop import ( + JobsAPIRoutesFineTuningCreateFineTuningJobResponse, + JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict, + Response, + ResponseTypedDict, + UnknownResponse, + ) + from .jobs_api_routes_fine_tuning_get_fine_tuning_jobop import ( + JobsAPIRoutesFineTuningGetFineTuningJobRequest, + JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict, + JobsAPIRoutesFineTuningGetFineTuningJobResponse, + JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict, + UnknownJobsAPIRoutesFineTuningGetFineTuningJobResponse, + ) + from .jobs_api_routes_fine_tuning_get_fine_tuning_jobsop import ( + JobsAPIRoutesFineTuningGetFineTuningJobsRequest, + JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict, + JobsAPIRoutesFineTuningGetFineTuningJobsStatus, + ) + from .jobs_api_routes_fine_tuning_start_fine_tuning_jobop import ( + JobsAPIRoutesFineTuningStartFineTuningJobRequest, + JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict, + JobsAPIRoutesFineTuningStartFineTuningJobResponse, + JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict, + UnknownJobsAPIRoutesFineTuningStartFineTuningJobResponse, + ) + from .jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop import ( + JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest, + JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict, + ) + from .jobs_api_routes_fine_tuning_update_fine_tuned_modelop import ( + JobsAPIRoutesFineTuningUpdateFineTunedModelRequest, + JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict, + JobsAPIRoutesFineTuningUpdateFineTunedModelResponse, + JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict, + UnknownJobsAPIRoutesFineTuningUpdateFineTunedModelResponse, + ) + from .jsonpatch import JSONPatch, JSONPatchTypedDict, UnknownJSONPatch + from .jsonpatchadd import JSONPatchAdd, JSONPatchAddTypedDict + from .jsonpatchappend import JSONPatchAppend, JSONPatchAppendTypedDict + from .jsonpatchpayloadresponse import ( + JSONPatchPayloadResponse, + JSONPatchPayloadResponseTypedDict, + ) + from .jsonpatchpayloadvalueresponse import ( + JSONPatchPayloadValueResponse, + JSONPatchPayloadValueResponseTypedDict, + ) + from .jsonpatchremove import JSONPatchRemove, JSONPatchRemoveTypedDict + from .jsonpatchreplace import JSONPatchReplace, JSONPatchReplaceTypedDict + from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict + from .jsonschema import JSONSchema, JSONSchemaTypedDict + from .judge import ( + Judge, + JudgeOutputUnion, + JudgeOutputUnionTypedDict, + JudgeTypedDict, + UnknownJudgeOutputUnion, + ) + from .judge_chat_completion_event_v1_observability_chat_completion_events_event_id_live_judging_postop import ( + JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequest, + JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequestTypedDict, + ) + from .judge_conversation_v1_observability_judges_judge_id_live_judging_postop import ( + JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequest, + JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequestTypedDict, + ) + from .judge_dataset_record_v1_observability_dataset_records_dataset_record_id_live_judging_postop import ( + JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequest, + JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequestTypedDict, + ) + from .judgechatcompletioneventrequest import ( + JudgeChatCompletionEventRequest, + JudgeChatCompletionEventRequestTypedDict, + ) + from .judgeclassificationoutput import ( + JudgeClassificationOutput, + JudgeClassificationOutputTypedDict, + ) + from .judgeclassificationoutputoption import ( + JudgeClassificationOutputOption, + JudgeClassificationOutputOptionTypedDict, + ) + from .judgeconversationrequest import ( + JudgeConversationRequest, + JudgeConversationRequestTypedDict, + ) + from .judgedatasetrecordrequest import ( + JudgeDatasetRecordRequest, + JudgeDatasetRecordRequestTypedDict, + ) + from .judgeoutput import Answer, AnswerTypedDict, JudgeOutput, JudgeOutputTypedDict + from .judgeoutputtype import JudgeOutputType + from .judgeregressionoutput import ( + JudgeRegressionOutput, + JudgeRegressionOutputTypedDict, + ) + from .legacyjobmetadata import LegacyJobMetadata, LegacyJobMetadataTypedDict + from .libraries_delete_v1op import ( + LibrariesDeleteV1Request, + LibrariesDeleteV1RequestTypedDict, + ) + from .libraries_documents_delete_v1op import ( + LibrariesDocumentsDeleteV1Request, + LibrariesDocumentsDeleteV1RequestTypedDict, + ) + from .libraries_documents_get_extracted_text_signed_url_v1op import ( + LibrariesDocumentsGetExtractedTextSignedURLV1Request, + LibrariesDocumentsGetExtractedTextSignedURLV1RequestTypedDict, + ) + from .libraries_documents_get_signed_url_v1op import ( + LibrariesDocumentsGetSignedURLV1Request, + LibrariesDocumentsGetSignedURLV1RequestTypedDict, + ) + from .libraries_documents_get_status_v1op import ( + LibrariesDocumentsGetStatusV1Request, + LibrariesDocumentsGetStatusV1RequestTypedDict, + ) + from .libraries_documents_get_text_content_v1op import ( + LibrariesDocumentsGetTextContentV1Request, + LibrariesDocumentsGetTextContentV1RequestTypedDict, + ) + from .libraries_documents_get_v1op import ( + LibrariesDocumentsGetV1Request, + LibrariesDocumentsGetV1RequestTypedDict, + ) + from .libraries_documents_list_v1op import ( + LibrariesDocumentsListV1Request, + LibrariesDocumentsListV1RequestTypedDict, + ) + from .libraries_documents_reprocess_v1op import ( + LibrariesDocumentsReprocessV1Request, + LibrariesDocumentsReprocessV1RequestTypedDict, + ) + from .libraries_documents_update_v1op import ( + LibrariesDocumentsUpdateV1Request, + LibrariesDocumentsUpdateV1RequestTypedDict, + ) + from .libraries_documents_upload_v1op import ( + DocumentUpload, + DocumentUploadTypedDict, + LibrariesDocumentsUploadV1Request, + LibrariesDocumentsUploadV1RequestTypedDict, + ) + from .libraries_get_v1op import ( + LibrariesGetV1Request, + LibrariesGetV1RequestTypedDict, + ) + from .libraries_list_v1op import ( + LibrariesListV1Request, + LibrariesListV1RequestTypedDict, + ) + from .libraries_share_create_v1op import ( + LibrariesShareCreateV1Request, + LibrariesShareCreateV1RequestTypedDict, + ) + from .libraries_share_delete_v1op import ( + LibrariesShareDeleteV1Request, + LibrariesShareDeleteV1RequestTypedDict, + ) + from .libraries_share_list_v1op import ( + LibrariesShareListV1Request, + LibrariesShareListV1RequestTypedDict, + ) + from .libraries_update_v1op import ( + LibrariesUpdateV1Request, + LibrariesUpdateV1RequestTypedDict, + ) + from .library import Library, LibraryTypedDict + from .list_deployments_v1_workflows_deployments_getop import ( + ListDeploymentsV1WorkflowsDeploymentsGetRequest, + ListDeploymentsV1WorkflowsDeploymentsGetRequestTypedDict, + ) + from .list_models_v1_models_getop import ( + ListModelsV1ModelsGetRequest, + ListModelsV1ModelsGetRequestTypedDict, + ) + from .list_runs_v1_workflows_runs_getop import ( + ListRunsV1WorkflowsRunsGetRequest, + ListRunsV1WorkflowsRunsGetRequestTypedDict, + ListRunsV1WorkflowsRunsGetResponse, + ListRunsV1WorkflowsRunsGetResponseTypedDict, + ListRunsV1WorkflowsRunsGetStatus, + ListRunsV1WorkflowsRunsGetStatusTypedDict, + ) + from .list_voices_v1_audio_voices_getop import ( + ListVoicesV1AudioVoicesGetRequest, + ListVoicesV1AudioVoicesGetRequestTypedDict, + ListVoicesV1AudioVoicesGetType, + ) + from .listbatchjobsresponse import ( + ListBatchJobsResponse, + ListBatchJobsResponseTypedDict, + ) + from .listcampaignselectedeventsresponse import ( + ListCampaignSelectedEventsResponse, + ListCampaignSelectedEventsResponseTypedDict, + ) + from .listcampaignsresponse import ( + ListCampaignsResponse, + ListCampaignsResponseTypedDict, + ) + from .listchatcompletionfieldsresponse import ( + ListChatCompletionFieldsResponse, + ListChatCompletionFieldsResponseTypedDict, + ) + from .listdatasetimporttasksresponse import ( + ListDatasetImportTasksResponse, + ListDatasetImportTasksResponseTypedDict, + ) + from .listdatasetrecordsresponse import ( + ListDatasetRecordsResponse, + ListDatasetRecordsResponseTypedDict, + ) + from .listdatasetsresponse import ( + ListDatasetsResponse, + ListDatasetsResponseTypedDict, + ) + from .listdocumentsresponse import ( + ListDocumentsResponse, + ListDocumentsResponseTypedDict, + ) + from .listfilesresponse import ListFilesResponse, ListFilesResponseTypedDict + from .listfinetuningjobsresponse import ( + ListFineTuningJobsResponse, + ListFineTuningJobsResponseData, + ListFineTuningJobsResponseDataTypedDict, + ListFineTuningJobsResponseTypedDict, + UnknownListFineTuningJobsResponseData, + ) + from .listjudgesresponse import ListJudgesResponse, ListJudgesResponseTypedDict + from .listlibrariesresponse import ( + ListLibrariesResponse, + ListLibrariesResponseTypedDict, + ) + from .listsharingresponse import ListSharingResponse, ListSharingResponseTypedDict + from .listworkfloweventresponse import ( + ListWorkflowEventResponse, + ListWorkflowEventResponseEvent, + ListWorkflowEventResponseEventTypedDict, + ListWorkflowEventResponseTypedDict, + ) + from .locationtype import LocationType + from .mcpservericon import MCPServerIcon, MCPServerIconTypedDict + from .mcptool import MCPTool, MCPToolTypedDict + from .mcptoolmeta import MCPToolMeta, MCPToolMetaTypedDict + from .mcpuitoolmeta import MCPUIToolMeta, MCPUIToolMetaTypedDict, Visibility + from .messageentries import MessageEntries, MessageEntriesTypedDict + from .messageinputcontentchunks import ( + MessageInputContentChunks, + MessageInputContentChunksTypedDict, + ) + from .messageinputentry import ( + MessageInputEntry, + MessageInputEntryContent, + MessageInputEntryContentTypedDict, + MessageInputEntryTypedDict, + Role, + ) + from .messageoutputcontentchunks import ( + MessageOutputContentChunks, + MessageOutputContentChunksTypedDict, + ) + from .messageoutputentry import ( + MessageOutputEntry, + MessageOutputEntryContent, + MessageOutputEntryContentTypedDict, + MessageOutputEntryTypedDict, + ) + from .messageoutputevent import ( + MessageOutputEvent, + MessageOutputEventContent, + MessageOutputEventContentTypedDict, + MessageOutputEventTypedDict, + ) + from .messageresponse import MessageResponse, MessageResponseTypedDict + from .messagetokens import MessageTokens, MessageTokensTypedDict + from .metric import Metric, MetricTypedDict + from .mistralpromptmode import MistralPromptMode + from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict + from .modelconversation import ( + ModelConversation, + ModelConversationTool, + ModelConversationToolTypedDict, + ModelConversationTypedDict, + UnknownModelConversationTool, + ) + from .modellist import ( + ModelList, + ModelListData, + ModelListDataTypedDict, + ModelListTypedDict, + UnknownModelListData, + ) + from .moderationllmaction import ModerationLLMAction + from .moderationllmv1categorythresholds import ( + ModerationLlmv1CategoryThresholds, + ModerationLlmv1CategoryThresholdsTypedDict, + ) + from .moderationllmv1config import ( + ModerationLlmv1Config, + ModerationLlmv1ConfigTypedDict, + ) + from .moderationllmv2categorythresholds import ( + ModerationLlmv2CategoryThresholds, + ModerationLlmv2CategoryThresholdsTypedDict, + ) + from .moderationllmv2config import ( + ModerationLlmv2Config, + ModerationLlmv2ConfigTypedDict, + ) + from .moderationobject import ModerationObject, ModerationObjectTypedDict + from .moderationresponse import ModerationResponse, ModerationResponseTypedDict + from .networkencodedinput import NetworkEncodedInput, NetworkEncodedInputTypedDict + from .oauth2token import OAuth2Token, OAuth2TokenTypedDict + from .oauth2tokenauth import OAuth2TokenAuth, OAuth2TokenAuthTypedDict + from .observabilityerrorcode import ObservabilityErrorCode + from .observabilityerrordetail import ( + ObservabilityErrorDetail, + ObservabilityErrorDetailTypedDict, + ) + from .ocrconfidencescore import OCRConfidenceScore, OCRConfidenceScoreTypedDict + from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict + from .ocrpageconfidencescores import ( + OCRPageConfidenceScores, + OCRPageConfidenceScoresTypedDict, + ) + from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict + from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict + from .ocrrequest import ( + ConfidenceScoresGranularity, + DocumentUnion, + DocumentUnionTypedDict, + OCRRequest, + OCRRequestTypedDict, + Pages, + PagesTypedDict, + TableFormat, + ) + from .ocrresponse import OCRResponse, OCRResponseTypedDict + from .ocrtableobject import Format, OCRTableObject, OCRTableObjectTypedDict + from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict + from .outboundauthenticationtype import OutboundAuthenticationType + from .outputcontentchunks import OutputContentChunks, OutputContentChunksTypedDict + from .paginatedconnectors import PaginatedConnectors, PaginatedConnectorsTypedDict + from .paginatedresultcampaignpreview import ( + PaginatedResultCampaignPreview, + PaginatedResultCampaignPreviewTypedDict, + ) + from .paginatedresultchatcompletioneventpreview import ( + PaginatedResultChatCompletionEventPreview, + PaginatedResultChatCompletionEventPreviewTypedDict, + ) + from .paginatedresultdatasetimporttask import ( + PaginatedResultDatasetImportTask, + PaginatedResultDatasetImportTaskTypedDict, + ) + from .paginatedresultdatasetpreview import ( + PaginatedResultDatasetPreview, + PaginatedResultDatasetPreviewTypedDict, + ) + from .paginatedresultdatasetrecord import ( + PaginatedResultDatasetRecord, + PaginatedResultDatasetRecordTypedDict, + ) + from .paginatedresultjudgepreview import ( + PaginatedResultJudgePreview, + PaginatedResultJudgePreviewTypedDict, + ) + from .paginationinfo import PaginationInfo, PaginationInfoTypedDict + from .paginationresponse import PaginationResponse, PaginationResponseTypedDict + from .pause_schedule_v1_workflows_schedules_schedule_id_pause_postop import ( + PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest, + PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequestTypedDict, + ) + from .post_dataset_records_from_campaign_v1_observability_datasets_dataset_id_imports_from_campaign_postop import ( + PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequest, + PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequestTypedDict, + ) + from .post_dataset_records_from_dataset_v1_observability_datasets_dataset_id_imports_from_dataset_postop import ( + PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequest, + PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequestTypedDict, + ) + from .post_dataset_records_from_explorer_v1_observability_datasets_dataset_id_imports_from_explorer_postop import ( + PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequest, + PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequestTypedDict, + ) + from .post_dataset_records_from_file_v1_observability_datasets_dataset_id_imports_from_file_postop import ( + PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequest, + PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequestTypedDict, + ) + from .post_dataset_records_from_playground_v1_observability_datasets_dataset_id_imports_from_playground_postop import ( + PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequest, + PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequestTypedDict, + ) + from .prediction import Prediction, PredictionTypedDict + from .processingstatus import ProcessingStatus, ProcessingStatusTypedDict + from .processstatus import ProcessStatus + from .prompttokensdetails import PromptTokensDetails, PromptTokensDetailsTypedDict + from .publicauthenticationmethod import ( + PublicAuthenticationMethod, + PublicAuthenticationMethodTypedDict, + ) + from .query_workflow_execution_v1_workflows_executions_execution_id_queries_postop import ( + QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest, + QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequestTypedDict, + ) + from .querydefinition import QueryDefinition, QueryDefinitionTypedDict + from .queryinvocationbody import ( + QueryInvocationBody, + QueryInvocationBodyInput, + QueryInvocationBodyInputTypedDict, + QueryInvocationBodyTypedDict, + ) + from .queryworkflowresponse import ( + QueryWorkflowResponse, + QueryWorkflowResponseTypedDict, + ) + from .realtimetranscriptionerror import ( + RealtimeTranscriptionError, + RealtimeTranscriptionErrorTypedDict, + ) + from .realtimetranscriptionerrordetail import ( + RealtimeTranscriptionErrorDetail, + RealtimeTranscriptionErrorDetailMessage, + RealtimeTranscriptionErrorDetailMessageTypedDict, + RealtimeTranscriptionErrorDetailTypedDict, + ) + from .realtimetranscriptioninputaudioappend import ( + RealtimeTranscriptionInputAudioAppend, + RealtimeTranscriptionInputAudioAppendTypedDict, + ) + from .realtimetranscriptioninputaudioend import ( + RealtimeTranscriptionInputAudioEnd, + RealtimeTranscriptionInputAudioEndTypedDict, + ) + from .realtimetranscriptioninputaudioflush import ( + RealtimeTranscriptionInputAudioFlush, + RealtimeTranscriptionInputAudioFlushTypedDict, + ) + from .realtimetranscriptionsession import ( + RealtimeTranscriptionSession, + RealtimeTranscriptionSessionTypedDict, + ) + from .realtimetranscriptionsessioncreated import ( + RealtimeTranscriptionSessionCreated, + RealtimeTranscriptionSessionCreatedTypedDict, + ) + from .realtimetranscriptionsessionupdated import ( + RealtimeTranscriptionSessionUpdated, + RealtimeTranscriptionSessionUpdatedTypedDict, + ) + from .realtimetranscriptionsessionupdatemessage import ( + RealtimeTranscriptionSessionUpdateMessage, + RealtimeTranscriptionSessionUpdateMessageTypedDict, + ) + from .realtimetranscriptionsessionupdatepayload import ( + RealtimeTranscriptionSessionUpdatePayload, + RealtimeTranscriptionSessionUpdatePayloadTypedDict, + ) + from .reasoningeffort import ReasoningEffort + from .referencechunk import ( + ReferenceChunk, + ReferenceChunkTypedDict, + ReferenceID, + ReferenceIDTypedDict, + ) + from .requestsource import RequestSource + from .reset_workflow_v1_workflows_executions_execution_id_reset_postop import ( + ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequest, + ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequestTypedDict, + ) + from .resetinvocationbody import ResetInvocationBody, ResetInvocationBodyTypedDict + from .resourcelink import ResourceLink, ResourceLinkTypedDict + from .resourcevisibility import ResourceVisibility + from .responsedoneevent import ResponseDoneEvent, ResponseDoneEventTypedDict + from .responseerrorevent import ResponseErrorEvent, ResponseErrorEventTypedDict + from .responseformat import ResponseFormat, ResponseFormatTypedDict + from .responseformats import ResponseFormats + from .responsestartedevent import ( + ResponseStartedEvent, + ResponseStartedEventTypedDict, + ) + from .resume_schedule_v1_workflows_schedules_schedule_id_resume_postop import ( + ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequest, + ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequestTypedDict, + ) + from .retrieve_model_v1_models_model_id_getop import ( + ResponseRetrieveModelV1ModelsModelIDGet, + ResponseRetrieveModelV1ModelsModelIDGetTypedDict, + RetrieveModelV1ModelsModelIDGetRequest, + RetrieveModelV1ModelsModelIDGetRequestTypedDict, + UnknownResponseRetrieveModelV1ModelsModelIDGet, + ) + from .roles import Roles + from .sampletype import SampleType + from .scalarmetric import ( + ScalarMetric, + ScalarMetricTypedDict, + ScalarMetricValue, + ScalarMetricValueTypedDict, + ) + from .schedulecalendar import ScheduleCalendar, ScheduleCalendarTypedDict + from .scheduledefinition import ScheduleDefinition, ScheduleDefinitionTypedDict + from .scheduledefinitionoutput import ( + ScheduleDefinitionOutput, + ScheduleDefinitionOutputTypedDict, + ) + from .schedulefutureexecution import ( + ScheduleFutureExecution, + ScheduleFutureExecutionTypedDict, + ) + from .scheduleinterval import ScheduleInterval, ScheduleIntervalTypedDict + from .scheduleoverlappolicy import ScheduleOverlapPolicy + from .schedulepolicy import SchedulePolicy, SchedulePolicyTypedDict + from .schedulerange import ScheduleRange, ScheduleRangeTypedDict + from .schedulerecentexecution import ( + ScheduleRecentExecution, + ScheduleRecentExecutionTypedDict, + ) + from .searchchatcompletioneventidsrequest import ( + SearchChatCompletionEventIdsRequest, + SearchChatCompletionEventIdsRequestTypedDict, + ) + from .searchchatcompletioneventidsresponse import ( + SearchChatCompletionEventIdsResponse, + SearchChatCompletionEventIdsResponseTypedDict, + ) + from .searchchatcompletioneventsrequest import ( + SearchChatCompletionEventsRequest, + SearchChatCompletionEventsRequestTypedDict, + ) + from .searchchatcompletioneventsresponse import ( + SearchChatCompletionEventsResponse, + SearchChatCompletionEventsResponseTypedDict, + ) + from .security import Security, SecurityTypedDict + from .shareenum import ShareEnum + from .sharing import Sharing, SharingTypedDict + from .sharingdelete import SharingDelete, SharingDeleteTypedDict + from .sharingrequest import SharingRequest, SharingRequestTypedDict + from .signal_workflow_execution_v1_workflows_executions_execution_id_signals_postop import ( + SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequest, + SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequestTypedDict, + ) + from .signaldefinition import SignalDefinition, SignalDefinitionTypedDict + from .signalinvocationbody import ( + SignalInvocationBody, + SignalInvocationBodyInput, + SignalInvocationBodyInputTypedDict, + SignalInvocationBodyNetworkEncodedInput, + SignalInvocationBodyNetworkEncodedInputTypedDict, + SignalInvocationBodyTypedDict, + ) + from .signalworkflowresponse import ( + SignalWorkflowResponse, + SignalWorkflowResponseTypedDict, + ) + from .source import Source + from .speech_v1_audio_speech_postop import ( + SpeechResponse, + SpeechResponseTypedDict, + SpeechStreamEvents, + SpeechStreamEventsTypedDict, + SpeechV1AudioSpeechPostData, + SpeechV1AudioSpeechPostDataTypedDict, + SpeechV1AudioSpeechPostResponse, + SpeechV1AudioSpeechPostResponseTypedDict, + UnknownSpeechV1AudioSpeechPostData, + ) + from .speechoutputformat import SpeechOutputFormat + from .speechrequest import SpeechRequest, SpeechRequestTypedDict + from .speechstreamaudiodelta import ( + SpeechStreamAudioDelta, + SpeechStreamAudioDeltaTypedDict, + ) + from .speechstreamdone import SpeechStreamDone, SpeechStreamDoneTypedDict + from .speechstreameventtypes import SpeechStreamEventTypes + from .ssetypes import SSETypes + from .stream_v1_workflows_executions_execution_id_stream_getop import ( + StreamV1WorkflowsExecutionsExecutionIDStreamGetRequest, + StreamV1WorkflowsExecutionsExecutionIDStreamGetRequestTypedDict, + StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody, + StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBodyTypedDict, + ) + from .streameventssepayload import ( + StreamEventSsePayload, + StreamEventSsePayloadData, + StreamEventSsePayloadDataTypedDict, + StreamEventSsePayloadTypedDict, + ) + from .streameventworkflowcontext import ( + StreamEventWorkflowContext, + StreamEventWorkflowContextTypedDict, + ) + from .systemmessage import ( + SystemMessage, + SystemMessageContent, + SystemMessageContentTypedDict, + SystemMessageTypedDict, + ) + from .systemmessagecontentchunks import ( + SystemMessageContentChunks, + SystemMessageContentChunksTypedDict, + ) + from .tempogettraceresponse import ( + TempoGetTraceResponse, + TempoGetTraceResponseTypedDict, + ) + from .tempotraceattribute import ( + TempoTraceAttribute, + TempoTraceAttributeTypedDict, + TempoTraceAttributeValue, + TempoTraceAttributeValueTypedDict, + ) + from .tempotraceattributearraycontainer import ( + TempoTraceAttributeArrayContainer, + TempoTraceAttributeArrayContainerTypedDict, + ) + from .tempotraceattributearrayelement import ( + TempoTraceAttributeArrayElement, + TempoTraceAttributeArrayElementTypedDict, + ) + from .tempotraceattributearrayvalue import ( + TempoTraceAttributeArrayValue, + TempoTraceAttributeArrayValueTypedDict, + ) + from .tempotraceattributeboolvalue import ( + TempoTraceAttributeBoolValue, + TempoTraceAttributeBoolValueTypedDict, + ) + from .tempotraceattributeintvalue import ( + TempoTraceAttributeIntValue, + TempoTraceAttributeIntValueTypedDict, + ) + from .tempotraceattributestringvalue import ( + TempoTraceAttributeStringValue, + TempoTraceAttributeStringValueTypedDict, + ) + from .tempotracebatch import TempoTraceBatch, TempoTraceBatchTypedDict + from .tempotraceevent import TempoTraceEvent, TempoTraceEventTypedDict + from .tempotraceresource import TempoTraceResource, TempoTraceResourceTypedDict + from .tempotracescope import TempoTraceScope, TempoTraceScopeTypedDict + from .tempotracescopekind import TempoTraceScopeKind + from .tempotracescopespan import TempoTraceScopeSpan, TempoTraceScopeSpanTypedDict + from .tempotracespan import TempoTraceSpan, TempoTraceSpanTypedDict + from .terminate_workflow_execution_v1_workflows_executions_execution_id_terminate_postop import ( + TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequest, + TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequestTypedDict, + ) + from .textchunk import TextChunk, TextChunkTypedDict + from .textcontent import TextContent, TextContentTypedDict + from .textresourcecontents import ( + TextResourceContents, + TextResourceContentsTypedDict, + ) + from .thinkchunk import ThinkChunk, ThinkChunkTypedDict, Thinking, ThinkingTypedDict + from .timeseriesmetric import ( + TimeSeriesMetric, + TimeSeriesMetricTypedDict, + TimeSeriesMetricValue1, + TimeSeriesMetricValue1TypedDict, + TimeSeriesMetricValue2, + TimeSeriesMetricValue2TypedDict, + ) + from .timestampgranularity import TimestampGranularity + from .tool import Tool, ToolTypedDict + from .toolannotations import ToolAnnotations, ToolAnnotationsTypedDict + from .toolcall import ToolCall, ToolCallTypedDict + from .toolcallconfirmation import ( + Confirmation, + ToolCallConfirmation, + ToolCallConfirmationTypedDict, + ) + from .toolchoice import ToolChoice, ToolChoiceTypedDict + from .toolchoiceenum import ToolChoiceEnum + from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict + from .toolexecution import TaskSupport, ToolExecution, ToolExecutionTypedDict + from .toolexecutiondeltaevent import ( + ToolExecutionDeltaEvent, + ToolExecutionDeltaEventName, + ToolExecutionDeltaEventNameTypedDict, + ToolExecutionDeltaEventTypedDict, + ) + from .toolexecutiondoneevent import ( + ToolExecutionDoneEvent, + ToolExecutionDoneEventName, + ToolExecutionDoneEventNameTypedDict, + ToolExecutionDoneEventTypedDict, + ) + from .toolexecutionentry import ( + ToolExecutionEntry, + ToolExecutionEntryName, + ToolExecutionEntryNameTypedDict, + ToolExecutionEntryTypedDict, + ) + from .toolexecutionstartedevent import ( + ToolExecutionStartedEvent, + ToolExecutionStartedEventName, + ToolExecutionStartedEventNameTypedDict, + ToolExecutionStartedEventTypedDict, + ) + from .toolfilechunk import ( + ToolFileChunk, + ToolFileChunkTool, + ToolFileChunkToolTypedDict, + ToolFileChunkTypedDict, + ) + from .toolmessage import ( + ToolMessage, + ToolMessageContent, + ToolMessageContentTypedDict, + ToolMessageTypedDict, + ) + from .toolreferencechunk import ( + ToolReferenceChunk, + ToolReferenceChunkTool, + ToolReferenceChunkToolTypedDict, + ToolReferenceChunkTypedDict, + ) + from .tooltype import ToolType + from .trainingfile import TrainingFile, TrainingFileTypedDict + from .transcriptionresponse import ( + TranscriptionResponse, + TranscriptionResponseTypedDict, + ) + from .transcriptionsegmentchunk import ( + TranscriptionSegmentChunk, + TranscriptionSegmentChunkTypedDict, + ) + from .transcriptionstreamdone import ( + TranscriptionStreamDone, + TranscriptionStreamDoneTypedDict, + ) + from .transcriptionstreamevents import ( + TranscriptionStreamEvents, + TranscriptionStreamEventsData, + TranscriptionStreamEventsDataTypedDict, + TranscriptionStreamEventsTypedDict, + UnknownTranscriptionStreamEventsData, + ) + from .transcriptionstreameventtypes import TranscriptionStreamEventTypes + from .transcriptionstreamlanguage import ( + TranscriptionStreamLanguage, + TranscriptionStreamLanguageTypedDict, + ) + from .transcriptionstreamsegmentdelta import ( + TranscriptionStreamSegmentDelta, + TranscriptionStreamSegmentDeltaTypedDict, + ) + from .transcriptionstreamtextdelta import ( + TranscriptionStreamTextDelta, + TranscriptionStreamTextDeltaTypedDict, + ) + from .turbinetoollocale import TurbineToolLocale, TurbineToolLocaleTypedDict + from .turbinetoolmeta import TurbineToolMeta, TurbineToolMetaTypedDict + from .unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop import ( + UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest, + UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequestTypedDict, + ) + from .unarchivemodelresponse import ( + UnarchiveModelResponse, + UnarchiveModelResponseTypedDict, + ) + from .unschedule_workflow_v1_workflows_schedules_schedule_id_deleteop import ( + UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequest, + UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequestTypedDict, + ) + from .update_dataset_record_payload_v1_observability_dataset_records_dataset_record_id_payload_putop import ( + UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequest, + UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequestTypedDict, + ) + from .update_dataset_record_properties_v1_observability_dataset_records_dataset_record_id_properties_putop import ( + UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequest, + UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequestTypedDict, + ) + from .update_dataset_v1_observability_datasets_dataset_id_patchop import ( + UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequest, + UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequestTypedDict, + ) + from .update_judge_v1_observability_judges_judge_id_putop import ( + UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequest, + UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequestTypedDict, + ) + from .update_run_info_v1_rag_ingestion_pipeline_configurations_id_run_info_putop import ( + UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest, + UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequestTypedDict, + ) + from .update_voice_v1_audio_voices_voice_id_patchop import ( + UpdateVoiceV1AudioVoicesVoiceIDPatchRequest, + UpdateVoiceV1AudioVoicesVoiceIDPatchRequestTypedDict, + ) + from .update_workflow_execution_v1_workflows_executions_execution_id_updates_postop import ( + UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequest, + UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequestTypedDict, + ) + from .update_workflow_v1_workflows_workflow_identifier_putop import ( + UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequest, + UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequestTypedDict, + ) + from .updateagentrequest import ( + UpdateAgentRequest, + UpdateAgentRequestTool, + UpdateAgentRequestToolTypedDict, + UpdateAgentRequestTypedDict, + ) + from .updateconnectorrequest import ( + UpdateConnectorRequest, + UpdateConnectorRequestTypedDict, + ) + from .updatedatasetrecordpayloadrequest import ( + UpdateDatasetRecordPayloadRequest, + UpdateDatasetRecordPayloadRequestTypedDict, + ) + from .updatedatasetrecordpropertiesrequest import ( + UpdateDatasetRecordPropertiesRequest, + UpdateDatasetRecordPropertiesRequestTypedDict, + ) + from .updatedatasetrequest import ( + UpdateDatasetRequest, + UpdateDatasetRequestTypedDict, + ) + from .updatedefinition import UpdateDefinition, UpdateDefinitionTypedDict + from .updatedocumentrequest import ( + Attributes, + AttributesTypedDict, + UpdateDocumentRequest, + UpdateDocumentRequestTypedDict, + ) + from .updateinvocationbody import ( + UpdateInvocationBody, + UpdateInvocationBodyInput, + UpdateInvocationBodyInputTypedDict, + UpdateInvocationBodyTypedDict, + ) + from .updatejudgerequest import ( + UpdateJudgeRequest, + UpdateJudgeRequestOutput, + UpdateJudgeRequestOutputTypedDict, + UpdateJudgeRequestTypedDict, + ) + from .updatelibraryrequest import ( + UpdateLibraryRequest, + UpdateLibraryRequestTypedDict, + ) + from .updatemodelrequest import UpdateModelRequest, UpdateModelRequestTypedDict + from .updateruninfo import UpdateRunInfo, UpdateRunInfoTypedDict + from .updateworkflowresponse import ( + UpdateWorkflowResponse, + UpdateWorkflowResponseTypedDict, + ) + from .usageinfo import UsageInfo, UsageInfoTypedDict + from .usageinfo_dollar_defs import UsageInfoDollarDefs, UsageInfoDollarDefsTypedDict + from .usermessage import ( + UserMessage, + UserMessageContent, + UserMessageContentTypedDict, + UserMessageTypedDict, + ) + from .validationerror import ( + Context, + ContextTypedDict, + Loc, + LocTypedDict, + ValidationError, + ValidationErrorTypedDict, + ) + from .voicecreaterequest import VoiceCreateRequest, VoiceCreateRequestTypedDict + from .voicelistresponse import VoiceListResponse, VoiceListResponseTypedDict + from .voiceresponse import VoiceResponse, VoiceResponseTypedDict + from .voiceupdaterequest import VoiceUpdateRequest, VoiceUpdateRequestTypedDict + from .wandbintegration import WandbIntegration, WandbIntegrationTypedDict + from .wandbintegrationresult import ( + WandbIntegrationResult, + WandbIntegrationResultTypedDict, + ) + from .websearchpremiumtool import ( + WebSearchPremiumTool, + WebSearchPremiumToolTypedDict, + ) + from .websearchtool import WebSearchTool, WebSearchToolTypedDict + from .workflow import Workflow, WorkflowTypedDict + from .workflowarchiveresponse import ( + WorkflowArchiveResponse, + WorkflowArchiveResponseTypedDict, + ) + from .workflowbasicdefinition import ( + WorkflowBasicDefinition, + WorkflowBasicDefinitionTypedDict, + ) + from .workflowcodedefinition import ( + WorkflowCodeDefinition, + WorkflowCodeDefinitionTypedDict, + ) + from .workfloweventtype import WorkflowEventType + from .workflowexecutioncanceledattributes import ( + WorkflowExecutionCanceledAttributes, + WorkflowExecutionCanceledAttributesTypedDict, + ) + from .workflowexecutioncanceledresponse import ( + WorkflowExecutionCanceledResponse, + WorkflowExecutionCanceledResponseTypedDict, + ) + from .workflowexecutioncompletedattributesresponse import ( + WorkflowExecutionCompletedAttributesResponse, + WorkflowExecutionCompletedAttributesResponseTypedDict, + ) + from .workflowexecutioncompletedresponse import ( + WorkflowExecutionCompletedResponse, + WorkflowExecutionCompletedResponseTypedDict, + ) + from .workflowexecutioncontinuedasnewattributesresponse import ( + WorkflowExecutionContinuedAsNewAttributesResponse, + WorkflowExecutionContinuedAsNewAttributesResponseTypedDict, + ) + from .workflowexecutioncontinuedasnewresponse import ( + WorkflowExecutionContinuedAsNewResponse, + WorkflowExecutionContinuedAsNewResponseTypedDict, + ) + from .workflowexecutionfailedattributes import ( + WorkflowExecutionFailedAttributes, + WorkflowExecutionFailedAttributesTypedDict, + ) + from .workflowexecutionfailedresponse import ( + WorkflowExecutionFailedResponse, + WorkflowExecutionFailedResponseTypedDict, + ) + from .workflowexecutionlistresponse import ( + WorkflowExecutionListResponse, + WorkflowExecutionListResponseTypedDict, + ) + from .workflowexecutionprogresstraceevent import ( + WorkflowExecutionProgressTraceEvent, + WorkflowExecutionProgressTraceEventTypedDict, + ) + from .workflowexecutionrequest import ( + WorkflowExecutionRequest, + WorkflowExecutionRequestTypedDict, + ) + from .workflowexecutionresponse import ( + WorkflowExecutionResponse, + WorkflowExecutionResponseTypedDict, + ) + from .workflowexecutionstartedattributesresponse import ( + WorkflowExecutionStartedAttributesResponse, + WorkflowExecutionStartedAttributesResponseTypedDict, + ) + from .workflowexecutionstartedresponse import ( + WorkflowExecutionStartedResponse, + WorkflowExecutionStartedResponseTypedDict, + ) + from .workflowexecutionstatus import WorkflowExecutionStatus + from .workflowexecutionsyncresponse import ( + WorkflowExecutionSyncResponse, + WorkflowExecutionSyncResponseTypedDict, + ) + from .workflowexecutiontraceevent import ( + WorkflowExecutionTraceEvent, + WorkflowExecutionTraceEventTypedDict, + ) + from .workflowexecutiontraceeventsresponse import ( + WorkflowExecutionTraceEventsResponse, + WorkflowExecutionTraceEventsResponseEvent, + WorkflowExecutionTraceEventsResponseEventTypedDict, + WorkflowExecutionTraceEventsResponseTypedDict, + ) + from .workflowexecutiontraceotelresponse import ( + WorkflowExecutionTraceOTelResponse, + WorkflowExecutionTraceOTelResponseTypedDict, + ) + from .workflowexecutiontracesummaryattributesvalues import ( + WorkflowExecutionTraceSummaryAttributesValues, + WorkflowExecutionTraceSummaryAttributesValuesTypedDict, + ) + from .workflowexecutiontracesummaryresponse import ( + WorkflowExecutionTraceSummaryResponse, + WorkflowExecutionTraceSummaryResponseTypedDict, + ) + from .workflowexecutiontracesummaryspan import ( + WorkflowExecutionTraceSummarySpan, + WorkflowExecutionTraceSummarySpanTypedDict, + ) + from .workflowexecutionwithoutresultresponse import ( + WorkflowExecutionWithoutResultResponse, + WorkflowExecutionWithoutResultResponseTypedDict, + ) + from .workflowgetresponse import WorkflowGetResponse, WorkflowGetResponseTypedDict + from .workflowlistresponse import ( + WorkflowListResponse, + WorkflowListResponseTypedDict, + ) + from .workflowmetadata import WorkflowMetadata, WorkflowMetadataTypedDict + from .workflowmetrics import WorkflowMetrics, WorkflowMetricsTypedDict + from .workflowregistration import ( + WorkflowRegistration, + WorkflowRegistrationTypedDict, + ) + from .workflowregistrationgetresponse import ( + WorkflowRegistrationGetResponse, + WorkflowRegistrationGetResponseTypedDict, + ) + from .workflowregistrationlistresponse import ( + WorkflowRegistrationListResponse, + WorkflowRegistrationListResponseTypedDict, + ) + from .workflowregistrationwithworkerstatus import ( + WorkflowRegistrationWithWorkerStatus, + WorkflowRegistrationWithWorkerStatusTypedDict, + ) + from .workflowschedulelistresponse import ( + WorkflowScheduleListResponse, + WorkflowScheduleListResponseTypedDict, + ) + from .workflowschedulepauserequest import ( + WorkflowSchedulePauseRequest, + WorkflowSchedulePauseRequestTypedDict, + ) + from .workflowschedulerequest import ( + WorkflowScheduleRequest, + WorkflowScheduleRequestTypedDict, + ) + from .workflowscheduleresponse import ( + WorkflowScheduleResponse, + WorkflowScheduleResponseTypedDict, + ) + from .workflowtaskfailedattributes import ( + WorkflowTaskFailedAttributes, + WorkflowTaskFailedAttributesTypedDict, + ) + from .workflowtaskfailedresponse import ( + WorkflowTaskFailedResponse, + WorkflowTaskFailedResponseTypedDict, + ) + from .workflowtasktimedoutattributes import ( + WorkflowTaskTimedOutAttributes, + WorkflowTaskTimedOutAttributesTypedDict, + ) + from .workflowtasktimedoutresponse import ( + WorkflowTaskTimedOutResponse, + WorkflowTaskTimedOutResponseTypedDict, + ) + from .workflowtype import WorkflowType + from .workflowunarchiveresponse import ( + WorkflowUnarchiveResponse, + WorkflowUnarchiveResponseTypedDict, + ) + from .workflowupdaterequest import ( + WorkflowUpdateRequest, + WorkflowUpdateRequestTypedDict, + ) + from .workflowupdateresponse import ( + WorkflowUpdateResponse, + WorkflowUpdateResponseTypedDict, + ) + from .workflowwithworkerstatus import ( + WorkflowWithWorkerStatus, + WorkflowWithWorkerStatusTypedDict, + ) # Pydantic models with forward references +FilterGroup.model_rebuild() + + +__all__ = [ + "APIEndpoint", + "APIKeyAuth", + "APIKeyAuthTypedDict", + "ActivityTaskCompletedAttributesResponse", + "ActivityTaskCompletedAttributesResponseTypedDict", + "ActivityTaskCompletedResponse", + "ActivityTaskCompletedResponseTypedDict", + "ActivityTaskFailedAttributes", + "ActivityTaskFailedAttributesTypedDict", + "ActivityTaskFailedResponse", + "ActivityTaskFailedResponseTypedDict", + "ActivityTaskRetryingAttributes", + "ActivityTaskRetryingAttributesTypedDict", + "ActivityTaskRetryingResponse", + "ActivityTaskRetryingResponseTypedDict", + "ActivityTaskStartedAttributesResponse", + "ActivityTaskStartedAttributesResponseTypedDict", + "ActivityTaskStartedResponse", + "ActivityTaskStartedResponseTypedDict", + "Agent", + "AgentAliasResponse", + "AgentAliasResponseTypedDict", + "AgentConversation", + "AgentConversationAgentVersion", + "AgentConversationAgentVersionTypedDict", + "AgentConversationTypedDict", + "AgentHandoffDoneEvent", + "AgentHandoffDoneEventTypedDict", + "AgentHandoffEntry", + "AgentHandoffEntryTypedDict", + "AgentHandoffStartedEvent", + "AgentHandoffStartedEventTypedDict", + "AgentTool", + "AgentToolTypedDict", + "AgentTypedDict", + "AgentsAPIV1AgentsCreateOrUpdateAliasRequest", + "AgentsAPIV1AgentsCreateOrUpdateAliasRequestTypedDict", + "AgentsAPIV1AgentsDeleteAliasRequest", + "AgentsAPIV1AgentsDeleteAliasRequestTypedDict", + "AgentsAPIV1AgentsDeleteRequest", + "AgentsAPIV1AgentsDeleteRequestTypedDict", + "AgentsAPIV1AgentsGetAgentVersion", + "AgentsAPIV1AgentsGetAgentVersionTypedDict", + "AgentsAPIV1AgentsGetRequest", + "AgentsAPIV1AgentsGetRequestTypedDict", + "AgentsAPIV1AgentsGetVersionRequest", + "AgentsAPIV1AgentsGetVersionRequestTypedDict", + "AgentsAPIV1AgentsListRequest", + "AgentsAPIV1AgentsListRequestTypedDict", + "AgentsAPIV1AgentsListVersionAliasesRequest", + "AgentsAPIV1AgentsListVersionAliasesRequestTypedDict", + "AgentsAPIV1AgentsListVersionsRequest", + "AgentsAPIV1AgentsListVersionsRequestTypedDict", + "AgentsAPIV1AgentsUpdateRequest", + "AgentsAPIV1AgentsUpdateRequestTypedDict", + "AgentsAPIV1AgentsUpdateVersionRequest", + "AgentsAPIV1AgentsUpdateVersionRequestTypedDict", + "AgentsAPIV1ConversationsAppendRequest", + "AgentsAPIV1ConversationsAppendRequestTypedDict", + "AgentsAPIV1ConversationsAppendStreamRequest", + "AgentsAPIV1ConversationsAppendStreamRequestTypedDict", + "AgentsAPIV1ConversationsDeleteRequest", + "AgentsAPIV1ConversationsDeleteRequestTypedDict", + "AgentsAPIV1ConversationsGetRequest", + "AgentsAPIV1ConversationsGetRequestTypedDict", + "AgentsAPIV1ConversationsHistoryRequest", + "AgentsAPIV1ConversationsHistoryRequestTypedDict", + "AgentsAPIV1ConversationsListRequest", + "AgentsAPIV1ConversationsListRequestTypedDict", + "AgentsAPIV1ConversationsListResponse", + "AgentsAPIV1ConversationsListResponseTypedDict", + "AgentsAPIV1ConversationsMessagesRequest", + "AgentsAPIV1ConversationsMessagesRequestTypedDict", + "AgentsAPIV1ConversationsRestartRequest", + "AgentsAPIV1ConversationsRestartRequestTypedDict", + "AgentsAPIV1ConversationsRestartStreamRequest", + "AgentsAPIV1ConversationsRestartStreamRequestTypedDict", + "AgentsCompletionRequest", + "AgentsCompletionRequestMessage", + "AgentsCompletionRequestMessageTypedDict", + "AgentsCompletionRequestStop", + "AgentsCompletionRequestStopTypedDict", + "AgentsCompletionRequestTool", + "AgentsCompletionRequestToolChoice", + "AgentsCompletionRequestToolChoiceTypedDict", + "AgentsCompletionRequestToolTypedDict", + "AgentsCompletionRequestTypedDict", + "AgentsCompletionStreamRequest", + "AgentsCompletionStreamRequestMessage", + "AgentsCompletionStreamRequestMessageTypedDict", + "AgentsCompletionStreamRequestStop", + "AgentsCompletionStreamRequestStopTypedDict", + "AgentsCompletionStreamRequestTool", + "AgentsCompletionStreamRequestToolChoice", + "AgentsCompletionStreamRequestToolChoiceTypedDict", + "AgentsCompletionStreamRequestToolTypedDict", + "AgentsCompletionStreamRequestTypedDict", + "And", + "AndTypedDict", + "Annotations", + "AnnotationsTypedDict", + "Answer", + "AnswerTypedDict", + "ArchiveModelResponse", + "ArchiveModelResponseTypedDict", + "ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequest", + "ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequestTypedDict", + "Arguments", + "ArgumentsTypedDict", + "AssistantMessage", + "AssistantMessageContent", + "AssistantMessageContentTypedDict", + "AssistantMessageTypedDict", + "Attributes", + "AttributesTypedDict", + "Audience", + "AudioChunk", + "AudioChunkTypedDict", + "AudioContent", + "AudioContentTypedDict", + "AudioEncoding", + "AudioFormat", + "AudioFormatTypedDict", + "AudioTranscriptionRequest", + "AudioTranscriptionRequestStream", + "AudioTranscriptionRequestStreamTypedDict", + "AudioTranscriptionRequestTypedDict", + "AuthData", + "AuthDataTypedDict", + "AuthURLResponse", + "AuthURLResponseTypedDict", + "AuthenticationConfiguration", + "AuthenticationConfigurationTypedDict", + "Authorization", + "AuthorizationTypedDict", + "BaseFieldDefinition", + "BaseFieldDefinitionType", + "BaseFieldDefinitionTypedDict", + "BaseModelCard", + "BaseModelCardTypedDict", + "BaseTaskStatus", + "BatchError", + "BatchErrorTypedDict", + "BatchExecutionBody", + "BatchExecutionBodyTypedDict", + "BatchExecutionResponse", + "BatchExecutionResponseTypedDict", + "BatchExecutionResult", + "BatchExecutionResultTypedDict", + "BatchJob", + "BatchJobStatus", + "BatchJobTypedDict", + "BatchRequest", + "BatchRequestTypedDict", + "BlobResourceContents", + "BlobResourceContentsTypedDict", + "BuiltInConnectors", + "Campaign", + "CampaignTypedDict", + "CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequest", + "CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequestTypedDict", + "ChatClassificationRequest", + "ChatClassificationRequestTypedDict", + "ChatCompletionChoice", + "ChatCompletionChoiceFinishReason", + "ChatCompletionChoiceTypedDict", + "ChatCompletionEvent", + "ChatCompletionEventExtraFields", + "ChatCompletionEventExtraFieldsTypedDict", + "ChatCompletionEventPreview", + "ChatCompletionEventPreviewExtraFields", + "ChatCompletionEventPreviewExtraFieldsTypedDict", + "ChatCompletionEventPreviewTypedDict", + "ChatCompletionEventTypedDict", + "ChatCompletionRequest", + "ChatCompletionRequestMessage", + "ChatCompletionRequestMessageTypedDict", + "ChatCompletionRequestStop", + "ChatCompletionRequestStopTypedDict", + "ChatCompletionRequestTool", + "ChatCompletionRequestToolChoice", + "ChatCompletionRequestToolChoiceTypedDict", + "ChatCompletionRequestToolTypedDict", + "ChatCompletionRequestTypedDict", + "ChatCompletionResponse", + "ChatCompletionResponseTypedDict", + "ChatCompletionStreamRequest", + "ChatCompletionStreamRequestMessage", + "ChatCompletionStreamRequestMessageTypedDict", + "ChatCompletionStreamRequestStop", + "ChatCompletionStreamRequestStopTypedDict", + "ChatCompletionStreamRequestTool", + "ChatCompletionStreamRequestToolChoice", + "ChatCompletionStreamRequestToolChoiceTypedDict", + "ChatCompletionStreamRequestToolTypedDict", + "ChatCompletionStreamRequestTypedDict", + "ChatModerationRequest", + "ChatModerationRequestInputs1", + "ChatModerationRequestInputs1TypedDict", + "ChatModerationRequestInputs2", + "ChatModerationRequestInputs2TypedDict", + "ChatModerationRequestInputs3", + "ChatModerationRequestInputs3TypedDict", + "ChatModerationRequestTypedDict", + "ChatTranscriptionEvent", + "ChatTranscriptionEventTypedDict", + "Checkpoint", + "CheckpointTypedDict", + "ClassificationRequest", + "ClassificationRequestInputs", + "ClassificationRequestInputsTypedDict", + "ClassificationRequestTypedDict", + "ClassificationResponse", + "ClassificationResponseTypedDict", + "ClassificationTargetResult", + "ClassificationTargetResultTypedDict", + "ClassifierFineTunedModel", + "ClassifierFineTunedModelTypedDict", + "ClassifierFineTuningJob", + "ClassifierFineTuningJobDetails", + "ClassifierFineTuningJobDetailsIntegration", + "ClassifierFineTuningJobDetailsIntegrationTypedDict", + "ClassifierFineTuningJobDetailsStatus", + "ClassifierFineTuningJobDetailsTypedDict", + "ClassifierFineTuningJobIntegration", + "ClassifierFineTuningJobIntegrationTypedDict", + "ClassifierFineTuningJobStatus", + "ClassifierFineTuningJobTypedDict", + "ClassifierTarget", + "ClassifierTargetResult", + "ClassifierTargetResultTypedDict", + "ClassifierTargetTypedDict", + "ClassifierTrainingParameters", + "ClassifierTrainingParametersTypedDict", + "CodeInterpreterTool", + "CodeInterpreterToolTypedDict", + "CompletionArgs", + "CompletionArgsStop", + "CompletionArgsStopTypedDict", + "CompletionArgsTypedDict", + "CompletionChunk", + "CompletionChunkTypedDict", + "CompletionEvent", + "CompletionEventTypedDict", + "CompletionFineTunedModel", + "CompletionFineTunedModelTypedDict", + "CompletionFineTuningJob", + "CompletionFineTuningJobDetails", + "CompletionFineTuningJobDetailsIntegration", + "CompletionFineTuningJobDetailsIntegrationTypedDict", + "CompletionFineTuningJobDetailsRepository", + "CompletionFineTuningJobDetailsRepositoryTypedDict", + "CompletionFineTuningJobDetailsStatus", + "CompletionFineTuningJobDetailsTypedDict", + "CompletionFineTuningJobIntegration", + "CompletionFineTuningJobIntegrationTypedDict", + "CompletionFineTuningJobRepository", + "CompletionFineTuningJobRepositoryTypedDict", + "CompletionFineTuningJobStatus", + "CompletionFineTuningJobTypedDict", + "CompletionResponseStreamChoice", + "CompletionResponseStreamChoiceFinishReason", + "CompletionResponseStreamChoiceTypedDict", + "CompletionTrainingParameters", + "CompletionTrainingParametersTypedDict", + "ConfidenceScoresGranularity", + "Confirmation", + "ConnectionCredentials", + "ConnectionCredentialsTypedDict", + "Connector", + "ConnectorAuthenticationHeader", + "ConnectorAuthenticationHeaderTypedDict", + "ConnectorCallToolRequest", + "ConnectorCallToolRequestTypedDict", + "ConnectorCallToolV1Request", + "ConnectorCallToolV1RequestTypedDict", + "ConnectorCreateOrUpdateOrganizationCredentialsV1Request", + "ConnectorCreateOrUpdateOrganizationCredentialsV1RequestTypedDict", + "ConnectorCreateOrUpdateUserCredentialsV1Request", + "ConnectorCreateOrUpdateUserCredentialsV1RequestTypedDict", + "ConnectorCreateOrUpdateWorkspaceCredentialsV1Request", + "ConnectorCreateOrUpdateWorkspaceCredentialsV1RequestTypedDict", + "ConnectorDeleteOrganizationCredentialsV1Request", + "ConnectorDeleteOrganizationCredentialsV1RequestTypedDict", + "ConnectorDeleteUserCredentialsV1Request", + "ConnectorDeleteUserCredentialsV1RequestTypedDict", + "ConnectorDeleteV1Request", + "ConnectorDeleteV1RequestTypedDict", + "ConnectorDeleteWorkspaceCredentialsV1Request", + "ConnectorDeleteWorkspaceCredentialsV1RequestTypedDict", + "ConnectorGetAuthURLV1Request", + "ConnectorGetAuthURLV1RequestTypedDict", + "ConnectorGetAuthenticationMethodsV1Request", + "ConnectorGetAuthenticationMethodsV1RequestTypedDict", + "ConnectorGetV1Request", + "ConnectorGetV1RequestTypedDict", + "ConnectorListOrganizationCredentialsV1Request", + "ConnectorListOrganizationCredentialsV1RequestTypedDict", + "ConnectorListToolsV1Request", + "ConnectorListToolsV1RequestTypedDict", + "ConnectorListUserCredentialsV1Request", + "ConnectorListUserCredentialsV1RequestTypedDict", + "ConnectorListV1Request", + "ConnectorListV1RequestTypedDict", + "ConnectorListWorkspaceCredentialsV1Request", + "ConnectorListWorkspaceCredentialsV1RequestTypedDict", + "ConnectorTool", + "ConnectorToolCallMetadata", + "ConnectorToolCallMetadataTypedDict", + "ConnectorToolCallResponse", + "ConnectorToolCallResponseContent", + "ConnectorToolCallResponseContentTypedDict", + "ConnectorToolCallResponseTypedDict", + "ConnectorToolLocale", + "ConnectorToolLocaleTypedDict", + "ConnectorToolResultMetadata", + "ConnectorToolResultMetadataTypedDict", + "ConnectorToolTypedDict", + "ConnectorTypedDict", + "ConnectorUpdateV1Request", + "ConnectorUpdateV1RequestTypedDict", + "ConnectorsQueryFilters", + "ConnectorsQueryFiltersTypedDict", + "ContentChunk", + "ContentChunkTypedDict", + "Context", + "ContextTypedDict", + "ConversationAppendRequest", + "ConversationAppendRequestHandoffExecution", + "ConversationAppendRequestTypedDict", + "ConversationAppendStreamRequest", + "ConversationAppendStreamRequestHandoffExecution", + "ConversationAppendStreamRequestTypedDict", + "ConversationEvents", + "ConversationEventsData", + "ConversationEventsDataTypedDict", + "ConversationEventsTypedDict", + "ConversationHistory", + "ConversationHistoryTypedDict", + "ConversationInputs", + "ConversationInputsTypedDict", + "ConversationMessages", + "ConversationMessagesTypedDict", + "ConversationPayload", + "ConversationPayloadTypedDict", + "ConversationRequest", + "ConversationRequestAgentVersion", + "ConversationRequestAgentVersionTypedDict", + "ConversationRequestHandoffExecution", + "ConversationRequestTool", + "ConversationRequestToolTypedDict", + "ConversationRequestTypedDict", + "ConversationResponse", + "ConversationResponseOutput", + "ConversationResponseOutputTypedDict", + "ConversationResponseTypedDict", + "ConversationRestartRequest", + "ConversationRestartRequestAgentVersion", + "ConversationRestartRequestAgentVersionTypedDict", + "ConversationRestartRequestHandoffExecution", + "ConversationRestartRequestTypedDict", + "ConversationRestartStreamRequest", + "ConversationRestartStreamRequestAgentVersion", + "ConversationRestartStreamRequestAgentVersionTypedDict", + "ConversationRestartStreamRequestHandoffExecution", + "ConversationRestartStreamRequestTypedDict", + "ConversationSource", + "ConversationStreamRequest", + "ConversationStreamRequestAgentVersion", + "ConversationStreamRequestAgentVersionTypedDict", + "ConversationStreamRequestHandoffExecution", + "ConversationStreamRequestTool", + "ConversationStreamRequestToolTypedDict", + "ConversationStreamRequestTypedDict", + "ConversationUsageInfo", + "ConversationUsageInfoTypedDict", + "CreateAgentRequest", + "CreateAgentRequestTool", + "CreateAgentRequestToolTypedDict", + "CreateAgentRequestTypedDict", + "CreateBatchJobRequest", + "CreateBatchJobRequestTypedDict", + "CreateCampaignRequest", + "CreateCampaignRequestTypedDict", + "CreateConnectorRequest", + "CreateConnectorRequestTypedDict", + "CreateDatasetRecordRequest", + "CreateDatasetRecordRequestTypedDict", + "CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequest", + "CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequestTypedDict", + "CreateDatasetRequest", + "CreateDatasetRequestTypedDict", + "CreateFileResponse", + "CreateFileResponseTypedDict", + "CreateFineTuningJobRequest", + "CreateFineTuningJobRequestIntegration", + "CreateFineTuningJobRequestIntegrationTypedDict", + "CreateFineTuningJobRequestRepository", + "CreateFineTuningJobRequestRepositoryTypedDict", + "CreateFineTuningJobRequestTypedDict", + "CreateGithubRepositoryRequest", + "CreateGithubRepositoryRequestTypedDict", + "CreateIngestionPipelineConfigurationRequest", + "CreateIngestionPipelineConfigurationRequestTypedDict", + "CreateJudgeRequest", + "CreateJudgeRequestOutput", + "CreateJudgeRequestOutputTypedDict", + "CreateJudgeRequestTypedDict", + "CreateLibraryRequest", + "CreateLibraryRequestTypedDict", + "CredentialsCreateOrUpdate", + "CredentialsCreateOrUpdateTypedDict", + "CredentialsResponse", + "CredentialsResponseTypedDict", + "CustomConnector", + "CustomConnectorTypedDict", + "CustomTaskCanceledAttributes", + "CustomTaskCanceledAttributesTypedDict", + "CustomTaskCanceledResponse", + "CustomTaskCanceledResponseTypedDict", + "CustomTaskCompletedAttributesResponse", + "CustomTaskCompletedAttributesResponseTypedDict", + "CustomTaskCompletedResponse", + "CustomTaskCompletedResponseTypedDict", + "CustomTaskFailedAttributes", + "CustomTaskFailedAttributesTypedDict", + "CustomTaskFailedResponse", + "CustomTaskFailedResponseTypedDict", + "CustomTaskInProgressAttributesResponse", + "CustomTaskInProgressAttributesResponseTypedDict", + "CustomTaskInProgressResponse", + "CustomTaskInProgressResponseTypedDict", + "CustomTaskStartedAttributesResponse", + "CustomTaskStartedAttributesResponseTypedDict", + "CustomTaskStartedResponse", + "CustomTaskStartedResponseTypedDict", + "CustomTaskTimedOutAttributes", + "CustomTaskTimedOutAttributesTypedDict", + "CustomTaskTimedOutResponse", + "CustomTaskTimedOutResponseTypedDict", + "Dataset", + "DatasetImportTask", + "DatasetImportTaskTypedDict", + "DatasetPreview", + "DatasetPreviewTypedDict", + "DatasetRecord", + "DatasetRecordTypedDict", + "DatasetTypedDict", + "DeleteBatchJobResponse", + "DeleteBatchJobResponseTypedDict", + "DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequest", + "DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequestTypedDict", + "DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequest", + "DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequestTypedDict", + "DeleteDatasetRecordsRequest", + "DeleteDatasetRecordsRequestTypedDict", + "DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequest", + "DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequestTypedDict", + "DeleteFileResponse", + "DeleteFileResponseTypedDict", + "DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequest", + "DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequestTypedDict", + "DeleteModelResponse", + "DeleteModelResponseTypedDict", + "DeleteModelV1ModelsModelIDDeleteRequest", + "DeleteModelV1ModelsModelIDDeleteRequestTypedDict", + "DeleteVoiceV1AudioVoicesVoiceIDDeleteRequest", + "DeleteVoiceV1AudioVoicesVoiceIDDeleteRequestTypedDict", + "DeltaMessage", + "DeltaMessageContent", + "DeltaMessageContentTypedDict", + "DeltaMessageTypedDict", + "DeploymentDetailResponse", + "DeploymentDetailResponseTypedDict", + "DeploymentListResponse", + "DeploymentListResponseTypedDict", + "DeploymentLocation", + "DeploymentLocationTypedDict", + "DeploymentResponse", + "DeploymentResponseTypedDict", + "DeploymentWorkerResponse", + "DeploymentWorkerResponseTypedDict", + "Document", + "DocumentLibraryTool", + "DocumentLibraryToolTypedDict", + "DocumentTextContent", + "DocumentTextContentTypedDict", + "DocumentTypedDict", + "DocumentURLChunk", + "DocumentURLChunkTypedDict", + "DocumentUnion", + "DocumentUnionTypedDict", + "DocumentUpload", + "DocumentUploadTypedDict", + "EmbeddedResource", + "EmbeddedResourceTypedDict", + "EmbeddingDtype", + "EmbeddingRequest", + "EmbeddingRequestInputs", + "EmbeddingRequestInputsTypedDict", + "EmbeddingRequestTypedDict", + "EmbeddingResponse", + "EmbeddingResponseData", + "EmbeddingResponseDataTypedDict", + "EmbeddingResponseTypedDict", + "EncodedPayloadOptions", + "EncodingFormat", + "EntityType", + "Entry", + "EntryTypedDict", + "Event", + "EventProgressStatus", + "EventSource", + "EventType", + "EventTypedDict", + "ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequest", + "ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequestTypedDict", + "ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequest", + "ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequestTypedDict", + "ExecutionConfig", + "ExecutionConfigTypedDict", + "ExportDatasetResponse", + "ExportDatasetResponseTypedDict", + "ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequest", + "ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequestTypedDict", + "FIMCompletionRequest", + "FIMCompletionRequestStop", + "FIMCompletionRequestStopTypedDict", + "FIMCompletionRequestTypedDict", + "FIMCompletionResponse", + "FIMCompletionResponseTypedDict", + "FIMCompletionStreamRequest", + "FIMCompletionStreamRequestStop", + "FIMCompletionStreamRequestStopTypedDict", + "FIMCompletionStreamRequestTypedDict", + "FTClassifierLossFunction", + "FTModelCard", + "FTModelCardTypedDict", + "Failure", + "FailureTypedDict", + "FeedResultChatCompletionEventPreview", + "FeedResultChatCompletionEventPreviewTypedDict", + "FetchCampaignStatusResponse", + "FetchCampaignStatusResponseTypedDict", + "FetchChatCompletionFieldOptionsResponse", + "FetchChatCompletionFieldOptionsResponseTypedDict", + "FetchFieldOptionCountsRequest", + "FetchFieldOptionCountsRequestTypedDict", + "FetchFieldOptionCountsResponse", + "FetchFieldOptionCountsResponseTypedDict", + "FieldGroup", + "FieldGroupTypedDict", + "FieldOptionCountItem", + "FieldOptionCountItemTypedDict", + "File", + "FileChunk", + "FileChunkTypedDict", + "FilePurpose", + "FileSchema", + "FileSchemaTypedDict", + "FileTypedDict", + "FileVisibility", + "FilesAPIRoutesDeleteFileRequest", + "FilesAPIRoutesDeleteFileRequestTypedDict", + "FilesAPIRoutesDownloadFileRequest", + "FilesAPIRoutesDownloadFileRequestTypedDict", + "FilesAPIRoutesGetSignedURLRequest", + "FilesAPIRoutesGetSignedURLRequestTypedDict", + "FilesAPIRoutesListFilesRequest", + "FilesAPIRoutesListFilesRequestTypedDict", + "FilesAPIRoutesRetrieveFileRequest", + "FilesAPIRoutesRetrieveFileRequestTypedDict", + "FilesAPIRoutesUploadFileFileVisibility", + "FilterCondition", + "FilterConditionTypedDict", + "FilterGroup", + "FilterGroupTypedDict", + "FilterPayload", + "FilterPayloadTypedDict", + "Filters", + "FiltersTypedDict", + "FineTuneableModelType", + "FineTunedModelCapabilities", + "FineTunedModelCapabilitiesTypedDict", + "Format", + "Function", + "FunctionCall", + "FunctionCallEntry", + "FunctionCallEntryArguments", + "FunctionCallEntryArgumentsTypedDict", + "FunctionCallEntryConfirmationStatus", + "FunctionCallEntryTypedDict", + "FunctionCallEvent", + "FunctionCallEventConfirmationStatus", + "FunctionCallEventTypedDict", + "FunctionCallTypedDict", + "FunctionName", + "FunctionNameTypedDict", + "FunctionResultEntry", + "FunctionResultEntryTypedDict", + "FunctionTool", + "FunctionToolTypedDict", + "FunctionTypedDict", + "GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequest", + "GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequestTypedDict", + "GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequest", + "GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequestTypedDict", + "GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequest", + "GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequestTypedDict", + "GetCampaignsV1ObservabilityCampaignsGetRequest", + "GetCampaignsV1ObservabilityCampaignsGetRequestTypedDict", + "GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequest", + "GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequestTypedDict", + "GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest", + "GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequestTypedDict", + "GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest", + "GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequestTypedDict", + "GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest", + "GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequestTypedDict", + "GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequest", + "GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequestTypedDict", + "GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequest", + "GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequestTypedDict", + "GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequest", + "GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequestTypedDict", + "GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequest", + "GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequestTypedDict", + "GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequest", + "GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequestTypedDict", + "GetDatasetsV1ObservabilityDatasetsGetRequest", + "GetDatasetsV1ObservabilityDatasetsGetRequestTypedDict", + "GetDeploymentV1WorkflowsDeploymentsNameGetRequest", + "GetDeploymentV1WorkflowsDeploymentsNameGetRequestTypedDict", + "GetFileResponse", + "GetFileResponseTypedDict", + "GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequest", + "GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequestTypedDict", + "GetJudgesV1ObservabilityJudgesGetRequest", + "GetJudgesV1ObservabilityJudgesGetRequestTypedDict", + "GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequest", + "GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequestTypedDict", + "GetRunV1WorkflowsRunsRunIDGetRequest", + "GetRunV1WorkflowsRunsRunIDGetRequestTypedDict", + "GetSignedURLResponse", + "GetSignedURLResponseTypedDict", + "GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest", + "GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequestTypedDict", + "GetStreamEventsV1WorkflowsEventsStreamGetRequest", + "GetStreamEventsV1WorkflowsEventsStreamGetRequestTypedDict", + "GetStreamEventsV1WorkflowsEventsStreamGetResponseBody", + "GetStreamEventsV1WorkflowsEventsStreamGetResponseBodyTypedDict", + "GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequest", + "GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequestTypedDict", + "GetVoiceV1AudioVoicesVoiceIDGetRequest", + "GetVoiceV1AudioVoicesVoiceIDGetRequestTypedDict", + "GetWorkflowEventsV1WorkflowsEventsListGetRequest", + "GetWorkflowEventsV1WorkflowsEventsListGetRequestTypedDict", + "GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequest", + "GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequestTypedDict", + "GetWorkflowExecutionTraceEventsRequest", + "GetWorkflowExecutionTraceEventsRequestTypedDict", + "GetWorkflowExecutionTraceOtelRequest", + "GetWorkflowExecutionTraceOtelRequestTypedDict", + "GetWorkflowExecutionTraceSummaryRequest", + "GetWorkflowExecutionTraceSummaryRequestTypedDict", + "GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequest", + "GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequestTypedDict", + "GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequest", + "GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequestTypedDict", + "GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequest", + "GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequestTypedDict", + "GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequest", + "GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequestTypedDict", + "GetWorkflowV1WorkflowsWorkflowIdentifierGetRequest", + "GetWorkflowV1WorkflowsWorkflowIdentifierGetRequestTypedDict", + "GetWorkflowsV1WorkflowsGetRequest", + "GetWorkflowsV1WorkflowsGetRequestTypedDict", + "GetWorkflowsV1WorkflowsGetResponse", + "GetWorkflowsV1WorkflowsGetResponseTypedDict", + "GithubRepository", + "GithubRepositoryTypedDict", + "GuardrailConfig", + "GuardrailConfigTypedDict", + "Hyperparameters", + "HyperparametersTypedDict", + "ImageContent", + "ImageContentTypedDict", + "ImageDetail", + "ImageGenerationTool", + "ImageGenerationToolTypedDict", + "ImageURL", + "ImageURLChunk", + "ImageURLChunkTypedDict", + "ImageURLTypedDict", + "ImageURLUnion", + "ImageURLUnionTypedDict", + "ImportDatasetFromCampaignRequest", + "ImportDatasetFromCampaignRequestTypedDict", + "ImportDatasetFromDatasetRequest", + "ImportDatasetFromDatasetRequestTypedDict", + "ImportDatasetFromExplorerRequest", + "ImportDatasetFromExplorerRequestTypedDict", + "ImportDatasetFromFileRequest", + "ImportDatasetFromFileRequestTypedDict", + "ImportDatasetFromPlaygroundRequest", + "ImportDatasetFromPlaygroundRequestTypedDict", + "IngestionPipelineConfiguration", + "IngestionPipelineConfigurationTypedDict", + "InputEntries", + "InputEntriesTypedDict", + "Inputs", + "InputsTypedDict", + "InstructRequest", + "InstructRequestMessage", + "InstructRequestMessageTypedDict", + "InstructRequestTypedDict", + "JSONPatch", + "JSONPatchAdd", + "JSONPatchAddTypedDict", + "JSONPatchAppend", + "JSONPatchAppendTypedDict", + "JSONPatchPayloadResponse", + "JSONPatchPayloadResponseTypedDict", + "JSONPatchPayloadValueResponse", + "JSONPatchPayloadValueResponseTypedDict", + "JSONPatchRemove", + "JSONPatchRemoveTypedDict", + "JSONPatchReplace", + "JSONPatchReplaceTypedDict", + "JSONPatchTypedDict", + "JSONPayloadResponse", + "JSONPayloadResponseTypedDict", + "JSONSchema", + "JSONSchemaTypedDict", + "JobMetadata", + "JobMetadataTypedDict", + "JobsAPIRoutesBatchCancelBatchJobRequest", + "JobsAPIRoutesBatchCancelBatchJobRequestTypedDict", + "JobsAPIRoutesBatchDeleteBatchJobRequest", + "JobsAPIRoutesBatchDeleteBatchJobRequestTypedDict", + "JobsAPIRoutesBatchGetBatchJobRequest", + "JobsAPIRoutesBatchGetBatchJobRequestTypedDict", + "JobsAPIRoutesBatchGetBatchJobsRequest", + "JobsAPIRoutesBatchGetBatchJobsRequestTypedDict", + "JobsAPIRoutesFineTuningArchiveFineTunedModelRequest", + "JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict", + "JobsAPIRoutesFineTuningCancelFineTuningJobRequest", + "JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict", + "JobsAPIRoutesFineTuningCancelFineTuningJobResponse", + "JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict", + "JobsAPIRoutesFineTuningCreateFineTuningJobResponse", + "JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict", + "JobsAPIRoutesFineTuningGetFineTuningJobRequest", + "JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict", + "JobsAPIRoutesFineTuningGetFineTuningJobResponse", + "JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict", + "JobsAPIRoutesFineTuningGetFineTuningJobsRequest", + "JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict", + "JobsAPIRoutesFineTuningGetFineTuningJobsStatus", + "JobsAPIRoutesFineTuningStartFineTuningJobRequest", + "JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict", + "JobsAPIRoutesFineTuningStartFineTuningJobResponse", + "JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict", + "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest", + "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict", + "JobsAPIRoutesFineTuningUpdateFineTunedModelRequest", + "JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict", + "JobsAPIRoutesFineTuningUpdateFineTunedModelResponse", + "JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict", + "Judge", + "JudgeChatCompletionEventRequest", + "JudgeChatCompletionEventRequestTypedDict", + "JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequest", + "JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequestTypedDict", + "JudgeClassificationOutput", + "JudgeClassificationOutputOption", + "JudgeClassificationOutputOptionTypedDict", + "JudgeClassificationOutputTypedDict", + "JudgeConversationRequest", + "JudgeConversationRequestTypedDict", + "JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequest", + "JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequestTypedDict", + "JudgeDatasetRecordRequest", + "JudgeDatasetRecordRequestTypedDict", + "JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequest", + "JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequestTypedDict", + "JudgeOutput", + "JudgeOutputType", + "JudgeOutputTypedDict", + "JudgeOutputUnion", + "JudgeOutputUnionTypedDict", + "JudgeRegressionOutput", + "JudgeRegressionOutputTypedDict", + "JudgeTypedDict", + "LegacyJobMetadata", + "LegacyJobMetadataTypedDict", + "LibrariesDeleteV1Request", + "LibrariesDeleteV1RequestTypedDict", + "LibrariesDocumentsDeleteV1Request", + "LibrariesDocumentsDeleteV1RequestTypedDict", + "LibrariesDocumentsGetExtractedTextSignedURLV1Request", + "LibrariesDocumentsGetExtractedTextSignedURLV1RequestTypedDict", + "LibrariesDocumentsGetSignedURLV1Request", + "LibrariesDocumentsGetSignedURLV1RequestTypedDict", + "LibrariesDocumentsGetStatusV1Request", + "LibrariesDocumentsGetStatusV1RequestTypedDict", + "LibrariesDocumentsGetTextContentV1Request", + "LibrariesDocumentsGetTextContentV1RequestTypedDict", + "LibrariesDocumentsGetV1Request", + "LibrariesDocumentsGetV1RequestTypedDict", + "LibrariesDocumentsListV1Request", + "LibrariesDocumentsListV1RequestTypedDict", + "LibrariesDocumentsReprocessV1Request", + "LibrariesDocumentsReprocessV1RequestTypedDict", + "LibrariesDocumentsUpdateV1Request", + "LibrariesDocumentsUpdateV1RequestTypedDict", + "LibrariesDocumentsUploadV1Request", + "LibrariesDocumentsUploadV1RequestTypedDict", + "LibrariesGetV1Request", + "LibrariesGetV1RequestTypedDict", + "LibrariesListV1Request", + "LibrariesListV1RequestTypedDict", + "LibrariesShareCreateV1Request", + "LibrariesShareCreateV1RequestTypedDict", + "LibrariesShareDeleteV1Request", + "LibrariesShareDeleteV1RequestTypedDict", + "LibrariesShareListV1Request", + "LibrariesShareListV1RequestTypedDict", + "LibrariesUpdateV1Request", + "LibrariesUpdateV1RequestTypedDict", + "Library", + "LibraryTypedDict", + "ListBatchJobsResponse", + "ListBatchJobsResponseTypedDict", + "ListCampaignSelectedEventsResponse", + "ListCampaignSelectedEventsResponseTypedDict", + "ListCampaignsResponse", + "ListCampaignsResponseTypedDict", + "ListChatCompletionFieldsResponse", + "ListChatCompletionFieldsResponseTypedDict", + "ListDatasetImportTasksResponse", + "ListDatasetImportTasksResponseTypedDict", + "ListDatasetRecordsResponse", + "ListDatasetRecordsResponseTypedDict", + "ListDatasetsResponse", + "ListDatasetsResponseTypedDict", + "ListDeploymentsV1WorkflowsDeploymentsGetRequest", + "ListDeploymentsV1WorkflowsDeploymentsGetRequestTypedDict", + "ListDocumentsResponse", + "ListDocumentsResponseTypedDict", + "ListFilesResponse", + "ListFilesResponseTypedDict", + "ListFineTuningJobsResponse", + "ListFineTuningJobsResponseData", + "ListFineTuningJobsResponseDataTypedDict", + "ListFineTuningJobsResponseTypedDict", + "ListJudgesResponse", + "ListJudgesResponseTypedDict", + "ListLibrariesResponse", + "ListLibrariesResponseTypedDict", + "ListModelsV1ModelsGetRequest", + "ListModelsV1ModelsGetRequestTypedDict", + "ListRunsV1WorkflowsRunsGetRequest", + "ListRunsV1WorkflowsRunsGetRequestTypedDict", + "ListRunsV1WorkflowsRunsGetResponse", + "ListRunsV1WorkflowsRunsGetResponseTypedDict", + "ListRunsV1WorkflowsRunsGetStatus", + "ListRunsV1WorkflowsRunsGetStatusTypedDict", + "ListSharingResponse", + "ListSharingResponseTypedDict", + "ListVoicesV1AudioVoicesGetRequest", + "ListVoicesV1AudioVoicesGetRequestTypedDict", + "ListVoicesV1AudioVoicesGetType", + "ListWorkflowEventResponse", + "ListWorkflowEventResponseEvent", + "ListWorkflowEventResponseEventTypedDict", + "ListWorkflowEventResponseTypedDict", + "Loc", + "LocTypedDict", + "LocationType", + "MCPServerIcon", + "MCPServerIconTypedDict", + "MCPTool", + "MCPToolMeta", + "MCPToolMetaTypedDict", + "MCPToolTypedDict", + "MCPUIToolMeta", + "MCPUIToolMetaTypedDict", + "MessageEntries", + "MessageEntriesTypedDict", + "MessageInputContentChunks", + "MessageInputContentChunksTypedDict", + "MessageInputEntry", + "MessageInputEntryContent", + "MessageInputEntryContentTypedDict", + "MessageInputEntryTypedDict", + "MessageOutputContentChunks", + "MessageOutputContentChunksTypedDict", + "MessageOutputEntry", + "MessageOutputEntryContent", + "MessageOutputEntryContentTypedDict", + "MessageOutputEntryTypedDict", + "MessageOutputEvent", + "MessageOutputEventContent", + "MessageOutputEventContentTypedDict", + "MessageOutputEventTypedDict", + "MessageResponse", + "MessageResponseTypedDict", + "MessageTokens", + "MessageTokensTypedDict", + "Metric", + "MetricTypedDict", + "MistralPromptMode", + "ModelCapabilities", + "ModelCapabilitiesTypedDict", + "ModelConversation", + "ModelConversationTool", + "ModelConversationToolTypedDict", + "ModelConversationTypedDict", + "ModelList", + "ModelListData", + "ModelListDataTypedDict", + "ModelListTypedDict", + "ModerationLLMAction", + "ModerationLlmv1CategoryThresholds", + "ModerationLlmv1CategoryThresholdsTypedDict", + "ModerationLlmv1Config", + "ModerationLlmv1ConfigTypedDict", + "ModerationLlmv2CategoryThresholds", + "ModerationLlmv2CategoryThresholdsTypedDict", + "ModerationLlmv2Config", + "ModerationLlmv2ConfigTypedDict", + "ModerationObject", + "ModerationObjectTypedDict", + "ModerationResponse", + "ModerationResponseTypedDict", + "MultiPartBodyParams", + "MultiPartBodyParamsTypedDict", + "NetworkEncodedInput", + "NetworkEncodedInputTypedDict", + "OAuth2Token", + "OAuth2TokenAuth", + "OAuth2TokenAuthTypedDict", + "OAuth2TokenTypedDict", + "OCRConfidenceScore", + "OCRConfidenceScoreTypedDict", + "OCRImageObject", + "OCRImageObjectTypedDict", + "OCRPageConfidenceScores", + "OCRPageConfidenceScoresTypedDict", + "OCRPageDimensions", + "OCRPageDimensionsTypedDict", + "OCRPageObject", + "OCRPageObjectTypedDict", + "OCRRequest", + "OCRRequestTypedDict", + "OCRResponse", + "OCRResponseTypedDict", + "OCRTableObject", + "OCRTableObjectTypedDict", + "OCRUsageInfo", + "OCRUsageInfoTypedDict", + "ObservabilityErrorCode", + "ObservabilityErrorDetail", + "ObservabilityErrorDetailTypedDict", + "Op", + "Operator", + "Option", + "OptionTypedDict", + "Or", + "OrTypedDict", + "OrderBy", + "OutboundAuthenticationType", + "OutputContentChunks", + "OutputContentChunksTypedDict", + "OwnerType", + "Pages", + "PagesTypedDict", + "PaginatedConnectors", + "PaginatedConnectorsTypedDict", + "PaginatedResultCampaignPreview", + "PaginatedResultCampaignPreviewTypedDict", + "PaginatedResultChatCompletionEventPreview", + "PaginatedResultChatCompletionEventPreviewTypedDict", + "PaginatedResultDatasetImportTask", + "PaginatedResultDatasetImportTaskTypedDict", + "PaginatedResultDatasetPreview", + "PaginatedResultDatasetPreviewTypedDict", + "PaginatedResultDatasetRecord", + "PaginatedResultDatasetRecordTypedDict", + "PaginatedResultJudgePreview", + "PaginatedResultJudgePreviewTypedDict", + "PaginationInfo", + "PaginationInfoTypedDict", + "PaginationResponse", + "PaginationResponseTypedDict", + "PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest", + "PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequestTypedDict", + "Payload", + "PayloadTypedDict", + "PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequest", + "PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequestTypedDict", + "PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequest", + "PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequestTypedDict", + "PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequest", + "PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequestTypedDict", + "PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequest", + "PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequestTypedDict", + "PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequest", + "PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequestTypedDict", + "Prediction", + "PredictionTypedDict", + "ProcessStatus", + "ProcessingStatus", + "ProcessingStatusTypedDict", + "PromptTokensDetails", + "PromptTokensDetailsTypedDict", + "PublicAuthenticationMethod", + "PublicAuthenticationMethodTypedDict", + "QueryDefinition", + "QueryDefinitionTypedDict", + "QueryInvocationBody", + "QueryInvocationBodyInput", + "QueryInvocationBodyInputTypedDict", + "QueryInvocationBodyTypedDict", + "QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest", + "QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequestTypedDict", + "QueryWorkflowResponse", + "QueryWorkflowResponseTypedDict", + "RealtimeTranscriptionError", + "RealtimeTranscriptionErrorDetail", + "RealtimeTranscriptionErrorDetailMessage", + "RealtimeTranscriptionErrorDetailMessageTypedDict", + "RealtimeTranscriptionErrorDetailTypedDict", + "RealtimeTranscriptionErrorTypedDict", + "RealtimeTranscriptionInputAudioAppend", + "RealtimeTranscriptionInputAudioAppendTypedDict", + "RealtimeTranscriptionInputAudioEnd", + "RealtimeTranscriptionInputAudioEndTypedDict", + "RealtimeTranscriptionInputAudioFlush", + "RealtimeTranscriptionInputAudioFlushTypedDict", + "RealtimeTranscriptionSession", + "RealtimeTranscriptionSessionCreated", + "RealtimeTranscriptionSessionCreatedTypedDict", + "RealtimeTranscriptionSessionTypedDict", + "RealtimeTranscriptionSessionUpdateMessage", + "RealtimeTranscriptionSessionUpdateMessageTypedDict", + "RealtimeTranscriptionSessionUpdatePayload", + "RealtimeTranscriptionSessionUpdatePayloadTypedDict", + "RealtimeTranscriptionSessionUpdated", + "RealtimeTranscriptionSessionUpdatedTypedDict", + "ReasoningEffort", + "ReferenceChunk", + "ReferenceChunkTypedDict", + "ReferenceID", + "ReferenceIDTypedDict", + "RequestSource", + "ResetInvocationBody", + "ResetInvocationBodyTypedDict", + "ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequest", + "ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequestTypedDict", + "Resource", + "ResourceLink", + "ResourceLinkTypedDict", + "ResourceTypedDict", + "ResourceVisibility", + "Response", + "ResponseConnectorListToolsV1", + "ResponseConnectorListToolsV1TypedDict", + "ResponseDoneEvent", + "ResponseDoneEventTypedDict", + "ResponseErrorEvent", + "ResponseErrorEventTypedDict", + "ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost", + "ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostTypedDict", + "ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost", + "ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostTypedDict", + "ResponseFormat", + "ResponseFormatTypedDict", + "ResponseFormats", + "ResponseRetrieveModelV1ModelsModelIDGet", + "ResponseRetrieveModelV1ModelsModelIDGetTypedDict", + "ResponseStartedEvent", + "ResponseStartedEventTypedDict", + "ResponseTypedDict", + "ResponseV1ConversationsGet", + "ResponseV1ConversationsGetTypedDict", + "ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequest", + "ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequestTypedDict", + "RetrieveModelV1ModelsModelIDGetRequest", + "RetrieveModelV1ModelsModelIDGetRequestTypedDict", + "Role", + "Roles", + "SSETypes", + "SampleType", + "ScalarMetric", + "ScalarMetricTypedDict", + "ScalarMetricValue", + "ScalarMetricValueTypedDict", + "ScheduleCalendar", + "ScheduleCalendarTypedDict", + "ScheduleDefinition", + "ScheduleDefinitionOutput", + "ScheduleDefinitionOutputTypedDict", + "ScheduleDefinitionTypedDict", + "ScheduleFutureExecution", + "ScheduleFutureExecutionTypedDict", + "ScheduleInterval", + "ScheduleIntervalTypedDict", + "ScheduleOverlapPolicy", + "SchedulePolicy", + "SchedulePolicyTypedDict", + "ScheduleRange", + "ScheduleRangeTypedDict", + "ScheduleRecentExecution", + "ScheduleRecentExecutionTypedDict", + "Scope", + "SearchChatCompletionEventIdsRequest", + "SearchChatCompletionEventIdsRequestTypedDict", + "SearchChatCompletionEventIdsResponse", + "SearchChatCompletionEventIdsResponseTypedDict", + "SearchChatCompletionEventsRequest", + "SearchChatCompletionEventsRequestTypedDict", + "SearchChatCompletionEventsResponse", + "SearchChatCompletionEventsResponseTypedDict", + "Security", + "SecurityTypedDict", + "ShareEnum", + "Sharing", + "SharingDelete", + "SharingDeleteTypedDict", + "SharingRequest", + "SharingRequestTypedDict", + "SharingTypedDict", + "SignalDefinition", + "SignalDefinitionTypedDict", + "SignalInvocationBody", + "SignalInvocationBodyInput", + "SignalInvocationBodyInputTypedDict", + "SignalInvocationBodyNetworkEncodedInput", + "SignalInvocationBodyNetworkEncodedInputTypedDict", + "SignalInvocationBodyTypedDict", + "SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequest", + "SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequestTypedDict", + "SignalWorkflowResponse", + "SignalWorkflowResponseTypedDict", + "Source", + "SpeechOutputFormat", + "SpeechRequest", + "SpeechRequestTypedDict", + "SpeechResponse", + "SpeechResponseTypedDict", + "SpeechStreamAudioDelta", + "SpeechStreamAudioDeltaTypedDict", + "SpeechStreamDone", + "SpeechStreamDoneTypedDict", + "SpeechStreamEventTypes", + "SpeechStreamEvents", + "SpeechStreamEventsTypedDict", + "SpeechV1AudioSpeechPostData", + "SpeechV1AudioSpeechPostDataTypedDict", + "SpeechV1AudioSpeechPostResponse", + "SpeechV1AudioSpeechPostResponseTypedDict", + "StreamEventSsePayload", + "StreamEventSsePayloadData", + "StreamEventSsePayloadDataTypedDict", + "StreamEventSsePayloadTypedDict", + "StreamEventWorkflowContext", + "StreamEventWorkflowContextTypedDict", + "StreamV1WorkflowsExecutionsExecutionIDStreamGetRequest", + "StreamV1WorkflowsExecutionsExecutionIDStreamGetRequestTypedDict", + "StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody", + "StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBodyTypedDict", + "SupportedOperator", + "SystemMessage", + "SystemMessageContent", + "SystemMessageContentChunks", + "SystemMessageContentChunksTypedDict", + "SystemMessageContentTypedDict", + "SystemMessageTypedDict", + "TableFormat", + "TaskSupport", + "TempoGetTraceResponse", + "TempoGetTraceResponseTypedDict", + "TempoTraceAttribute", + "TempoTraceAttributeArrayContainer", + "TempoTraceAttributeArrayContainerTypedDict", + "TempoTraceAttributeArrayElement", + "TempoTraceAttributeArrayElementTypedDict", + "TempoTraceAttributeArrayValue", + "TempoTraceAttributeArrayValueTypedDict", + "TempoTraceAttributeBoolValue", + "TempoTraceAttributeBoolValueTypedDict", + "TempoTraceAttributeIntValue", + "TempoTraceAttributeIntValueTypedDict", + "TempoTraceAttributeStringValue", + "TempoTraceAttributeStringValueTypedDict", + "TempoTraceAttributeTypedDict", + "TempoTraceAttributeValue", + "TempoTraceAttributeValueTypedDict", + "TempoTraceBatch", + "TempoTraceBatchTypedDict", + "TempoTraceEvent", + "TempoTraceEventTypedDict", + "TempoTraceResource", + "TempoTraceResourceTypedDict", + "TempoTraceScope", + "TempoTraceScopeKind", + "TempoTraceScopeSpan", + "TempoTraceScopeSpanTypedDict", + "TempoTraceScopeTypedDict", + "TempoTraceSpan", + "TempoTraceSpanTypedDict", + "TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequest", + "TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequestTypedDict", + "TextChunk", + "TextChunkTypedDict", + "TextContent", + "TextContentTypedDict", + "TextResourceContents", + "TextResourceContentsTypedDict", + "ThinkChunk", + "ThinkChunkTypedDict", + "Thinking", + "ThinkingTypedDict", + "TimeSeriesMetric", + "TimeSeriesMetricTypedDict", + "TimeSeriesMetricValue1", + "TimeSeriesMetricValue1TypedDict", + "TimeSeriesMetricValue2", + "TimeSeriesMetricValue2TypedDict", + "TimestampGranularity", + "Tool", + "ToolAnnotations", + "ToolAnnotationsTypedDict", + "ToolCall", + "ToolCallConfirmation", + "ToolCallConfirmationTypedDict", + "ToolCallTypedDict", + "ToolChoice", + "ToolChoiceEnum", + "ToolChoiceTypedDict", + "ToolConfiguration", + "ToolConfigurationTypedDict", + "ToolExecution", + "ToolExecutionDeltaEvent", + "ToolExecutionDeltaEventName", + "ToolExecutionDeltaEventNameTypedDict", + "ToolExecutionDeltaEventTypedDict", + "ToolExecutionDoneEvent", + "ToolExecutionDoneEventName", + "ToolExecutionDoneEventNameTypedDict", + "ToolExecutionDoneEventTypedDict", + "ToolExecutionEntry", + "ToolExecutionEntryName", + "ToolExecutionEntryNameTypedDict", + "ToolExecutionEntryTypedDict", + "ToolExecutionStartedEvent", + "ToolExecutionStartedEventName", + "ToolExecutionStartedEventNameTypedDict", + "ToolExecutionStartedEventTypedDict", + "ToolExecutionTypedDict", + "ToolFileChunk", + "ToolFileChunkTool", + "ToolFileChunkToolTypedDict", + "ToolFileChunkTypedDict", + "ToolMessage", + "ToolMessageContent", + "ToolMessageContentTypedDict", + "ToolMessageTypedDict", + "ToolReferenceChunk", + "ToolReferenceChunkTool", + "ToolReferenceChunkToolTypedDict", + "ToolReferenceChunkTypedDict", + "ToolType", + "ToolTypedDict", + "TrainingFile", + "TrainingFileTypedDict", + "TranscriptionResponse", + "TranscriptionResponseTypedDict", + "TranscriptionSegmentChunk", + "TranscriptionSegmentChunkTypedDict", + "TranscriptionStreamDone", + "TranscriptionStreamDoneTypedDict", + "TranscriptionStreamEventTypes", + "TranscriptionStreamEvents", + "TranscriptionStreamEventsData", + "TranscriptionStreamEventsDataTypedDict", + "TranscriptionStreamEventsTypedDict", + "TranscriptionStreamLanguage", + "TranscriptionStreamLanguageTypedDict", + "TranscriptionStreamSegmentDelta", + "TranscriptionStreamSegmentDeltaTypedDict", + "TranscriptionStreamTextDelta", + "TranscriptionStreamTextDeltaTypedDict", + "TurbineToolLocale", + "TurbineToolLocaleTypedDict", + "TurbineToolMeta", + "TurbineToolMetaTypedDict", + "UnarchiveModelResponse", + "UnarchiveModelResponseTypedDict", + "UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest", + "UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequestTypedDict", + "UnknownAgentTool", + "UnknownAuthorization", + "UnknownClassifierFineTuningJobDetailsIntegration", + "UnknownClassifierFineTuningJobIntegration", + "UnknownCompletionFineTuningJobDetailsIntegration", + "UnknownCompletionFineTuningJobDetailsRepository", + "UnknownCompletionFineTuningJobIntegration", + "UnknownCompletionFineTuningJobRepository", + "UnknownConnectorToolCallResponseContent", + "UnknownContentChunk", + "UnknownConversationEventsData", + "UnknownJSONPatch", + "UnknownJobsAPIRoutesFineTuningCancelFineTuningJobResponse", + "UnknownJobsAPIRoutesFineTuningGetFineTuningJobResponse", + "UnknownJobsAPIRoutesFineTuningStartFineTuningJobResponse", + "UnknownJobsAPIRoutesFineTuningUpdateFineTunedModelResponse", + "UnknownJudgeOutputUnion", + "UnknownListFineTuningJobsResponseData", + "UnknownModelConversationTool", + "UnknownModelListData", + "UnknownPayload", + "UnknownResponse", + "UnknownResponseRetrieveModelV1ModelsModelIDGet", + "UnknownSpeechV1AudioSpeechPostData", + "UnknownTranscriptionStreamEventsData", + "UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequest", + "UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequestTypedDict", + "UpdateAgentRequest", + "UpdateAgentRequestTool", + "UpdateAgentRequestToolTypedDict", + "UpdateAgentRequestTypedDict", + "UpdateConnectorRequest", + "UpdateConnectorRequestTypedDict", + "UpdateDatasetRecordPayloadRequest", + "UpdateDatasetRecordPayloadRequestTypedDict", + "UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequest", + "UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequestTypedDict", + "UpdateDatasetRecordPropertiesRequest", + "UpdateDatasetRecordPropertiesRequestTypedDict", + "UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequest", + "UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequestTypedDict", + "UpdateDatasetRequest", + "UpdateDatasetRequestTypedDict", + "UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequest", + "UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequestTypedDict", + "UpdateDefinition", + "UpdateDefinitionTypedDict", + "UpdateDocumentRequest", + "UpdateDocumentRequestTypedDict", + "UpdateInvocationBody", + "UpdateInvocationBodyInput", + "UpdateInvocationBodyInputTypedDict", + "UpdateInvocationBodyTypedDict", + "UpdateJudgeRequest", + "UpdateJudgeRequestOutput", + "UpdateJudgeRequestOutputTypedDict", + "UpdateJudgeRequestTypedDict", + "UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequest", + "UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequestTypedDict", + "UpdateLibraryRequest", + "UpdateLibraryRequestTypedDict", + "UpdateModelRequest", + "UpdateModelRequestTypedDict", + "UpdateRunInfo", + "UpdateRunInfoTypedDict", + "UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest", + "UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequestTypedDict", + "UpdateVoiceV1AudioVoicesVoiceIDPatchRequest", + "UpdateVoiceV1AudioVoicesVoiceIDPatchRequestTypedDict", + "UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequest", + "UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequestTypedDict", + "UpdateWorkflowResponse", + "UpdateWorkflowResponseTypedDict", + "UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequest", + "UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequestTypedDict", + "UsageInfo", + "UsageInfoDollarDefs", + "UsageInfoDollarDefsTypedDict", + "UsageInfoTypedDict", + "UserMessage", + "UserMessageContent", + "UserMessageContentTypedDict", + "UserMessageTypedDict", + "ValidationError", + "ValidationErrorTypedDict", + "Visibility", + "VoiceCreateRequest", + "VoiceCreateRequestTypedDict", + "VoiceListResponse", + "VoiceListResponseTypedDict", + "VoiceResponse", + "VoiceResponseTypedDict", + "VoiceUpdateRequest", + "VoiceUpdateRequestTypedDict", + "WandbIntegration", + "WandbIntegrationResult", + "WandbIntegrationResultTypedDict", + "WandbIntegrationTypedDict", + "WebSearchPremiumTool", + "WebSearchPremiumToolTypedDict", + "WebSearchTool", + "WebSearchToolTypedDict", + "Workflow", + "WorkflowArchiveResponse", + "WorkflowArchiveResponseTypedDict", + "WorkflowBasicDefinition", + "WorkflowBasicDefinitionTypedDict", + "WorkflowCodeDefinition", + "WorkflowCodeDefinitionTypedDict", + "WorkflowEventType", + "WorkflowExecutionCanceledAttributes", + "WorkflowExecutionCanceledAttributesTypedDict", + "WorkflowExecutionCanceledResponse", + "WorkflowExecutionCanceledResponseTypedDict", + "WorkflowExecutionCompletedAttributesResponse", + "WorkflowExecutionCompletedAttributesResponseTypedDict", + "WorkflowExecutionCompletedResponse", + "WorkflowExecutionCompletedResponseTypedDict", + "WorkflowExecutionContinuedAsNewAttributesResponse", + "WorkflowExecutionContinuedAsNewAttributesResponseTypedDict", + "WorkflowExecutionContinuedAsNewResponse", + "WorkflowExecutionContinuedAsNewResponseTypedDict", + "WorkflowExecutionFailedAttributes", + "WorkflowExecutionFailedAttributesTypedDict", + "WorkflowExecutionFailedResponse", + "WorkflowExecutionFailedResponseTypedDict", + "WorkflowExecutionListResponse", + "WorkflowExecutionListResponseTypedDict", + "WorkflowExecutionProgressTraceEvent", + "WorkflowExecutionProgressTraceEventTypedDict", + "WorkflowExecutionRequest", + "WorkflowExecutionRequestTypedDict", + "WorkflowExecutionResponse", + "WorkflowExecutionResponseTypedDict", + "WorkflowExecutionStartedAttributesResponse", + "WorkflowExecutionStartedAttributesResponseTypedDict", + "WorkflowExecutionStartedResponse", + "WorkflowExecutionStartedResponseTypedDict", + "WorkflowExecutionStatus", + "WorkflowExecutionSyncResponse", + "WorkflowExecutionSyncResponseTypedDict", + "WorkflowExecutionTraceEvent", + "WorkflowExecutionTraceEventTypedDict", + "WorkflowExecutionTraceEventsResponse", + "WorkflowExecutionTraceEventsResponseEvent", + "WorkflowExecutionTraceEventsResponseEventTypedDict", + "WorkflowExecutionTraceEventsResponseTypedDict", + "WorkflowExecutionTraceOTelResponse", + "WorkflowExecutionTraceOTelResponseTypedDict", + "WorkflowExecutionTraceSummaryAttributesValues", + "WorkflowExecutionTraceSummaryAttributesValuesTypedDict", + "WorkflowExecutionTraceSummaryResponse", + "WorkflowExecutionTraceSummaryResponseTypedDict", + "WorkflowExecutionTraceSummarySpan", + "WorkflowExecutionTraceSummarySpanTypedDict", + "WorkflowExecutionWithoutResultResponse", + "WorkflowExecutionWithoutResultResponseTypedDict", + "WorkflowGetResponse", + "WorkflowGetResponseTypedDict", + "WorkflowListResponse", + "WorkflowListResponseTypedDict", + "WorkflowMetadata", + "WorkflowMetadataTypedDict", + "WorkflowMetrics", + "WorkflowMetricsTypedDict", + "WorkflowRegistration", + "WorkflowRegistrationGetResponse", + "WorkflowRegistrationGetResponseTypedDict", + "WorkflowRegistrationListResponse", + "WorkflowRegistrationListResponseTypedDict", + "WorkflowRegistrationTypedDict", + "WorkflowRegistrationWithWorkerStatus", + "WorkflowRegistrationWithWorkerStatusTypedDict", + "WorkflowScheduleListResponse", + "WorkflowScheduleListResponseTypedDict", + "WorkflowSchedulePauseRequest", + "WorkflowSchedulePauseRequestTypedDict", + "WorkflowScheduleRequest", + "WorkflowScheduleRequestTypedDict", + "WorkflowScheduleResponse", + "WorkflowScheduleResponseTypedDict", + "WorkflowTaskFailedAttributes", + "WorkflowTaskFailedAttributesTypedDict", + "WorkflowTaskFailedResponse", + "WorkflowTaskFailedResponseTypedDict", + "WorkflowTaskTimedOutAttributes", + "WorkflowTaskTimedOutAttributesTypedDict", + "WorkflowTaskTimedOutResponse", + "WorkflowTaskTimedOutResponseTypedDict", + "WorkflowType", + "WorkflowTypedDict", + "WorkflowUnarchiveResponse", + "WorkflowUnarchiveResponseTypedDict", + "WorkflowUpdateRequest", + "WorkflowUpdateRequestTypedDict", + "WorkflowUpdateResponse", + "WorkflowUpdateResponseTypedDict", + "WorkflowWithWorkerStatus", + "WorkflowWithWorkerStatusTypedDict", +] + +_dynamic_imports: dict[str, str] = { + "ActivityTaskCompletedAttributesResponse": ".activitytaskcompletedattributesresponse", + "ActivityTaskCompletedAttributesResponseTypedDict": ".activitytaskcompletedattributesresponse", + "ActivityTaskCompletedResponse": ".activitytaskcompletedresponse", + "ActivityTaskCompletedResponseTypedDict": ".activitytaskcompletedresponse", + "ActivityTaskFailedAttributes": ".activitytaskfailedattributes", + "ActivityTaskFailedAttributesTypedDict": ".activitytaskfailedattributes", + "ActivityTaskFailedResponse": ".activitytaskfailedresponse", + "ActivityTaskFailedResponseTypedDict": ".activitytaskfailedresponse", + "ActivityTaskRetryingAttributes": ".activitytaskretryingattributes", + "ActivityTaskRetryingAttributesTypedDict": ".activitytaskretryingattributes", + "ActivityTaskRetryingResponse": ".activitytaskretryingresponse", + "ActivityTaskRetryingResponseTypedDict": ".activitytaskretryingresponse", + "ActivityTaskStartedAttributesResponse": ".activitytaskstartedattributesresponse", + "ActivityTaskStartedAttributesResponseTypedDict": ".activitytaskstartedattributesresponse", + "ActivityTaskStartedResponse": ".activitytaskstartedresponse", + "ActivityTaskStartedResponseTypedDict": ".activitytaskstartedresponse", + "Agent": ".agent", + "AgentTool": ".agent", + "AgentToolTypedDict": ".agent", + "AgentTypedDict": ".agent", + "UnknownAgentTool": ".agent", + "AgentAliasResponse": ".agentaliasresponse", + "AgentAliasResponseTypedDict": ".agentaliasresponse", + "AgentConversation": ".agentconversation", + "AgentConversationAgentVersion": ".agentconversation", + "AgentConversationAgentVersionTypedDict": ".agentconversation", + "AgentConversationTypedDict": ".agentconversation", + "AgentHandoffDoneEvent": ".agenthandoffdoneevent", + "AgentHandoffDoneEventTypedDict": ".agenthandoffdoneevent", + "AgentHandoffEntry": ".agenthandoffentry", + "AgentHandoffEntryTypedDict": ".agenthandoffentry", + "AgentHandoffStartedEvent": ".agenthandoffstartedevent", + "AgentHandoffStartedEventTypedDict": ".agenthandoffstartedevent", + "AgentsAPIV1AgentsCreateOrUpdateAliasRequest": ".agents_api_v1_agents_create_or_update_aliasop", + "AgentsAPIV1AgentsCreateOrUpdateAliasRequestTypedDict": ".agents_api_v1_agents_create_or_update_aliasop", + "AgentsAPIV1AgentsDeleteAliasRequest": ".agents_api_v1_agents_delete_aliasop", + "AgentsAPIV1AgentsDeleteAliasRequestTypedDict": ".agents_api_v1_agents_delete_aliasop", + "AgentsAPIV1AgentsDeleteRequest": ".agents_api_v1_agents_deleteop", + "AgentsAPIV1AgentsDeleteRequestTypedDict": ".agents_api_v1_agents_deleteop", + "AgentsAPIV1AgentsGetVersionRequest": ".agents_api_v1_agents_get_versionop", + "AgentsAPIV1AgentsGetVersionRequestTypedDict": ".agents_api_v1_agents_get_versionop", + "AgentsAPIV1AgentsGetAgentVersion": ".agents_api_v1_agents_getop", + "AgentsAPIV1AgentsGetAgentVersionTypedDict": ".agents_api_v1_agents_getop", + "AgentsAPIV1AgentsGetRequest": ".agents_api_v1_agents_getop", + "AgentsAPIV1AgentsGetRequestTypedDict": ".agents_api_v1_agents_getop", + "AgentsAPIV1AgentsListVersionAliasesRequest": ".agents_api_v1_agents_list_version_aliasesop", + "AgentsAPIV1AgentsListVersionAliasesRequestTypedDict": ".agents_api_v1_agents_list_version_aliasesop", + "AgentsAPIV1AgentsListVersionsRequest": ".agents_api_v1_agents_list_versionsop", + "AgentsAPIV1AgentsListVersionsRequestTypedDict": ".agents_api_v1_agents_list_versionsop", + "AgentsAPIV1AgentsListRequest": ".agents_api_v1_agents_listop", + "AgentsAPIV1AgentsListRequestTypedDict": ".agents_api_v1_agents_listop", + "AgentsAPIV1AgentsUpdateVersionRequest": ".agents_api_v1_agents_update_versionop", + "AgentsAPIV1AgentsUpdateVersionRequestTypedDict": ".agents_api_v1_agents_update_versionop", + "AgentsAPIV1AgentsUpdateRequest": ".agents_api_v1_agents_updateop", + "AgentsAPIV1AgentsUpdateRequestTypedDict": ".agents_api_v1_agents_updateop", + "AgentsAPIV1ConversationsAppendStreamRequest": ".agents_api_v1_conversations_append_streamop", + "AgentsAPIV1ConversationsAppendStreamRequestTypedDict": ".agents_api_v1_conversations_append_streamop", + "AgentsAPIV1ConversationsAppendRequest": ".agents_api_v1_conversations_appendop", + "AgentsAPIV1ConversationsAppendRequestTypedDict": ".agents_api_v1_conversations_appendop", + "AgentsAPIV1ConversationsDeleteRequest": ".agents_api_v1_conversations_deleteop", + "AgentsAPIV1ConversationsDeleteRequestTypedDict": ".agents_api_v1_conversations_deleteop", + "AgentsAPIV1ConversationsGetRequest": ".agents_api_v1_conversations_getop", + "AgentsAPIV1ConversationsGetRequestTypedDict": ".agents_api_v1_conversations_getop", + "ResponseV1ConversationsGet": ".agents_api_v1_conversations_getop", + "ResponseV1ConversationsGetTypedDict": ".agents_api_v1_conversations_getop", + "AgentsAPIV1ConversationsHistoryRequest": ".agents_api_v1_conversations_historyop", + "AgentsAPIV1ConversationsHistoryRequestTypedDict": ".agents_api_v1_conversations_historyop", + "AgentsAPIV1ConversationsListRequest": ".agents_api_v1_conversations_listop", + "AgentsAPIV1ConversationsListRequestTypedDict": ".agents_api_v1_conversations_listop", + "AgentsAPIV1ConversationsListResponse": ".agents_api_v1_conversations_listop", + "AgentsAPIV1ConversationsListResponseTypedDict": ".agents_api_v1_conversations_listop", + "AgentsAPIV1ConversationsMessagesRequest": ".agents_api_v1_conversations_messagesop", + "AgentsAPIV1ConversationsMessagesRequestTypedDict": ".agents_api_v1_conversations_messagesop", + "AgentsAPIV1ConversationsRestartStreamRequest": ".agents_api_v1_conversations_restart_streamop", + "AgentsAPIV1ConversationsRestartStreamRequestTypedDict": ".agents_api_v1_conversations_restart_streamop", + "AgentsAPIV1ConversationsRestartRequest": ".agents_api_v1_conversations_restartop", + "AgentsAPIV1ConversationsRestartRequestTypedDict": ".agents_api_v1_conversations_restartop", + "AgentsCompletionRequest": ".agentscompletionrequest", + "AgentsCompletionRequestMessage": ".agentscompletionrequest", + "AgentsCompletionRequestMessageTypedDict": ".agentscompletionrequest", + "AgentsCompletionRequestStop": ".agentscompletionrequest", + "AgentsCompletionRequestStopTypedDict": ".agentscompletionrequest", + "AgentsCompletionRequestTool": ".agentscompletionrequest", + "AgentsCompletionRequestToolChoice": ".agentscompletionrequest", + "AgentsCompletionRequestToolChoiceTypedDict": ".agentscompletionrequest", + "AgentsCompletionRequestToolTypedDict": ".agentscompletionrequest", + "AgentsCompletionRequestTypedDict": ".agentscompletionrequest", + "AgentsCompletionStreamRequest": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestMessage": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestMessageTypedDict": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestStop": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestStopTypedDict": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestTool": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestToolChoice": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestToolChoiceTypedDict": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestToolTypedDict": ".agentscompletionstreamrequest", + "AgentsCompletionStreamRequestTypedDict": ".agentscompletionstreamrequest", + "Annotations": ".annotations", + "AnnotationsTypedDict": ".annotations", + "Audience": ".annotations", + "APIEndpoint": ".apiendpoint", + "APIKeyAuth": ".apikeyauth", + "APIKeyAuthTypedDict": ".apikeyauth", + "ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequest": ".archive_workflow_v1_workflows_workflow_identifier_archive_putop", + "ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequestTypedDict": ".archive_workflow_v1_workflows_workflow_identifier_archive_putop", + "ArchiveModelResponse": ".archivemodelresponse", + "ArchiveModelResponseTypedDict": ".archivemodelresponse", + "AssistantMessage": ".assistantmessage", + "AssistantMessageContent": ".assistantmessage", + "AssistantMessageContentTypedDict": ".assistantmessage", + "AssistantMessageTypedDict": ".assistantmessage", + "AudioChunk": ".audiochunk", + "AudioChunkTypedDict": ".audiochunk", + "AudioContent": ".audiocontent", + "AudioContentTypedDict": ".audiocontent", + "AudioEncoding": ".audioencoding", + "AudioFormat": ".audioformat", + "AudioFormatTypedDict": ".audioformat", + "AudioTranscriptionRequest": ".audiotranscriptionrequest", + "AudioTranscriptionRequestTypedDict": ".audiotranscriptionrequest", + "AudioTranscriptionRequestStream": ".audiotranscriptionrequeststream", + "AudioTranscriptionRequestStreamTypedDict": ".audiotranscriptionrequeststream", + "AuthData": ".authdata", + "AuthDataTypedDict": ".authdata", + "AuthenticationConfiguration": ".authenticationconfiguration", + "AuthenticationConfigurationTypedDict": ".authenticationconfiguration", + "AuthURLResponse": ".authurlresponse", + "AuthURLResponseTypedDict": ".authurlresponse", + "BaseFieldDefinition": ".basefielddefinition", + "BaseFieldDefinitionType": ".basefielddefinition", + "BaseFieldDefinitionTypedDict": ".basefielddefinition", + "SupportedOperator": ".basefielddefinition", + "BaseModelCard": ".basemodelcard", + "BaseModelCardTypedDict": ".basemodelcard", + "BaseTaskStatus": ".basetaskstatus", + "BatchError": ".batcherror", + "BatchErrorTypedDict": ".batcherror", + "BatchExecutionBody": ".batchexecutionbody", + "BatchExecutionBodyTypedDict": ".batchexecutionbody", + "BatchExecutionResponse": ".batchexecutionresponse", + "BatchExecutionResponseTypedDict": ".batchexecutionresponse", + "BatchExecutionResult": ".batchexecutionresult", + "BatchExecutionResultTypedDict": ".batchexecutionresult", + "BatchJob": ".batchjob", + "BatchJobTypedDict": ".batchjob", + "BatchJobStatus": ".batchjobstatus", + "BatchRequest": ".batchrequest", + "BatchRequestTypedDict": ".batchrequest", + "BlobResourceContents": ".blobresourcecontents", + "BlobResourceContentsTypedDict": ".blobresourcecontents", + "BuiltInConnectors": ".builtinconnectors", + "Campaign": ".campaign", + "CampaignTypedDict": ".campaign", + "CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequest": ".cancel_workflow_execution_v1_workflows_executions_execution_id_cancel_postop", + "CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequestTypedDict": ".cancel_workflow_execution_v1_workflows_executions_execution_id_cancel_postop", + "ChatClassificationRequest": ".chatclassificationrequest", + "ChatClassificationRequestTypedDict": ".chatclassificationrequest", + "ChatCompletionChoice": ".chatcompletionchoice", + "ChatCompletionChoiceFinishReason": ".chatcompletionchoice", + "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", + "ChatCompletionEvent": ".chatcompletionevent", + "ChatCompletionEventExtraFields": ".chatcompletionevent", + "ChatCompletionEventExtraFieldsTypedDict": ".chatcompletionevent", + "ChatCompletionEventTypedDict": ".chatcompletionevent", + "ChatCompletionEventPreview": ".chatcompletioneventpreview", + "ChatCompletionEventPreviewExtraFields": ".chatcompletioneventpreview", + "ChatCompletionEventPreviewExtraFieldsTypedDict": ".chatcompletioneventpreview", + "ChatCompletionEventPreviewTypedDict": ".chatcompletioneventpreview", + "ChatCompletionRequest": ".chatcompletionrequest", + "ChatCompletionRequestMessage": ".chatcompletionrequest", + "ChatCompletionRequestMessageTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestStop": ".chatcompletionrequest", + "ChatCompletionRequestStopTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestTool": ".chatcompletionrequest", + "ChatCompletionRequestToolChoice": ".chatcompletionrequest", + "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestToolTypedDict": ".chatcompletionrequest", + "ChatCompletionRequestTypedDict": ".chatcompletionrequest", + "ChatCompletionResponse": ".chatcompletionresponse", + "ChatCompletionResponseTypedDict": ".chatcompletionresponse", + "ChatCompletionStreamRequest": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessage": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestMessageTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestTool": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestToolTypedDict": ".chatcompletionstreamrequest", + "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", + "ChatModerationRequest": ".chatmoderationrequest", + "ChatModerationRequestInputs1": ".chatmoderationrequest", + "ChatModerationRequestInputs1TypedDict": ".chatmoderationrequest", + "ChatModerationRequestInputs2": ".chatmoderationrequest", + "ChatModerationRequestInputs2TypedDict": ".chatmoderationrequest", + "ChatModerationRequestInputs3": ".chatmoderationrequest", + "ChatModerationRequestInputs3TypedDict": ".chatmoderationrequest", + "ChatModerationRequestTypedDict": ".chatmoderationrequest", + "ChatTranscriptionEvent": ".chattranscriptionevent", + "ChatTranscriptionEventTypedDict": ".chattranscriptionevent", + "Checkpoint": ".checkpoint", + "CheckpointTypedDict": ".checkpoint", + "ClassificationRequest": ".classificationrequest", + "ClassificationRequestInputs": ".classificationrequest", + "ClassificationRequestInputsTypedDict": ".classificationrequest", + "ClassificationRequestTypedDict": ".classificationrequest", + "ClassificationResponse": ".classificationresponse", + "ClassificationResponseTypedDict": ".classificationresponse", + "ClassificationTargetResult": ".classificationtargetresult", + "ClassificationTargetResultTypedDict": ".classificationtargetresult", + "ClassifierFineTunedModel": ".classifierfinetunedmodel", + "ClassifierFineTunedModelTypedDict": ".classifierfinetunedmodel", + "ClassifierFineTuningJob": ".classifierfinetuningjob", + "ClassifierFineTuningJobIntegration": ".classifierfinetuningjob", + "ClassifierFineTuningJobIntegrationTypedDict": ".classifierfinetuningjob", + "ClassifierFineTuningJobStatus": ".classifierfinetuningjob", + "ClassifierFineTuningJobTypedDict": ".classifierfinetuningjob", + "UnknownClassifierFineTuningJobIntegration": ".classifierfinetuningjob", + "ClassifierFineTuningJobDetails": ".classifierfinetuningjobdetails", + "ClassifierFineTuningJobDetailsIntegration": ".classifierfinetuningjobdetails", + "ClassifierFineTuningJobDetailsIntegrationTypedDict": ".classifierfinetuningjobdetails", + "ClassifierFineTuningJobDetailsStatus": ".classifierfinetuningjobdetails", + "ClassifierFineTuningJobDetailsTypedDict": ".classifierfinetuningjobdetails", + "UnknownClassifierFineTuningJobDetailsIntegration": ".classifierfinetuningjobdetails", + "ClassifierTarget": ".classifiertarget", + "ClassifierTargetTypedDict": ".classifiertarget", + "ClassifierTargetResult": ".classifiertargetresult", + "ClassifierTargetResultTypedDict": ".classifiertargetresult", + "ClassifierTrainingParameters": ".classifiertrainingparameters", + "ClassifierTrainingParametersTypedDict": ".classifiertrainingparameters", + "CodeInterpreterTool": ".codeinterpretertool", + "CodeInterpreterToolTypedDict": ".codeinterpretertool", + "CompletionArgs": ".completionargs", + "CompletionArgsTypedDict": ".completionargs", + "CompletionArgsStop": ".completionargsstop", + "CompletionArgsStopTypedDict": ".completionargsstop", + "CompletionChunk": ".completionchunk", + "CompletionChunkTypedDict": ".completionchunk", + "CompletionEvent": ".completionevent", + "CompletionEventTypedDict": ".completionevent", + "CompletionFineTunedModel": ".completionfinetunedmodel", + "CompletionFineTunedModelTypedDict": ".completionfinetunedmodel", + "CompletionFineTuningJob": ".completionfinetuningjob", + "CompletionFineTuningJobIntegration": ".completionfinetuningjob", + "CompletionFineTuningJobIntegrationTypedDict": ".completionfinetuningjob", + "CompletionFineTuningJobRepository": ".completionfinetuningjob", + "CompletionFineTuningJobRepositoryTypedDict": ".completionfinetuningjob", + "CompletionFineTuningJobStatus": ".completionfinetuningjob", + "CompletionFineTuningJobTypedDict": ".completionfinetuningjob", + "UnknownCompletionFineTuningJobIntegration": ".completionfinetuningjob", + "UnknownCompletionFineTuningJobRepository": ".completionfinetuningjob", + "CompletionFineTuningJobDetails": ".completionfinetuningjobdetails", + "CompletionFineTuningJobDetailsIntegration": ".completionfinetuningjobdetails", + "CompletionFineTuningJobDetailsIntegrationTypedDict": ".completionfinetuningjobdetails", + "CompletionFineTuningJobDetailsRepository": ".completionfinetuningjobdetails", + "CompletionFineTuningJobDetailsRepositoryTypedDict": ".completionfinetuningjobdetails", + "CompletionFineTuningJobDetailsStatus": ".completionfinetuningjobdetails", + "CompletionFineTuningJobDetailsTypedDict": ".completionfinetuningjobdetails", + "UnknownCompletionFineTuningJobDetailsIntegration": ".completionfinetuningjobdetails", + "UnknownCompletionFineTuningJobDetailsRepository": ".completionfinetuningjobdetails", + "CompletionResponseStreamChoice": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceFinishReason": ".completionresponsestreamchoice", + "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", + "CompletionTrainingParameters": ".completiontrainingparameters", + "CompletionTrainingParametersTypedDict": ".completiontrainingparameters", + "ConnectionCredentials": ".connectioncredentials", + "ConnectionCredentialsTypedDict": ".connectioncredentials", + "Connector": ".connector", + "ConnectorTypedDict": ".connector", + "ConnectorCallToolV1Request": ".connector_call_tool_v1op", + "ConnectorCallToolV1RequestTypedDict": ".connector_call_tool_v1op", + "ConnectorCreateOrUpdateOrganizationCredentialsV1Request": ".connector_create_or_update_organization_credentials_v1op", + "ConnectorCreateOrUpdateOrganizationCredentialsV1RequestTypedDict": ".connector_create_or_update_organization_credentials_v1op", + "ConnectorCreateOrUpdateUserCredentialsV1Request": ".connector_create_or_update_user_credentials_v1op", + "ConnectorCreateOrUpdateUserCredentialsV1RequestTypedDict": ".connector_create_or_update_user_credentials_v1op", + "ConnectorCreateOrUpdateWorkspaceCredentialsV1Request": ".connector_create_or_update_workspace_credentials_v1op", + "ConnectorCreateOrUpdateWorkspaceCredentialsV1RequestTypedDict": ".connector_create_or_update_workspace_credentials_v1op", + "ConnectorDeleteOrganizationCredentialsV1Request": ".connector_delete_organization_credentials_v1op", + "ConnectorDeleteOrganizationCredentialsV1RequestTypedDict": ".connector_delete_organization_credentials_v1op", + "ConnectorDeleteUserCredentialsV1Request": ".connector_delete_user_credentials_v1op", + "ConnectorDeleteUserCredentialsV1RequestTypedDict": ".connector_delete_user_credentials_v1op", + "ConnectorDeleteV1Request": ".connector_delete_v1op", + "ConnectorDeleteV1RequestTypedDict": ".connector_delete_v1op", + "ConnectorDeleteWorkspaceCredentialsV1Request": ".connector_delete_workspace_credentials_v1op", + "ConnectorDeleteWorkspaceCredentialsV1RequestTypedDict": ".connector_delete_workspace_credentials_v1op", + "ConnectorGetAuthURLV1Request": ".connector_get_auth_url_v1op", + "ConnectorGetAuthURLV1RequestTypedDict": ".connector_get_auth_url_v1op", + "ConnectorGetAuthenticationMethodsV1Request": ".connector_get_authentication_methods_v1op", + "ConnectorGetAuthenticationMethodsV1RequestTypedDict": ".connector_get_authentication_methods_v1op", + "ConnectorGetV1Request": ".connector_get_v1op", + "ConnectorGetV1RequestTypedDict": ".connector_get_v1op", + "ConnectorListOrganizationCredentialsV1Request": ".connector_list_organization_credentials_v1op", + "ConnectorListOrganizationCredentialsV1RequestTypedDict": ".connector_list_organization_credentials_v1op", + "ConnectorListToolsV1Request": ".connector_list_tools_v1op", + "ConnectorListToolsV1RequestTypedDict": ".connector_list_tools_v1op", + "ResponseConnectorListToolsV1": ".connector_list_tools_v1op", + "ResponseConnectorListToolsV1TypedDict": ".connector_list_tools_v1op", + "ConnectorListUserCredentialsV1Request": ".connector_list_user_credentials_v1op", + "ConnectorListUserCredentialsV1RequestTypedDict": ".connector_list_user_credentials_v1op", + "ConnectorListV1Request": ".connector_list_v1op", + "ConnectorListV1RequestTypedDict": ".connector_list_v1op", + "ConnectorListWorkspaceCredentialsV1Request": ".connector_list_workspace_credentials_v1op", + "ConnectorListWorkspaceCredentialsV1RequestTypedDict": ".connector_list_workspace_credentials_v1op", + "ConnectorUpdateV1Request": ".connector_update_v1op", + "ConnectorUpdateV1RequestTypedDict": ".connector_update_v1op", + "ConnectorAuthenticationHeader": ".connectorauthenticationheader", + "ConnectorAuthenticationHeaderTypedDict": ".connectorauthenticationheader", + "ConnectorCallToolRequest": ".connectorcalltoolrequest", + "ConnectorCallToolRequestTypedDict": ".connectorcalltoolrequest", + "ConnectorsQueryFilters": ".connectorsqueryfilters", + "ConnectorsQueryFiltersTypedDict": ".connectorsqueryfilters", + "ConnectorTool": ".connectortool", + "ConnectorToolTypedDict": ".connectortool", + "ConnectorToolCallMetadata": ".connectortoolcallmetadata", + "ConnectorToolCallMetadataTypedDict": ".connectortoolcallmetadata", + "ConnectorToolCallResponse": ".connectortoolcallresponse", + "ConnectorToolCallResponseContent": ".connectortoolcallresponse", + "ConnectorToolCallResponseContentTypedDict": ".connectortoolcallresponse", + "ConnectorToolCallResponseTypedDict": ".connectortoolcallresponse", + "UnknownConnectorToolCallResponseContent": ".connectortoolcallresponse", + "ConnectorToolLocale": ".connectortoollocale", + "ConnectorToolLocaleTypedDict": ".connectortoollocale", + "ConnectorToolResultMetadata": ".connectortoolresultmetadata", + "ConnectorToolResultMetadataTypedDict": ".connectortoolresultmetadata", + "ContentChunk": ".contentchunk", + "ContentChunkTypedDict": ".contentchunk", + "UnknownContentChunk": ".contentchunk", + "ConversationAppendRequest": ".conversationappendrequest", + "ConversationAppendRequestHandoffExecution": ".conversationappendrequest", + "ConversationAppendRequestTypedDict": ".conversationappendrequest", + "ConversationAppendStreamRequest": ".conversationappendstreamrequest", + "ConversationAppendStreamRequestHandoffExecution": ".conversationappendstreamrequest", + "ConversationAppendStreamRequestTypedDict": ".conversationappendstreamrequest", + "ConversationEvents": ".conversationevents", + "ConversationEventsData": ".conversationevents", + "ConversationEventsDataTypedDict": ".conversationevents", + "ConversationEventsTypedDict": ".conversationevents", + "UnknownConversationEventsData": ".conversationevents", + "ConversationHistory": ".conversationhistory", + "ConversationHistoryTypedDict": ".conversationhistory", + "Entry": ".conversationhistory", + "EntryTypedDict": ".conversationhistory", + "ConversationInputs": ".conversationinputs", + "ConversationInputsTypedDict": ".conversationinputs", + "ConversationMessages": ".conversationmessages", + "ConversationMessagesTypedDict": ".conversationmessages", + "ConversationPayload": ".conversationpayload", + "ConversationPayloadTypedDict": ".conversationpayload", + "ConversationRequest": ".conversationrequest", + "ConversationRequestAgentVersion": ".conversationrequest", + "ConversationRequestAgentVersionTypedDict": ".conversationrequest", + "ConversationRequestHandoffExecution": ".conversationrequest", + "ConversationRequestTool": ".conversationrequest", + "ConversationRequestToolTypedDict": ".conversationrequest", + "ConversationRequestTypedDict": ".conversationrequest", + "ConversationResponse": ".conversationresponse", + "ConversationResponseOutput": ".conversationresponse", + "ConversationResponseOutputTypedDict": ".conversationresponse", + "ConversationResponseTypedDict": ".conversationresponse", + "ConversationRestartRequest": ".conversationrestartrequest", + "ConversationRestartRequestAgentVersion": ".conversationrestartrequest", + "ConversationRestartRequestAgentVersionTypedDict": ".conversationrestartrequest", + "ConversationRestartRequestHandoffExecution": ".conversationrestartrequest", + "ConversationRestartRequestTypedDict": ".conversationrestartrequest", + "ConversationRestartStreamRequest": ".conversationrestartstreamrequest", + "ConversationRestartStreamRequestAgentVersion": ".conversationrestartstreamrequest", + "ConversationRestartStreamRequestAgentVersionTypedDict": ".conversationrestartstreamrequest", + "ConversationRestartStreamRequestHandoffExecution": ".conversationrestartstreamrequest", + "ConversationRestartStreamRequestTypedDict": ".conversationrestartstreamrequest", + "ConversationSource": ".conversationsource", + "ConversationStreamRequest": ".conversationstreamrequest", + "ConversationStreamRequestAgentVersion": ".conversationstreamrequest", + "ConversationStreamRequestAgentVersionTypedDict": ".conversationstreamrequest", + "ConversationStreamRequestHandoffExecution": ".conversationstreamrequest", + "ConversationStreamRequestTool": ".conversationstreamrequest", + "ConversationStreamRequestToolTypedDict": ".conversationstreamrequest", + "ConversationStreamRequestTypedDict": ".conversationstreamrequest", + "ConversationUsageInfo": ".conversationusageinfo", + "ConversationUsageInfoTypedDict": ".conversationusageinfo", + "CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequest": ".create_dataset_record_v1_observability_datasets_dataset_id_records_postop", + "CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequestTypedDict": ".create_dataset_record_v1_observability_datasets_dataset_id_records_postop", + "CreateAgentRequest": ".createagentrequest", + "CreateAgentRequestTool": ".createagentrequest", + "CreateAgentRequestToolTypedDict": ".createagentrequest", + "CreateAgentRequestTypedDict": ".createagentrequest", + "CreateBatchJobRequest": ".createbatchjobrequest", + "CreateBatchJobRequestTypedDict": ".createbatchjobrequest", + "CreateCampaignRequest": ".createcampaignrequest", + "CreateCampaignRequestTypedDict": ".createcampaignrequest", + "CreateConnectorRequest": ".createconnectorrequest", + "CreateConnectorRequestTypedDict": ".createconnectorrequest", + "CreateDatasetRecordRequest": ".createdatasetrecordrequest", + "CreateDatasetRecordRequestTypedDict": ".createdatasetrecordrequest", + "CreateDatasetRequest": ".createdatasetrequest", + "CreateDatasetRequestTypedDict": ".createdatasetrequest", + "CreateFileResponse": ".createfileresponse", + "CreateFileResponseTypedDict": ".createfileresponse", + "CreateFineTuningJobRequest": ".createfinetuningjobrequest", + "CreateFineTuningJobRequestIntegration": ".createfinetuningjobrequest", + "CreateFineTuningJobRequestIntegrationTypedDict": ".createfinetuningjobrequest", + "CreateFineTuningJobRequestRepository": ".createfinetuningjobrequest", + "CreateFineTuningJobRequestRepositoryTypedDict": ".createfinetuningjobrequest", + "CreateFineTuningJobRequestTypedDict": ".createfinetuningjobrequest", + "Hyperparameters": ".createfinetuningjobrequest", + "HyperparametersTypedDict": ".createfinetuningjobrequest", + "CreateGithubRepositoryRequest": ".creategithubrepositoryrequest", + "CreateGithubRepositoryRequestTypedDict": ".creategithubrepositoryrequest", + "CreateIngestionPipelineConfigurationRequest": ".createingestionpipelineconfigurationrequest", + "CreateIngestionPipelineConfigurationRequestTypedDict": ".createingestionpipelineconfigurationrequest", + "CreateJudgeRequest": ".createjudgerequest", + "CreateJudgeRequestOutput": ".createjudgerequest", + "CreateJudgeRequestOutputTypedDict": ".createjudgerequest", + "CreateJudgeRequestTypedDict": ".createjudgerequest", + "CreateLibraryRequest": ".createlibraryrequest", + "CreateLibraryRequestTypedDict": ".createlibraryrequest", + "OwnerType": ".createlibraryrequest", + "CredentialsCreateOrUpdate": ".credentialscreateorupdate", + "CredentialsCreateOrUpdateTypedDict": ".credentialscreateorupdate", + "CredentialsResponse": ".credentialsresponse", + "CredentialsResponseTypedDict": ".credentialsresponse", + "Authorization": ".customconnector", + "AuthorizationTypedDict": ".customconnector", + "CustomConnector": ".customconnector", + "CustomConnectorTypedDict": ".customconnector", + "UnknownAuthorization": ".customconnector", + "CustomTaskCanceledAttributes": ".customtaskcanceledattributes", + "CustomTaskCanceledAttributesTypedDict": ".customtaskcanceledattributes", + "CustomTaskCanceledResponse": ".customtaskcanceledresponse", + "CustomTaskCanceledResponseTypedDict": ".customtaskcanceledresponse", + "CustomTaskCompletedAttributesResponse": ".customtaskcompletedattributesresponse", + "CustomTaskCompletedAttributesResponseTypedDict": ".customtaskcompletedattributesresponse", + "CustomTaskCompletedResponse": ".customtaskcompletedresponse", + "CustomTaskCompletedResponseTypedDict": ".customtaskcompletedresponse", + "CustomTaskFailedAttributes": ".customtaskfailedattributes", + "CustomTaskFailedAttributesTypedDict": ".customtaskfailedattributes", + "CustomTaskFailedResponse": ".customtaskfailedresponse", + "CustomTaskFailedResponseTypedDict": ".customtaskfailedresponse", + "CustomTaskInProgressAttributesResponse": ".customtaskinprogressattributesresponse", + "CustomTaskInProgressAttributesResponseTypedDict": ".customtaskinprogressattributesresponse", + "Payload": ".customtaskinprogressattributesresponse", + "PayloadTypedDict": ".customtaskinprogressattributesresponse", + "UnknownPayload": ".customtaskinprogressattributesresponse", + "CustomTaskInProgressResponse": ".customtaskinprogressresponse", + "CustomTaskInProgressResponseTypedDict": ".customtaskinprogressresponse", + "CustomTaskStartedAttributesResponse": ".customtaskstartedattributesresponse", + "CustomTaskStartedAttributesResponseTypedDict": ".customtaskstartedattributesresponse", + "CustomTaskStartedResponse": ".customtaskstartedresponse", + "CustomTaskStartedResponseTypedDict": ".customtaskstartedresponse", + "CustomTaskTimedOutAttributes": ".customtasktimedoutattributes", + "CustomTaskTimedOutAttributesTypedDict": ".customtasktimedoutattributes", + "CustomTaskTimedOutResponse": ".customtasktimedoutresponse", + "CustomTaskTimedOutResponseTypedDict": ".customtasktimedoutresponse", + "Dataset": ".dataset", + "DatasetTypedDict": ".dataset", + "DatasetImportTask": ".datasetimporttask", + "DatasetImportTaskTypedDict": ".datasetimporttask", + "DatasetPreview": ".datasetpreview", + "DatasetPreviewTypedDict": ".datasetpreview", + "DatasetRecord": ".datasetrecord", + "DatasetRecordTypedDict": ".datasetrecord", + "DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequest": ".delete_campaign_v1_observability_campaigns_campaign_id_deleteop", + "DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequestTypedDict": ".delete_campaign_v1_observability_campaigns_campaign_id_deleteop", + "DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequest": ".delete_dataset_record_v1_observability_dataset_records_dataset_record_id_deleteop", + "DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequestTypedDict": ".delete_dataset_record_v1_observability_dataset_records_dataset_record_id_deleteop", + "DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequest": ".delete_dataset_v1_observability_datasets_dataset_id_deleteop", + "DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequestTypedDict": ".delete_dataset_v1_observability_datasets_dataset_id_deleteop", + "DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequest": ".delete_judge_v1_observability_judges_judge_id_deleteop", + "DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequestTypedDict": ".delete_judge_v1_observability_judges_judge_id_deleteop", + "DeleteModelV1ModelsModelIDDeleteRequest": ".delete_model_v1_models_model_id_deleteop", + "DeleteModelV1ModelsModelIDDeleteRequestTypedDict": ".delete_model_v1_models_model_id_deleteop", + "DeleteVoiceV1AudioVoicesVoiceIDDeleteRequest": ".delete_voice_v1_audio_voices_voice_id_deleteop", + "DeleteVoiceV1AudioVoicesVoiceIDDeleteRequestTypedDict": ".delete_voice_v1_audio_voices_voice_id_deleteop", + "DeleteBatchJobResponse": ".deletebatchjobresponse", + "DeleteBatchJobResponseTypedDict": ".deletebatchjobresponse", + "DeleteDatasetRecordsRequest": ".deletedatasetrecordsrequest", + "DeleteDatasetRecordsRequestTypedDict": ".deletedatasetrecordsrequest", + "DeleteFileResponse": ".deletefileresponse", + "DeleteFileResponseTypedDict": ".deletefileresponse", + "DeleteModelResponse": ".deletemodelresponse", + "DeleteModelResponseTypedDict": ".deletemodelresponse", + "DeltaMessage": ".deltamessage", + "DeltaMessageContent": ".deltamessage", + "DeltaMessageContentTypedDict": ".deltamessage", + "DeltaMessageTypedDict": ".deltamessage", + "DeploymentDetailResponse": ".deploymentdetailresponse", + "DeploymentDetailResponseTypedDict": ".deploymentdetailresponse", + "DeploymentListResponse": ".deploymentlistresponse", + "DeploymentListResponseTypedDict": ".deploymentlistresponse", + "DeploymentLocation": ".deploymentlocation", + "DeploymentLocationTypedDict": ".deploymentlocation", + "DeploymentResponse": ".deploymentresponse", + "DeploymentResponseTypedDict": ".deploymentresponse", + "DeploymentWorkerResponse": ".deploymentworkerresponse", + "DeploymentWorkerResponseTypedDict": ".deploymentworkerresponse", + "Document": ".document", + "DocumentTypedDict": ".document", + "DocumentLibraryTool": ".documentlibrarytool", + "DocumentLibraryToolTypedDict": ".documentlibrarytool", + "DocumentTextContent": ".documenttextcontent", + "DocumentTextContentTypedDict": ".documenttextcontent", + "DocumentURLChunk": ".documenturlchunk", + "DocumentURLChunkTypedDict": ".documenturlchunk", + "EmbeddedResource": ".embeddedresource", + "EmbeddedResourceTypedDict": ".embeddedresource", + "Resource": ".embeddedresource", + "ResourceTypedDict": ".embeddedresource", + "EmbeddingDtype": ".embeddingdtype", + "EmbeddingRequest": ".embeddingrequest", + "EmbeddingRequestInputs": ".embeddingrequest", + "EmbeddingRequestInputsTypedDict": ".embeddingrequest", + "EmbeddingRequestTypedDict": ".embeddingrequest", + "EmbeddingResponse": ".embeddingresponse", + "EmbeddingResponseTypedDict": ".embeddingresponse", + "EmbeddingResponseData": ".embeddingresponsedata", + "EmbeddingResponseDataTypedDict": ".embeddingresponsedata", + "EncodedPayloadOptions": ".encodedpayloadoptions", + "EncodingFormat": ".encodingformat", + "EntityType": ".entitytype", + "Event": ".event", + "EventTypedDict": ".event", + "EventProgressStatus": ".eventprogressstatus", + "EventSource": ".eventsource", + "EventType": ".eventtype", + "ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequest": ".execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop", + "ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequestTypedDict": ".execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop", + "ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost": ".execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop", + "ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostTypedDict": ".execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop", + "ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequest": ".execute_workflow_v1_workflows_workflow_identifier_execute_postop", + "ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequestTypedDict": ".execute_workflow_v1_workflows_workflow_identifier_execute_postop", + "ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost": ".execute_workflow_v1_workflows_workflow_identifier_execute_postop", + "ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostTypedDict": ".execute_workflow_v1_workflows_workflow_identifier_execute_postop", + "ExecutionConfig": ".executionconfig", + "ExecutionConfigTypedDict": ".executionconfig", + "ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequest": ".export_dataset_to_jsonl_v1_observability_datasets_dataset_id_exports_to_jsonl_getop", + "ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequestTypedDict": ".export_dataset_to_jsonl_v1_observability_datasets_dataset_id_exports_to_jsonl_getop", + "ExportDatasetResponse": ".exportdatasetresponse", + "ExportDatasetResponseTypedDict": ".exportdatasetresponse", + "Failure": ".failure", + "FailureTypedDict": ".failure", + "FeedResultChatCompletionEventPreview": ".feedresultchatcompletioneventpreview", + "FeedResultChatCompletionEventPreviewTypedDict": ".feedresultchatcompletioneventpreview", + "FetchCampaignStatusResponse": ".fetchcampaignstatusresponse", + "FetchCampaignStatusResponseTypedDict": ".fetchcampaignstatusresponse", + "FetchChatCompletionFieldOptionsResponse": ".fetchchatcompletionfieldoptionsresponse", + "FetchChatCompletionFieldOptionsResponseTypedDict": ".fetchchatcompletionfieldoptionsresponse", + "Option": ".fetchchatcompletionfieldoptionsresponse", + "OptionTypedDict": ".fetchchatcompletionfieldoptionsresponse", + "FetchFieldOptionCountsRequest": ".fetchfieldoptioncountsrequest", + "FetchFieldOptionCountsRequestTypedDict": ".fetchfieldoptioncountsrequest", + "FetchFieldOptionCountsResponse": ".fetchfieldoptioncountsresponse", + "FetchFieldOptionCountsResponseTypedDict": ".fetchfieldoptioncountsresponse", + "FieldGroup": ".fieldgroup", + "FieldGroupTypedDict": ".fieldgroup", + "FieldOptionCountItem": ".fieldoptioncountitem", + "FieldOptionCountItemTypedDict": ".fieldoptioncountitem", + "File": ".file", + "FileTypedDict": ".file", + "FileChunk": ".filechunk", + "FileChunkTypedDict": ".filechunk", + "FilePurpose": ".filepurpose", + "FilesAPIRoutesDeleteFileRequest": ".files_api_routes_delete_fileop", + "FilesAPIRoutesDeleteFileRequestTypedDict": ".files_api_routes_delete_fileop", + "FilesAPIRoutesDownloadFileRequest": ".files_api_routes_download_fileop", + "FilesAPIRoutesDownloadFileRequestTypedDict": ".files_api_routes_download_fileop", + "FilesAPIRoutesGetSignedURLRequest": ".files_api_routes_get_signed_urlop", + "FilesAPIRoutesGetSignedURLRequestTypedDict": ".files_api_routes_get_signed_urlop", + "FilesAPIRoutesListFilesRequest": ".files_api_routes_list_filesop", + "FilesAPIRoutesListFilesRequestTypedDict": ".files_api_routes_list_filesop", + "FilesAPIRoutesRetrieveFileRequest": ".files_api_routes_retrieve_fileop", + "FilesAPIRoutesRetrieveFileRequestTypedDict": ".files_api_routes_retrieve_fileop", + "FilesAPIRoutesUploadFileFileVisibility": ".files_api_routes_upload_fileop", + "MultiPartBodyParams": ".files_api_routes_upload_fileop", + "MultiPartBodyParamsTypedDict": ".files_api_routes_upload_fileop", + "FileSchema": ".fileschema", + "FileSchemaTypedDict": ".fileschema", + "FileVisibility": ".filevisibility", + "FilterCondition": ".filtercondition", + "FilterConditionTypedDict": ".filtercondition", + "Op": ".filtercondition", + "FilterPayload": ".filterpayload", + "FilterPayloadTypedDict": ".filterpayload", + "Filters": ".filterpayload", + "FiltersTypedDict": ".filterpayload", + "FIMCompletionRequest": ".fimcompletionrequest", + "FIMCompletionRequestStop": ".fimcompletionrequest", + "FIMCompletionRequestStopTypedDict": ".fimcompletionrequest", + "FIMCompletionRequestTypedDict": ".fimcompletionrequest", + "FIMCompletionResponse": ".fimcompletionresponse", + "FIMCompletionResponseTypedDict": ".fimcompletionresponse", + "FIMCompletionStreamRequest": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestStop": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestStopTypedDict": ".fimcompletionstreamrequest", + "FIMCompletionStreamRequestTypedDict": ".fimcompletionstreamrequest", + "FineTuneableModelType": ".finetuneablemodeltype", + "FineTunedModelCapabilities": ".finetunedmodelcapabilities", + "FineTunedModelCapabilitiesTypedDict": ".finetunedmodelcapabilities", + "FTClassifierLossFunction": ".ftclassifierlossfunction", + "FTModelCard": ".ftmodelcard", + "FTModelCardTypedDict": ".ftmodelcard", + "Function": ".function", + "FunctionTypedDict": ".function", + "Arguments": ".functioncall", + "ArgumentsTypedDict": ".functioncall", + "FunctionCall": ".functioncall", + "FunctionCallTypedDict": ".functioncall", + "FunctionCallEntry": ".functioncallentry", + "FunctionCallEntryConfirmationStatus": ".functioncallentry", + "FunctionCallEntryTypedDict": ".functioncallentry", + "FunctionCallEntryArguments": ".functioncallentryarguments", + "FunctionCallEntryArgumentsTypedDict": ".functioncallentryarguments", + "FunctionCallEvent": ".functioncallevent", + "FunctionCallEventConfirmationStatus": ".functioncallevent", + "FunctionCallEventTypedDict": ".functioncallevent", + "FunctionName": ".functionname", + "FunctionNameTypedDict": ".functionname", + "FunctionResultEntry": ".functionresultentry", + "FunctionResultEntryTypedDict": ".functionresultentry", + "FunctionTool": ".functiontool", + "FunctionToolTypedDict": ".functiontool", + "GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequest": ".get_campaign_by_id_v1_observability_campaigns_campaign_id_getop", + "GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequestTypedDict": ".get_campaign_by_id_v1_observability_campaigns_campaign_id_getop", + "GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequest": ".get_campaign_selected_events_v1_observability_campaigns_campaign_id_selected_events_getop", + "GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequestTypedDict": ".get_campaign_selected_events_v1_observability_campaigns_campaign_id_selected_events_getop", + "GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequest": ".get_campaign_status_by_id_v1_observability_campaigns_campaign_id_status_getop", + "GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequestTypedDict": ".get_campaign_status_by_id_v1_observability_campaigns_campaign_id_status_getop", + "GetCampaignsV1ObservabilityCampaignsGetRequest": ".get_campaigns_v1_observability_campaigns_getop", + "GetCampaignsV1ObservabilityCampaignsGetRequestTypedDict": ".get_campaigns_v1_observability_campaigns_getop", + "GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequest": ".get_chat_completion_event_v1_observability_chat_completion_events_event_id_getop", + "GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequestTypedDict": ".get_chat_completion_event_v1_observability_chat_completion_events_event_id_getop", + "GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest": ".get_chat_completion_events_v1_observability_chat_completion_events_search_postop", + "GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequestTypedDict": ".get_chat_completion_events_v1_observability_chat_completion_events_search_postop", + "GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest": ".get_chat_completion_field_options_counts_v1_observability_chat_completion_fields_field_name_options_counts_postop", + "GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequestTypedDict": ".get_chat_completion_field_options_counts_v1_observability_chat_completion_fields_field_name_options_counts_postop", + "GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest": ".get_chat_completion_field_options_v1_observability_chat_completion_fields_field_name_options_getop", + "GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequestTypedDict": ".get_chat_completion_field_options_v1_observability_chat_completion_fields_field_name_options_getop", + "Operator": ".get_chat_completion_field_options_v1_observability_chat_completion_fields_field_name_options_getop", + "GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequest": ".get_dataset_by_id_v1_observability_datasets_dataset_id_getop", + "GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequestTypedDict": ".get_dataset_by_id_v1_observability_datasets_dataset_id_getop", + "GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequest": ".get_dataset_import_task_v1_observability_datasets_dataset_id_tasks_task_id_getop", + "GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequestTypedDict": ".get_dataset_import_task_v1_observability_datasets_dataset_id_tasks_task_id_getop", + "GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequest": ".get_dataset_import_tasks_v1_observability_datasets_dataset_id_tasks_getop", + "GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequestTypedDict": ".get_dataset_import_tasks_v1_observability_datasets_dataset_id_tasks_getop", + "GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequest": ".get_dataset_record_v1_observability_dataset_records_dataset_record_id_getop", + "GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequestTypedDict": ".get_dataset_record_v1_observability_dataset_records_dataset_record_id_getop", + "GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequest": ".get_dataset_records_v1_observability_datasets_dataset_id_records_getop", + "GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequestTypedDict": ".get_dataset_records_v1_observability_datasets_dataset_id_records_getop", + "GetDatasetsV1ObservabilityDatasetsGetRequest": ".get_datasets_v1_observability_datasets_getop", + "GetDatasetsV1ObservabilityDatasetsGetRequestTypedDict": ".get_datasets_v1_observability_datasets_getop", + "GetDeploymentV1WorkflowsDeploymentsNameGetRequest": ".get_deployment_v1_workflows_deployments_name_getop", + "GetDeploymentV1WorkflowsDeploymentsNameGetRequestTypedDict": ".get_deployment_v1_workflows_deployments_name_getop", + "GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequest": ".get_judge_by_id_v1_observability_judges_judge_id_getop", + "GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequestTypedDict": ".get_judge_by_id_v1_observability_judges_judge_id_getop", + "GetJudgesV1ObservabilityJudgesGetRequest": ".get_judges_v1_observability_judges_getop", + "GetJudgesV1ObservabilityJudgesGetRequestTypedDict": ".get_judges_v1_observability_judges_getop", + "GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequest": ".get_run_history_v1_workflows_runs_run_id_history_getop", + "GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequestTypedDict": ".get_run_history_v1_workflows_runs_run_id_history_getop", + "GetRunV1WorkflowsRunsRunIDGetRequest": ".get_run_v1_workflows_runs_run_id_getop", + "GetRunV1WorkflowsRunsRunIDGetRequestTypedDict": ".get_run_v1_workflows_runs_run_id_getop", + "GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest": ".get_similar_chat_completion_events_v1_observability_chat_completion_events_event_id_similar_events_getop", + "GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequestTypedDict": ".get_similar_chat_completion_events_v1_observability_chat_completion_events_event_id_similar_events_getop", + "GetStreamEventsV1WorkflowsEventsStreamGetRequest": ".get_stream_events_v1_workflows_events_stream_getop", + "GetStreamEventsV1WorkflowsEventsStreamGetRequestTypedDict": ".get_stream_events_v1_workflows_events_stream_getop", + "GetStreamEventsV1WorkflowsEventsStreamGetResponseBody": ".get_stream_events_v1_workflows_events_stream_getop", + "GetStreamEventsV1WorkflowsEventsStreamGetResponseBodyTypedDict": ".get_stream_events_v1_workflows_events_stream_getop", + "Scope": ".get_stream_events_v1_workflows_events_stream_getop", + "GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequest": ".get_voice_sample_audio_v1_audio_voices_voice_id_sample_getop", + "GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequestTypedDict": ".get_voice_sample_audio_v1_audio_voices_voice_id_sample_getop", + "GetVoiceV1AudioVoicesVoiceIDGetRequest": ".get_voice_v1_audio_voices_voice_id_getop", + "GetVoiceV1AudioVoicesVoiceIDGetRequestTypedDict": ".get_voice_v1_audio_voices_voice_id_getop", + "GetWorkflowEventsV1WorkflowsEventsListGetRequest": ".get_workflow_events_v1_workflows_events_list_getop", + "GetWorkflowEventsV1WorkflowsEventsListGetRequestTypedDict": ".get_workflow_events_v1_workflows_events_list_getop", + "GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequest": ".get_workflow_execution_history_v1_workflows_executions_execution_id_history_getop", + "GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequestTypedDict": ".get_workflow_execution_history_v1_workflows_executions_execution_id_history_getop", + "GetWorkflowExecutionTraceEventsRequest": ".get_workflow_execution_trace_eventsop", + "GetWorkflowExecutionTraceEventsRequestTypedDict": ".get_workflow_execution_trace_eventsop", + "GetWorkflowExecutionTraceOtelRequest": ".get_workflow_execution_trace_otelop", + "GetWorkflowExecutionTraceOtelRequestTypedDict": ".get_workflow_execution_trace_otelop", + "GetWorkflowExecutionTraceSummaryRequest": ".get_workflow_execution_trace_summaryop", + "GetWorkflowExecutionTraceSummaryRequestTypedDict": ".get_workflow_execution_trace_summaryop", + "GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequest": ".get_workflow_execution_v1_workflows_executions_execution_id_getop", + "GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequestTypedDict": ".get_workflow_execution_v1_workflows_executions_execution_id_getop", + "GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequest": ".get_workflow_metrics_v1_workflows_workflow_name_metrics_getop", + "GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequestTypedDict": ".get_workflow_metrics_v1_workflows_workflow_name_metrics_getop", + "GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequest": ".get_workflow_registration_v1_workflows_registrations_workflow_registration_id_getop", + "GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequestTypedDict": ".get_workflow_registration_v1_workflows_registrations_workflow_registration_id_getop", + "GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequest": ".get_workflow_registrations_v1_workflows_registrations_getop", + "GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequestTypedDict": ".get_workflow_registrations_v1_workflows_registrations_getop", + "GetWorkflowV1WorkflowsWorkflowIdentifierGetRequest": ".get_workflow_v1_workflows_workflow_identifier_getop", + "GetWorkflowV1WorkflowsWorkflowIdentifierGetRequestTypedDict": ".get_workflow_v1_workflows_workflow_identifier_getop", + "GetWorkflowsV1WorkflowsGetRequest": ".get_workflows_v1_workflows_getop", + "GetWorkflowsV1WorkflowsGetRequestTypedDict": ".get_workflows_v1_workflows_getop", + "GetWorkflowsV1WorkflowsGetResponse": ".get_workflows_v1_workflows_getop", + "GetWorkflowsV1WorkflowsGetResponseTypedDict": ".get_workflows_v1_workflows_getop", + "GetFileResponse": ".getfileresponse", + "GetFileResponseTypedDict": ".getfileresponse", + "GetSignedURLResponse": ".getsignedurlresponse", + "GetSignedURLResponseTypedDict": ".getsignedurlresponse", + "GithubRepository": ".githubrepository", + "GithubRepositoryTypedDict": ".githubrepository", + "GuardrailConfig": ".guardrailconfig", + "GuardrailConfigTypedDict": ".guardrailconfig", + "ImageContent": ".imagecontent", + "ImageContentTypedDict": ".imagecontent", + "ImageDetail": ".imagedetail", + "ImageGenerationTool": ".imagegenerationtool", + "ImageGenerationToolTypedDict": ".imagegenerationtool", + "ImageURL": ".imageurl", + "ImageURLTypedDict": ".imageurl", + "ImageURLChunk": ".imageurlchunk", + "ImageURLChunkTypedDict": ".imageurlchunk", + "ImageURLUnion": ".imageurlchunk", + "ImageURLUnionTypedDict": ".imageurlchunk", + "ImportDatasetFromCampaignRequest": ".importdatasetfromcampaignrequest", + "ImportDatasetFromCampaignRequestTypedDict": ".importdatasetfromcampaignrequest", + "ImportDatasetFromDatasetRequest": ".importdatasetfromdatasetrequest", + "ImportDatasetFromDatasetRequestTypedDict": ".importdatasetfromdatasetrequest", + "ImportDatasetFromExplorerRequest": ".importdatasetfromexplorerrequest", + "ImportDatasetFromExplorerRequestTypedDict": ".importdatasetfromexplorerrequest", + "ImportDatasetFromFileRequest": ".importdatasetfromfilerequest", + "ImportDatasetFromFileRequestTypedDict": ".importdatasetfromfilerequest", + "ImportDatasetFromPlaygroundRequest": ".importdatasetfromplaygroundrequest", + "ImportDatasetFromPlaygroundRequestTypedDict": ".importdatasetfromplaygroundrequest", + "IngestionPipelineConfiguration": ".ingestionpipelineconfiguration", + "IngestionPipelineConfigurationTypedDict": ".ingestionpipelineconfiguration", + "InputEntries": ".inputentries", + "InputEntriesTypedDict": ".inputentries", + "Inputs": ".inputs", + "InputsTypedDict": ".inputs", + "InstructRequest": ".instructrequest", + "InstructRequestMessage": ".instructrequest", + "InstructRequestMessageTypedDict": ".instructrequest", + "InstructRequestTypedDict": ".instructrequest", + "JobMetadata": ".jobmetadata", + "JobMetadataTypedDict": ".jobmetadata", + "JobsAPIRoutesBatchCancelBatchJobRequest": ".jobs_api_routes_batch_cancel_batch_jobop", + "JobsAPIRoutesBatchCancelBatchJobRequestTypedDict": ".jobs_api_routes_batch_cancel_batch_jobop", + "JobsAPIRoutesBatchDeleteBatchJobRequest": ".jobs_api_routes_batch_delete_batch_jobop", + "JobsAPIRoutesBatchDeleteBatchJobRequestTypedDict": ".jobs_api_routes_batch_delete_batch_jobop", + "JobsAPIRoutesBatchGetBatchJobRequest": ".jobs_api_routes_batch_get_batch_jobop", + "JobsAPIRoutesBatchGetBatchJobRequestTypedDict": ".jobs_api_routes_batch_get_batch_jobop", + "JobsAPIRoutesBatchGetBatchJobsRequest": ".jobs_api_routes_batch_get_batch_jobsop", + "JobsAPIRoutesBatchGetBatchJobsRequestTypedDict": ".jobs_api_routes_batch_get_batch_jobsop", + "OrderBy": ".jobs_api_routes_batch_get_batch_jobsop", + "JobsAPIRoutesFineTuningArchiveFineTunedModelRequest": ".jobs_api_routes_fine_tuning_archive_fine_tuned_modelop", + "JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_archive_fine_tuned_modelop", + "JobsAPIRoutesFineTuningCancelFineTuningJobRequest": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCancelFineTuningJobResponse": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "UnknownJobsAPIRoutesFineTuningCancelFineTuningJobResponse": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCreateFineTuningJobResponse": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "Response": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "ResponseTypedDict": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "UnknownResponse": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobRequest": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobResponse": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "UnknownJobsAPIRoutesFineTuningGetFineTuningJobResponse": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", + "JobsAPIRoutesFineTuningGetFineTuningJobsRequest": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", + "JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", + "JobsAPIRoutesFineTuningGetFineTuningJobsStatus": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", + "JobsAPIRoutesFineTuningStartFineTuningJobRequest": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "JobsAPIRoutesFineTuningStartFineTuningJobResponse": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "UnknownJobsAPIRoutesFineTuningStartFineTuningJobResponse": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", + "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest": ".jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUpdateFineTunedModelRequest": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUpdateFineTunedModelResponse": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "UnknownJobsAPIRoutesFineTuningUpdateFineTunedModelResponse": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", + "JSONPatch": ".jsonpatch", + "JSONPatchTypedDict": ".jsonpatch", + "UnknownJSONPatch": ".jsonpatch", + "JSONPatchAdd": ".jsonpatchadd", + "JSONPatchAddTypedDict": ".jsonpatchadd", + "JSONPatchAppend": ".jsonpatchappend", + "JSONPatchAppendTypedDict": ".jsonpatchappend", + "JSONPatchPayloadResponse": ".jsonpatchpayloadresponse", + "JSONPatchPayloadResponseTypedDict": ".jsonpatchpayloadresponse", + "JSONPatchPayloadValueResponse": ".jsonpatchpayloadvalueresponse", + "JSONPatchPayloadValueResponseTypedDict": ".jsonpatchpayloadvalueresponse", + "JSONPatchRemove": ".jsonpatchremove", + "JSONPatchRemoveTypedDict": ".jsonpatchremove", + "JSONPatchReplace": ".jsonpatchreplace", + "JSONPatchReplaceTypedDict": ".jsonpatchreplace", + "JSONPayloadResponse": ".jsonpayloadresponse", + "JSONPayloadResponseTypedDict": ".jsonpayloadresponse", + "JSONSchema": ".jsonschema", + "JSONSchemaTypedDict": ".jsonschema", + "Judge": ".judge", + "JudgeOutputUnion": ".judge", + "JudgeOutputUnionTypedDict": ".judge", + "JudgeTypedDict": ".judge", + "UnknownJudgeOutputUnion": ".judge", + "JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequest": ".judge_chat_completion_event_v1_observability_chat_completion_events_event_id_live_judging_postop", + "JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequestTypedDict": ".judge_chat_completion_event_v1_observability_chat_completion_events_event_id_live_judging_postop", + "JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequest": ".judge_conversation_v1_observability_judges_judge_id_live_judging_postop", + "JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequestTypedDict": ".judge_conversation_v1_observability_judges_judge_id_live_judging_postop", + "JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequest": ".judge_dataset_record_v1_observability_dataset_records_dataset_record_id_live_judging_postop", + "JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequestTypedDict": ".judge_dataset_record_v1_observability_dataset_records_dataset_record_id_live_judging_postop", + "JudgeChatCompletionEventRequest": ".judgechatcompletioneventrequest", + "JudgeChatCompletionEventRequestTypedDict": ".judgechatcompletioneventrequest", + "JudgeClassificationOutput": ".judgeclassificationoutput", + "JudgeClassificationOutputTypedDict": ".judgeclassificationoutput", + "JudgeClassificationOutputOption": ".judgeclassificationoutputoption", + "JudgeClassificationOutputOptionTypedDict": ".judgeclassificationoutputoption", + "JudgeConversationRequest": ".judgeconversationrequest", + "JudgeConversationRequestTypedDict": ".judgeconversationrequest", + "JudgeDatasetRecordRequest": ".judgedatasetrecordrequest", + "JudgeDatasetRecordRequestTypedDict": ".judgedatasetrecordrequest", + "Answer": ".judgeoutput", + "AnswerTypedDict": ".judgeoutput", + "JudgeOutput": ".judgeoutput", + "JudgeOutputTypedDict": ".judgeoutput", + "JudgeOutputType": ".judgeoutputtype", + "JudgeRegressionOutput": ".judgeregressionoutput", + "JudgeRegressionOutputTypedDict": ".judgeregressionoutput", + "LegacyJobMetadata": ".legacyjobmetadata", + "LegacyJobMetadataTypedDict": ".legacyjobmetadata", + "LibrariesDeleteV1Request": ".libraries_delete_v1op", + "LibrariesDeleteV1RequestTypedDict": ".libraries_delete_v1op", + "LibrariesDocumentsDeleteV1Request": ".libraries_documents_delete_v1op", + "LibrariesDocumentsDeleteV1RequestTypedDict": ".libraries_documents_delete_v1op", + "LibrariesDocumentsGetExtractedTextSignedURLV1Request": ".libraries_documents_get_extracted_text_signed_url_v1op", + "LibrariesDocumentsGetExtractedTextSignedURLV1RequestTypedDict": ".libraries_documents_get_extracted_text_signed_url_v1op", + "LibrariesDocumentsGetSignedURLV1Request": ".libraries_documents_get_signed_url_v1op", + "LibrariesDocumentsGetSignedURLV1RequestTypedDict": ".libraries_documents_get_signed_url_v1op", + "LibrariesDocumentsGetStatusV1Request": ".libraries_documents_get_status_v1op", + "LibrariesDocumentsGetStatusV1RequestTypedDict": ".libraries_documents_get_status_v1op", + "LibrariesDocumentsGetTextContentV1Request": ".libraries_documents_get_text_content_v1op", + "LibrariesDocumentsGetTextContentV1RequestTypedDict": ".libraries_documents_get_text_content_v1op", + "LibrariesDocumentsGetV1Request": ".libraries_documents_get_v1op", + "LibrariesDocumentsGetV1RequestTypedDict": ".libraries_documents_get_v1op", + "LibrariesDocumentsListV1Request": ".libraries_documents_list_v1op", + "LibrariesDocumentsListV1RequestTypedDict": ".libraries_documents_list_v1op", + "LibrariesDocumentsReprocessV1Request": ".libraries_documents_reprocess_v1op", + "LibrariesDocumentsReprocessV1RequestTypedDict": ".libraries_documents_reprocess_v1op", + "LibrariesDocumentsUpdateV1Request": ".libraries_documents_update_v1op", + "LibrariesDocumentsUpdateV1RequestTypedDict": ".libraries_documents_update_v1op", + "DocumentUpload": ".libraries_documents_upload_v1op", + "DocumentUploadTypedDict": ".libraries_documents_upload_v1op", + "LibrariesDocumentsUploadV1Request": ".libraries_documents_upload_v1op", + "LibrariesDocumentsUploadV1RequestTypedDict": ".libraries_documents_upload_v1op", + "LibrariesGetV1Request": ".libraries_get_v1op", + "LibrariesGetV1RequestTypedDict": ".libraries_get_v1op", + "LibrariesListV1Request": ".libraries_list_v1op", + "LibrariesListV1RequestTypedDict": ".libraries_list_v1op", + "LibrariesShareCreateV1Request": ".libraries_share_create_v1op", + "LibrariesShareCreateV1RequestTypedDict": ".libraries_share_create_v1op", + "LibrariesShareDeleteV1Request": ".libraries_share_delete_v1op", + "LibrariesShareDeleteV1RequestTypedDict": ".libraries_share_delete_v1op", + "LibrariesShareListV1Request": ".libraries_share_list_v1op", + "LibrariesShareListV1RequestTypedDict": ".libraries_share_list_v1op", + "LibrariesUpdateV1Request": ".libraries_update_v1op", + "LibrariesUpdateV1RequestTypedDict": ".libraries_update_v1op", + "Library": ".library", + "LibraryTypedDict": ".library", + "ListDeploymentsV1WorkflowsDeploymentsGetRequest": ".list_deployments_v1_workflows_deployments_getop", + "ListDeploymentsV1WorkflowsDeploymentsGetRequestTypedDict": ".list_deployments_v1_workflows_deployments_getop", + "ListModelsV1ModelsGetRequest": ".list_models_v1_models_getop", + "ListModelsV1ModelsGetRequestTypedDict": ".list_models_v1_models_getop", + "ListRunsV1WorkflowsRunsGetRequest": ".list_runs_v1_workflows_runs_getop", + "ListRunsV1WorkflowsRunsGetRequestTypedDict": ".list_runs_v1_workflows_runs_getop", + "ListRunsV1WorkflowsRunsGetResponse": ".list_runs_v1_workflows_runs_getop", + "ListRunsV1WorkflowsRunsGetResponseTypedDict": ".list_runs_v1_workflows_runs_getop", + "ListRunsV1WorkflowsRunsGetStatus": ".list_runs_v1_workflows_runs_getop", + "ListRunsV1WorkflowsRunsGetStatusTypedDict": ".list_runs_v1_workflows_runs_getop", + "ListVoicesV1AudioVoicesGetRequest": ".list_voices_v1_audio_voices_getop", + "ListVoicesV1AudioVoicesGetRequestTypedDict": ".list_voices_v1_audio_voices_getop", + "ListVoicesV1AudioVoicesGetType": ".list_voices_v1_audio_voices_getop", + "ListBatchJobsResponse": ".listbatchjobsresponse", + "ListBatchJobsResponseTypedDict": ".listbatchjobsresponse", + "ListCampaignSelectedEventsResponse": ".listcampaignselectedeventsresponse", + "ListCampaignSelectedEventsResponseTypedDict": ".listcampaignselectedeventsresponse", + "ListCampaignsResponse": ".listcampaignsresponse", + "ListCampaignsResponseTypedDict": ".listcampaignsresponse", + "ListChatCompletionFieldsResponse": ".listchatcompletionfieldsresponse", + "ListChatCompletionFieldsResponseTypedDict": ".listchatcompletionfieldsresponse", + "ListDatasetImportTasksResponse": ".listdatasetimporttasksresponse", + "ListDatasetImportTasksResponseTypedDict": ".listdatasetimporttasksresponse", + "ListDatasetRecordsResponse": ".listdatasetrecordsresponse", + "ListDatasetRecordsResponseTypedDict": ".listdatasetrecordsresponse", + "ListDatasetsResponse": ".listdatasetsresponse", + "ListDatasetsResponseTypedDict": ".listdatasetsresponse", + "ListDocumentsResponse": ".listdocumentsresponse", + "ListDocumentsResponseTypedDict": ".listdocumentsresponse", + "ListFilesResponse": ".listfilesresponse", + "ListFilesResponseTypedDict": ".listfilesresponse", + "ListFineTuningJobsResponse": ".listfinetuningjobsresponse", + "ListFineTuningJobsResponseData": ".listfinetuningjobsresponse", + "ListFineTuningJobsResponseDataTypedDict": ".listfinetuningjobsresponse", + "ListFineTuningJobsResponseTypedDict": ".listfinetuningjobsresponse", + "UnknownListFineTuningJobsResponseData": ".listfinetuningjobsresponse", + "ListJudgesResponse": ".listjudgesresponse", + "ListJudgesResponseTypedDict": ".listjudgesresponse", + "ListLibrariesResponse": ".listlibrariesresponse", + "ListLibrariesResponseTypedDict": ".listlibrariesresponse", + "ListSharingResponse": ".listsharingresponse", + "ListSharingResponseTypedDict": ".listsharingresponse", + "ListWorkflowEventResponse": ".listworkfloweventresponse", + "ListWorkflowEventResponseEvent": ".listworkfloweventresponse", + "ListWorkflowEventResponseEventTypedDict": ".listworkfloweventresponse", + "ListWorkflowEventResponseTypedDict": ".listworkfloweventresponse", + "LocationType": ".locationtype", + "MCPServerIcon": ".mcpservericon", + "MCPServerIconTypedDict": ".mcpservericon", + "MCPTool": ".mcptool", + "MCPToolTypedDict": ".mcptool", + "MCPToolMeta": ".mcptoolmeta", + "MCPToolMetaTypedDict": ".mcptoolmeta", + "MCPUIToolMeta": ".mcpuitoolmeta", + "MCPUIToolMetaTypedDict": ".mcpuitoolmeta", + "Visibility": ".mcpuitoolmeta", + "MessageEntries": ".messageentries", + "MessageEntriesTypedDict": ".messageentries", + "MessageInputContentChunks": ".messageinputcontentchunks", + "MessageInputContentChunksTypedDict": ".messageinputcontentchunks", + "MessageInputEntry": ".messageinputentry", + "MessageInputEntryContent": ".messageinputentry", + "MessageInputEntryContentTypedDict": ".messageinputentry", + "MessageInputEntryTypedDict": ".messageinputentry", + "Role": ".messageinputentry", + "MessageOutputContentChunks": ".messageoutputcontentchunks", + "MessageOutputContentChunksTypedDict": ".messageoutputcontentchunks", + "MessageOutputEntry": ".messageoutputentry", + "MessageOutputEntryContent": ".messageoutputentry", + "MessageOutputEntryContentTypedDict": ".messageoutputentry", + "MessageOutputEntryTypedDict": ".messageoutputentry", + "MessageOutputEvent": ".messageoutputevent", + "MessageOutputEventContent": ".messageoutputevent", + "MessageOutputEventContentTypedDict": ".messageoutputevent", + "MessageOutputEventTypedDict": ".messageoutputevent", + "MessageResponse": ".messageresponse", + "MessageResponseTypedDict": ".messageresponse", + "MessageTokens": ".messagetokens", + "MessageTokensTypedDict": ".messagetokens", + "Metric": ".metric", + "MetricTypedDict": ".metric", + "MistralPromptMode": ".mistralpromptmode", + "ModelCapabilities": ".modelcapabilities", + "ModelCapabilitiesTypedDict": ".modelcapabilities", + "ModelConversation": ".modelconversation", + "ModelConversationTool": ".modelconversation", + "ModelConversationToolTypedDict": ".modelconversation", + "ModelConversationTypedDict": ".modelconversation", + "UnknownModelConversationTool": ".modelconversation", + "ModelList": ".modellist", + "ModelListData": ".modellist", + "ModelListDataTypedDict": ".modellist", + "ModelListTypedDict": ".modellist", + "UnknownModelListData": ".modellist", + "ModerationLLMAction": ".moderationllmaction", + "ModerationLlmv1CategoryThresholds": ".moderationllmv1categorythresholds", + "ModerationLlmv1CategoryThresholdsTypedDict": ".moderationllmv1categorythresholds", + "ModerationLlmv1Config": ".moderationllmv1config", + "ModerationLlmv1ConfigTypedDict": ".moderationllmv1config", + "ModerationLlmv2CategoryThresholds": ".moderationllmv2categorythresholds", + "ModerationLlmv2CategoryThresholdsTypedDict": ".moderationllmv2categorythresholds", + "ModerationLlmv2Config": ".moderationllmv2config", + "ModerationLlmv2ConfigTypedDict": ".moderationllmv2config", + "ModerationObject": ".moderationobject", + "ModerationObjectTypedDict": ".moderationobject", + "ModerationResponse": ".moderationresponse", + "ModerationResponseTypedDict": ".moderationresponse", + "NetworkEncodedInput": ".networkencodedinput", + "NetworkEncodedInputTypedDict": ".networkencodedinput", + "OAuth2Token": ".oauth2token", + "OAuth2TokenTypedDict": ".oauth2token", + "OAuth2TokenAuth": ".oauth2tokenauth", + "OAuth2TokenAuthTypedDict": ".oauth2tokenauth", + "ObservabilityErrorCode": ".observabilityerrorcode", + "ObservabilityErrorDetail": ".observabilityerrordetail", + "ObservabilityErrorDetailTypedDict": ".observabilityerrordetail", + "OCRConfidenceScore": ".ocrconfidencescore", + "OCRConfidenceScoreTypedDict": ".ocrconfidencescore", + "OCRImageObject": ".ocrimageobject", + "OCRImageObjectTypedDict": ".ocrimageobject", + "OCRPageConfidenceScores": ".ocrpageconfidencescores", + "OCRPageConfidenceScoresTypedDict": ".ocrpageconfidencescores", + "OCRPageDimensions": ".ocrpagedimensions", + "OCRPageDimensionsTypedDict": ".ocrpagedimensions", + "OCRPageObject": ".ocrpageobject", + "OCRPageObjectTypedDict": ".ocrpageobject", + "ConfidenceScoresGranularity": ".ocrrequest", + "DocumentUnion": ".ocrrequest", + "DocumentUnionTypedDict": ".ocrrequest", + "OCRRequest": ".ocrrequest", + "OCRRequestTypedDict": ".ocrrequest", + "Pages": ".ocrrequest", + "PagesTypedDict": ".ocrrequest", + "TableFormat": ".ocrrequest", + "OCRResponse": ".ocrresponse", + "OCRResponseTypedDict": ".ocrresponse", + "Format": ".ocrtableobject", + "OCRTableObject": ".ocrtableobject", + "OCRTableObjectTypedDict": ".ocrtableobject", + "OCRUsageInfo": ".ocrusageinfo", + "OCRUsageInfoTypedDict": ".ocrusageinfo", + "OutboundAuthenticationType": ".outboundauthenticationtype", + "OutputContentChunks": ".outputcontentchunks", + "OutputContentChunksTypedDict": ".outputcontentchunks", + "PaginatedConnectors": ".paginatedconnectors", + "PaginatedConnectorsTypedDict": ".paginatedconnectors", + "PaginatedResultCampaignPreview": ".paginatedresultcampaignpreview", + "PaginatedResultCampaignPreviewTypedDict": ".paginatedresultcampaignpreview", + "PaginatedResultChatCompletionEventPreview": ".paginatedresultchatcompletioneventpreview", + "PaginatedResultChatCompletionEventPreviewTypedDict": ".paginatedresultchatcompletioneventpreview", + "PaginatedResultDatasetImportTask": ".paginatedresultdatasetimporttask", + "PaginatedResultDatasetImportTaskTypedDict": ".paginatedresultdatasetimporttask", + "PaginatedResultDatasetPreview": ".paginatedresultdatasetpreview", + "PaginatedResultDatasetPreviewTypedDict": ".paginatedresultdatasetpreview", + "PaginatedResultDatasetRecord": ".paginatedresultdatasetrecord", + "PaginatedResultDatasetRecordTypedDict": ".paginatedresultdatasetrecord", + "PaginatedResultJudgePreview": ".paginatedresultjudgepreview", + "PaginatedResultJudgePreviewTypedDict": ".paginatedresultjudgepreview", + "PaginationInfo": ".paginationinfo", + "PaginationInfoTypedDict": ".paginationinfo", + "PaginationResponse": ".paginationresponse", + "PaginationResponseTypedDict": ".paginationresponse", + "PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest": ".pause_schedule_v1_workflows_schedules_schedule_id_pause_postop", + "PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequestTypedDict": ".pause_schedule_v1_workflows_schedules_schedule_id_pause_postop", + "PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequest": ".post_dataset_records_from_campaign_v1_observability_datasets_dataset_id_imports_from_campaign_postop", + "PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequestTypedDict": ".post_dataset_records_from_campaign_v1_observability_datasets_dataset_id_imports_from_campaign_postop", + "PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequest": ".post_dataset_records_from_dataset_v1_observability_datasets_dataset_id_imports_from_dataset_postop", + "PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequestTypedDict": ".post_dataset_records_from_dataset_v1_observability_datasets_dataset_id_imports_from_dataset_postop", + "PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequest": ".post_dataset_records_from_explorer_v1_observability_datasets_dataset_id_imports_from_explorer_postop", + "PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequestTypedDict": ".post_dataset_records_from_explorer_v1_observability_datasets_dataset_id_imports_from_explorer_postop", + "PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequest": ".post_dataset_records_from_file_v1_observability_datasets_dataset_id_imports_from_file_postop", + "PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequestTypedDict": ".post_dataset_records_from_file_v1_observability_datasets_dataset_id_imports_from_file_postop", + "PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequest": ".post_dataset_records_from_playground_v1_observability_datasets_dataset_id_imports_from_playground_postop", + "PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequestTypedDict": ".post_dataset_records_from_playground_v1_observability_datasets_dataset_id_imports_from_playground_postop", + "Prediction": ".prediction", + "PredictionTypedDict": ".prediction", + "ProcessingStatus": ".processingstatus", + "ProcessingStatusTypedDict": ".processingstatus", + "ProcessStatus": ".processstatus", + "PromptTokensDetails": ".prompttokensdetails", + "PromptTokensDetailsTypedDict": ".prompttokensdetails", + "PublicAuthenticationMethod": ".publicauthenticationmethod", + "PublicAuthenticationMethodTypedDict": ".publicauthenticationmethod", + "QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest": ".query_workflow_execution_v1_workflows_executions_execution_id_queries_postop", + "QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequestTypedDict": ".query_workflow_execution_v1_workflows_executions_execution_id_queries_postop", + "QueryDefinition": ".querydefinition", + "QueryDefinitionTypedDict": ".querydefinition", + "QueryInvocationBody": ".queryinvocationbody", + "QueryInvocationBodyInput": ".queryinvocationbody", + "QueryInvocationBodyInputTypedDict": ".queryinvocationbody", + "QueryInvocationBodyTypedDict": ".queryinvocationbody", + "QueryWorkflowResponse": ".queryworkflowresponse", + "QueryWorkflowResponseTypedDict": ".queryworkflowresponse", + "RealtimeTranscriptionError": ".realtimetranscriptionerror", + "RealtimeTranscriptionErrorTypedDict": ".realtimetranscriptionerror", + "RealtimeTranscriptionErrorDetail": ".realtimetranscriptionerrordetail", + "RealtimeTranscriptionErrorDetailMessage": ".realtimetranscriptionerrordetail", + "RealtimeTranscriptionErrorDetailMessageTypedDict": ".realtimetranscriptionerrordetail", + "RealtimeTranscriptionErrorDetailTypedDict": ".realtimetranscriptionerrordetail", + "RealtimeTranscriptionInputAudioAppend": ".realtimetranscriptioninputaudioappend", + "RealtimeTranscriptionInputAudioAppendTypedDict": ".realtimetranscriptioninputaudioappend", + "RealtimeTranscriptionInputAudioEnd": ".realtimetranscriptioninputaudioend", + "RealtimeTranscriptionInputAudioEndTypedDict": ".realtimetranscriptioninputaudioend", + "RealtimeTranscriptionInputAudioFlush": ".realtimetranscriptioninputaudioflush", + "RealtimeTranscriptionInputAudioFlushTypedDict": ".realtimetranscriptioninputaudioflush", + "RealtimeTranscriptionSession": ".realtimetranscriptionsession", + "RealtimeTranscriptionSessionTypedDict": ".realtimetranscriptionsession", + "RealtimeTranscriptionSessionCreated": ".realtimetranscriptionsessioncreated", + "RealtimeTranscriptionSessionCreatedTypedDict": ".realtimetranscriptionsessioncreated", + "RealtimeTranscriptionSessionUpdated": ".realtimetranscriptionsessionupdated", + "RealtimeTranscriptionSessionUpdatedTypedDict": ".realtimetranscriptionsessionupdated", + "RealtimeTranscriptionSessionUpdateMessage": ".realtimetranscriptionsessionupdatemessage", + "RealtimeTranscriptionSessionUpdateMessageTypedDict": ".realtimetranscriptionsessionupdatemessage", + "RealtimeTranscriptionSessionUpdatePayload": ".realtimetranscriptionsessionupdatepayload", + "RealtimeTranscriptionSessionUpdatePayloadTypedDict": ".realtimetranscriptionsessionupdatepayload", + "ReasoningEffort": ".reasoningeffort", + "ReferenceChunk": ".referencechunk", + "ReferenceChunkTypedDict": ".referencechunk", + "ReferenceID": ".referencechunk", + "ReferenceIDTypedDict": ".referencechunk", + "RequestSource": ".requestsource", + "ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequest": ".reset_workflow_v1_workflows_executions_execution_id_reset_postop", + "ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequestTypedDict": ".reset_workflow_v1_workflows_executions_execution_id_reset_postop", + "ResetInvocationBody": ".resetinvocationbody", + "ResetInvocationBodyTypedDict": ".resetinvocationbody", + "ResourceLink": ".resourcelink", + "ResourceLinkTypedDict": ".resourcelink", + "ResourceVisibility": ".resourcevisibility", + "ResponseDoneEvent": ".responsedoneevent", + "ResponseDoneEventTypedDict": ".responsedoneevent", + "ResponseErrorEvent": ".responseerrorevent", + "ResponseErrorEventTypedDict": ".responseerrorevent", + "ResponseFormat": ".responseformat", + "ResponseFormatTypedDict": ".responseformat", + "ResponseFormats": ".responseformats", + "ResponseStartedEvent": ".responsestartedevent", + "ResponseStartedEventTypedDict": ".responsestartedevent", + "ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequest": ".resume_schedule_v1_workflows_schedules_schedule_id_resume_postop", + "ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequestTypedDict": ".resume_schedule_v1_workflows_schedules_schedule_id_resume_postop", + "ResponseRetrieveModelV1ModelsModelIDGet": ".retrieve_model_v1_models_model_id_getop", + "ResponseRetrieveModelV1ModelsModelIDGetTypedDict": ".retrieve_model_v1_models_model_id_getop", + "RetrieveModelV1ModelsModelIDGetRequest": ".retrieve_model_v1_models_model_id_getop", + "RetrieveModelV1ModelsModelIDGetRequestTypedDict": ".retrieve_model_v1_models_model_id_getop", + "UnknownResponseRetrieveModelV1ModelsModelIDGet": ".retrieve_model_v1_models_model_id_getop", + "Roles": ".roles", + "SampleType": ".sampletype", + "ScalarMetric": ".scalarmetric", + "ScalarMetricTypedDict": ".scalarmetric", + "ScalarMetricValue": ".scalarmetric", + "ScalarMetricValueTypedDict": ".scalarmetric", + "ScheduleCalendar": ".schedulecalendar", + "ScheduleCalendarTypedDict": ".schedulecalendar", + "ScheduleDefinition": ".scheduledefinition", + "ScheduleDefinitionTypedDict": ".scheduledefinition", + "ScheduleDefinitionOutput": ".scheduledefinitionoutput", + "ScheduleDefinitionOutputTypedDict": ".scheduledefinitionoutput", + "ScheduleFutureExecution": ".schedulefutureexecution", + "ScheduleFutureExecutionTypedDict": ".schedulefutureexecution", + "ScheduleInterval": ".scheduleinterval", + "ScheduleIntervalTypedDict": ".scheduleinterval", + "ScheduleOverlapPolicy": ".scheduleoverlappolicy", + "SchedulePolicy": ".schedulepolicy", + "SchedulePolicyTypedDict": ".schedulepolicy", + "ScheduleRange": ".schedulerange", + "ScheduleRangeTypedDict": ".schedulerange", + "ScheduleRecentExecution": ".schedulerecentexecution", + "ScheduleRecentExecutionTypedDict": ".schedulerecentexecution", + "SearchChatCompletionEventIdsRequest": ".searchchatcompletioneventidsrequest", + "SearchChatCompletionEventIdsRequestTypedDict": ".searchchatcompletioneventidsrequest", + "SearchChatCompletionEventIdsResponse": ".searchchatcompletioneventidsresponse", + "SearchChatCompletionEventIdsResponseTypedDict": ".searchchatcompletioneventidsresponse", + "SearchChatCompletionEventsRequest": ".searchchatcompletioneventsrequest", + "SearchChatCompletionEventsRequestTypedDict": ".searchchatcompletioneventsrequest", + "SearchChatCompletionEventsResponse": ".searchchatcompletioneventsresponse", + "SearchChatCompletionEventsResponseTypedDict": ".searchchatcompletioneventsresponse", + "Security": ".security", + "SecurityTypedDict": ".security", + "ShareEnum": ".shareenum", + "Sharing": ".sharing", + "SharingTypedDict": ".sharing", + "SharingDelete": ".sharingdelete", + "SharingDeleteTypedDict": ".sharingdelete", + "SharingRequest": ".sharingrequest", + "SharingRequestTypedDict": ".sharingrequest", + "SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequest": ".signal_workflow_execution_v1_workflows_executions_execution_id_signals_postop", + "SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequestTypedDict": ".signal_workflow_execution_v1_workflows_executions_execution_id_signals_postop", + "SignalDefinition": ".signaldefinition", + "SignalDefinitionTypedDict": ".signaldefinition", + "SignalInvocationBody": ".signalinvocationbody", + "SignalInvocationBodyInput": ".signalinvocationbody", + "SignalInvocationBodyInputTypedDict": ".signalinvocationbody", + "SignalInvocationBodyNetworkEncodedInput": ".signalinvocationbody", + "SignalInvocationBodyNetworkEncodedInputTypedDict": ".signalinvocationbody", + "SignalInvocationBodyTypedDict": ".signalinvocationbody", + "SignalWorkflowResponse": ".signalworkflowresponse", + "SignalWorkflowResponseTypedDict": ".signalworkflowresponse", + "Source": ".source", + "SpeechResponse": ".speech_v1_audio_speech_postop", + "SpeechResponseTypedDict": ".speech_v1_audio_speech_postop", + "SpeechStreamEvents": ".speech_v1_audio_speech_postop", + "SpeechStreamEventsTypedDict": ".speech_v1_audio_speech_postop", + "SpeechV1AudioSpeechPostData": ".speech_v1_audio_speech_postop", + "SpeechV1AudioSpeechPostDataTypedDict": ".speech_v1_audio_speech_postop", + "SpeechV1AudioSpeechPostResponse": ".speech_v1_audio_speech_postop", + "SpeechV1AudioSpeechPostResponseTypedDict": ".speech_v1_audio_speech_postop", + "UnknownSpeechV1AudioSpeechPostData": ".speech_v1_audio_speech_postop", + "SpeechOutputFormat": ".speechoutputformat", + "SpeechRequest": ".speechrequest", + "SpeechRequestTypedDict": ".speechrequest", + "SpeechStreamAudioDelta": ".speechstreamaudiodelta", + "SpeechStreamAudioDeltaTypedDict": ".speechstreamaudiodelta", + "SpeechStreamDone": ".speechstreamdone", + "SpeechStreamDoneTypedDict": ".speechstreamdone", + "SpeechStreamEventTypes": ".speechstreameventtypes", + "SSETypes": ".ssetypes", + "StreamV1WorkflowsExecutionsExecutionIDStreamGetRequest": ".stream_v1_workflows_executions_execution_id_stream_getop", + "StreamV1WorkflowsExecutionsExecutionIDStreamGetRequestTypedDict": ".stream_v1_workflows_executions_execution_id_stream_getop", + "StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody": ".stream_v1_workflows_executions_execution_id_stream_getop", + "StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBodyTypedDict": ".stream_v1_workflows_executions_execution_id_stream_getop", + "StreamEventSsePayload": ".streameventssepayload", + "StreamEventSsePayloadData": ".streameventssepayload", + "StreamEventSsePayloadDataTypedDict": ".streameventssepayload", + "StreamEventSsePayloadTypedDict": ".streameventssepayload", + "StreamEventWorkflowContext": ".streameventworkflowcontext", + "StreamEventWorkflowContextTypedDict": ".streameventworkflowcontext", + "SystemMessage": ".systemmessage", + "SystemMessageContent": ".systemmessage", + "SystemMessageContentTypedDict": ".systemmessage", + "SystemMessageTypedDict": ".systemmessage", + "SystemMessageContentChunks": ".systemmessagecontentchunks", + "SystemMessageContentChunksTypedDict": ".systemmessagecontentchunks", + "TempoGetTraceResponse": ".tempogettraceresponse", + "TempoGetTraceResponseTypedDict": ".tempogettraceresponse", + "TempoTraceAttribute": ".tempotraceattribute", + "TempoTraceAttributeTypedDict": ".tempotraceattribute", + "TempoTraceAttributeValue": ".tempotraceattribute", + "TempoTraceAttributeValueTypedDict": ".tempotraceattribute", + "TempoTraceAttributeArrayContainer": ".tempotraceattributearraycontainer", + "TempoTraceAttributeArrayContainerTypedDict": ".tempotraceattributearraycontainer", + "TempoTraceAttributeArrayElement": ".tempotraceattributearrayelement", + "TempoTraceAttributeArrayElementTypedDict": ".tempotraceattributearrayelement", + "TempoTraceAttributeArrayValue": ".tempotraceattributearrayvalue", + "TempoTraceAttributeArrayValueTypedDict": ".tempotraceattributearrayvalue", + "TempoTraceAttributeBoolValue": ".tempotraceattributeboolvalue", + "TempoTraceAttributeBoolValueTypedDict": ".tempotraceattributeboolvalue", + "TempoTraceAttributeIntValue": ".tempotraceattributeintvalue", + "TempoTraceAttributeIntValueTypedDict": ".tempotraceattributeintvalue", + "TempoTraceAttributeStringValue": ".tempotraceattributestringvalue", + "TempoTraceAttributeStringValueTypedDict": ".tempotraceattributestringvalue", + "TempoTraceBatch": ".tempotracebatch", + "TempoTraceBatchTypedDict": ".tempotracebatch", + "TempoTraceEvent": ".tempotraceevent", + "TempoTraceEventTypedDict": ".tempotraceevent", + "TempoTraceResource": ".tempotraceresource", + "TempoTraceResourceTypedDict": ".tempotraceresource", + "TempoTraceScope": ".tempotracescope", + "TempoTraceScopeTypedDict": ".tempotracescope", + "TempoTraceScopeKind": ".tempotracescopekind", + "TempoTraceScopeSpan": ".tempotracescopespan", + "TempoTraceScopeSpanTypedDict": ".tempotracescopespan", + "TempoTraceSpan": ".tempotracespan", + "TempoTraceSpanTypedDict": ".tempotracespan", + "TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequest": ".terminate_workflow_execution_v1_workflows_executions_execution_id_terminate_postop", + "TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequestTypedDict": ".terminate_workflow_execution_v1_workflows_executions_execution_id_terminate_postop", + "TextChunk": ".textchunk", + "TextChunkTypedDict": ".textchunk", + "TextContent": ".textcontent", + "TextContentTypedDict": ".textcontent", + "TextResourceContents": ".textresourcecontents", + "TextResourceContentsTypedDict": ".textresourcecontents", + "ThinkChunk": ".thinkchunk", + "ThinkChunkTypedDict": ".thinkchunk", + "Thinking": ".thinkchunk", + "ThinkingTypedDict": ".thinkchunk", + "TimeSeriesMetric": ".timeseriesmetric", + "TimeSeriesMetricTypedDict": ".timeseriesmetric", + "TimeSeriesMetricValue1": ".timeseriesmetric", + "TimeSeriesMetricValue1TypedDict": ".timeseriesmetric", + "TimeSeriesMetricValue2": ".timeseriesmetric", + "TimeSeriesMetricValue2TypedDict": ".timeseriesmetric", + "TimestampGranularity": ".timestampgranularity", + "Tool": ".tool", + "ToolTypedDict": ".tool", + "ToolAnnotations": ".toolannotations", + "ToolAnnotationsTypedDict": ".toolannotations", + "ToolCall": ".toolcall", + "ToolCallTypedDict": ".toolcall", + "Confirmation": ".toolcallconfirmation", + "ToolCallConfirmation": ".toolcallconfirmation", + "ToolCallConfirmationTypedDict": ".toolcallconfirmation", + "ToolChoice": ".toolchoice", + "ToolChoiceTypedDict": ".toolchoice", + "ToolChoiceEnum": ".toolchoiceenum", + "ToolConfiguration": ".toolconfiguration", + "ToolConfigurationTypedDict": ".toolconfiguration", + "TaskSupport": ".toolexecution", + "ToolExecution": ".toolexecution", + "ToolExecutionTypedDict": ".toolexecution", + "ToolExecutionDeltaEvent": ".toolexecutiondeltaevent", + "ToolExecutionDeltaEventName": ".toolexecutiondeltaevent", + "ToolExecutionDeltaEventNameTypedDict": ".toolexecutiondeltaevent", + "ToolExecutionDeltaEventTypedDict": ".toolexecutiondeltaevent", + "ToolExecutionDoneEvent": ".toolexecutiondoneevent", + "ToolExecutionDoneEventName": ".toolexecutiondoneevent", + "ToolExecutionDoneEventNameTypedDict": ".toolexecutiondoneevent", + "ToolExecutionDoneEventTypedDict": ".toolexecutiondoneevent", + "ToolExecutionEntry": ".toolexecutionentry", + "ToolExecutionEntryName": ".toolexecutionentry", + "ToolExecutionEntryNameTypedDict": ".toolexecutionentry", + "ToolExecutionEntryTypedDict": ".toolexecutionentry", + "ToolExecutionStartedEvent": ".toolexecutionstartedevent", + "ToolExecutionStartedEventName": ".toolexecutionstartedevent", + "ToolExecutionStartedEventNameTypedDict": ".toolexecutionstartedevent", + "ToolExecutionStartedEventTypedDict": ".toolexecutionstartedevent", + "ToolFileChunk": ".toolfilechunk", + "ToolFileChunkTool": ".toolfilechunk", + "ToolFileChunkToolTypedDict": ".toolfilechunk", + "ToolFileChunkTypedDict": ".toolfilechunk", + "ToolMessage": ".toolmessage", + "ToolMessageContent": ".toolmessage", + "ToolMessageContentTypedDict": ".toolmessage", + "ToolMessageTypedDict": ".toolmessage", + "ToolReferenceChunk": ".toolreferencechunk", + "ToolReferenceChunkTool": ".toolreferencechunk", + "ToolReferenceChunkToolTypedDict": ".toolreferencechunk", + "ToolReferenceChunkTypedDict": ".toolreferencechunk", + "ToolType": ".tooltype", + "TrainingFile": ".trainingfile", + "TrainingFileTypedDict": ".trainingfile", + "TranscriptionResponse": ".transcriptionresponse", + "TranscriptionResponseTypedDict": ".transcriptionresponse", + "TranscriptionSegmentChunk": ".transcriptionsegmentchunk", + "TranscriptionSegmentChunkTypedDict": ".transcriptionsegmentchunk", + "TranscriptionStreamDone": ".transcriptionstreamdone", + "TranscriptionStreamDoneTypedDict": ".transcriptionstreamdone", + "TranscriptionStreamEvents": ".transcriptionstreamevents", + "TranscriptionStreamEventsData": ".transcriptionstreamevents", + "TranscriptionStreamEventsDataTypedDict": ".transcriptionstreamevents", + "TranscriptionStreamEventsTypedDict": ".transcriptionstreamevents", + "UnknownTranscriptionStreamEventsData": ".transcriptionstreamevents", + "TranscriptionStreamEventTypes": ".transcriptionstreameventtypes", + "TranscriptionStreamLanguage": ".transcriptionstreamlanguage", + "TranscriptionStreamLanguageTypedDict": ".transcriptionstreamlanguage", + "TranscriptionStreamSegmentDelta": ".transcriptionstreamsegmentdelta", + "TranscriptionStreamSegmentDeltaTypedDict": ".transcriptionstreamsegmentdelta", + "TranscriptionStreamTextDelta": ".transcriptionstreamtextdelta", + "TranscriptionStreamTextDeltaTypedDict": ".transcriptionstreamtextdelta", + "TurbineToolLocale": ".turbinetoollocale", + "TurbineToolLocaleTypedDict": ".turbinetoollocale", + "TurbineToolMeta": ".turbinetoolmeta", + "TurbineToolMetaTypedDict": ".turbinetoolmeta", + "UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest": ".unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop", + "UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequestTypedDict": ".unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop", + "UnarchiveModelResponse": ".unarchivemodelresponse", + "UnarchiveModelResponseTypedDict": ".unarchivemodelresponse", + "UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequest": ".unschedule_workflow_v1_workflows_schedules_schedule_id_deleteop", + "UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequestTypedDict": ".unschedule_workflow_v1_workflows_schedules_schedule_id_deleteop", + "UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequest": ".update_dataset_record_payload_v1_observability_dataset_records_dataset_record_id_payload_putop", + "UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequestTypedDict": ".update_dataset_record_payload_v1_observability_dataset_records_dataset_record_id_payload_putop", + "UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequest": ".update_dataset_record_properties_v1_observability_dataset_records_dataset_record_id_properties_putop", + "UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequestTypedDict": ".update_dataset_record_properties_v1_observability_dataset_records_dataset_record_id_properties_putop", + "UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequest": ".update_dataset_v1_observability_datasets_dataset_id_patchop", + "UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequestTypedDict": ".update_dataset_v1_observability_datasets_dataset_id_patchop", + "UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequest": ".update_judge_v1_observability_judges_judge_id_putop", + "UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequestTypedDict": ".update_judge_v1_observability_judges_judge_id_putop", + "UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest": ".update_run_info_v1_rag_ingestion_pipeline_configurations_id_run_info_putop", + "UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequestTypedDict": ".update_run_info_v1_rag_ingestion_pipeline_configurations_id_run_info_putop", + "UpdateVoiceV1AudioVoicesVoiceIDPatchRequest": ".update_voice_v1_audio_voices_voice_id_patchop", + "UpdateVoiceV1AudioVoicesVoiceIDPatchRequestTypedDict": ".update_voice_v1_audio_voices_voice_id_patchop", + "UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequest": ".update_workflow_execution_v1_workflows_executions_execution_id_updates_postop", + "UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequestTypedDict": ".update_workflow_execution_v1_workflows_executions_execution_id_updates_postop", + "UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequest": ".update_workflow_v1_workflows_workflow_identifier_putop", + "UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequestTypedDict": ".update_workflow_v1_workflows_workflow_identifier_putop", + "UpdateAgentRequest": ".updateagentrequest", + "UpdateAgentRequestTool": ".updateagentrequest", + "UpdateAgentRequestToolTypedDict": ".updateagentrequest", + "UpdateAgentRequestTypedDict": ".updateagentrequest", + "UpdateConnectorRequest": ".updateconnectorrequest", + "UpdateConnectorRequestTypedDict": ".updateconnectorrequest", + "UpdateDatasetRecordPayloadRequest": ".updatedatasetrecordpayloadrequest", + "UpdateDatasetRecordPayloadRequestTypedDict": ".updatedatasetrecordpayloadrequest", + "UpdateDatasetRecordPropertiesRequest": ".updatedatasetrecordpropertiesrequest", + "UpdateDatasetRecordPropertiesRequestTypedDict": ".updatedatasetrecordpropertiesrequest", + "UpdateDatasetRequest": ".updatedatasetrequest", + "UpdateDatasetRequestTypedDict": ".updatedatasetrequest", + "UpdateDefinition": ".updatedefinition", + "UpdateDefinitionTypedDict": ".updatedefinition", + "Attributes": ".updatedocumentrequest", + "AttributesTypedDict": ".updatedocumentrequest", + "UpdateDocumentRequest": ".updatedocumentrequest", + "UpdateDocumentRequestTypedDict": ".updatedocumentrequest", + "UpdateInvocationBody": ".updateinvocationbody", + "UpdateInvocationBodyInput": ".updateinvocationbody", + "UpdateInvocationBodyInputTypedDict": ".updateinvocationbody", + "UpdateInvocationBodyTypedDict": ".updateinvocationbody", + "UpdateJudgeRequest": ".updatejudgerequest", + "UpdateJudgeRequestOutput": ".updatejudgerequest", + "UpdateJudgeRequestOutputTypedDict": ".updatejudgerequest", + "UpdateJudgeRequestTypedDict": ".updatejudgerequest", + "UpdateLibraryRequest": ".updatelibraryrequest", + "UpdateLibraryRequestTypedDict": ".updatelibraryrequest", + "UpdateModelRequest": ".updatemodelrequest", + "UpdateModelRequestTypedDict": ".updatemodelrequest", + "UpdateRunInfo": ".updateruninfo", + "UpdateRunInfoTypedDict": ".updateruninfo", + "UpdateWorkflowResponse": ".updateworkflowresponse", + "UpdateWorkflowResponseTypedDict": ".updateworkflowresponse", + "UsageInfo": ".usageinfo", + "UsageInfoTypedDict": ".usageinfo", + "UsageInfoDollarDefs": ".usageinfo_dollar_defs", + "UsageInfoDollarDefsTypedDict": ".usageinfo_dollar_defs", + "UserMessage": ".usermessage", + "UserMessageContent": ".usermessage", + "UserMessageContentTypedDict": ".usermessage", + "UserMessageTypedDict": ".usermessage", + "Context": ".validationerror", + "ContextTypedDict": ".validationerror", + "Loc": ".validationerror", + "LocTypedDict": ".validationerror", + "ValidationError": ".validationerror", + "ValidationErrorTypedDict": ".validationerror", + "VoiceCreateRequest": ".voicecreaterequest", + "VoiceCreateRequestTypedDict": ".voicecreaterequest", + "VoiceListResponse": ".voicelistresponse", + "VoiceListResponseTypedDict": ".voicelistresponse", + "VoiceResponse": ".voiceresponse", + "VoiceResponseTypedDict": ".voiceresponse", + "VoiceUpdateRequest": ".voiceupdaterequest", + "VoiceUpdateRequestTypedDict": ".voiceupdaterequest", + "WandbIntegration": ".wandbintegration", + "WandbIntegrationTypedDict": ".wandbintegration", + "WandbIntegrationResult": ".wandbintegrationresult", + "WandbIntegrationResultTypedDict": ".wandbintegrationresult", + "WebSearchPremiumTool": ".websearchpremiumtool", + "WebSearchPremiumToolTypedDict": ".websearchpremiumtool", + "WebSearchTool": ".websearchtool", + "WebSearchToolTypedDict": ".websearchtool", + "Workflow": ".workflow", + "WorkflowTypedDict": ".workflow", + "WorkflowArchiveResponse": ".workflowarchiveresponse", + "WorkflowArchiveResponseTypedDict": ".workflowarchiveresponse", + "WorkflowBasicDefinition": ".workflowbasicdefinition", + "WorkflowBasicDefinitionTypedDict": ".workflowbasicdefinition", + "WorkflowCodeDefinition": ".workflowcodedefinition", + "WorkflowCodeDefinitionTypedDict": ".workflowcodedefinition", + "WorkflowEventType": ".workfloweventtype", + "WorkflowExecutionCanceledAttributes": ".workflowexecutioncanceledattributes", + "WorkflowExecutionCanceledAttributesTypedDict": ".workflowexecutioncanceledattributes", + "WorkflowExecutionCanceledResponse": ".workflowexecutioncanceledresponse", + "WorkflowExecutionCanceledResponseTypedDict": ".workflowexecutioncanceledresponse", + "WorkflowExecutionCompletedAttributesResponse": ".workflowexecutioncompletedattributesresponse", + "WorkflowExecutionCompletedAttributesResponseTypedDict": ".workflowexecutioncompletedattributesresponse", + "WorkflowExecutionCompletedResponse": ".workflowexecutioncompletedresponse", + "WorkflowExecutionCompletedResponseTypedDict": ".workflowexecutioncompletedresponse", + "WorkflowExecutionContinuedAsNewAttributesResponse": ".workflowexecutioncontinuedasnewattributesresponse", + "WorkflowExecutionContinuedAsNewAttributesResponseTypedDict": ".workflowexecutioncontinuedasnewattributesresponse", + "WorkflowExecutionContinuedAsNewResponse": ".workflowexecutioncontinuedasnewresponse", + "WorkflowExecutionContinuedAsNewResponseTypedDict": ".workflowexecutioncontinuedasnewresponse", + "WorkflowExecutionFailedAttributes": ".workflowexecutionfailedattributes", + "WorkflowExecutionFailedAttributesTypedDict": ".workflowexecutionfailedattributes", + "WorkflowExecutionFailedResponse": ".workflowexecutionfailedresponse", + "WorkflowExecutionFailedResponseTypedDict": ".workflowexecutionfailedresponse", + "WorkflowExecutionListResponse": ".workflowexecutionlistresponse", + "WorkflowExecutionListResponseTypedDict": ".workflowexecutionlistresponse", + "WorkflowExecutionProgressTraceEvent": ".workflowexecutionprogresstraceevent", + "WorkflowExecutionProgressTraceEventTypedDict": ".workflowexecutionprogresstraceevent", + "WorkflowExecutionRequest": ".workflowexecutionrequest", + "WorkflowExecutionRequestTypedDict": ".workflowexecutionrequest", + "WorkflowExecutionResponse": ".workflowexecutionresponse", + "WorkflowExecutionResponseTypedDict": ".workflowexecutionresponse", + "WorkflowExecutionStartedAttributesResponse": ".workflowexecutionstartedattributesresponse", + "WorkflowExecutionStartedAttributesResponseTypedDict": ".workflowexecutionstartedattributesresponse", + "WorkflowExecutionStartedResponse": ".workflowexecutionstartedresponse", + "WorkflowExecutionStartedResponseTypedDict": ".workflowexecutionstartedresponse", + "WorkflowExecutionStatus": ".workflowexecutionstatus", + "WorkflowExecutionSyncResponse": ".workflowexecutionsyncresponse", + "WorkflowExecutionSyncResponseTypedDict": ".workflowexecutionsyncresponse", + "WorkflowExecutionTraceEvent": ".workflowexecutiontraceevent", + "WorkflowExecutionTraceEventTypedDict": ".workflowexecutiontraceevent", + "WorkflowExecutionTraceEventsResponse": ".workflowexecutiontraceeventsresponse", + "WorkflowExecutionTraceEventsResponseEvent": ".workflowexecutiontraceeventsresponse", + "WorkflowExecutionTraceEventsResponseEventTypedDict": ".workflowexecutiontraceeventsresponse", + "WorkflowExecutionTraceEventsResponseTypedDict": ".workflowexecutiontraceeventsresponse", + "WorkflowExecutionTraceOTelResponse": ".workflowexecutiontraceotelresponse", + "WorkflowExecutionTraceOTelResponseTypedDict": ".workflowexecutiontraceotelresponse", + "WorkflowExecutionTraceSummaryAttributesValues": ".workflowexecutiontracesummaryattributesvalues", + "WorkflowExecutionTraceSummaryAttributesValuesTypedDict": ".workflowexecutiontracesummaryattributesvalues", + "WorkflowExecutionTraceSummaryResponse": ".workflowexecutiontracesummaryresponse", + "WorkflowExecutionTraceSummaryResponseTypedDict": ".workflowexecutiontracesummaryresponse", + "WorkflowExecutionTraceSummarySpan": ".workflowexecutiontracesummaryspan", + "WorkflowExecutionTraceSummarySpanTypedDict": ".workflowexecutiontracesummaryspan", + "WorkflowExecutionWithoutResultResponse": ".workflowexecutionwithoutresultresponse", + "WorkflowExecutionWithoutResultResponseTypedDict": ".workflowexecutionwithoutresultresponse", + "WorkflowGetResponse": ".workflowgetresponse", + "WorkflowGetResponseTypedDict": ".workflowgetresponse", + "WorkflowListResponse": ".workflowlistresponse", + "WorkflowListResponseTypedDict": ".workflowlistresponse", + "WorkflowMetadata": ".workflowmetadata", + "WorkflowMetadataTypedDict": ".workflowmetadata", + "WorkflowMetrics": ".workflowmetrics", + "WorkflowMetricsTypedDict": ".workflowmetrics", + "WorkflowRegistration": ".workflowregistration", + "WorkflowRegistrationTypedDict": ".workflowregistration", + "WorkflowRegistrationGetResponse": ".workflowregistrationgetresponse", + "WorkflowRegistrationGetResponseTypedDict": ".workflowregistrationgetresponse", + "WorkflowRegistrationListResponse": ".workflowregistrationlistresponse", + "WorkflowRegistrationListResponseTypedDict": ".workflowregistrationlistresponse", + "WorkflowRegistrationWithWorkerStatus": ".workflowregistrationwithworkerstatus", + "WorkflowRegistrationWithWorkerStatusTypedDict": ".workflowregistrationwithworkerstatus", + "WorkflowScheduleListResponse": ".workflowschedulelistresponse", + "WorkflowScheduleListResponseTypedDict": ".workflowschedulelistresponse", + "WorkflowSchedulePauseRequest": ".workflowschedulepauserequest", + "WorkflowSchedulePauseRequestTypedDict": ".workflowschedulepauserequest", + "WorkflowScheduleRequest": ".workflowschedulerequest", + "WorkflowScheduleRequestTypedDict": ".workflowschedulerequest", + "WorkflowScheduleResponse": ".workflowscheduleresponse", + "WorkflowScheduleResponseTypedDict": ".workflowscheduleresponse", + "WorkflowTaskFailedAttributes": ".workflowtaskfailedattributes", + "WorkflowTaskFailedAttributesTypedDict": ".workflowtaskfailedattributes", + "WorkflowTaskFailedResponse": ".workflowtaskfailedresponse", + "WorkflowTaskFailedResponseTypedDict": ".workflowtaskfailedresponse", + "WorkflowTaskTimedOutAttributes": ".workflowtasktimedoutattributes", + "WorkflowTaskTimedOutAttributesTypedDict": ".workflowtasktimedoutattributes", + "WorkflowTaskTimedOutResponse": ".workflowtasktimedoutresponse", + "WorkflowTaskTimedOutResponseTypedDict": ".workflowtasktimedoutresponse", + "WorkflowType": ".workflowtype", + "WorkflowUnarchiveResponse": ".workflowunarchiveresponse", + "WorkflowUnarchiveResponseTypedDict": ".workflowunarchiveresponse", + "WorkflowUpdateRequest": ".workflowupdaterequest", + "WorkflowUpdateRequestTypedDict": ".workflowupdaterequest", + "WorkflowUpdateResponse": ".workflowupdateresponse", + "WorkflowUpdateResponseTypedDict": ".workflowupdateresponse", + "WorkflowWithWorkerStatus": ".workflowwithworkerstatus", + "WorkflowWithWorkerStatusTypedDict": ".workflowwithworkerstatus", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/src/mistralai/client/models/activitytaskcompletedattributesresponse.py b/src/mistralai/client/models/activitytaskcompletedattributesresponse.py new file mode 100644 index 00000000..8e355d48 --- /dev/null +++ b/src/mistralai/client/models/activitytaskcompletedattributesresponse.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8174941767cc + +from __future__ import annotations +from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ActivityTaskCompletedAttributesResponseTypedDict(TypedDict): + r"""Attributes for activity task completed events.""" + + task_id: str + r"""Unique identifier for the activity task within the workflow.""" + activity_name: str + r"""The registered name of the activity being executed.""" + result: JSONPayloadResponseTypedDict + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + +class ActivityTaskCompletedAttributesResponse(BaseModel): + r"""Attributes for activity task completed events.""" + + task_id: str + r"""Unique identifier for the activity task within the workflow.""" + + activity_name: str + r"""The registered name of the activity being executed.""" + + result: JSONPayloadResponse + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ diff --git a/src/mistralai/client/models/activitytaskcompletedresponse.py b/src/mistralai/client/models/activitytaskcompletedresponse.py new file mode 100644 index 00000000..b324066b --- /dev/null +++ b/src/mistralai/client/models/activitytaskcompletedresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 28373f0a2c9e + +from __future__ import annotations +from .activitytaskcompletedattributesresponse import ( + ActivityTaskCompletedAttributesResponse, + ActivityTaskCompletedAttributesResponseTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ActivityTaskCompletedResponseTypedDict(TypedDict): + r"""Emitted when an activity task completes successfully. + + Contains timing information about the successful execution. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: ActivityTaskCompletedAttributesResponseTypedDict + r"""Attributes for activity task completed events.""" + event_type: Literal["ACTIVITY_TASK_COMPLETED"] + r"""Event type discriminator.""" + + +class ActivityTaskCompletedResponse(BaseModel): + r"""Emitted when an activity task completes successfully. + + Contains timing information about the successful execution. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: ActivityTaskCompletedAttributesResponse + r"""Attributes for activity task completed events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["ACTIVITY_TASK_COMPLETED"]], + AfterValidator(validate_const("ACTIVITY_TASK_COMPLETED")), + ], + pydantic.Field(alias="event_type"), + ] = "ACTIVITY_TASK_COMPLETED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ActivityTaskCompletedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/activitytaskfailedattributes.py b/src/mistralai/client/models/activitytaskfailedattributes.py new file mode 100644 index 00000000..37749d4a --- /dev/null +++ b/src/mistralai/client/models/activitytaskfailedattributes.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 12635cd17417 + +from __future__ import annotations +from .failure import Failure, FailureTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ActivityTaskFailedAttributesTypedDict(TypedDict): + r"""Attributes for activity task failed events (final failure after all retries).""" + + task_id: str + r"""Unique identifier for the activity task within the workflow.""" + activity_name: str + r"""The registered name of the activity being executed.""" + attempt: int + r"""The final attempt number that failed (1-indexed).""" + failure: FailureTypedDict + r"""Represents an error or exception that occurred during execution.""" + + +class ActivityTaskFailedAttributes(BaseModel): + r"""Attributes for activity task failed events (final failure after all retries).""" + + task_id: str + r"""Unique identifier for the activity task within the workflow.""" + + activity_name: str + r"""The registered name of the activity being executed.""" + + attempt: int + r"""The final attempt number that failed (1-indexed).""" + + failure: Failure + r"""Represents an error or exception that occurred during execution.""" diff --git a/src/mistralai/client/models/activitytaskfailedresponse.py b/src/mistralai/client/models/activitytaskfailedresponse.py new file mode 100644 index 00000000..3410ea84 --- /dev/null +++ b/src/mistralai/client/models/activitytaskfailedresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b739e8fc9b44 + +from __future__ import annotations +from .activitytaskfailedattributes import ( + ActivityTaskFailedAttributes, + ActivityTaskFailedAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ActivityTaskFailedResponseTypedDict(TypedDict): + r"""Emitted when an activity task fails after exhausting all retry attempts. + + This is a terminal event indicating the activity could not complete successfully. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: ActivityTaskFailedAttributesTypedDict + r"""Attributes for activity task failed events (final failure after all retries).""" + event_type: Literal["ACTIVITY_TASK_FAILED"] + r"""Event type discriminator.""" + + +class ActivityTaskFailedResponse(BaseModel): + r"""Emitted when an activity task fails after exhausting all retry attempts. + + This is a terminal event indicating the activity could not complete successfully. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: ActivityTaskFailedAttributes + r"""Attributes for activity task failed events (final failure after all retries).""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["ACTIVITY_TASK_FAILED"]], + AfterValidator(validate_const("ACTIVITY_TASK_FAILED")), + ], + pydantic.Field(alias="event_type"), + ] = "ACTIVITY_TASK_FAILED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ActivityTaskFailedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/activitytaskretryingattributes.py b/src/mistralai/client/models/activitytaskretryingattributes.py new file mode 100644 index 00000000..b0ee11d8 --- /dev/null +++ b/src/mistralai/client/models/activitytaskretryingattributes.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9aaa9eecac09 + +from __future__ import annotations +from .failure import Failure, FailureTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ActivityTaskRetryingAttributesTypedDict(TypedDict): + r"""Attributes for activity task retrying events.""" + + task_id: str + r"""Unique identifier for the activity task within the workflow.""" + activity_name: str + r"""The registered name of the activity being executed.""" + attempt: int + r"""The attempt number that failed (1-indexed).""" + failure: FailureTypedDict + r"""Represents an error or exception that occurred during execution.""" + + +class ActivityTaskRetryingAttributes(BaseModel): + r"""Attributes for activity task retrying events.""" + + task_id: str + r"""Unique identifier for the activity task within the workflow.""" + + activity_name: str + r"""The registered name of the activity being executed.""" + + attempt: int + r"""The attempt number that failed (1-indexed).""" + + failure: Failure + r"""Represents an error or exception that occurred during execution.""" diff --git a/src/mistralai/client/models/activitytaskretryingresponse.py b/src/mistralai/client/models/activitytaskretryingresponse.py new file mode 100644 index 00000000..cf054a27 --- /dev/null +++ b/src/mistralai/client/models/activitytaskretryingresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3a4ff1e01fa1 + +from __future__ import annotations +from .activitytaskretryingattributes import ( + ActivityTaskRetryingAttributes, + ActivityTaskRetryingAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ActivityTaskRetryingResponseTypedDict(TypedDict): + r"""Emitted when an activity task fails and will be retried. + + Contains information about the failed attempt and the error that occurred. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: ActivityTaskRetryingAttributesTypedDict + r"""Attributes for activity task retrying events.""" + event_type: Literal["ACTIVITY_TASK_RETRYING"] + r"""Event type discriminator.""" + + +class ActivityTaskRetryingResponse(BaseModel): + r"""Emitted when an activity task fails and will be retried. + + Contains information about the failed attempt and the error that occurred. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: ActivityTaskRetryingAttributes + r"""Attributes for activity task retrying events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["ACTIVITY_TASK_RETRYING"]], + AfterValidator(validate_const("ACTIVITY_TASK_RETRYING")), + ], + pydantic.Field(alias="event_type"), + ] = "ACTIVITY_TASK_RETRYING" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ActivityTaskRetryingResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/activitytaskstartedattributesresponse.py b/src/mistralai/client/models/activitytaskstartedattributesresponse.py new file mode 100644 index 00000000..9a049150 --- /dev/null +++ b/src/mistralai/client/models/activitytaskstartedattributesresponse.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3a365e2c2942 + +from __future__ import annotations +from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ActivityTaskStartedAttributesResponseTypedDict(TypedDict): + r"""Attributes for activity task started events.""" + + task_id: str + r"""Unique identifier for the activity task within the workflow.""" + activity_name: str + r"""The registered name of the activity being executed.""" + input: JSONPayloadResponseTypedDict + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + +class ActivityTaskStartedAttributesResponse(BaseModel): + r"""Attributes for activity task started events.""" + + task_id: str + r"""Unique identifier for the activity task within the workflow.""" + + activity_name: str + r"""The registered name of the activity being executed.""" + + input: JSONPayloadResponse + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ diff --git a/src/mistralai/client/models/activitytaskstartedresponse.py b/src/mistralai/client/models/activitytaskstartedresponse.py new file mode 100644 index 00000000..75186e02 --- /dev/null +++ b/src/mistralai/client/models/activitytaskstartedresponse.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d01ef9cb3955 + +from __future__ import annotations +from .activitytaskstartedattributesresponse import ( + ActivityTaskStartedAttributesResponse, + ActivityTaskStartedAttributesResponseTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ActivityTaskStartedResponseTypedDict(TypedDict): + r"""Emitted when an activity task begins execution. + + This is the first event for an activity, emitted on the first attempt only. + Subsequent retry attempts emit ACTIVITY_TASK_RETRYING instead. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: ActivityTaskStartedAttributesResponseTypedDict + r"""Attributes for activity task started events.""" + event_type: Literal["ACTIVITY_TASK_STARTED"] + r"""Event type discriminator.""" + + +class ActivityTaskStartedResponse(BaseModel): + r"""Emitted when an activity task begins execution. + + This is the first event for an activity, emitted on the first attempt only. + Subsequent retry attempts emit ACTIVITY_TASK_RETRYING instead. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: ActivityTaskStartedAttributesResponse + r"""Attributes for activity task started events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["ACTIVITY_TASK_STARTED"]], + AfterValidator(validate_const("ACTIVITY_TASK_STARTED")), + ], + pydantic.Field(alias="event_type"), + ] = "ACTIVITY_TASK_STARTED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ActivityTaskStartedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/agent.py b/src/mistralai/client/models/agent.py new file mode 100644 index 00000000..36cb26bf --- /dev/null +++ b/src/mistralai/client/models/agent.py @@ -0,0 +1,207 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1336849c84fb + +from __future__ import annotations +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .functiontool import FunctionTool, FunctionToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from datetime import datetime +from functools import partial +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +from mistralai.client.utils.unions import parse_open_union +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator, BeforeValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AgentToolTypedDict = TypeAliasType( + "AgentToolTypedDict", + Union[ + FunctionToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +class UnknownAgentTool(BaseModel): + r"""A AgentTool variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_AGENT_TOOL_VARIANTS: dict[str, Any] = { + "code_interpreter": CodeInterpreterTool, + "connector": CustomConnector, + "document_library": DocumentLibraryTool, + "function": FunctionTool, + "image_generation": ImageGenerationTool, + "web_search": WebSearchTool, + "web_search_premium": WebSearchPremiumTool, +} + + +AgentTool = Annotated[ + Union[ + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, + UnknownAgentTool, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_AGENT_TOOL_VARIANTS, + unknown_cls=UnknownAgentTool, + union_name="AgentTool", + ) + ), +] + + +class AgentTypedDict(TypedDict): + model: str + name: str + id: str + version: int + versions: List[int] + created_at: datetime + updated_at: datetime + deployment_chat: bool + source: str + instructions: NotRequired[Nullable[str]] + r"""Instruction prompt the model will follow during the conversation.""" + tools: NotRequired[List[AgentToolTypedDict]] + r"""List of tools which are available to the model during the conversation.""" + completion_args: NotRequired[CompletionArgsTypedDict] + r"""White-listed arguments from the completion API""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + description: NotRequired[Nullable[str]] + handoffs: NotRequired[Nullable[List[str]]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + object: Literal["agent"] + version_message: NotRequired[Nullable[str]] + + +class Agent(BaseModel): + model: str + + name: str + + id: str + + version: int + + versions: List[int] + + created_at: datetime + + updated_at: datetime + + deployment_chat: bool + + source: str + + instructions: OptionalNullable[str] = UNSET + r"""Instruction prompt the model will follow during the conversation.""" + + tools: Optional[List[AgentTool]] = None + r"""List of tools which are available to the model during the conversation.""" + + completion_args: Optional[CompletionArgs] = None + r"""White-listed arguments from the completion API""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + description: OptionalNullable[str] = UNSET + + handoffs: OptionalNullable[List[str]] = UNSET + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + object: Annotated[ + Annotated[Optional[Literal["agent"]], AfterValidator(validate_const("agent"))], + pydantic.Field(alias="object"), + ] = "agent" + + version_message: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "instructions", + "tools", + "completion_args", + "guardrails", + "description", + "handoffs", + "metadata", + "object", + "version_message", + ] + ) + nullable_fields = set( + [ + "instructions", + "guardrails", + "description", + "handoffs", + "metadata", + "version_message", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + Agent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/agentaliasresponse.py b/src/mistralai/client/models/agentaliasresponse.py new file mode 100644 index 00000000..6972af2a --- /dev/null +++ b/src/mistralai/client/models/agentaliasresponse.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3899a98a55dd + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class AgentAliasResponseTypedDict(TypedDict): + alias: str + version: int + created_at: datetime + updated_at: datetime + + +class AgentAliasResponse(BaseModel): + alias: str + + version: int + + created_at: datetime + + updated_at: datetime diff --git a/src/mistralai/client/models/agentconversation.py b/src/mistralai/client/models/agentconversation.py new file mode 100644 index 00000000..b52f5e5a --- /dev/null +++ b/src/mistralai/client/models/agentconversation.py @@ -0,0 +1,105 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1b7d73eddf51 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AgentConversationAgentVersionTypedDict = TypeAliasType( + "AgentConversationAgentVersionTypedDict", Union[str, int] +) + + +AgentConversationAgentVersion = TypeAliasType( + "AgentConversationAgentVersion", Union[str, int] +) + + +class AgentConversationTypedDict(TypedDict): + id: str + created_at: datetime + updated_at: datetime + agent_id: str + name: NotRequired[Nullable[str]] + r"""Name given to the conversation.""" + description: NotRequired[Nullable[str]] + r"""Description of the what the conversation is about.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + r"""Custom metadata for the conversation.""" + object: Literal["conversation"] + agent_version: NotRequired[Nullable[AgentConversationAgentVersionTypedDict]] + + +class AgentConversation(BaseModel): + id: str + + created_at: datetime + + updated_at: datetime + + agent_id: str + + name: OptionalNullable[str] = UNSET + r"""Name given to the conversation.""" + + description: OptionalNullable[str] = UNSET + r"""Description of the what the conversation is about.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + r"""Custom metadata for the conversation.""" + + object: Annotated[ + Annotated[ + Optional[Literal["conversation"]], + AfterValidator(validate_const("conversation")), + ], + pydantic.Field(alias="object"), + ] = "conversation" + + agent_version: OptionalNullable[AgentConversationAgentVersion] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["name", "description", "metadata", "object", "agent_version"] + ) + nullable_fields = set(["name", "description", "metadata", "agent_version"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + AgentConversation.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/agenthandoffdoneevent.py b/src/mistralai/client/models/agenthandoffdoneevent.py new file mode 100644 index 00000000..ea9cd6b2 --- /dev/null +++ b/src/mistralai/client/models/agenthandoffdoneevent.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 82628bb5fcea + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AgentHandoffDoneEventTypedDict(TypedDict): + id: str + next_agent_id: str + next_agent_name: str + type: Literal["agent.handoff.done"] + created_at: NotRequired[datetime] + output_index: NotRequired[int] + + +class AgentHandoffDoneEvent(BaseModel): + id: str + + next_agent_id: str + + next_agent_name: str + + type: Annotated[ + Annotated[ + Literal["agent.handoff.done"], + AfterValidator(validate_const("agent.handoff.done")), + ], + pydantic.Field(alias="type"), + ] = "agent.handoff.done" + + created_at: Optional[datetime] = None + + output_index: Optional[int] = 0 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["created_at", "output_index"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + AgentHandoffDoneEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/agenthandoffentry.py b/src/mistralai/client/models/agenthandoffentry.py new file mode 100644 index 00000000..8d1c143e --- /dev/null +++ b/src/mistralai/client/models/agenthandoffentry.py @@ -0,0 +1,90 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5030bcaa3a07 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AgentHandoffEntryTypedDict(TypedDict): + previous_agent_id: str + previous_agent_name: str + next_agent_id: str + next_agent_name: str + object: Literal["entry"] + type: Literal["agent.handoff"] + created_at: NotRequired[datetime] + completed_at: NotRequired[Nullable[datetime]] + id: NotRequired[str] + + +class AgentHandoffEntry(BaseModel): + previous_agent_id: str + + previous_agent_name: str + + next_agent_id: str + + next_agent_name: str + + object: Annotated[ + Annotated[Optional[Literal["entry"]], AfterValidator(validate_const("entry"))], + pydantic.Field(alias="object"), + ] = "entry" + + type: Annotated[ + Annotated[ + Optional[Literal["agent.handoff"]], + AfterValidator(validate_const("agent.handoff")), + ], + pydantic.Field(alias="type"), + ] = "agent.handoff" + + created_at: Optional[datetime] = None + + completed_at: OptionalNullable[datetime] = UNSET + + id: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "type", "created_at", "completed_at", "id"]) + nullable_fields = set(["completed_at"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + AgentHandoffEntry.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/agenthandoffstartedevent.py b/src/mistralai/client/models/agenthandoffstartedevent.py new file mode 100644 index 00000000..9525bcf6 --- /dev/null +++ b/src/mistralai/client/models/agenthandoffstartedevent.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2f6093d9b222 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AgentHandoffStartedEventTypedDict(TypedDict): + id: str + previous_agent_id: str + previous_agent_name: str + type: Literal["agent.handoff.started"] + created_at: NotRequired[datetime] + output_index: NotRequired[int] + + +class AgentHandoffStartedEvent(BaseModel): + id: str + + previous_agent_id: str + + previous_agent_name: str + + type: Annotated[ + Annotated[ + Literal["agent.handoff.started"], + AfterValidator(validate_const("agent.handoff.started")), + ], + pydantic.Field(alias="type"), + ] = "agent.handoff.started" + + created_at: Optional[datetime] = None + + output_index: Optional[int] = 0 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["created_at", "output_index"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + AgentHandoffStartedEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/agents_api_v1_agents_create_or_update_aliasop.py b/src/mistralai/client/models/agents_api_v1_agents_create_or_update_aliasop.py new file mode 100644 index 00000000..04761ae7 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_create_or_update_aliasop.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 23a832f8f175 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from typing_extensions import Annotated, TypedDict + + +class AgentsAPIV1AgentsCreateOrUpdateAliasRequestTypedDict(TypedDict): + agent_id: str + alias: str + version: int + + +class AgentsAPIV1AgentsCreateOrUpdateAliasRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + alias: Annotated[ + str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) + ] + + version: Annotated[ + int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) + ] diff --git a/src/mistralai/client/models/agents_api_v1_agents_delete_aliasop.py b/src/mistralai/client/models/agents_api_v1_agents_delete_aliasop.py new file mode 100644 index 00000000..291a9802 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_delete_aliasop.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9c9947e768d3 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from typing_extensions import Annotated, TypedDict + + +class AgentsAPIV1AgentsDeleteAliasRequestTypedDict(TypedDict): + agent_id: str + alias: str + + +class AgentsAPIV1AgentsDeleteAliasRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + alias: Annotated[ + str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) + ] diff --git a/src/mistralai/client/models/agents_api_v1_agents_deleteop.py b/src/mistralai/client/models/agents_api_v1_agents_deleteop.py new file mode 100644 index 00000000..5e41fdcd --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_deleteop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 95adb6768908 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class AgentsAPIV1AgentsDeleteRequestTypedDict(TypedDict): + agent_id: str + + +class AgentsAPIV1AgentsDeleteRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/agents_api_v1_agents_get_versionop.py b/src/mistralai/client/models/agents_api_v1_agents_get_versionop.py new file mode 100644 index 00000000..941863d0 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_get_versionop.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ef9914284afb + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class AgentsAPIV1AgentsGetVersionRequestTypedDict(TypedDict): + agent_id: str + version: str + + +class AgentsAPIV1AgentsGetVersionRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + version: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/agents_api_v1_agents_getop.py b/src/mistralai/client/models/agents_api_v1_agents_getop.py new file mode 100644 index 00000000..dee6a347 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_getop.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f5918c34f1c7 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AgentsAPIV1AgentsGetAgentVersionTypedDict = TypeAliasType( + "AgentsAPIV1AgentsGetAgentVersionTypedDict", Union[int, str] +) + + +AgentsAPIV1AgentsGetAgentVersion = TypeAliasType( + "AgentsAPIV1AgentsGetAgentVersion", Union[int, str] +) + + +class AgentsAPIV1AgentsGetRequestTypedDict(TypedDict): + agent_id: str + agent_version: NotRequired[Nullable[AgentsAPIV1AgentsGetAgentVersionTypedDict]] + + +class AgentsAPIV1AgentsGetRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + agent_version: Annotated[ + OptionalNullable[AgentsAPIV1AgentsGetAgentVersion], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["agent_version"]) + nullable_fields = set(["agent_version"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/agents_api_v1_agents_list_version_aliasesop.py b/src/mistralai/client/models/agents_api_v1_agents_list_version_aliasesop.py new file mode 100644 index 00000000..bb1da602 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_list_version_aliasesop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a04815e6c798 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class AgentsAPIV1AgentsListVersionAliasesRequestTypedDict(TypedDict): + agent_id: str + + +class AgentsAPIV1AgentsListVersionAliasesRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/agents_api_v1_agents_list_versionsop.py b/src/mistralai/client/models/agents_api_v1_agents_list_versionsop.py new file mode 100644 index 00000000..25ea29e3 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_list_versionsop.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 19e3310c3907 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AgentsAPIV1AgentsListVersionsRequestTypedDict(TypedDict): + agent_id: str + page: NotRequired[int] + r"""Page number (0-indexed)""" + page_size: NotRequired[int] + r"""Number of versions per page""" + + +class AgentsAPIV1AgentsListVersionsRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Page number (0-indexed)""" + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 20 + r"""Number of versions per page""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page", "page_size"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/agents_api_v1_agents_listop.py b/src/mistralai/client/models/agents_api_v1_agents_listop.py new file mode 100644 index 00000000..100e0da7 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_listop.py @@ -0,0 +1,115 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 25a6460a6e19 + +from __future__ import annotations +from .requestsource import RequestSource +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Any, Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AgentsAPIV1AgentsListRequestTypedDict(TypedDict): + page: NotRequired[int] + r"""Page number (0-indexed)""" + page_size: NotRequired[int] + r"""Number of agents per page""" + deployment_chat: NotRequired[Nullable[bool]] + sources: NotRequired[Nullable[List[RequestSource]]] + name: NotRequired[Nullable[str]] + r"""Filter by agent name""" + search: NotRequired[Nullable[str]] + r"""Search agents by name or ID""" + id: NotRequired[Nullable[str]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + + +class AgentsAPIV1AgentsListRequest(BaseModel): + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Page number (0-indexed)""" + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 20 + r"""Number of agents per page""" + + deployment_chat: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + sources: Annotated[ + OptionalNullable[List[RequestSource]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + name: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by agent name""" + + search: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Search agents by name or ID""" + + id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + metadata: Annotated[ + OptionalNullable[Dict[str, Any]], + FieldMetadata(query=QueryParamMetadata(serialization="json")), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "page", + "page_size", + "deployment_chat", + "sources", + "name", + "search", + "id", + "metadata", + ] + ) + nullable_fields = set( + ["deployment_chat", "sources", "name", "search", "id", "metadata"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/models/agents_api_v1_agents_update_versionop.py b/src/mistralai/client/models/agents_api_v1_agents_update_versionop.py similarity index 76% rename from src/mistralai/models/agents_api_v1_agents_update_versionop.py rename to src/mistralai/client/models/agents_api_v1_agents_update_versionop.py index 5e4b97b3..5ab821ea 100644 --- a/src/mistralai/models/agents_api_v1_agents_update_versionop.py +++ b/src/mistralai/client/models/agents_api_v1_agents_update_versionop.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 63f61b8891bf from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/agents_api_v1_agents_updateop.py b/src/mistralai/client/models/agents_api_v1_agents_updateop.py new file mode 100644 index 00000000..69da5001 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_agents_updateop.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bb55993c932d + +from __future__ import annotations +from .updateagentrequest import UpdateAgentRequest, UpdateAgentRequestTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class AgentsAPIV1AgentsUpdateRequestTypedDict(TypedDict): + agent_id: str + update_agent_request: UpdateAgentRequestTypedDict + + +class AgentsAPIV1AgentsUpdateRequest(BaseModel): + agent_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_agent_request: Annotated[ + UpdateAgentRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/models/agents_api_v1_conversations_append_streamop.py b/src/mistralai/client/models/agents_api_v1_conversations_append_streamop.py similarity index 85% rename from src/mistralai/models/agents_api_v1_conversations_append_streamop.py rename to src/mistralai/client/models/agents_api_v1_conversations_append_streamop.py index d2489ffb..d257dc78 100644 --- a/src/mistralai/models/agents_api_v1_conversations_append_streamop.py +++ b/src/mistralai/client/models/agents_api_v1_conversations_append_streamop.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ec00e0905f15 from __future__ import annotations from .conversationappendstreamrequest import ( ConversationAppendStreamRequest, ConversationAppendStreamRequestTypedDict, ) -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/models/agents_api_v1_conversations_appendop.py b/src/mistralai/client/models/agents_api_v1_conversations_appendop.py similarity index 84% rename from src/mistralai/models/agents_api_v1_conversations_appendop.py rename to src/mistralai/client/models/agents_api_v1_conversations_appendop.py index ba37697e..61fec083 100644 --- a/src/mistralai/models/agents_api_v1_conversations_appendop.py +++ b/src/mistralai/client/models/agents_api_v1_conversations_appendop.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 39c6125e850c from __future__ import annotations from .conversationappendrequest import ( ConversationAppendRequest, ConversationAppendRequestTypedDict, ) -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/agents_api_v1_conversations_deleteop.py b/src/mistralai/client/models/agents_api_v1_conversations_deleteop.py new file mode 100644 index 00000000..499645a7 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_conversations_deleteop.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0792e6abbdcb + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class AgentsAPIV1ConversationsDeleteRequestTypedDict(TypedDict): + conversation_id: str + r"""ID of the conversation from which we are fetching metadata.""" + + +class AgentsAPIV1ConversationsDeleteRequest(BaseModel): + conversation_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the conversation from which we are fetching metadata.""" diff --git a/src/mistralai/client/models/agents_api_v1_conversations_getop.py b/src/mistralai/client/models/agents_api_v1_conversations_getop.py new file mode 100644 index 00000000..504616ab --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_conversations_getop.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c530f2fc64d0 + +from __future__ import annotations +from .agentconversation import AgentConversation, AgentConversationTypedDict +from .modelconversation import ModelConversation, ModelConversationTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing import Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class AgentsAPIV1ConversationsGetRequestTypedDict(TypedDict): + conversation_id: str + r"""ID of the conversation from which we are fetching metadata.""" + + +class AgentsAPIV1ConversationsGetRequest(BaseModel): + conversation_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the conversation from which we are fetching metadata.""" + + +ResponseV1ConversationsGetTypedDict = TypeAliasType( + "ResponseV1ConversationsGetTypedDict", + Union[AgentConversationTypedDict, ModelConversationTypedDict], +) +r"""Successful Response""" + + +ResponseV1ConversationsGet = TypeAliasType( + "ResponseV1ConversationsGet", Union[AgentConversation, ModelConversation] +) +r"""Successful Response""" diff --git a/src/mistralai/models/agents_api_v1_conversations_historyop.py b/src/mistralai/client/models/agents_api_v1_conversations_historyop.py similarity index 79% rename from src/mistralai/models/agents_api_v1_conversations_historyop.py rename to src/mistralai/client/models/agents_api_v1_conversations_historyop.py index b8c33d1b..ef0a4eb0 100644 --- a/src/mistralai/models/agents_api_v1_conversations_historyop.py +++ b/src/mistralai/client/models/agents_api_v1_conversations_historyop.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2f5ca33768aa from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/agents_api_v1_conversations_listop.py b/src/mistralai/client/models/agents_api_v1_conversations_listop.py new file mode 100644 index 00000000..dd6276d9 --- /dev/null +++ b/src/mistralai/client/models/agents_api_v1_conversations_listop.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 936e36181d36 + +from __future__ import annotations +from .agentconversation import AgentConversation, AgentConversationTypedDict +from .modelconversation import ModelConversation, ModelConversationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Any, Dict, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +class AgentsAPIV1ConversationsListRequestTypedDict(TypedDict): + page: NotRequired[int] + page_size: NotRequired[int] + metadata: NotRequired[Nullable[Dict[str, Any]]] + + +class AgentsAPIV1ConversationsListRequest(BaseModel): + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + + metadata: Annotated[ + OptionalNullable[Dict[str, Any]], + FieldMetadata(query=QueryParamMetadata(serialization="json")), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page", "page_size", "metadata"]) + nullable_fields = set(["metadata"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +AgentsAPIV1ConversationsListResponseTypedDict = TypeAliasType( + "AgentsAPIV1ConversationsListResponseTypedDict", + Union[AgentConversationTypedDict, ModelConversationTypedDict], +) + + +AgentsAPIV1ConversationsListResponse = TypeAliasType( + "AgentsAPIV1ConversationsListResponse", Union[AgentConversation, ModelConversation] +) diff --git a/src/mistralai/models/agents_api_v1_conversations_messagesop.py b/src/mistralai/client/models/agents_api_v1_conversations_messagesop.py similarity index 80% rename from src/mistralai/models/agents_api_v1_conversations_messagesop.py rename to src/mistralai/client/models/agents_api_v1_conversations_messagesop.py index f0dac8bf..19978a19 100644 --- a/src/mistralai/models/agents_api_v1_conversations_messagesop.py +++ b/src/mistralai/client/models/agents_api_v1_conversations_messagesop.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b5141764a708 from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/models/agents_api_v1_conversations_restart_streamop.py b/src/mistralai/client/models/agents_api_v1_conversations_restart_streamop.py similarity index 85% rename from src/mistralai/models/agents_api_v1_conversations_restart_streamop.py rename to src/mistralai/client/models/agents_api_v1_conversations_restart_streamop.py index f39b74eb..63c74449 100644 --- a/src/mistralai/models/agents_api_v1_conversations_restart_streamop.py +++ b/src/mistralai/client/models/agents_api_v1_conversations_restart_streamop.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c284a1711148 from __future__ import annotations from .conversationrestartstreamrequest import ( ConversationRestartStreamRequest, ConversationRestartStreamRequestTypedDict, ) -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/models/agents_api_v1_conversations_restartop.py b/src/mistralai/client/models/agents_api_v1_conversations_restartop.py similarity index 85% rename from src/mistralai/models/agents_api_v1_conversations_restartop.py rename to src/mistralai/client/models/agents_api_v1_conversations_restartop.py index f706c066..3186d5df 100644 --- a/src/mistralai/models/agents_api_v1_conversations_restartop.py +++ b/src/mistralai/client/models/agents_api_v1_conversations_restartop.py @@ -1,12 +1,13 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3ba234e5a8fc from __future__ import annotations from .conversationrestartrequest import ( ConversationRestartRequest, ConversationRestartRequestTypedDict, ) -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/agentscompletionrequest.py b/src/mistralai/client/models/agentscompletionrequest.py new file mode 100644 index 00000000..55794ea2 --- /dev/null +++ b/src/mistralai/client/models/agentscompletionrequest.py @@ -0,0 +1,249 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3960bc4c545f + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .mistralpromptmode import MistralPromptMode +from .prediction import Prediction, PredictionTypedDict +from .reasoningeffort import ReasoningEffort +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .tool import Tool, ToolTypedDict +from .toolchoice import ToolChoice, ToolChoiceTypedDict +from .toolchoiceenum import ToolChoiceEnum +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AgentsCompletionRequestStopTypedDict = TypeAliasType( + "AgentsCompletionRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +AgentsCompletionRequestStop = TypeAliasType( + "AgentsCompletionRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +AgentsCompletionRequestMessageTypedDict = TypeAliasType( + "AgentsCompletionRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +AgentsCompletionRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +AgentsCompletionRequestToolTypedDict = TypeAliasType( + "AgentsCompletionRequestToolTypedDict", + Union[ + ToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +AgentsCompletionRequestTool = Union[ + Tool, + WebSearchTool, + WebSearchPremiumTool, + CodeInterpreterTool, + ImageGenerationTool, + DocumentLibraryTool, + CustomConnector, +] + + +AgentsCompletionRequestToolChoiceTypedDict = TypeAliasType( + "AgentsCompletionRequestToolChoiceTypedDict", + Union[ToolChoiceTypedDict, ToolChoiceEnum], +) + + +AgentsCompletionRequestToolChoice = TypeAliasType( + "AgentsCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] +) + + +class AgentsCompletionRequestTypedDict(TypedDict): + messages: List[AgentsCompletionRequestMessageTypedDict] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + agent_id: str + r"""The ID of the agent to use for this completion.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + stop: NotRequired[Nullable[AgentsCompletionRequestStopTypedDict]] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + response_format: NotRequired[ResponseFormatTypedDict] + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + tools: NotRequired[Nullable[List[AgentsCompletionRequestToolTypedDict]]] + tool_choice: NotRequired[AgentsCompletionRequestToolChoiceTypedDict] + presence_penalty: NotRequired[Nullable[float]] + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + frequency_penalty: NotRequired[Nullable[float]] + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + n: NotRequired[Nullable[int]] + r"""Number of completions to return for each request, input tokens are only billed once.""" + prediction: NotRequired[PredictionTypedDict] + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + parallel_tool_calls: NotRequired[bool] + reasoning_effort: NotRequired[Nullable[ReasoningEffort]] + prompt_mode: NotRequired[Nullable[MistralPromptMode]] + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + prompt_cache_key: NotRequired[Nullable[str]] + + +class AgentsCompletionRequest(BaseModel): + messages: List[AgentsCompletionRequestMessage] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + + agent_id: str + r"""The ID of the agent to use for this completion.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = False + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + + stop: OptionalNullable[AgentsCompletionRequestStop] = UNSET + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + response_format: Optional[ResponseFormat] = None + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + tools: OptionalNullable[List[AgentsCompletionRequestTool]] = UNSET + + tool_choice: Optional[AgentsCompletionRequestToolChoice] = None + + presence_penalty: OptionalNullable[float] = UNSET + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + + frequency_penalty: OptionalNullable[float] = UNSET + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + + n: OptionalNullable[int] = UNSET + r"""Number of completions to return for each request, input tokens are only billed once.""" + + prediction: Optional[Prediction] = None + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + parallel_tool_calls: Optional[bool] = None + + reasoning_effort: OptionalNullable[ReasoningEffort] = UNSET + + prompt_mode: OptionalNullable[MistralPromptMode] = UNSET + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + prompt_cache_key: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "response_format", + "tools", + "tool_choice", + "presence_penalty", + "frequency_penalty", + "n", + "prediction", + "parallel_tool_calls", + "reasoning_effort", + "prompt_mode", + "guardrails", + "prompt_cache_key", + ] + ) + nullable_fields = set( + [ + "max_tokens", + "stop", + "random_seed", + "metadata", + "tools", + "presence_penalty", + "frequency_penalty", + "n", + "reasoning_effort", + "prompt_mode", + "guardrails", + "prompt_cache_key", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/agentscompletionstreamrequest.py b/src/mistralai/client/models/agentscompletionstreamrequest.py new file mode 100644 index 00000000..5d3bdecd --- /dev/null +++ b/src/mistralai/client/models/agentscompletionstreamrequest.py @@ -0,0 +1,247 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1b73f90befc2 + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .mistralpromptmode import MistralPromptMode +from .prediction import Prediction, PredictionTypedDict +from .reasoningeffort import ReasoningEffort +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .tool import Tool, ToolTypedDict +from .toolchoice import ToolChoice, ToolChoiceTypedDict +from .toolchoiceenum import ToolChoiceEnum +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AgentsCompletionStreamRequestStopTypedDict = TypeAliasType( + "AgentsCompletionStreamRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +AgentsCompletionStreamRequestStop = TypeAliasType( + "AgentsCompletionStreamRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +AgentsCompletionStreamRequestMessageTypedDict = TypeAliasType( + "AgentsCompletionStreamRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +AgentsCompletionStreamRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +AgentsCompletionStreamRequestToolTypedDict = TypeAliasType( + "AgentsCompletionStreamRequestToolTypedDict", + Union[ + ToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +AgentsCompletionStreamRequestTool = Union[ + Tool, + WebSearchTool, + WebSearchPremiumTool, + CodeInterpreterTool, + ImageGenerationTool, + DocumentLibraryTool, + CustomConnector, +] + + +AgentsCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( + "AgentsCompletionStreamRequestToolChoiceTypedDict", + Union[ToolChoiceTypedDict, ToolChoiceEnum], +) + + +AgentsCompletionStreamRequestToolChoice = TypeAliasType( + "AgentsCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] +) + + +class AgentsCompletionStreamRequestTypedDict(TypedDict): + messages: List[AgentsCompletionStreamRequestMessageTypedDict] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + agent_id: str + r"""The ID of the agent to use for this completion.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + stop: NotRequired[Nullable[AgentsCompletionStreamRequestStopTypedDict]] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + response_format: NotRequired[ResponseFormatTypedDict] + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + tools: NotRequired[Nullable[List[AgentsCompletionStreamRequestToolTypedDict]]] + tool_choice: NotRequired[AgentsCompletionStreamRequestToolChoiceTypedDict] + presence_penalty: NotRequired[Nullable[float]] + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + frequency_penalty: NotRequired[Nullable[float]] + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + n: NotRequired[Nullable[int]] + r"""Number of completions to return for each request, input tokens are only billed once.""" + prediction: NotRequired[PredictionTypedDict] + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + parallel_tool_calls: NotRequired[bool] + reasoning_effort: NotRequired[Nullable[ReasoningEffort]] + prompt_mode: NotRequired[Nullable[MistralPromptMode]] + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + prompt_cache_key: NotRequired[Nullable[str]] + + +class AgentsCompletionStreamRequest(BaseModel): + messages: List[AgentsCompletionStreamRequestMessage] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + + agent_id: str + r"""The ID of the agent to use for this completion.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = True + + stop: OptionalNullable[AgentsCompletionStreamRequestStop] = UNSET + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + response_format: Optional[ResponseFormat] = None + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + tools: OptionalNullable[List[AgentsCompletionStreamRequestTool]] = UNSET + + tool_choice: Optional[AgentsCompletionStreamRequestToolChoice] = None + + presence_penalty: OptionalNullable[float] = UNSET + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + + frequency_penalty: OptionalNullable[float] = UNSET + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + + n: OptionalNullable[int] = UNSET + r"""Number of completions to return for each request, input tokens are only billed once.""" + + prediction: Optional[Prediction] = None + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + parallel_tool_calls: Optional[bool] = None + + reasoning_effort: OptionalNullable[ReasoningEffort] = UNSET + + prompt_mode: OptionalNullable[MistralPromptMode] = UNSET + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + prompt_cache_key: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "response_format", + "tools", + "tool_choice", + "presence_penalty", + "frequency_penalty", + "n", + "prediction", + "parallel_tool_calls", + "reasoning_effort", + "prompt_mode", + "guardrails", + "prompt_cache_key", + ] + ) + nullable_fields = set( + [ + "max_tokens", + "stop", + "random_seed", + "metadata", + "tools", + "presence_penalty", + "frequency_penalty", + "n", + "reasoning_effort", + "prompt_mode", + "guardrails", + "prompt_cache_key", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/annotations.py b/src/mistralai/client/models/annotations.py new file mode 100644 index 00000000..f3f5c21c --- /dev/null +++ b/src/mistralai/client/models/annotations.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3ae9e07de11d + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List, Literal, Union +from typing_extensions import NotRequired, TypedDict + + +Audience = Union[ + Literal[ + "user", + "assistant", + ], + UnrecognizedStr, +] + + +class AnnotationsTypedDict(TypedDict): + audience: NotRequired[Nullable[List[Audience]]] + priority: NotRequired[Nullable[float]] + + +class Annotations(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + audience: OptionalNullable[List[Audience]] = UNSET + + priority: OptionalNullable[float] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["audience", "priority"]) + nullable_fields = set(["audience", "priority"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/src/mistralai/models/apiendpoint.py b/src/mistralai/client/models/apiendpoint.py similarity index 86% rename from src/mistralai/models/apiendpoint.py rename to src/mistralai/client/models/apiendpoint.py index 0ad9366f..a6665c10 100644 --- a/src/mistralai/models/apiendpoint.py +++ b/src/mistralai/client/models/apiendpoint.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 00b34ce0a24d from __future__ import annotations -from mistralai.types import UnrecognizedStr +from mistralai.client.types import UnrecognizedStr from typing import Literal, Union diff --git a/src/mistralai/client/models/apikeyauth.py b/src/mistralai/client/models/apikeyauth.py new file mode 100644 index 00000000..10cbaf58 --- /dev/null +++ b/src/mistralai/client/models/apikeyauth.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f55510f5ff82 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class APIKeyAuthTypedDict(TypedDict): + value: str + type: Literal["api-key"] + + +class APIKeyAuth(BaseModel): + value: str + + type: Annotated[ + Annotated[Literal["api-key"], AfterValidator(validate_const("api-key"))], + pydantic.Field(alias="type"), + ] = "api-key" + + +try: + APIKeyAuth.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/archive_workflow_v1_workflows_workflow_identifier_archive_putop.py b/src/mistralai/client/models/archive_workflow_v1_workflows_workflow_identifier_archive_putop.py new file mode 100644 index 00000000..8582aaf5 --- /dev/null +++ b/src/mistralai/client/models/archive_workflow_v1_workflows_workflow_identifier_archive_putop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0be575ead94b + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequestTypedDict(TypedDict): + workflow_identifier: str + + +class ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequest(BaseModel): + workflow_identifier: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/archivemodelresponse.py b/src/mistralai/client/models/archivemodelresponse.py new file mode 100644 index 00000000..c5ca8ff5 --- /dev/null +++ b/src/mistralai/client/models/archivemodelresponse.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2d22c644df64 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ArchiveModelResponseTypedDict(TypedDict): + id: str + object: Literal["model"] + archived: NotRequired[bool] + + +class ArchiveModelResponse(BaseModel): + id: str + + object: Annotated[ + Annotated[Optional[Literal["model"]], AfterValidator(validate_const("model"))], + pydantic.Field(alias="object"), + ] = "model" + + archived: Optional[bool] = True + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "archived"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ArchiveModelResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/assistantmessage.py b/src/mistralai/client/models/assistantmessage.py new file mode 100644 index 00000000..f333a444 --- /dev/null +++ b/src/mistralai/client/models/assistantmessage.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2b49546e0742 + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from .toolcall import ToolCall, ToolCallTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AssistantMessageContentTypedDict = TypeAliasType( + "AssistantMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +AssistantMessageContent = TypeAliasType( + "AssistantMessageContent", Union[str, List[ContentChunk]] +) + + +class AssistantMessageTypedDict(TypedDict): + role: Literal["assistant"] + content: NotRequired[Nullable[AssistantMessageContentTypedDict]] + tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] + prefix: NotRequired[bool] + r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" + + +class AssistantMessage(BaseModel): + role: Annotated[ + Annotated[ + Optional[Literal["assistant"]], AfterValidator(validate_const("assistant")) + ], + pydantic.Field(alias="role"), + ] = "assistant" + + content: OptionalNullable[AssistantMessageContent] = UNSET + + tool_calls: OptionalNullable[List[ToolCall]] = UNSET + + prefix: Optional[bool] = False + r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["role", "content", "tool_calls", "prefix"]) + nullable_fields = set(["content", "tool_calls"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + AssistantMessage.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/audiochunk.py b/src/mistralai/client/models/audiochunk.py new file mode 100644 index 00000000..68866cd2 --- /dev/null +++ b/src/mistralai/client/models/audiochunk.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ce5dce4dced2 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class AudioChunkTypedDict(TypedDict): + input_audio: str + type: Literal["input_audio"] + + +class AudioChunk(BaseModel): + input_audio: str + + type: Annotated[ + Annotated[ + Literal["input_audio"], AfterValidator(validate_const("input_audio")) + ], + pydantic.Field(alias="type"), + ] = "input_audio" + + +try: + AudioChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/audiocontent.py b/src/mistralai/client/models/audiocontent.py new file mode 100644 index 00000000..2d38d2a1 --- /dev/null +++ b/src/mistralai/client/models/audiocontent.py @@ -0,0 +1,94 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8e39736e73f0 + +from __future__ import annotations +from .annotations import Annotations, AnnotationsTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AudioContentTypedDict(TypedDict): + r"""Audio content for a message.""" + + data: str + mime_type: str + type: Literal["audio"] + annotations: NotRequired[Nullable[AnnotationsTypedDict]] + meta: NotRequired[Nullable[Dict[str, Any]]] + + +class AudioContent(BaseModel): + r"""Audio content for a message.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + data: str + + mime_type: Annotated[str, pydantic.Field(alias="mimeType")] + + type: Annotated[ + Annotated[Literal["audio"], AfterValidator(validate_const("audio"))], + pydantic.Field(alias="type"), + ] = "audio" + + annotations: OptionalNullable[Annotations] = UNSET + + meta: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["annotations", "_meta"]) + nullable_fields = set(["annotations", "_meta"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + AudioContent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/audioencoding.py b/src/mistralai/client/models/audioencoding.py new file mode 100644 index 00000000..67fec75d --- /dev/null +++ b/src/mistralai/client/models/audioencoding.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b14e6a50f730 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +AudioEncoding = Union[ + Literal[ + "pcm_s16le", + "pcm_s32le", + "pcm_f16le", + "pcm_f32le", + "pcm_mulaw", + "pcm_alaw", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/audioformat.py b/src/mistralai/client/models/audioformat.py new file mode 100644 index 00000000..fef87ae7 --- /dev/null +++ b/src/mistralai/client/models/audioformat.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c8655712c218 + +from __future__ import annotations +from .audioencoding import AudioEncoding +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class AudioFormatTypedDict(TypedDict): + encoding: AudioEncoding + sample_rate: int + + +class AudioFormat(BaseModel): + encoding: AudioEncoding + + sample_rate: int diff --git a/src/mistralai/client/models/audiotranscriptionrequest.py b/src/mistralai/client/models/audiotranscriptionrequest.py new file mode 100644 index 00000000..734860d5 --- /dev/null +++ b/src/mistralai/client/models/audiotranscriptionrequest.py @@ -0,0 +1,117 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e4148b4d23e7 + +from __future__ import annotations +from .file import File, FileTypedDict +from .timestampgranularity import TimestampGranularity +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, MultipartFormMetadata, validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AudioTranscriptionRequestTypedDict(TypedDict): + model: str + r"""ID of the model to be used.""" + file: NotRequired[FileTypedDict] + file_url: NotRequired[Nullable[str]] + r"""Url of a file to be transcribed""" + file_id: NotRequired[Nullable[str]] + r"""ID of a file uploaded to /v1/files""" + language: NotRequired[Nullable[str]] + r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy.""" + temperature: NotRequired[Nullable[float]] + stream: Literal[False] + diarize: NotRequired[bool] + context_bias: NotRequired[List[str]] + timestamp_granularities: NotRequired[List[TimestampGranularity]] + r"""Granularities of timestamps to include in the response.""" + + +class AudioTranscriptionRequest(BaseModel): + model: Annotated[str, FieldMetadata(multipart=True)] + r"""ID of the model to be used.""" + + file: Annotated[ + Optional[File], FieldMetadata(multipart=MultipartFormMetadata(file=True)) + ] = None + + file_url: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET + r"""Url of a file to be transcribed""" + + file_id: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET + r"""ID of a file uploaded to /v1/files""" + + language: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET + r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy.""" + + temperature: Annotated[OptionalNullable[float], FieldMetadata(multipart=True)] = ( + UNSET + ) + + stream: Annotated[ + Annotated[Optional[Literal[False]], AfterValidator(validate_const(False))], + pydantic.Field(alias="stream"), + FieldMetadata(multipart=True), + ] = False + + diarize: Annotated[Optional[bool], FieldMetadata(multipart=True)] = False + + context_bias: Annotated[Optional[List[str]], FieldMetadata(multipart=True)] = None + + timestamp_granularities: Annotated[ + Optional[List[TimestampGranularity]], FieldMetadata(multipart=True) + ] = None + r"""Granularities of timestamps to include in the response.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "file", + "file_url", + "file_id", + "language", + "temperature", + "stream", + "diarize", + "context_bias", + "timestamp_granularities", + ] + ) + nullable_fields = set(["file_url", "file_id", "language", "temperature"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + AudioTranscriptionRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/audiotranscriptionrequeststream.py b/src/mistralai/client/models/audiotranscriptionrequeststream.py new file mode 100644 index 00000000..84c4dbcd --- /dev/null +++ b/src/mistralai/client/models/audiotranscriptionrequeststream.py @@ -0,0 +1,115 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 33a07317a3b3 + +from __future__ import annotations +from .file import File, FileTypedDict +from .timestampgranularity import TimestampGranularity +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, MultipartFormMetadata, validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AudioTranscriptionRequestStreamTypedDict(TypedDict): + model: str + file: NotRequired[FileTypedDict] + file_url: NotRequired[Nullable[str]] + r"""Url of a file to be transcribed""" + file_id: NotRequired[Nullable[str]] + r"""ID of a file uploaded to /v1/files""" + language: NotRequired[Nullable[str]] + r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy.""" + temperature: NotRequired[Nullable[float]] + stream: Literal[True] + diarize: NotRequired[bool] + context_bias: NotRequired[List[str]] + timestamp_granularities: NotRequired[List[TimestampGranularity]] + r"""Granularities of timestamps to include in the response.""" + + +class AudioTranscriptionRequestStream(BaseModel): + model: Annotated[str, FieldMetadata(multipart=True)] + + file: Annotated[ + Optional[File], FieldMetadata(multipart=MultipartFormMetadata(file=True)) + ] = None + + file_url: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET + r"""Url of a file to be transcribed""" + + file_id: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET + r"""ID of a file uploaded to /v1/files""" + + language: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET + r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy.""" + + temperature: Annotated[OptionalNullable[float], FieldMetadata(multipart=True)] = ( + UNSET + ) + + stream: Annotated[ + Annotated[Optional[Literal[True]], AfterValidator(validate_const(True))], + pydantic.Field(alias="stream"), + FieldMetadata(multipart=True), + ] = True + + diarize: Annotated[Optional[bool], FieldMetadata(multipart=True)] = False + + context_bias: Annotated[Optional[List[str]], FieldMetadata(multipart=True)] = None + + timestamp_granularities: Annotated[ + Optional[List[TimestampGranularity]], FieldMetadata(multipart=True) + ] = None + r"""Granularities of timestamps to include in the response.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "file", + "file_url", + "file_id", + "language", + "temperature", + "stream", + "diarize", + "context_bias", + "timestamp_granularities", + ] + ) + nullable_fields = set(["file_url", "file_id", "language", "temperature"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + AudioTranscriptionRequestStream.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/authdata.py b/src/mistralai/client/models/authdata.py new file mode 100644 index 00000000..fb8b7972 --- /dev/null +++ b/src/mistralai/client/models/authdata.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b4d3fb07196e + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class AuthDataTypedDict(TypedDict): + client_id: str + client_secret: str + + +class AuthData(BaseModel): + client_id: str + + client_secret: str diff --git a/src/mistralai/client/models/authenticationconfiguration.py b/src/mistralai/client/models/authenticationconfiguration.py new file mode 100644 index 00000000..84f66591 --- /dev/null +++ b/src/mistralai/client/models/authenticationconfiguration.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 97b5056c29fb + +from __future__ import annotations +from .outboundauthenticationtype import OutboundAuthenticationType +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class AuthenticationConfigurationTypedDict(TypedDict): + name: str + authentication_type: OutboundAuthenticationType + is_default: NotRequired[bool] + + +class AuthenticationConfiguration(BaseModel): + name: str + + authentication_type: OutboundAuthenticationType + + is_default: Optional[bool] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["is_default"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/authurlresponse.py b/src/mistralai/client/models/authurlresponse.py new file mode 100644 index 00000000..1f5a6639 --- /dev/null +++ b/src/mistralai/client/models/authurlresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a2b468c87a8a + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class AuthURLResponseTypedDict(TypedDict): + auth_url: str + ttl: int + + +class AuthURLResponse(BaseModel): + auth_url: str + + ttl: int diff --git a/src/mistralai/client/models/basefielddefinition.py b/src/mistralai/client/models/basefielddefinition.py new file mode 100644 index 00000000..2b45183d --- /dev/null +++ b/src/mistralai/client/models/basefielddefinition.py @@ -0,0 +1,101 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ffa42818fea3 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import List, Literal, Union +from typing_extensions import NotRequired, TypedDict + + +BaseFieldDefinitionType = Union[ + Literal[ + "ENUM", + "TEXT", + "INT", + "FLOAT", + "BOOL", + "TIMESTAMP", + "ARRAY", + "MAP", + ], + UnrecognizedStr, +] + + +SupportedOperator = Union[ + Literal[ + "lt", + "lte", + "gt", + "gte", + "startswith", + "istartswith", + "endswith", + "iendswith", + "contains", + "icontains", + "matches", + "notcontains", + "inotcontains", + "eq", + "neq", + "isnull", + "includes", + "excludes", + "len_eq", + ], + UnrecognizedStr, +] + + +class BaseFieldDefinitionTypedDict(TypedDict): + name: str + label: str + type: BaseFieldDefinitionType + supported_operators: List[SupportedOperator] + group: NotRequired[Nullable[str]] + + +class BaseFieldDefinition(BaseModel): + name: str + + label: str + + type: BaseFieldDefinitionType + + supported_operators: List[SupportedOperator] + + group: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["group"]) + nullable_fields = set(["group"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/basemodelcard.py b/src/mistralai/client/models/basemodelcard.py new file mode 100644 index 00000000..bb3c99dd --- /dev/null +++ b/src/mistralai/client/models/basemodelcard.py @@ -0,0 +1,124 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 556ebdc33276 + +from __future__ import annotations +from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BaseModelCardTypedDict(TypedDict): + id: str + capabilities: ModelCapabilitiesTypedDict + r"""This is populated by Harmattan, but some fields have a name + that we don't want to expose in the API. + """ + object: NotRequired[str] + created: NotRequired[int] + owned_by: NotRequired[str] + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + max_context_length: NotRequired[int] + aliases: NotRequired[List[str]] + deprecation: NotRequired[Nullable[datetime]] + deprecation_replacement_model: NotRequired[Nullable[str]] + default_model_temperature: NotRequired[Nullable[float]] + type: Literal["base"] + + +class BaseModelCard(BaseModel): + id: str + + capabilities: ModelCapabilities + r"""This is populated by Harmattan, but some fields have a name + that we don't want to expose in the API. + """ + + object: Optional[str] = "model" + + created: Optional[int] = None + + owned_by: Optional[str] = "mistralai" + + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + max_context_length: Optional[int] = 32768 + + aliases: Optional[List[str]] = None + + deprecation: OptionalNullable[datetime] = UNSET + + deprecation_replacement_model: OptionalNullable[str] = UNSET + + default_model_temperature: OptionalNullable[float] = UNSET + + type: Annotated[ + Annotated[Literal["base"], AfterValidator(validate_const("base"))], + pydantic.Field(alias="type"), + ] = "base" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "object", + "created", + "owned_by", + "name", + "description", + "max_context_length", + "aliases", + "deprecation", + "deprecation_replacement_model", + "default_model_temperature", + ] + ) + nullable_fields = set( + [ + "name", + "description", + "deprecation", + "deprecation_replacement_model", + "default_model_temperature", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + BaseModelCard.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/basetaskstatus.py b/src/mistralai/client/models/basetaskstatus.py new file mode 100644 index 00000000..ff2f1c63 --- /dev/null +++ b/src/mistralai/client/models/basetaskstatus.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7b381554d5c7 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +BaseTaskStatus = Union[ + Literal[ + "RUNNING", + "COMPLETED", + "FAILED", + "CANCELED", + "TERMINATED", + "CONTINUED_AS_NEW", + "TIMED_OUT", + "UNKNOWN", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/batcherror.py b/src/mistralai/client/models/batcherror.py new file mode 100644 index 00000000..a0add5ad --- /dev/null +++ b/src/mistralai/client/models/batcherror.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1563e2a576ec + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class BatchErrorTypedDict(TypedDict): + message: str + count: NotRequired[int] + + +class BatchError(BaseModel): + message: str + + count: Optional[int] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["count"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/batchexecutionbody.py b/src/mistralai/client/models/batchexecutionbody.py new file mode 100644 index 00000000..7d9895e5 --- /dev/null +++ b/src/mistralai/client/models/batchexecutionbody.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6cfbee9c4ec7 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class BatchExecutionBodyTypedDict(TypedDict): + execution_ids: List[str] + r"""List of execution IDs to process""" + + +class BatchExecutionBody(BaseModel): + execution_ids: List[str] + r"""List of execution IDs to process""" diff --git a/src/mistralai/client/models/batchexecutionresponse.py b/src/mistralai/client/models/batchexecutionresponse.py new file mode 100644 index 00000000..a0c1f06e --- /dev/null +++ b/src/mistralai/client/models/batchexecutionresponse.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 37e6d5d616fe + +from __future__ import annotations +from .batchexecutionresult import BatchExecutionResult, BatchExecutionResultTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class BatchExecutionResponseTypedDict(TypedDict): + results: NotRequired[Dict[str, BatchExecutionResultTypedDict]] + r"""Mapping of execution_id to result with status and optional error message""" + + +class BatchExecutionResponse(BaseModel): + results: Optional[Dict[str, BatchExecutionResult]] = None + r"""Mapping of execution_id to result with status and optional error message""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/batchexecutionresult.py b/src/mistralai/client/models/batchexecutionresult.py new file mode 100644 index 00000000..ebe41e01 --- /dev/null +++ b/src/mistralai/client/models/batchexecutionresult.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ca6840204f22 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class BatchExecutionResultTypedDict(TypedDict): + status: str + r"""Status of the operation (success/failure)""" + error: NotRequired[Nullable[str]] + r"""Error message if operation failed""" + + +class BatchExecutionResult(BaseModel): + status: str + r"""Status of the operation (success/failure)""" + + error: OptionalNullable[str] = UNSET + r"""Error message if operation failed""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["error"]) + nullable_fields = set(["error"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/batchjob.py b/src/mistralai/client/models/batchjob.py new file mode 100644 index 00000000..9cef4380 --- /dev/null +++ b/src/mistralai/client/models/batchjob.py @@ -0,0 +1,138 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 85cd28932cc7 + +from __future__ import annotations +from .batcherror import BatchError, BatchErrorTypedDict +from .batchjobstatus import BatchJobStatus +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BatchJobTypedDict(TypedDict): + id: str + input_files: List[str] + endpoint: str + errors: List[BatchErrorTypedDict] + status: BatchJobStatus + created_at: int + total_requests: int + completed_requests: int + succeeded_requests: int + failed_requests: int + object: Literal["batch"] + metadata: NotRequired[Nullable[Dict[str, Any]]] + model: NotRequired[Nullable[str]] + agent_id: NotRequired[Nullable[str]] + output_file: NotRequired[Nullable[str]] + error_file: NotRequired[Nullable[str]] + outputs: NotRequired[Nullable[List[Dict[str, Any]]]] + started_at: NotRequired[Nullable[int]] + completed_at: NotRequired[Nullable[int]] + + +class BatchJob(BaseModel): + id: str + + input_files: List[str] + + endpoint: str + + errors: List[BatchError] + + status: BatchJobStatus + + created_at: int + + total_requests: int + + completed_requests: int + + succeeded_requests: int + + failed_requests: int + + object: Annotated[ + Annotated[Optional[Literal["batch"]], AfterValidator(validate_const("batch"))], + pydantic.Field(alias="object"), + ] = "batch" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + model: OptionalNullable[str] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + output_file: OptionalNullable[str] = UNSET + + error_file: OptionalNullable[str] = UNSET + + outputs: OptionalNullable[List[Dict[str, Any]]] = UNSET + + started_at: OptionalNullable[int] = UNSET + + completed_at: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "object", + "metadata", + "model", + "agent_id", + "output_file", + "error_file", + "outputs", + "started_at", + "completed_at", + ] + ) + nullable_fields = set( + [ + "metadata", + "model", + "agent_id", + "output_file", + "error_file", + "outputs", + "started_at", + "completed_at", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + BatchJob.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/batchjobstatus.py b/src/mistralai/client/models/batchjobstatus.py new file mode 100644 index 00000000..bd77faa2 --- /dev/null +++ b/src/mistralai/client/models/batchjobstatus.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 61e08cf5eea9 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +BatchJobStatus = Union[ + Literal[ + "QUEUED", + "RUNNING", + "SUCCESS", + "FAILED", + "TIMEOUT_EXCEEDED", + "CANCELLATION_REQUESTED", + "CANCELLED", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/batchrequest.py b/src/mistralai/client/models/batchrequest.py new file mode 100644 index 00000000..dcc47bd2 --- /dev/null +++ b/src/mistralai/client/models/batchrequest.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6f36819eeb46 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class BatchRequestTypedDict(TypedDict): + body: Dict[str, Any] + custom_id: NotRequired[Nullable[str]] + + +class BatchRequest(BaseModel): + body: Dict[str, Any] + + custom_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["custom_id"]) + nullable_fields = set(["custom_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/blobresourcecontents.py b/src/mistralai/client/models/blobresourcecontents.py new file mode 100644 index 00000000..bfae16fb --- /dev/null +++ b/src/mistralai/client/models/blobresourcecontents.py @@ -0,0 +1,87 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fa924bc295ad + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BlobResourceContentsTypedDict(TypedDict): + r"""Binary contents of a resource.""" + + uri: str + blob: str + mime_type: NotRequired[Nullable[str]] + meta: NotRequired[Nullable[Dict[str, Any]]] + + +class BlobResourceContents(BaseModel): + r"""Binary contents of a resource.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + uri: str + + blob: str + + mime_type: Annotated[OptionalNullable[str], pydantic.Field(alias="mimeType")] = ( + UNSET + ) + + meta: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["mimeType", "_meta"]) + nullable_fields = set(["mimeType", "_meta"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + BlobResourceContents.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/builtinconnectors.py b/src/mistralai/client/models/builtinconnectors.py new file mode 100644 index 00000000..ecf60d3c --- /dev/null +++ b/src/mistralai/client/models/builtinconnectors.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2d276ce938dc + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +BuiltInConnectors = Union[ + Literal[ + "web_search", + "web_search_premium", + "code_interpreter", + "image_generation", + "document_library", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/campaign.py b/src/mistralai/client/models/campaign.py new file mode 100644 index 00000000..62427fa0 --- /dev/null +++ b/src/mistralai/client/models/campaign.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c91d862fb405 + +from __future__ import annotations +from .filterpayload import FilterPayload, FilterPayloadTypedDict +from .judge import Judge, JudgeTypedDict +from datetime import datetime +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class CampaignTypedDict(TypedDict): + id: str + created_at: datetime + updated_at: datetime + deleted_at: Nullable[datetime] + name: str + owner_id: str + workspace_id: str + description: str + max_nb_events: int + search_params: FilterPayloadTypedDict + judge: JudgeTypedDict + + +class Campaign(BaseModel): + id: str + + created_at: datetime + + updated_at: datetime + + deleted_at: Nullable[datetime] + + name: str + + owner_id: str + + workspace_id: str + + description: str + + max_nb_events: int + + search_params: FilterPayload + + judge: Judge + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/cancel_workflow_execution_v1_workflows_executions_execution_id_cancel_postop.py b/src/mistralai/client/models/cancel_workflow_execution_v1_workflows_executions_execution_id_cancel_postop.py new file mode 100644 index 00000000..8ba7176c --- /dev/null +++ b/src/mistralai/client/models/cancel_workflow_execution_v1_workflows_executions_execution_id_cancel_postop.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e26fc5a228af + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequestTypedDict( + TypedDict +): + execution_id: str + + +class CancelWorkflowExecutionV1WorkflowsExecutionsExecutionIDCancelPostRequest( + BaseModel +): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/chatclassificationrequest.py b/src/mistralai/client/models/chatclassificationrequest.py new file mode 100644 index 00000000..cf2aa78a --- /dev/null +++ b/src/mistralai/client/models/chatclassificationrequest.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: afd9cdc71834 + +from __future__ import annotations +from .inputs import Inputs, InputsTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ChatClassificationRequestTypedDict(TypedDict): + model: str + input: InputsTypedDict + r"""Chat to classify""" + + +class ChatClassificationRequest(BaseModel): + model: str + + input: Inputs + r"""Chat to classify""" diff --git a/src/mistralai/client/models/chatcompletionchoice.py b/src/mistralai/client/models/chatcompletionchoice.py new file mode 100644 index 00000000..ab8f331f --- /dev/null +++ b/src/mistralai/client/models/chatcompletionchoice.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7e6a512f6a04 + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .deltamessage import DeltaMessage, DeltaMessageTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import NotRequired, TypedDict + + +ChatCompletionChoiceFinishReason = Union[ + Literal[ + "stop", + "length", + "model_length", + "error", + "tool_calls", + ], + UnrecognizedStr, +] + + +class ChatCompletionChoiceTypedDict(TypedDict): + index: int + finish_reason: ChatCompletionChoiceFinishReason + message: NotRequired[AssistantMessageTypedDict] + messages: NotRequired[List[DeltaMessageTypedDict]] + + +class ChatCompletionChoice(BaseModel): + index: int + + finish_reason: ChatCompletionChoiceFinishReason + + message: Optional[AssistantMessage] = None + + messages: Optional[List[DeltaMessage]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["message", "messages"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/chatcompletionevent.py b/src/mistralai/client/models/chatcompletionevent.py new file mode 100644 index 00000000..bcd6757f --- /dev/null +++ b/src/mistralai/client/models/chatcompletionevent.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d85484d0205e + +from __future__ import annotations +from .chattranscriptionevent import ( + ChatTranscriptionEvent, + ChatTranscriptionEventTypedDict, +) +from datetime import datetime +from mistralai.client.types import BaseModel, Nullable +from typing import Any, Dict, List, Union +from typing_extensions import TypeAliasType, TypedDict + + +ChatCompletionEventExtraFieldsTypedDict = TypeAliasType( + "ChatCompletionEventExtraFieldsTypedDict", + Union[bool, int, float, str, datetime, List[str], Dict[str, str]], +) + + +ChatCompletionEventExtraFields = TypeAliasType( + "ChatCompletionEventExtraFields", + Union[bool, int, float, str, datetime, List[str], Dict[str, str]], +) + + +class ChatCompletionEventTypedDict(TypedDict): + event_id: str + correlation_id: str + created_at: datetime + extra_fields: Dict[str, Nullable[ChatCompletionEventExtraFieldsTypedDict]] + nb_input_tokens: int + nb_output_tokens: int + enabled_tools: List[Dict[str, Any]] + request_messages: List[Dict[str, Any]] + response_messages: List[Dict[str, Any]] + nb_messages: int + chat_transcription_events: List[ChatTranscriptionEventTypedDict] + + +class ChatCompletionEvent(BaseModel): + event_id: str + + correlation_id: str + + created_at: datetime + + extra_fields: Dict[str, Nullable[ChatCompletionEventExtraFields]] + + nb_input_tokens: int + + nb_output_tokens: int + + enabled_tools: List[Dict[str, Any]] + + request_messages: List[Dict[str, Any]] + + response_messages: List[Dict[str, Any]] + + nb_messages: int + + chat_transcription_events: List[ChatTranscriptionEvent] diff --git a/src/mistralai/client/models/chatcompletioneventpreview.py b/src/mistralai/client/models/chatcompletioneventpreview.py new file mode 100644 index 00000000..40985f84 --- /dev/null +++ b/src/mistralai/client/models/chatcompletioneventpreview.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1cd843828e99 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel, Nullable +from typing import Dict, List, Union +from typing_extensions import TypeAliasType, TypedDict + + +ChatCompletionEventPreviewExtraFieldsTypedDict = TypeAliasType( + "ChatCompletionEventPreviewExtraFieldsTypedDict", + Union[bool, int, float, str, datetime, List[str], Dict[str, str]], +) + + +ChatCompletionEventPreviewExtraFields = TypeAliasType( + "ChatCompletionEventPreviewExtraFields", + Union[bool, int, float, str, datetime, List[str], Dict[str, str]], +) + + +class ChatCompletionEventPreviewTypedDict(TypedDict): + event_id: str + correlation_id: str + created_at: datetime + extra_fields: Dict[str, Nullable[ChatCompletionEventPreviewExtraFieldsTypedDict]] + nb_input_tokens: int + nb_output_tokens: int + + +class ChatCompletionEventPreview(BaseModel): + event_id: str + + correlation_id: str + + created_at: datetime + + extra_fields: Dict[str, Nullable[ChatCompletionEventPreviewExtraFields]] + + nb_input_tokens: int + + nb_output_tokens: int diff --git a/src/mistralai/client/models/chatcompletionrequest.py b/src/mistralai/client/models/chatcompletionrequest.py new file mode 100644 index 00000000..ee168c18 --- /dev/null +++ b/src/mistralai/client/models/chatcompletionrequest.py @@ -0,0 +1,277 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9979805d8c38 + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .mistralpromptmode import MistralPromptMode +from .prediction import Prediction, PredictionTypedDict +from .reasoningeffort import ReasoningEffort +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .tool import Tool, ToolTypedDict +from .toolchoice import ToolChoice, ToolChoiceTypedDict +from .toolchoiceenum import ToolChoiceEnum +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ChatCompletionRequestStopTypedDict = TypeAliasType( + "ChatCompletionRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionRequestStop = TypeAliasType( + "ChatCompletionRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionRequestMessageTypedDict = TypeAliasType( + "ChatCompletionRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +ChatCompletionRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +ChatCompletionRequestToolTypedDict = TypeAliasType( + "ChatCompletionRequestToolTypedDict", + Union[ + ToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +ChatCompletionRequestTool = Union[ + Tool, + WebSearchTool, + WebSearchPremiumTool, + CodeInterpreterTool, + ImageGenerationTool, + DocumentLibraryTool, + CustomConnector, +] + + +ChatCompletionRequestToolChoiceTypedDict = TypeAliasType( + "ChatCompletionRequestToolChoiceTypedDict", + Union[ToolChoiceTypedDict, ToolChoiceEnum], +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +ChatCompletionRequestToolChoice = TypeAliasType( + "ChatCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +class ChatCompletionRequestTypedDict(TypedDict): + model: str + r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" + messages: List[ChatCompletionRequestMessageTypedDict] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[Nullable[float]] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + stop: NotRequired[Nullable[ChatCompletionRequestStopTypedDict]] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + response_format: NotRequired[ResponseFormatTypedDict] + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + tools: NotRequired[Nullable[List[ChatCompletionRequestToolTypedDict]]] + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + tool_choice: NotRequired[ChatCompletionRequestToolChoiceTypedDict] + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + presence_penalty: NotRequired[Nullable[float]] + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + frequency_penalty: NotRequired[Nullable[float]] + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + n: NotRequired[Nullable[int]] + r"""Number of completions to return for each request, input tokens are only billed once.""" + prediction: NotRequired[PredictionTypedDict] + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + parallel_tool_calls: NotRequired[bool] + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + reasoning_effort: NotRequired[Nullable[ReasoningEffort]] + prompt_mode: NotRequired[Nullable[MistralPromptMode]] + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + prompt_cache_key: NotRequired[Nullable[str]] + safe_prompt: NotRequired[bool] + r"""Whether to inject a safety prompt before all conversations.""" + + +class ChatCompletionRequest(BaseModel): + model: str + r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" + + messages: List[ChatCompletionRequestMessage] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: OptionalNullable[float] = UNSET + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = False + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + + stop: OptionalNullable[ChatCompletionRequestStop] = UNSET + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + response_format: Optional[ResponseFormat] = None + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + tools: OptionalNullable[List[ChatCompletionRequestTool]] = UNSET + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + + tool_choice: Optional[ChatCompletionRequestToolChoice] = None + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + presence_penalty: OptionalNullable[float] = UNSET + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + + frequency_penalty: OptionalNullable[float] = UNSET + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + + n: OptionalNullable[int] = UNSET + r"""Number of completions to return for each request, input tokens are only billed once.""" + + prediction: Optional[Prediction] = None + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + parallel_tool_calls: Optional[bool] = None + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + + reasoning_effort: OptionalNullable[ReasoningEffort] = UNSET + + prompt_mode: OptionalNullable[MistralPromptMode] = UNSET + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + prompt_cache_key: OptionalNullable[str] = UNSET + + safe_prompt: Optional[bool] = None + r"""Whether to inject a safety prompt before all conversations.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "response_format", + "tools", + "tool_choice", + "presence_penalty", + "frequency_penalty", + "n", + "prediction", + "parallel_tool_calls", + "reasoning_effort", + "prompt_mode", + "guardrails", + "prompt_cache_key", + "safe_prompt", + ] + ) + nullable_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stop", + "random_seed", + "metadata", + "tools", + "presence_penalty", + "frequency_penalty", + "n", + "reasoning_effort", + "prompt_mode", + "guardrails", + "prompt_cache_key", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/chatcompletionresponse.py b/src/mistralai/client/models/chatcompletionresponse.py new file mode 100644 index 00000000..7092bbc1 --- /dev/null +++ b/src/mistralai/client/models/chatcompletionresponse.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 669d996b8e82 + +from __future__ import annotations +from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ChatCompletionResponseTypedDict(TypedDict): + id: str + object: str + model: str + usage: UsageInfoTypedDict + created: int + choices: List[ChatCompletionChoiceTypedDict] + + +class ChatCompletionResponse(BaseModel): + id: str + + object: str + + model: str + + usage: UsageInfo + + created: int + + choices: List[ChatCompletionChoice] diff --git a/src/mistralai/client/models/chatcompletionstreamrequest.py b/src/mistralai/client/models/chatcompletionstreamrequest.py new file mode 100644 index 00000000..f6ad6a36 --- /dev/null +++ b/src/mistralai/client/models/chatcompletionstreamrequest.py @@ -0,0 +1,275 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 18cb2b2415d4 + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .mistralpromptmode import MistralPromptMode +from .prediction import Prediction, PredictionTypedDict +from .reasoningeffort import ReasoningEffort +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .tool import Tool, ToolTypedDict +from .toolchoice import ToolChoice, ToolChoiceTypedDict +from .toolchoiceenum import ToolChoiceEnum +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ChatCompletionStreamRequestStopTypedDict = TypeAliasType( + "ChatCompletionStreamRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionStreamRequestStop = TypeAliasType( + "ChatCompletionStreamRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +ChatCompletionStreamRequestMessageTypedDict = TypeAliasType( + "ChatCompletionStreamRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +ChatCompletionStreamRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +ChatCompletionStreamRequestToolTypedDict = TypeAliasType( + "ChatCompletionStreamRequestToolTypedDict", + Union[ + ToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +ChatCompletionStreamRequestTool = Union[ + Tool, + WebSearchTool, + WebSearchPremiumTool, + CodeInterpreterTool, + ImageGenerationTool, + DocumentLibraryTool, + CustomConnector, +] + + +ChatCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( + "ChatCompletionStreamRequestToolChoiceTypedDict", + Union[ToolChoiceTypedDict, ToolChoiceEnum], +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +ChatCompletionStreamRequestToolChoice = TypeAliasType( + "ChatCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] +) +r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + +class ChatCompletionStreamRequestTypedDict(TypedDict): + model: str + r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" + messages: List[ChatCompletionStreamRequestMessageTypedDict] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[Nullable[float]] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + stop: NotRequired[Nullable[ChatCompletionStreamRequestStopTypedDict]] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + response_format: NotRequired[ResponseFormatTypedDict] + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + tools: NotRequired[Nullable[List[ChatCompletionStreamRequestToolTypedDict]]] + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + tool_choice: NotRequired[ChatCompletionStreamRequestToolChoiceTypedDict] + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + presence_penalty: NotRequired[Nullable[float]] + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + frequency_penalty: NotRequired[Nullable[float]] + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + n: NotRequired[Nullable[int]] + r"""Number of completions to return for each request, input tokens are only billed once.""" + prediction: NotRequired[PredictionTypedDict] + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + parallel_tool_calls: NotRequired[bool] + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + reasoning_effort: NotRequired[Nullable[ReasoningEffort]] + prompt_mode: NotRequired[Nullable[MistralPromptMode]] + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + prompt_cache_key: NotRequired[Nullable[str]] + safe_prompt: NotRequired[bool] + r"""Whether to inject a safety prompt before all conversations.""" + + +class ChatCompletionStreamRequest(BaseModel): + model: str + r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" + + messages: List[ChatCompletionStreamRequestMessage] + r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: OptionalNullable[float] = UNSET + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = True + + stop: OptionalNullable[ChatCompletionStreamRequestStop] = UNSET + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + response_format: Optional[ResponseFormat] = None + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + tools: OptionalNullable[List[ChatCompletionStreamRequestTool]] = UNSET + r"""A list of tools the model may call. Use this to provide a list of functions the model may generate JSON inputs for.""" + + tool_choice: Optional[ChatCompletionStreamRequestToolChoice] = None + r"""Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `any` or `required` means the model must call one or more tools. Specifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.""" + + presence_penalty: OptionalNullable[float] = UNSET + r"""The `presence_penalty` determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" + + frequency_penalty: OptionalNullable[float] = UNSET + r"""The `frequency_penalty` penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" + + n: OptionalNullable[int] = UNSET + r"""Number of completions to return for each request, input tokens are only billed once.""" + + prediction: Optional[Prediction] = None + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + parallel_tool_calls: Optional[bool] = None + r"""Whether to enable parallel function calling during tool use, when enabled the model can call multiple tools in parallel.""" + + reasoning_effort: OptionalNullable[ReasoningEffort] = UNSET + + prompt_mode: OptionalNullable[MistralPromptMode] = UNSET + r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + prompt_cache_key: OptionalNullable[str] = UNSET + + safe_prompt: Optional[bool] = None + r"""Whether to inject a safety prompt before all conversations.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "response_format", + "tools", + "tool_choice", + "presence_penalty", + "frequency_penalty", + "n", + "prediction", + "parallel_tool_calls", + "reasoning_effort", + "prompt_mode", + "guardrails", + "prompt_cache_key", + "safe_prompt", + ] + ) + nullable_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stop", + "random_seed", + "metadata", + "tools", + "presence_penalty", + "frequency_penalty", + "n", + "reasoning_effort", + "prompt_mode", + "guardrails", + "prompt_cache_key", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/chatmoderationrequest.py b/src/mistralai/client/models/chatmoderationrequest.py new file mode 100644 index 00000000..228e7d26 --- /dev/null +++ b/src/mistralai/client/models/chatmoderationrequest.py @@ -0,0 +1,94 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 057aecb07275 + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import get_discriminator +import pydantic +from pydantic import Discriminator, Tag +from typing import List, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ChatModerationRequestInputs2TypedDict = TypeAliasType( + "ChatModerationRequestInputs2TypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +ChatModerationRequestInputs2 = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +ChatModerationRequestInputs1TypedDict = TypeAliasType( + "ChatModerationRequestInputs1TypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +ChatModerationRequestInputs1 = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +ChatModerationRequestInputs3TypedDict = TypeAliasType( + "ChatModerationRequestInputs3TypedDict", + Union[ + List[ChatModerationRequestInputs1TypedDict], + List[List[ChatModerationRequestInputs2TypedDict]], + ], +) +r"""Chat to classify""" + + +ChatModerationRequestInputs3 = TypeAliasType( + "ChatModerationRequestInputs3", + Union[List[ChatModerationRequestInputs1], List[List[ChatModerationRequestInputs2]]], +) +r"""Chat to classify""" + + +class ChatModerationRequestTypedDict(TypedDict): + inputs: ChatModerationRequestInputs3TypedDict + r"""Chat to classify""" + model: str + + +class ChatModerationRequest(BaseModel): + inputs: Annotated[ChatModerationRequestInputs3, pydantic.Field(alias="input")] + r"""Chat to classify""" + + model: str + + +try: + ChatModerationRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/chattranscriptionevent.py b/src/mistralai/client/models/chattranscriptionevent.py new file mode 100644 index 00000000..b23adf74 --- /dev/null +++ b/src/mistralai/client/models/chattranscriptionevent.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8ca679b2c39a + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Any, Dict +from typing_extensions import TypedDict + + +class ChatTranscriptionEventTypedDict(TypedDict): + audio_url: str + model: str + response_message: Dict[str, Any] + + +class ChatTranscriptionEvent(BaseModel): + audio_url: str + + model: str + + response_message: Dict[str, Any] diff --git a/src/mistralai/client/models/checkpoint.py b/src/mistralai/client/models/checkpoint.py new file mode 100644 index 00000000..c24e433e --- /dev/null +++ b/src/mistralai/client/models/checkpoint.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1a530d3674d8 + +from __future__ import annotations +from .metric import Metric, MetricTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class CheckpointTypedDict(TypedDict): + metrics: MetricTypedDict + r"""Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase).""" + step_number: int + r"""The step number that the checkpoint was created at.""" + created_at: int + r"""The UNIX timestamp (in seconds) for when the checkpoint was created.""" + + +class Checkpoint(BaseModel): + metrics: Metric + r"""Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase).""" + + step_number: int + r"""The step number that the checkpoint was created at.""" + + created_at: int + r"""The UNIX timestamp (in seconds) for when the checkpoint was created.""" diff --git a/src/mistralai/client/models/classificationrequest.py b/src/mistralai/client/models/classificationrequest.py new file mode 100644 index 00000000..4300f9ad --- /dev/null +++ b/src/mistralai/client/models/classificationrequest.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6942fe3de24a + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, List, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ClassificationRequestInputsTypedDict = TypeAliasType( + "ClassificationRequestInputsTypedDict", Union[str, List[str]] +) +r"""Text to classify.""" + + +ClassificationRequestInputs = TypeAliasType( + "ClassificationRequestInputs", Union[str, List[str]] +) +r"""Text to classify.""" + + +class ClassificationRequestTypedDict(TypedDict): + model: str + r"""ID of the model to use.""" + inputs: ClassificationRequestInputsTypedDict + r"""Text to classify.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + + +class ClassificationRequest(BaseModel): + model: str + r"""ID of the model to use.""" + + inputs: Annotated[ClassificationRequestInputs, pydantic.Field(alias="input")] + r"""Text to classify.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["metadata"]) + nullable_fields = set(["metadata"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ClassificationRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/models/classificationresponse.py b/src/mistralai/client/models/classificationresponse.py similarity index 88% rename from src/mistralai/models/classificationresponse.py rename to src/mistralai/client/models/classificationresponse.py index b7741f37..d2f09f43 100644 --- a/src/mistralai/models/classificationresponse.py +++ b/src/mistralai/client/models/classificationresponse.py @@ -1,11 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: eaf279db1109 from __future__ import annotations from .classificationtargetresult import ( ClassificationTargetResult, ClassificationTargetResultTypedDict, ) -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel from typing import Dict, List from typing_extensions import TypedDict diff --git a/src/mistralai/models/classificationtargetresult.py b/src/mistralai/client/models/classificationtargetresult.py similarity index 81% rename from src/mistralai/models/classificationtargetresult.py rename to src/mistralai/client/models/classificationtargetresult.py index 60c5a51b..6c7d6231 100644 --- a/src/mistralai/models/classificationtargetresult.py +++ b/src/mistralai/client/models/classificationtargetresult.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2445f12b2a57 from __future__ import annotations -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel from typing import Dict from typing_extensions import TypedDict diff --git a/src/mistralai/client/models/classifierfinetunedmodel.py b/src/mistralai/client/models/classifierfinetunedmodel.py new file mode 100644 index 00000000..35d557aa --- /dev/null +++ b/src/mistralai/client/models/classifierfinetunedmodel.py @@ -0,0 +1,117 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5a9a7a0153c8 + +from __future__ import annotations +from .classifiertargetresult import ( + ClassifierTargetResult, + ClassifierTargetResultTypedDict, +) +from .finetunedmodelcapabilities import ( + FineTunedModelCapabilities, + FineTunedModelCapabilitiesTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClassifierFineTunedModelTypedDict(TypedDict): + id: str + created: int + owned_by: str + workspace_id: str + root: str + root_version: str + archived: bool + capabilities: FineTunedModelCapabilitiesTypedDict + classifier_targets: List[ClassifierTargetResultTypedDict] + object: Literal["model"] + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + max_context_length: NotRequired[int] + aliases: NotRequired[List[str]] + job: NotRequired[Nullable[str]] + model_type: Literal["classifier"] + + +class ClassifierFineTunedModel(BaseModel): + id: str + + created: int + + owned_by: str + + workspace_id: str + + root: str + + root_version: str + + archived: bool + + capabilities: FineTunedModelCapabilities + + classifier_targets: List[ClassifierTargetResult] + + object: Annotated[ + Annotated[Optional[Literal["model"]], AfterValidator(validate_const("model"))], + pydantic.Field(alias="object"), + ] = "model" + + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + max_context_length: Optional[int] = 32768 + + aliases: Optional[List[str]] = None + + job: OptionalNullable[str] = UNSET + + model_type: Annotated[ + Annotated[Literal["classifier"], AfterValidator(validate_const("classifier"))], + pydantic.Field(alias="model_type"), + ] = "classifier" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["object", "name", "description", "max_context_length", "aliases", "job"] + ) + nullable_fields = set(["name", "description", "job"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ClassifierFineTunedModel.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/classifierfinetuningjob.py b/src/mistralai/client/models/classifierfinetuningjob.py new file mode 100644 index 00000000..05de88c7 --- /dev/null +++ b/src/mistralai/client/models/classifierfinetuningjob.py @@ -0,0 +1,201 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a244d5f2afc5 + +from __future__ import annotations +from .classifiertrainingparameters import ( + ClassifierTrainingParameters, + ClassifierTrainingParametersTypedDict, +) +from .jobmetadata import JobMetadata, JobMetadataTypedDict +from .wandbintegrationresult import ( + WandbIntegrationResult, + WandbIntegrationResultTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +ClassifierFineTuningJobStatus = Union[ + Literal[ + "QUEUED", + "STARTED", + "VALIDATING", + "VALIDATED", + "RUNNING", + "FAILED_VALIDATION", + "FAILED", + "SUCCESS", + "CANCELLED", + "CANCELLATION_REQUESTED", + ], + UnrecognizedStr, +] +r"""The current status of the fine-tuning job.""" + + +ClassifierFineTuningJobIntegrationTypedDict = WandbIntegrationResultTypedDict + + +class UnknownClassifierFineTuningJobIntegration(BaseModel): + r"""A ClassifierFineTuningJobIntegration variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_CLASSIFIER_FINE_TUNING_JOB_INTEGRATION_VARIANTS: dict[str, Any] = { + "wandb": WandbIntegrationResult, +} + + +ClassifierFineTuningJobIntegration = WandbIntegrationResult + + +class ClassifierFineTuningJobTypedDict(TypedDict): + id: str + r"""The ID of the job.""" + auto_start: bool + model: str + status: ClassifierFineTuningJobStatus + r"""The current status of the fine-tuning job.""" + created_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" + modified_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" + training_files: List[str] + r"""A list containing the IDs of uploaded files that contain training data.""" + hyperparameters: ClassifierTrainingParametersTypedDict + validation_files: NotRequired[Nullable[List[str]]] + r"""A list containing the IDs of uploaded files that contain validation data.""" + object: Literal["job"] + r"""The object type of the fine-tuning job.""" + fine_tuned_model: NotRequired[Nullable[str]] + r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" + suffix: NotRequired[Nullable[str]] + r"""Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `\"my-great-model\"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`.""" + integrations: NotRequired[ + Nullable[List[ClassifierFineTuningJobIntegrationTypedDict]] + ] + r"""A list of integrations enabled for your fine-tuning job.""" + trained_tokens: NotRequired[Nullable[int]] + r"""Total number of tokens trained.""" + metadata: NotRequired[Nullable[JobMetadataTypedDict]] + job_type: Literal["classifier"] + r"""The type of job (`FT` for fine-tuning).""" + + +class ClassifierFineTuningJob(BaseModel): + id: str + r"""The ID of the job.""" + + auto_start: bool + + model: str + + status: ClassifierFineTuningJobStatus + r"""The current status of the fine-tuning job.""" + + created_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" + + modified_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" + + training_files: List[str] + r"""A list containing the IDs of uploaded files that contain training data.""" + + hyperparameters: ClassifierTrainingParameters + + validation_files: OptionalNullable[List[str]] = UNSET + r"""A list containing the IDs of uploaded files that contain validation data.""" + + object: Annotated[ + Annotated[Optional[Literal["job"]], AfterValidator(validate_const("job"))], + pydantic.Field(alias="object"), + ] = "job" + r"""The object type of the fine-tuning job.""" + + fine_tuned_model: OptionalNullable[str] = UNSET + r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" + + suffix: OptionalNullable[str] = UNSET + r"""Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `\"my-great-model\"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`.""" + + integrations: OptionalNullable[List[ClassifierFineTuningJobIntegration]] = UNSET + r"""A list of integrations enabled for your fine-tuning job.""" + + trained_tokens: OptionalNullable[int] = UNSET + r"""Total number of tokens trained.""" + + metadata: OptionalNullable[JobMetadata] = UNSET + + job_type: Annotated[ + Annotated[Literal["classifier"], AfterValidator(validate_const("classifier"))], + pydantic.Field(alias="job_type"), + ] = "classifier" + r"""The type of job (`FT` for fine-tuning).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "validation_files", + "object", + "fine_tuned_model", + "suffix", + "integrations", + "trained_tokens", + "metadata", + ] + ) + nullable_fields = set( + [ + "validation_files", + "fine_tuned_model", + "suffix", + "integrations", + "trained_tokens", + "metadata", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ClassifierFineTuningJob.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/classifierfinetuningjobdetails.py b/src/mistralai/client/models/classifierfinetuningjobdetails.py new file mode 100644 index 00000000..98cdc810 --- /dev/null +++ b/src/mistralai/client/models/classifierfinetuningjobdetails.py @@ -0,0 +1,222 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 75c5dee8df2e + +from __future__ import annotations +from .checkpoint import Checkpoint, CheckpointTypedDict +from .classifiertargetresult import ( + ClassifierTargetResult, + ClassifierTargetResultTypedDict, +) +from .classifiertrainingparameters import ( + ClassifierTrainingParameters, + ClassifierTrainingParametersTypedDict, +) +from .event import Event, EventTypedDict +from .jobmetadata import JobMetadata, JobMetadataTypedDict +from .wandbintegrationresult import ( + WandbIntegrationResult, + WandbIntegrationResultTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +ClassifierFineTuningJobDetailsStatus = Union[ + Literal[ + "QUEUED", + "STARTED", + "VALIDATING", + "VALIDATED", + "RUNNING", + "FAILED_VALIDATION", + "FAILED", + "SUCCESS", + "CANCELLED", + "CANCELLATION_REQUESTED", + ], + UnrecognizedStr, +] +r"""The current status of the fine-tuning job.""" + + +ClassifierFineTuningJobDetailsIntegrationTypedDict = WandbIntegrationResultTypedDict + + +class UnknownClassifierFineTuningJobDetailsIntegration(BaseModel): + r"""A ClassifierFineTuningJobDetailsIntegration variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_CLASSIFIER_FINE_TUNING_JOB_DETAILS_INTEGRATION_VARIANTS: dict[str, Any] = { + "wandb": WandbIntegrationResult, +} + + +ClassifierFineTuningJobDetailsIntegration = WandbIntegrationResult + + +class ClassifierFineTuningJobDetailsTypedDict(TypedDict): + id: str + r"""The ID of the job.""" + auto_start: bool + model: str + status: ClassifierFineTuningJobDetailsStatus + r"""The current status of the fine-tuning job.""" + created_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" + modified_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" + training_files: List[str] + r"""A list containing the IDs of uploaded files that contain training data.""" + hyperparameters: ClassifierTrainingParametersTypedDict + classifier_targets: List[ClassifierTargetResultTypedDict] + validation_files: NotRequired[Nullable[List[str]]] + r"""A list containing the IDs of uploaded files that contain validation data.""" + object: Literal["job"] + r"""The object type of the fine-tuning job.""" + fine_tuned_model: NotRequired[Nullable[str]] + r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" + suffix: NotRequired[Nullable[str]] + r"""Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `\"my-great-model\"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`.""" + integrations: NotRequired[ + Nullable[List[ClassifierFineTuningJobDetailsIntegrationTypedDict]] + ] + r"""A list of integrations enabled for your fine-tuning job.""" + trained_tokens: NotRequired[Nullable[int]] + r"""Total number of tokens trained.""" + metadata: NotRequired[Nullable[JobMetadataTypedDict]] + job_type: Literal["classifier"] + r"""The type of job (`FT` for fine-tuning).""" + events: NotRequired[List[EventTypedDict]] + r"""Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here.""" + checkpoints: NotRequired[List[CheckpointTypedDict]] + + +class ClassifierFineTuningJobDetails(BaseModel): + id: str + r"""The ID of the job.""" + + auto_start: bool + + model: str + + status: ClassifierFineTuningJobDetailsStatus + r"""The current status of the fine-tuning job.""" + + created_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" + + modified_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" + + training_files: List[str] + r"""A list containing the IDs of uploaded files that contain training data.""" + + hyperparameters: ClassifierTrainingParameters + + classifier_targets: List[ClassifierTargetResult] + + validation_files: OptionalNullable[List[str]] = UNSET + r"""A list containing the IDs of uploaded files that contain validation data.""" + + object: Annotated[ + Annotated[Optional[Literal["job"]], AfterValidator(validate_const("job"))], + pydantic.Field(alias="object"), + ] = "job" + r"""The object type of the fine-tuning job.""" + + fine_tuned_model: OptionalNullable[str] = UNSET + r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" + + suffix: OptionalNullable[str] = UNSET + r"""Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `\"my-great-model\"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`.""" + + integrations: OptionalNullable[List[ClassifierFineTuningJobDetailsIntegration]] = ( + UNSET + ) + r"""A list of integrations enabled for your fine-tuning job.""" + + trained_tokens: OptionalNullable[int] = UNSET + r"""Total number of tokens trained.""" + + metadata: OptionalNullable[JobMetadata] = UNSET + + job_type: Annotated[ + Annotated[Literal["classifier"], AfterValidator(validate_const("classifier"))], + pydantic.Field(alias="job_type"), + ] = "classifier" + r"""The type of job (`FT` for fine-tuning).""" + + events: Optional[List[Event]] = None + r"""Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here.""" + + checkpoints: Optional[List[Checkpoint]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "validation_files", + "object", + "fine_tuned_model", + "suffix", + "integrations", + "trained_tokens", + "metadata", + "events", + "checkpoints", + ] + ) + nullable_fields = set( + [ + "validation_files", + "fine_tuned_model", + "suffix", + "integrations", + "trained_tokens", + "metadata", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ClassifierFineTuningJobDetails.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/classifiertarget.py b/src/mistralai/client/models/classifiertarget.py new file mode 100644 index 00000000..bfd5646e --- /dev/null +++ b/src/mistralai/client/models/classifiertarget.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2177d51d9dcf + +from __future__ import annotations +from .ftclassifierlossfunction import FTClassifierLossFunction +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class ClassifierTargetTypedDict(TypedDict): + name: str + labels: List[str] + weight: NotRequired[float] + loss_function: NotRequired[Nullable[FTClassifierLossFunction]] + + +class ClassifierTarget(BaseModel): + name: str + + labels: List[str] + + weight: Optional[float] = 1 + + loss_function: OptionalNullable[FTClassifierLossFunction] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["weight", "loss_function"]) + nullable_fields = set(["loss_function"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/classifiertargetresult.py b/src/mistralai/client/models/classifiertargetresult.py new file mode 100644 index 00000000..8ce7c0ca --- /dev/null +++ b/src/mistralai/client/models/classifiertargetresult.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 19c343844888 + +from __future__ import annotations +from .ftclassifierlossfunction import FTClassifierLossFunction +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ClassifierTargetResultTypedDict(TypedDict): + name: str + labels: List[str] + weight: float + loss_function: FTClassifierLossFunction + + +class ClassifierTargetResult(BaseModel): + name: str + + labels: List[str] + + weight: float + + loss_function: FTClassifierLossFunction diff --git a/src/mistralai/client/models/classifiertrainingparameters.py b/src/mistralai/client/models/classifiertrainingparameters.py new file mode 100644 index 00000000..5d1d1f8f --- /dev/null +++ b/src/mistralai/client/models/classifiertrainingparameters.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4000b05e3b8d + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ClassifierTrainingParametersTypedDict(TypedDict): + training_steps: NotRequired[Nullable[int]] + r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" + learning_rate: NotRequired[float] + r"""A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.""" + weight_decay: NotRequired[Nullable[float]] + r"""(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.""" + warmup_fraction: NotRequired[Nullable[float]] + r"""(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)""" + epochs: NotRequired[Nullable[float]] + seq_len: NotRequired[Nullable[int]] + + +class ClassifierTrainingParameters(BaseModel): + training_steps: OptionalNullable[int] = UNSET + r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" + + learning_rate: Optional[float] = 0.0001 + r"""A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.""" + + weight_decay: OptionalNullable[float] = UNSET + r"""(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.""" + + warmup_fraction: OptionalNullable[float] = UNSET + r"""(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)""" + + epochs: OptionalNullable[float] = UNSET + + seq_len: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "training_steps", + "learning_rate", + "weight_decay", + "warmup_fraction", + "epochs", + "seq_len", + ] + ) + nullable_fields = set( + ["training_steps", "weight_decay", "warmup_fraction", "epochs", "seq_len"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/codeinterpretertool.py b/src/mistralai/client/models/codeinterpretertool.py new file mode 100644 index 00000000..4cf9d055 --- /dev/null +++ b/src/mistralai/client/models/codeinterpretertool.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 950cd8f4ad49 + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CodeInterpreterToolTypedDict(TypedDict): + tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] + type: Literal["code_interpreter"] + + +class CodeInterpreterTool(BaseModel): + tool_configuration: OptionalNullable[ToolConfiguration] = UNSET + + type: Annotated[ + Annotated[ + Literal["code_interpreter"], + AfterValidator(validate_const("code_interpreter")), + ], + pydantic.Field(alias="type"), + ] = "code_interpreter" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_configuration"]) + nullable_fields = set(["tool_configuration"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CodeInterpreterTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/completionargs.py b/src/mistralai/client/models/completionargs.py new file mode 100644 index 00000000..57e4840a --- /dev/null +++ b/src/mistralai/client/models/completionargs.py @@ -0,0 +1,113 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3db008bcddca + +from __future__ import annotations +from .completionargsstop import CompletionArgsStop, CompletionArgsStopTypedDict +from .prediction import Prediction, PredictionTypedDict +from .reasoningeffort import ReasoningEffort +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from .toolchoiceenum import ToolChoiceEnum +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CompletionArgsTypedDict(TypedDict): + r"""White-listed arguments from the completion API""" + + stop: NotRequired[Nullable[CompletionArgsStopTypedDict]] + presence_penalty: NotRequired[Nullable[float]] + frequency_penalty: NotRequired[Nullable[float]] + temperature: NotRequired[Nullable[float]] + top_p: NotRequired[Nullable[float]] + max_tokens: NotRequired[Nullable[int]] + random_seed: NotRequired[Nullable[int]] + prediction: NotRequired[Nullable[PredictionTypedDict]] + response_format: NotRequired[Nullable[ResponseFormatTypedDict]] + tool_choice: NotRequired[ToolChoiceEnum] + reasoning_effort: NotRequired[Nullable[ReasoningEffort]] + + +class CompletionArgs(BaseModel): + r"""White-listed arguments from the completion API""" + + stop: OptionalNullable[CompletionArgsStop] = UNSET + + presence_penalty: OptionalNullable[float] = UNSET + + frequency_penalty: OptionalNullable[float] = UNSET + + temperature: OptionalNullable[float] = UNSET + + top_p: OptionalNullable[float] = UNSET + + max_tokens: OptionalNullable[int] = UNSET + + random_seed: OptionalNullable[int] = UNSET + + prediction: OptionalNullable[Prediction] = UNSET + + response_format: OptionalNullable[ResponseFormat] = UNSET + + tool_choice: Optional[ToolChoiceEnum] = None + + reasoning_effort: OptionalNullable[ReasoningEffort] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "stop", + "presence_penalty", + "frequency_penalty", + "temperature", + "top_p", + "max_tokens", + "random_seed", + "prediction", + "response_format", + "tool_choice", + "reasoning_effort", + ] + ) + nullable_fields = set( + [ + "stop", + "presence_penalty", + "frequency_penalty", + "temperature", + "top_p", + "max_tokens", + "random_seed", + "prediction", + "response_format", + "reasoning_effort", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/models/completionargsstop.py b/src/mistralai/client/models/completionargsstop.py similarity index 92% rename from src/mistralai/models/completionargsstop.py rename to src/mistralai/client/models/completionargsstop.py index de7a0956..39c858e6 100644 --- a/src/mistralai/models/completionargsstop.py +++ b/src/mistralai/client/models/completionargsstop.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5f339214501d from __future__ import annotations from typing import List, Union diff --git a/src/mistralai/client/models/completionchunk.py b/src/mistralai/client/models/completionchunk.py new file mode 100644 index 00000000..27029b6f --- /dev/null +++ b/src/mistralai/client/models/completionchunk.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d786b44926f4 + +from __future__ import annotations +from .completionresponsestreamchoice import ( + CompletionResponseStreamChoice, + CompletionResponseStreamChoiceTypedDict, +) +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class CompletionChunkTypedDict(TypedDict): + id: str + model: str + choices: List[CompletionResponseStreamChoiceTypedDict] + object: NotRequired[str] + created: NotRequired[int] + usage: NotRequired[UsageInfoTypedDict] + + +class CompletionChunk(BaseModel): + id: str + + model: str + + choices: List[CompletionResponseStreamChoice] + + object: Optional[str] = None + + created: Optional[int] = None + + usage: Optional[UsageInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "created", "usage"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/completionevent.py b/src/mistralai/client/models/completionevent.py new file mode 100644 index 00000000..3b90ab0c --- /dev/null +++ b/src/mistralai/client/models/completionevent.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c68817e7e190 + +from __future__ import annotations +from .completionchunk import CompletionChunk, CompletionChunkTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class CompletionEventTypedDict(TypedDict): + data: CompletionChunkTypedDict + + +class CompletionEvent(BaseModel): + data: CompletionChunk diff --git a/src/mistralai/client/models/completionfinetunedmodel.py b/src/mistralai/client/models/completionfinetunedmodel.py new file mode 100644 index 00000000..9b420ed7 --- /dev/null +++ b/src/mistralai/client/models/completionfinetunedmodel.py @@ -0,0 +1,110 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f08c10d149f5 + +from __future__ import annotations +from .finetunedmodelcapabilities import ( + FineTunedModelCapabilities, + FineTunedModelCapabilitiesTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompletionFineTunedModelTypedDict(TypedDict): + id: str + created: int + owned_by: str + workspace_id: str + root: str + root_version: str + archived: bool + capabilities: FineTunedModelCapabilitiesTypedDict + object: Literal["model"] + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + max_context_length: NotRequired[int] + aliases: NotRequired[List[str]] + job: NotRequired[Nullable[str]] + model_type: Literal["completion"] + + +class CompletionFineTunedModel(BaseModel): + id: str + + created: int + + owned_by: str + + workspace_id: str + + root: str + + root_version: str + + archived: bool + + capabilities: FineTunedModelCapabilities + + object: Annotated[ + Annotated[Optional[Literal["model"]], AfterValidator(validate_const("model"))], + pydantic.Field(alias="object"), + ] = "model" + + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + max_context_length: Optional[int] = 32768 + + aliases: Optional[List[str]] = None + + job: OptionalNullable[str] = UNSET + + model_type: Annotated[ + Annotated[Literal["completion"], AfterValidator(validate_const("completion"))], + pydantic.Field(alias="model_type"), + ] = "completion" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["object", "name", "description", "max_context_length", "aliases", "job"] + ) + nullable_fields = set(["name", "description", "job"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CompletionFineTunedModel.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/completionfinetuningjob.py b/src/mistralai/client/models/completionfinetuningjob.py new file mode 100644 index 00000000..ff94ed5f --- /dev/null +++ b/src/mistralai/client/models/completionfinetuningjob.py @@ -0,0 +1,227 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c242237efe9b + +from __future__ import annotations +from .completiontrainingparameters import ( + CompletionTrainingParameters, + CompletionTrainingParametersTypedDict, +) +from .githubrepository import GithubRepository, GithubRepositoryTypedDict +from .jobmetadata import JobMetadata, JobMetadataTypedDict +from .wandbintegrationresult import ( + WandbIntegrationResult, + WandbIntegrationResultTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +CompletionFineTuningJobStatus = Union[ + Literal[ + "QUEUED", + "STARTED", + "VALIDATING", + "VALIDATED", + "RUNNING", + "FAILED_VALIDATION", + "FAILED", + "SUCCESS", + "CANCELLED", + "CANCELLATION_REQUESTED", + ], + UnrecognizedStr, +] +r"""The current status of the fine-tuning job.""" + + +CompletionFineTuningJobIntegrationTypedDict = WandbIntegrationResultTypedDict + + +class UnknownCompletionFineTuningJobIntegration(BaseModel): + r"""A CompletionFineTuningJobIntegration variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_COMPLETION_FINE_TUNING_JOB_INTEGRATION_VARIANTS: dict[str, Any] = { + "wandb": WandbIntegrationResult, +} + + +CompletionFineTuningJobIntegration = WandbIntegrationResult + + +CompletionFineTuningJobRepositoryTypedDict = GithubRepositoryTypedDict + + +class UnknownCompletionFineTuningJobRepository(BaseModel): + r"""A CompletionFineTuningJobRepository variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_COMPLETION_FINE_TUNING_JOB_REPOSITORY_VARIANTS: dict[str, Any] = { + "github": GithubRepository, +} + + +CompletionFineTuningJobRepository = GithubRepository + + +class CompletionFineTuningJobTypedDict(TypedDict): + id: str + r"""The ID of the job.""" + auto_start: bool + model: str + status: CompletionFineTuningJobStatus + r"""The current status of the fine-tuning job.""" + created_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" + modified_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" + training_files: List[str] + r"""A list containing the IDs of uploaded files that contain training data.""" + hyperparameters: CompletionTrainingParametersTypedDict + validation_files: NotRequired[Nullable[List[str]]] + r"""A list containing the IDs of uploaded files that contain validation data.""" + object: Literal["job"] + r"""The object type of the fine-tuning job.""" + fine_tuned_model: NotRequired[Nullable[str]] + r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" + suffix: NotRequired[Nullable[str]] + r"""Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `\"my-great-model\"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`.""" + integrations: NotRequired[ + Nullable[List[CompletionFineTuningJobIntegrationTypedDict]] + ] + r"""A list of integrations enabled for your fine-tuning job.""" + trained_tokens: NotRequired[Nullable[int]] + r"""Total number of tokens trained.""" + metadata: NotRequired[Nullable[JobMetadataTypedDict]] + job_type: Literal["completion"] + r"""The type of job (`FT` for fine-tuning).""" + repositories: NotRequired[List[CompletionFineTuningJobRepositoryTypedDict]] + + +class CompletionFineTuningJob(BaseModel): + id: str + r"""The ID of the job.""" + + auto_start: bool + + model: str + + status: CompletionFineTuningJobStatus + r"""The current status of the fine-tuning job.""" + + created_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" + + modified_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" + + training_files: List[str] + r"""A list containing the IDs of uploaded files that contain training data.""" + + hyperparameters: CompletionTrainingParameters + + validation_files: OptionalNullable[List[str]] = UNSET + r"""A list containing the IDs of uploaded files that contain validation data.""" + + object: Annotated[ + Annotated[Optional[Literal["job"]], AfterValidator(validate_const("job"))], + pydantic.Field(alias="object"), + ] = "job" + r"""The object type of the fine-tuning job.""" + + fine_tuned_model: OptionalNullable[str] = UNSET + r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" + + suffix: OptionalNullable[str] = UNSET + r"""Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `\"my-great-model\"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`.""" + + integrations: OptionalNullable[List[CompletionFineTuningJobIntegration]] = UNSET + r"""A list of integrations enabled for your fine-tuning job.""" + + trained_tokens: OptionalNullable[int] = UNSET + r"""Total number of tokens trained.""" + + metadata: OptionalNullable[JobMetadata] = UNSET + + job_type: Annotated[ + Annotated[Literal["completion"], AfterValidator(validate_const("completion"))], + pydantic.Field(alias="job_type"), + ] = "completion" + r"""The type of job (`FT` for fine-tuning).""" + + repositories: Optional[List[CompletionFineTuningJobRepository]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "validation_files", + "object", + "fine_tuned_model", + "suffix", + "integrations", + "trained_tokens", + "metadata", + "repositories", + ] + ) + nullable_fields = set( + [ + "validation_files", + "fine_tuned_model", + "suffix", + "integrations", + "trained_tokens", + "metadata", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CompletionFineTuningJob.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/completionfinetuningjobdetails.py b/src/mistralai/client/models/completionfinetuningjobdetails.py new file mode 100644 index 00000000..490982cd --- /dev/null +++ b/src/mistralai/client/models/completionfinetuningjobdetails.py @@ -0,0 +1,241 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e8379265af48 + +from __future__ import annotations +from .checkpoint import Checkpoint, CheckpointTypedDict +from .completiontrainingparameters import ( + CompletionTrainingParameters, + CompletionTrainingParametersTypedDict, +) +from .event import Event, EventTypedDict +from .githubrepository import GithubRepository, GithubRepositoryTypedDict +from .jobmetadata import JobMetadata, JobMetadataTypedDict +from .wandbintegrationresult import ( + WandbIntegrationResult, + WandbIntegrationResultTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +CompletionFineTuningJobDetailsStatus = Union[ + Literal[ + "QUEUED", + "STARTED", + "VALIDATING", + "VALIDATED", + "RUNNING", + "FAILED_VALIDATION", + "FAILED", + "SUCCESS", + "CANCELLED", + "CANCELLATION_REQUESTED", + ], + UnrecognizedStr, +] +r"""The current status of the fine-tuning job.""" + + +CompletionFineTuningJobDetailsIntegrationTypedDict = WandbIntegrationResultTypedDict + + +class UnknownCompletionFineTuningJobDetailsIntegration(BaseModel): + r"""A CompletionFineTuningJobDetailsIntegration variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_COMPLETION_FINE_TUNING_JOB_DETAILS_INTEGRATION_VARIANTS: dict[str, Any] = { + "wandb": WandbIntegrationResult, +} + + +CompletionFineTuningJobDetailsIntegration = WandbIntegrationResult + + +CompletionFineTuningJobDetailsRepositoryTypedDict = GithubRepositoryTypedDict + + +class UnknownCompletionFineTuningJobDetailsRepository(BaseModel): + r"""A CompletionFineTuningJobDetailsRepository variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_COMPLETION_FINE_TUNING_JOB_DETAILS_REPOSITORY_VARIANTS: dict[str, Any] = { + "github": GithubRepository, +} + + +CompletionFineTuningJobDetailsRepository = GithubRepository + + +class CompletionFineTuningJobDetailsTypedDict(TypedDict): + id: str + r"""The ID of the job.""" + auto_start: bool + model: str + status: CompletionFineTuningJobDetailsStatus + r"""The current status of the fine-tuning job.""" + created_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" + modified_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" + training_files: List[str] + r"""A list containing the IDs of uploaded files that contain training data.""" + hyperparameters: CompletionTrainingParametersTypedDict + validation_files: NotRequired[Nullable[List[str]]] + r"""A list containing the IDs of uploaded files that contain validation data.""" + object: Literal["job"] + r"""The object type of the fine-tuning job.""" + fine_tuned_model: NotRequired[Nullable[str]] + r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" + suffix: NotRequired[Nullable[str]] + r"""Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `\"my-great-model\"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`.""" + integrations: NotRequired[ + Nullable[List[CompletionFineTuningJobDetailsIntegrationTypedDict]] + ] + r"""A list of integrations enabled for your fine-tuning job.""" + trained_tokens: NotRequired[Nullable[int]] + r"""Total number of tokens trained.""" + metadata: NotRequired[Nullable[JobMetadataTypedDict]] + job_type: Literal["completion"] + r"""The type of job (`FT` for fine-tuning).""" + repositories: NotRequired[List[CompletionFineTuningJobDetailsRepositoryTypedDict]] + events: NotRequired[List[EventTypedDict]] + r"""Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here.""" + checkpoints: NotRequired[List[CheckpointTypedDict]] + + +class CompletionFineTuningJobDetails(BaseModel): + id: str + r"""The ID of the job.""" + + auto_start: bool + + model: str + + status: CompletionFineTuningJobDetailsStatus + r"""The current status of the fine-tuning job.""" + + created_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" + + modified_at: int + r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" + + training_files: List[str] + r"""A list containing the IDs of uploaded files that contain training data.""" + + hyperparameters: CompletionTrainingParameters + + validation_files: OptionalNullable[List[str]] = UNSET + r"""A list containing the IDs of uploaded files that contain validation data.""" + + object: Annotated[ + Annotated[Optional[Literal["job"]], AfterValidator(validate_const("job"))], + pydantic.Field(alias="object"), + ] = "job" + r"""The object type of the fine-tuning job.""" + + fine_tuned_model: OptionalNullable[str] = UNSET + r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" + + suffix: OptionalNullable[str] = UNSET + r"""Optional user-provided string inserted into the fine-tuned model name to help identify it. For example, a suffix of `\"my-great-model\"` produces a name like `ft:open-mistral-7b:abcd1234:20260101:my-great-model:efgh5678`.""" + + integrations: OptionalNullable[List[CompletionFineTuningJobDetailsIntegration]] = ( + UNSET + ) + r"""A list of integrations enabled for your fine-tuning job.""" + + trained_tokens: OptionalNullable[int] = UNSET + r"""Total number of tokens trained.""" + + metadata: OptionalNullable[JobMetadata] = UNSET + + job_type: Annotated[ + Annotated[Literal["completion"], AfterValidator(validate_const("completion"))], + pydantic.Field(alias="job_type"), + ] = "completion" + r"""The type of job (`FT` for fine-tuning).""" + + repositories: Optional[List[CompletionFineTuningJobDetailsRepository]] = None + + events: Optional[List[Event]] = None + r"""Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here.""" + + checkpoints: Optional[List[Checkpoint]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "validation_files", + "object", + "fine_tuned_model", + "suffix", + "integrations", + "trained_tokens", + "metadata", + "repositories", + "events", + "checkpoints", + ] + ) + nullable_fields = set( + [ + "validation_files", + "fine_tuned_model", + "suffix", + "integrations", + "trained_tokens", + "metadata", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CompletionFineTuningJobDetails.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/completionresponsestreamchoice.py b/src/mistralai/client/models/completionresponsestreamchoice.py new file mode 100644 index 00000000..ef1a106b --- /dev/null +++ b/src/mistralai/client/models/completionresponsestreamchoice.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5969a6bc07f3 + +from __future__ import annotations +from .deltamessage import DeltaMessage, DeltaMessageTypedDict +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr +from pydantic import model_serializer +from typing import Literal, Union +from typing_extensions import TypedDict + + +CompletionResponseStreamChoiceFinishReason = Union[ + Literal[ + "stop", + "length", + "error", + "tool_calls", + ], + UnrecognizedStr, +] + + +class CompletionResponseStreamChoiceTypedDict(TypedDict): + index: int + delta: DeltaMessageTypedDict + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] + + +class CompletionResponseStreamChoice(BaseModel): + index: int + + delta: DeltaMessage + + finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/completiontrainingparameters.py b/src/mistralai/client/models/completiontrainingparameters.py new file mode 100644 index 00000000..3b99a693 --- /dev/null +++ b/src/mistralai/client/models/completiontrainingparameters.py @@ -0,0 +1,92 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: be202ea0d5a6 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CompletionTrainingParametersTypedDict(TypedDict): + training_steps: NotRequired[Nullable[int]] + r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" + learning_rate: NotRequired[float] + r"""A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.""" + weight_decay: NotRequired[Nullable[float]] + r"""(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.""" + warmup_fraction: NotRequired[Nullable[float]] + r"""(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)""" + epochs: NotRequired[Nullable[float]] + seq_len: NotRequired[Nullable[int]] + fim_ratio: NotRequired[Nullable[float]] + + +class CompletionTrainingParameters(BaseModel): + training_steps: OptionalNullable[int] = UNSET + r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" + + learning_rate: Optional[float] = 0.0001 + r"""A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.""" + + weight_decay: OptionalNullable[float] = UNSET + r"""(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.""" + + warmup_fraction: OptionalNullable[float] = UNSET + r"""(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)""" + + epochs: OptionalNullable[float] = UNSET + + seq_len: OptionalNullable[int] = UNSET + + fim_ratio: OptionalNullable[float] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "training_steps", + "learning_rate", + "weight_decay", + "warmup_fraction", + "epochs", + "seq_len", + "fim_ratio", + ] + ) + nullable_fields = set( + [ + "training_steps", + "weight_decay", + "warmup_fraction", + "epochs", + "seq_len", + "fim_ratio", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connectioncredentials.py b/src/mistralai/client/models/connectioncredentials.py new file mode 100644 index 00000000..de461057 --- /dev/null +++ b/src/mistralai/client/models/connectioncredentials.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2f4a79b452fb + +from __future__ import annotations +from .oauth2token import OAuth2Token, OAuth2TokenTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Dict +from typing_extensions import NotRequired, TypedDict + + +class ConnectionCredentialsTypedDict(TypedDict): + oauth: NotRequired[Nullable[OAuth2TokenTypedDict]] + headers: NotRequired[Nullable[Dict[str, str]]] + bearer_token: NotRequired[Nullable[str]] + + +class ConnectionCredentials(BaseModel): + oauth: OptionalNullable[OAuth2Token] = UNSET + + headers: OptionalNullable[Dict[str, str]] = UNSET + + bearer_token: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["oauth", "headers", "bearer_token"]) + nullable_fields = set(["oauth", "headers", "bearer_token"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector.py b/src/mistralai/client/models/connector.py new file mode 100644 index 00000000..9d8b6000 --- /dev/null +++ b/src/mistralai/client/models/connector.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1a4facac922d + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ConnectorTypedDict(TypedDict): + id: str + name: str + description: str + created_at: datetime + modified_at: datetime + title: NotRequired[Nullable[str]] + server: NotRequired[Nullable[str]] + auth_type: NotRequired[Nullable[str]] + + +class Connector(BaseModel): + id: str + + name: str + + description: str + + created_at: datetime + + modified_at: datetime + + title: OptionalNullable[str] = UNSET + + server: OptionalNullable[str] = UNSET + + auth_type: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["title", "server", "auth_type"]) + nullable_fields = set(["title", "server", "auth_type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector_call_tool_v1op.py b/src/mistralai/client/models/connector_call_tool_v1op.py new file mode 100644 index 00000000..9c77123e --- /dev/null +++ b/src/mistralai/client/models/connector_call_tool_v1op.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7948899b3068 + +from __future__ import annotations +from .connectorcalltoolrequest import ( + ConnectorCallToolRequest, + ConnectorCallToolRequestTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorCallToolV1RequestTypedDict(TypedDict): + tool_name: str + connector_id_or_name: str + connector_call_tool_request: ConnectorCallToolRequestTypedDict + credentials_name: NotRequired[Nullable[str]] + + +class ConnectorCallToolV1Request(BaseModel): + tool_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + connector_call_tool_request: Annotated[ + ConnectorCallToolRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + credentials_name: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["credentials_name"]) + nullable_fields = set(["credentials_name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector_create_or_update_organization_credentials_v1op.py b/src/mistralai/client/models/connector_create_or_update_organization_credentials_v1op.py new file mode 100644 index 00000000..f66d73d3 --- /dev/null +++ b/src/mistralai/client/models/connector_create_or_update_organization_credentials_v1op.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 57c711e81d89 + +from __future__ import annotations +from .credentialscreateorupdate import ( + CredentialsCreateOrUpdate, + CredentialsCreateOrUpdateTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorCreateOrUpdateOrganizationCredentialsV1RequestTypedDict(TypedDict): + connector_id_or_name: str + credentials_create_or_update: CredentialsCreateOrUpdateTypedDict + + +class ConnectorCreateOrUpdateOrganizationCredentialsV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + credentials_create_or_update: Annotated[ + CredentialsCreateOrUpdate, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/connector_create_or_update_user_credentials_v1op.py b/src/mistralai/client/models/connector_create_or_update_user_credentials_v1op.py new file mode 100644 index 00000000..338d4f39 --- /dev/null +++ b/src/mistralai/client/models/connector_create_or_update_user_credentials_v1op.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6ededc839b03 + +from __future__ import annotations +from .credentialscreateorupdate import ( + CredentialsCreateOrUpdate, + CredentialsCreateOrUpdateTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorCreateOrUpdateUserCredentialsV1RequestTypedDict(TypedDict): + connector_id_or_name: str + credentials_create_or_update: CredentialsCreateOrUpdateTypedDict + + +class ConnectorCreateOrUpdateUserCredentialsV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + credentials_create_or_update: Annotated[ + CredentialsCreateOrUpdate, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/connector_create_or_update_workspace_credentials_v1op.py b/src/mistralai/client/models/connector_create_or_update_workspace_credentials_v1op.py new file mode 100644 index 00000000..43b3c1dc --- /dev/null +++ b/src/mistralai/client/models/connector_create_or_update_workspace_credentials_v1op.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7795b085704b + +from __future__ import annotations +from .credentialscreateorupdate import ( + CredentialsCreateOrUpdate, + CredentialsCreateOrUpdateTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorCreateOrUpdateWorkspaceCredentialsV1RequestTypedDict(TypedDict): + connector_id_or_name: str + credentials_create_or_update: CredentialsCreateOrUpdateTypedDict + + +class ConnectorCreateOrUpdateWorkspaceCredentialsV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + credentials_create_or_update: Annotated[ + CredentialsCreateOrUpdate, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/connector_delete_organization_credentials_v1op.py b/src/mistralai/client/models/connector_delete_organization_credentials_v1op.py new file mode 100644 index 00000000..6cdb0c31 --- /dev/null +++ b/src/mistralai/client/models/connector_delete_organization_credentials_v1op.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: aab3a70dbbc5 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorDeleteOrganizationCredentialsV1RequestTypedDict(TypedDict): + credentials_name: str + connector_id_or_name: str + + +class ConnectorDeleteOrganizationCredentialsV1Request(BaseModel): + credentials_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/connector_delete_user_credentials_v1op.py b/src/mistralai/client/models/connector_delete_user_credentials_v1op.py new file mode 100644 index 00000000..40d25aab --- /dev/null +++ b/src/mistralai/client/models/connector_delete_user_credentials_v1op.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8bf2075ebdbf + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorDeleteUserCredentialsV1RequestTypedDict(TypedDict): + credentials_name: str + connector_id_or_name: str + + +class ConnectorDeleteUserCredentialsV1Request(BaseModel): + credentials_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/connector_delete_v1op.py b/src/mistralai/client/models/connector_delete_v1op.py new file mode 100644 index 00000000..74134361 --- /dev/null +++ b/src/mistralai/client/models/connector_delete_v1op.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a377930b1435 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorDeleteV1RequestTypedDict(TypedDict): + connector_id: str + + +class ConnectorDeleteV1Request(BaseModel): + connector_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/connector_delete_workspace_credentials_v1op.py b/src/mistralai/client/models/connector_delete_workspace_credentials_v1op.py new file mode 100644 index 00000000..a746ff5e --- /dev/null +++ b/src/mistralai/client/models/connector_delete_workspace_credentials_v1op.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4f0993c25ece + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorDeleteWorkspaceCredentialsV1RequestTypedDict(TypedDict): + credentials_name: str + connector_id_or_name: str + + +class ConnectorDeleteWorkspaceCredentialsV1Request(BaseModel): + credentials_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/connector_get_auth_url_v1op.py b/src/mistralai/client/models/connector_get_auth_url_v1op.py new file mode 100644 index 00000000..10f42827 --- /dev/null +++ b/src/mistralai/client/models/connector_get_auth_url_v1op.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2e6b9ab43d1d + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorGetAuthURLV1RequestTypedDict(TypedDict): + connector_id_or_name: str + app_return_url: NotRequired[Nullable[str]] + credentials_name: NotRequired[Nullable[str]] + + +class ConnectorGetAuthURLV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + app_return_url: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + credentials_name: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["app_return_url", "credentials_name"]) + nullable_fields = set(["app_return_url", "credentials_name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector_get_authentication_methods_v1op.py b/src/mistralai/client/models/connector_get_authentication_methods_v1op.py new file mode 100644 index 00000000..e0c4146d --- /dev/null +++ b/src/mistralai/client/models/connector_get_authentication_methods_v1op.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6861e4d57959 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorGetAuthenticationMethodsV1RequestTypedDict(TypedDict): + connector_id_or_name: str + + +class ConnectorGetAuthenticationMethodsV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/connector_get_v1op.py b/src/mistralai/client/models/connector_get_v1op.py new file mode 100644 index 00000000..780afac9 --- /dev/null +++ b/src/mistralai/client/models/connector_get_v1op.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 73ca3a446dcc + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorGetV1RequestTypedDict(TypedDict): + connector_id_or_name: str + fetch_customer_data: NotRequired[bool] + r"""Fetch the customer data associated with the connector (e.g. customer secrets / config).""" + fetch_connection_secrets: NotRequired[bool] + r"""Fetch the general connection secrets associated with the connector.""" + + +class ConnectorGetV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + fetch_customer_data: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Fetch the customer data associated with the connector (e.g. customer secrets / config).""" + + fetch_connection_secrets: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Fetch the general connection secrets associated with the connector.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["fetch_customer_data", "fetch_connection_secrets"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector_list_organization_credentials_v1op.py b/src/mistralai/client/models/connector_list_organization_credentials_v1op.py new file mode 100644 index 00000000..6b37773f --- /dev/null +++ b/src/mistralai/client/models/connector_list_organization_credentials_v1op.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a52ee058feab + +from __future__ import annotations +from .outboundauthenticationtype import OutboundAuthenticationType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorListOrganizationCredentialsV1RequestTypedDict(TypedDict): + connector_id_or_name: str + auth_type: NotRequired[Nullable[OutboundAuthenticationType]] + fetch_default: NotRequired[bool] + + +class ConnectorListOrganizationCredentialsV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + auth_type: Annotated[ + OptionalNullable[OutboundAuthenticationType], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + fetch_default: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["auth_type", "fetch_default"]) + nullable_fields = set(["auth_type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector_list_tools_v1op.py b/src/mistralai/client/models/connector_list_tools_v1op.py new file mode 100644 index 00000000..3e9905c3 --- /dev/null +++ b/src/mistralai/client/models/connector_list_tools_v1op.py @@ -0,0 +1,100 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4c6ad704479b + +from __future__ import annotations +from .connectortool import ConnectorTool, ConnectorToolTypedDict +from .mcptool import MCPTool, MCPToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +class ConnectorListToolsV1RequestTypedDict(TypedDict): + connector_id_or_name: str + page: NotRequired[int] + page_size: NotRequired[int] + refresh: NotRequired[bool] + pretty: NotRequired[bool] + r"""Return a simplified payload with only name, description, annotations, and a compact inputSchema.""" + credentials_name: NotRequired[Nullable[str]] + + +class ConnectorListToolsV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + + refresh: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + + pretty: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Return a simplified payload with only name, description, annotations, and a compact inputSchema.""" + + credentials_name: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["page", "page_size", "refresh", "pretty", "credentials_name"] + ) + nullable_fields = set(["credentials_name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +ResponseConnectorListToolsV1TypedDict = TypeAliasType( + "ResponseConnectorListToolsV1TypedDict", + Union[List[ConnectorToolTypedDict], List[MCPToolTypedDict], List[Dict[str, Any]]], +) +r"""Successful Response""" + + +ResponseConnectorListToolsV1 = TypeAliasType( + "ResponseConnectorListToolsV1", + Union[List[ConnectorTool], List[MCPTool], List[Dict[str, Any]]], +) +r"""Successful Response""" diff --git a/src/mistralai/client/models/connector_list_user_credentials_v1op.py b/src/mistralai/client/models/connector_list_user_credentials_v1op.py new file mode 100644 index 00000000..5434a283 --- /dev/null +++ b/src/mistralai/client/models/connector_list_user_credentials_v1op.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 106e8fba762d + +from __future__ import annotations +from .outboundauthenticationtype import OutboundAuthenticationType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorListUserCredentialsV1RequestTypedDict(TypedDict): + connector_id_or_name: str + auth_type: NotRequired[Nullable[OutboundAuthenticationType]] + fetch_default: NotRequired[bool] + + +class ConnectorListUserCredentialsV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + auth_type: Annotated[ + OptionalNullable[OutboundAuthenticationType], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + fetch_default: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["auth_type", "fetch_default"]) + nullable_fields = set(["auth_type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector_list_v1op.py b/src/mistralai/client/models/connector_list_v1op.py new file mode 100644 index 00000000..3cb31bf7 --- /dev/null +++ b/src/mistralai/client/models/connector_list_v1op.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5ec0889995f5 + +from __future__ import annotations +from .connectorsqueryfilters import ( + ConnectorsQueryFilters, + ConnectorsQueryFiltersTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorListV1RequestTypedDict(TypedDict): + query_filters: NotRequired[ConnectorsQueryFiltersTypedDict] + cursor: NotRequired[Nullable[str]] + page_size: NotRequired[int] + + +class ConnectorListV1Request(BaseModel): + query_filters: Annotated[ + Optional[ConnectorsQueryFilters], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + + cursor: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["query_filters", "cursor", "page_size"]) + nullable_fields = set(["cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector_list_workspace_credentials_v1op.py b/src/mistralai/client/models/connector_list_workspace_credentials_v1op.py new file mode 100644 index 00000000..c610c4c8 --- /dev/null +++ b/src/mistralai/client/models/connector_list_workspace_credentials_v1op.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: de7c431e8a54 + +from __future__ import annotations +from .outboundauthenticationtype import OutboundAuthenticationType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorListWorkspaceCredentialsV1RequestTypedDict(TypedDict): + connector_id_or_name: str + auth_type: NotRequired[Nullable[OutboundAuthenticationType]] + fetch_default: NotRequired[bool] + + +class ConnectorListWorkspaceCredentialsV1Request(BaseModel): + connector_id_or_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + auth_type: Annotated[ + OptionalNullable[OutboundAuthenticationType], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + fetch_default: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["auth_type", "fetch_default"]) + nullable_fields = set(["auth_type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connector_update_v1op.py b/src/mistralai/client/models/connector_update_v1op.py new file mode 100644 index 00000000..6b00d0b0 --- /dev/null +++ b/src/mistralai/client/models/connector_update_v1op.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6f884d18ac56 + +from __future__ import annotations +from .updateconnectorrequest import ( + UpdateConnectorRequest, + UpdateConnectorRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class ConnectorUpdateV1RequestTypedDict(TypedDict): + connector_id: str + update_connector_request: UpdateConnectorRequestTypedDict + + +class ConnectorUpdateV1Request(BaseModel): + connector_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_connector_request: Annotated[ + UpdateConnectorRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/connectorauthenticationheader.py b/src/mistralai/client/models/connectorauthenticationheader.py new file mode 100644 index 00000000..5fc073f0 --- /dev/null +++ b/src/mistralai/client/models/connectorauthenticationheader.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7271f22f39b0 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ConnectorAuthenticationHeaderTypedDict(TypedDict): + name: str + is_required: NotRequired[bool] + is_secret: NotRequired[bool] + + +class ConnectorAuthenticationHeader(BaseModel): + name: str + + is_required: Optional[bool] = True + + is_secret: Optional[bool] = True + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["is_required", "is_secret"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/connectorcalltoolrequest.py b/src/mistralai/client/models/connectorcalltoolrequest.py new file mode 100644 index 00000000..85366bb6 --- /dev/null +++ b/src/mistralai/client/models/connectorcalltoolrequest.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7dc7ec295301 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class ConnectorCallToolRequestTypedDict(TypedDict): + r"""Request body for calling an MCP tool.""" + + arguments: NotRequired[Dict[str, Any]] + + +class ConnectorCallToolRequest(BaseModel): + r"""Request body for calling an MCP tool.""" + + arguments: Optional[Dict[str, Any]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["arguments"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/connectorsqueryfilters.py b/src/mistralai/client/models/connectorsqueryfilters.py new file mode 100644 index 00000000..f10d6897 --- /dev/null +++ b/src/mistralai/client/models/connectorsqueryfilters.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3b9fc81aa726 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorsQueryFiltersTypedDict(TypedDict): + active: NotRequired[Nullable[bool]] + r"""Filter for active connectors for a given user, workspace and organization.""" + fetch_connection_secrets: NotRequired[bool] + r"""Fetch connection secrets.""" + + +class ConnectorsQueryFilters(BaseModel): + active: Annotated[OptionalNullable[bool], FieldMetadata(query=True)] = UNSET + r"""Filter for active connectors for a given user, workspace and organization.""" + + fetch_connection_secrets: Annotated[Optional[bool], FieldMetadata(query=True)] = ( + False + ) + r"""Fetch connection secrets.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["active", "fetch_connection_secrets"]) + nullable_fields = set(["active"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connectortool.py b/src/mistralai/client/models/connectortool.py new file mode 100644 index 00000000..e8a036c7 --- /dev/null +++ b/src/mistralai/client/models/connectortool.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 41ca596b44f8 + +from __future__ import annotations +from .connectortoollocale import ConnectorToolLocale, ConnectorToolLocaleTypedDict +from .executionconfig import ExecutionConfig, ExecutionConfigTypedDict +from .resourcevisibility import ResourceVisibility +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class ConnectorToolTypedDict(TypedDict): + id: str + name: str + description: str + execution_config: Nullable[ExecutionConfigTypedDict] + visibility: ResourceVisibility + created_at: datetime + modified_at: datetime + system_prompt: NotRequired[Nullable[str]] + locale: NotRequired[Nullable[ConnectorToolLocaleTypedDict]] + jsonschema: NotRequired[Nullable[Dict[str, Any]]] + active: NotRequired[Nullable[bool]] + + +class ConnectorTool(BaseModel): + id: str + + name: str + + description: str + + execution_config: Nullable[ExecutionConfig] + + visibility: ResourceVisibility + + created_at: datetime + + modified_at: datetime + + system_prompt: OptionalNullable[str] = UNSET + + locale: OptionalNullable[ConnectorToolLocale] = UNSET + + jsonschema: OptionalNullable[Dict[str, Any]] = UNSET + + active: OptionalNullable[bool] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["system_prompt", "locale", "jsonschema", "active"]) + nullable_fields = set( + ["system_prompt", "locale", "jsonschema", "execution_config", "active"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/connectortoolcallmetadata.py b/src/mistralai/client/models/connectortoolcallmetadata.py new file mode 100644 index 00000000..0280eae0 --- /dev/null +++ b/src/mistralai/client/models/connectortoolcallmetadata.py @@ -0,0 +1,80 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2d27189e58e6 + +from __future__ import annotations +from .connectortoolresultmetadata import ( + ConnectorToolResultMetadata, + ConnectorToolResultMetadataTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class ConnectorToolCallMetadataTypedDict(TypedDict): + r"""Metadata wrapper for MCP tool call responses. + + Nests MCP-specific fields under `mcp_meta` to avoid collisions with other + metadata keys (e.g. `tool_call_result`) in Harmattan's streaming deltas. + """ + + mcp_meta: NotRequired[Nullable[ConnectorToolResultMetadataTypedDict]] + + +class ConnectorToolCallMetadata(BaseModel): + r"""Metadata wrapper for MCP tool call responses. + + Nests MCP-specific fields under `mcp_meta` to avoid collisions with other + metadata keys (e.g. `tool_call_result`) in Harmattan's streaming deltas. + """ + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + mcp_meta: OptionalNullable[ConnectorToolResultMetadata] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["mcp_meta"]) + nullable_fields = set(["mcp_meta"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/src/mistralai/client/models/connectortoolcallresponse.py b/src/mistralai/client/models/connectortoolcallresponse.py new file mode 100644 index 00000000..76abe558 --- /dev/null +++ b/src/mistralai/client/models/connectortoolcallresponse.py @@ -0,0 +1,149 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c4f7a932bd2e + +from __future__ import annotations +from .audiocontent import AudioContent, AudioContentTypedDict +from .connectortoolcallmetadata import ( + ConnectorToolCallMetadata, + ConnectorToolCallMetadataTypedDict, +) +from .embeddedresource import EmbeddedResource, EmbeddedResourceTypedDict +from .imagecontent import ImageContent, ImageContentTypedDict +from .resourcelink import ResourceLink, ResourceLinkTypedDict +from .textcontent import TextContent, TextContentTypedDict +from functools import partial +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils.unions import parse_open_union +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import BeforeValidator +from typing import Any, Dict, List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ConnectorToolCallResponseContentTypedDict = TypeAliasType( + "ConnectorToolCallResponseContentTypedDict", + Union[ + TextContentTypedDict, + EmbeddedResourceTypedDict, + ImageContentTypedDict, + AudioContentTypedDict, + ResourceLinkTypedDict, + ], +) + + +class UnknownConnectorToolCallResponseContent(BaseModel): + r"""A ConnectorToolCallResponseContent variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_CONNECTOR_TOOL_CALL_RESPONSE_CONTENT_VARIANTS: dict[str, Any] = { + "text": TextContent, + "image": ImageContent, + "audio": AudioContent, + "resource_link": ResourceLink, + "resource": EmbeddedResource, +} + + +ConnectorToolCallResponseContent = Annotated[ + Union[ + TextContent, + ImageContent, + AudioContent, + ResourceLink, + EmbeddedResource, + UnknownConnectorToolCallResponseContent, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_CONNECTOR_TOOL_CALL_RESPONSE_CONTENT_VARIANTS, + unknown_cls=UnknownConnectorToolCallResponseContent, + union_name="ConnectorToolCallResponseContent", + ) + ), +] + + +class ConnectorToolCallResponseTypedDict(TypedDict): + r"""Response from calling an MCP tool. + + We override mcp_types.CallToolResult because: + - Models only support `content`, not `structuredContent` at top level + - Downstream consumers (le-chat, etc.) need structuredContent/isError/_meta via metadata + + SYNC: Keep in sync with Harmattan (orchestrator) for harmonized tool result processing. + """ + + content: List[ConnectorToolCallResponseContentTypedDict] + metadata: NotRequired[Nullable[ConnectorToolCallMetadataTypedDict]] + + +class ConnectorToolCallResponse(BaseModel): + r"""Response from calling an MCP tool. + + We override mcp_types.CallToolResult because: + - Models only support `content`, not `structuredContent` at top level + - Downstream consumers (le-chat, etc.) need structuredContent/isError/_meta via metadata + + SYNC: Keep in sync with Harmattan (orchestrator) for harmonized tool result processing. + """ + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + content: List[ConnectorToolCallResponseContent] + + metadata: OptionalNullable[ConnectorToolCallMetadata] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["metadata"]) + nullable_fields = set(["metadata"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/src/mistralai/client/models/connectortoollocale.py b/src/mistralai/client/models/connectortoollocale.py new file mode 100644 index 00000000..ec1359c8 --- /dev/null +++ b/src/mistralai/client/models/connectortoollocale.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 247ebe411537 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Dict +from typing_extensions import TypedDict + + +class ConnectorToolLocaleTypedDict(TypedDict): + name: Dict[str, str] + description: Dict[str, str] + usage_sentence: Dict[str, str] + + +class ConnectorToolLocale(BaseModel): + name: Dict[str, str] + + description: Dict[str, str] + + usage_sentence: Dict[str, str] diff --git a/src/mistralai/client/models/connectortoolresultmetadata.py b/src/mistralai/client/models/connectortoolresultmetadata.py new file mode 100644 index 00000000..8c92f2f8 --- /dev/null +++ b/src/mistralai/client/models/connectortoolresultmetadata.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 86730e16aa67 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectorToolResultMetadataTypedDict(TypedDict): + r"""MCP-specific result metadata (isError, structuredContent, _meta).""" + + is_error: NotRequired[bool] + structured_content: NotRequired[Nullable[Dict[str, Any]]] + meta: NotRequired[Nullable[Dict[str, Any]]] + + +class ConnectorToolResultMetadata(BaseModel): + r"""MCP-specific result metadata (isError, structuredContent, _meta).""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + is_error: Annotated[Optional[bool], pydantic.Field(alias="isError")] = False + + structured_content: Annotated[ + OptionalNullable[Dict[str, Any]], pydantic.Field(alias="structuredContent") + ] = UNSET + + meta: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["isError", "structuredContent", "_meta"]) + nullable_fields = set(["structuredContent", "_meta"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + ConnectorToolResultMetadata.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/contentchunk.py b/src/mistralai/client/models/contentchunk.py new file mode 100644 index 00000000..e3de7591 --- /dev/null +++ b/src/mistralai/client/models/contentchunk.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c007f5ee0325 + +from __future__ import annotations +from .audiochunk import AudioChunk, AudioChunkTypedDict +from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict +from .filechunk import FileChunk, FileChunkTypedDict +from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict +from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict +from .textchunk import TextChunk, TextChunkTypedDict +from .thinkchunk import ThinkChunk, ThinkChunkTypedDict +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +ContentChunkTypedDict = TypeAliasType( + "ContentChunkTypedDict", + Union[ + TextChunkTypedDict, + ImageURLChunkTypedDict, + ReferenceChunkTypedDict, + FileChunkTypedDict, + AudioChunkTypedDict, + DocumentURLChunkTypedDict, + ThinkChunkTypedDict, + ], +) + + +class UnknownContentChunk(BaseModel): + r"""A ContentChunk variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_CONTENT_CHUNK_VARIANTS: dict[str, Any] = { + "image_url": ImageURLChunk, + "document_url": DocumentURLChunk, + "text": TextChunk, + "reference": ReferenceChunk, + "file": FileChunk, + "thinking": ThinkChunk, + "input_audio": AudioChunk, +} + + +ContentChunk = Annotated[ + Union[ + ImageURLChunk, + DocumentURLChunk, + TextChunk, + ReferenceChunk, + FileChunk, + ThinkChunk, + AudioChunk, + UnknownContentChunk, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_CONTENT_CHUNK_VARIANTS, + unknown_cls=UnknownContentChunk, + union_name="ContentChunk", + ) + ), +] diff --git a/src/mistralai/client/models/conversationappendrequest.py b/src/mistralai/client/models/conversationappendrequest.py new file mode 100644 index 00000000..6d310816 --- /dev/null +++ b/src/mistralai/client/models/conversationappendrequest.py @@ -0,0 +1,96 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 81ce529e0865 + +from __future__ import annotations +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .conversationinputs import ConversationInputs, ConversationInputsTypedDict +from .toolcallconfirmation import ToolCallConfirmation, ToolCallConfirmationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +ConversationAppendRequestHandoffExecution = Literal[ + "client", + "server", +] + + +class ConversationAppendRequestTypedDict(TypedDict): + inputs: NotRequired[ConversationInputsTypedDict] + stream: Literal[False] + store: NotRequired[bool] + r"""Whether to store the results into our servers or not.""" + handoff_execution: NotRequired[ConversationAppendRequestHandoffExecution] + completion_args: NotRequired[CompletionArgsTypedDict] + r"""White-listed arguments from the completion API""" + tool_confirmations: NotRequired[Nullable[List[ToolCallConfirmationTypedDict]]] + + +class ConversationAppendRequest(BaseModel): + inputs: Optional[ConversationInputs] = None + + stream: Annotated[ + Annotated[Optional[Literal[False]], AfterValidator(validate_const(False))], + pydantic.Field(alias="stream"), + ] = False + + store: Optional[bool] = True + r"""Whether to store the results into our servers or not.""" + + handoff_execution: Optional[ConversationAppendRequestHandoffExecution] = "server" + + completion_args: Optional[CompletionArgs] = None + r"""White-listed arguments from the completion API""" + + tool_confirmations: OptionalNullable[List[ToolCallConfirmation]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "inputs", + "stream", + "store", + "handoff_execution", + "completion_args", + "tool_confirmations", + ] + ) + nullable_fields = set(["tool_confirmations"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ConversationAppendRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationappendstreamrequest.py b/src/mistralai/client/models/conversationappendstreamrequest.py new file mode 100644 index 00000000..b65f1e82 --- /dev/null +++ b/src/mistralai/client/models/conversationappendstreamrequest.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 27ada745e6ad + +from __future__ import annotations +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .conversationinputs import ConversationInputs, ConversationInputsTypedDict +from .toolcallconfirmation import ToolCallConfirmation, ToolCallConfirmationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +ConversationAppendStreamRequestHandoffExecution = Literal[ + "client", + "server", +] + + +class ConversationAppendStreamRequestTypedDict(TypedDict): + inputs: NotRequired[ConversationInputsTypedDict] + stream: Literal[True] + store: NotRequired[bool] + r"""Whether to store the results into our servers or not.""" + handoff_execution: NotRequired[ConversationAppendStreamRequestHandoffExecution] + completion_args: NotRequired[CompletionArgsTypedDict] + r"""White-listed arguments from the completion API""" + tool_confirmations: NotRequired[Nullable[List[ToolCallConfirmationTypedDict]]] + + +class ConversationAppendStreamRequest(BaseModel): + inputs: Optional[ConversationInputs] = None + + stream: Annotated[ + Annotated[Optional[Literal[True]], AfterValidator(validate_const(True))], + pydantic.Field(alias="stream"), + ] = True + + store: Optional[bool] = True + r"""Whether to store the results into our servers or not.""" + + handoff_execution: Optional[ConversationAppendStreamRequestHandoffExecution] = ( + "server" + ) + + completion_args: Optional[CompletionArgs] = None + r"""White-listed arguments from the completion API""" + + tool_confirmations: OptionalNullable[List[ToolCallConfirmation]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "inputs", + "stream", + "store", + "handoff_execution", + "completion_args", + "tool_confirmations", + ] + ) + nullable_fields = set(["tool_confirmations"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ConversationAppendStreamRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationevents.py b/src/mistralai/client/models/conversationevents.py new file mode 100644 index 00000000..17812983 --- /dev/null +++ b/src/mistralai/client/models/conversationevents.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8c8b08d853f6 + +from __future__ import annotations +from .agenthandoffdoneevent import AgentHandoffDoneEvent, AgentHandoffDoneEventTypedDict +from .agenthandoffstartedevent import ( + AgentHandoffStartedEvent, + AgentHandoffStartedEventTypedDict, +) +from .functioncallevent import FunctionCallEvent, FunctionCallEventTypedDict +from .messageoutputevent import MessageOutputEvent, MessageOutputEventTypedDict +from .responsedoneevent import ResponseDoneEvent, ResponseDoneEventTypedDict +from .responseerrorevent import ResponseErrorEvent, ResponseErrorEventTypedDict +from .responsestartedevent import ResponseStartedEvent, ResponseStartedEventTypedDict +from .ssetypes import SSETypes +from .toolexecutiondeltaevent import ( + ToolExecutionDeltaEvent, + ToolExecutionDeltaEventTypedDict, +) +from .toolexecutiondoneevent import ( + ToolExecutionDoneEvent, + ToolExecutionDoneEventTypedDict, +) +from .toolexecutionstartedevent import ( + ToolExecutionStartedEvent, + ToolExecutionStartedEventTypedDict, +) +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ConversationEventsDataTypedDict = TypeAliasType( + "ConversationEventsDataTypedDict", + Union[ + ResponseStartedEventTypedDict, + ResponseDoneEventTypedDict, + ResponseErrorEventTypedDict, + ToolExecutionDeltaEventTypedDict, + ToolExecutionDoneEventTypedDict, + AgentHandoffStartedEventTypedDict, + AgentHandoffDoneEventTypedDict, + ToolExecutionStartedEventTypedDict, + MessageOutputEventTypedDict, + FunctionCallEventTypedDict, + ], +) + + +class UnknownConversationEventsData(BaseModel): + r"""A ConversationEventsData variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_CONVERSATION_EVENTS_DATA_VARIANTS: dict[str, Any] = { + "agent.handoff.done": AgentHandoffDoneEvent, + "agent.handoff.started": AgentHandoffStartedEvent, + "conversation.response.done": ResponseDoneEvent, + "conversation.response.error": ResponseErrorEvent, + "conversation.response.started": ResponseStartedEvent, + "function.call.delta": FunctionCallEvent, + "message.output.delta": MessageOutputEvent, + "tool.execution.delta": ToolExecutionDeltaEvent, + "tool.execution.done": ToolExecutionDoneEvent, + "tool.execution.started": ToolExecutionStartedEvent, +} + + +ConversationEventsData = Annotated[ + Union[ + AgentHandoffDoneEvent, + AgentHandoffStartedEvent, + ResponseDoneEvent, + ResponseErrorEvent, + ResponseStartedEvent, + FunctionCallEvent, + MessageOutputEvent, + ToolExecutionDeltaEvent, + ToolExecutionDoneEvent, + ToolExecutionStartedEvent, + UnknownConversationEventsData, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_CONVERSATION_EVENTS_DATA_VARIANTS, + unknown_cls=UnknownConversationEventsData, + union_name="ConversationEventsData", + ) + ), +] + + +class ConversationEventsTypedDict(TypedDict): + event: SSETypes + r"""Server side events sent when streaming a conversation response.""" + data: ConversationEventsDataTypedDict + + +class ConversationEvents(BaseModel): + event: SSETypes + r"""Server side events sent when streaming a conversation response.""" + + data: ConversationEventsData diff --git a/src/mistralai/client/models/conversationhistory.py b/src/mistralai/client/models/conversationhistory.py new file mode 100644 index 00000000..2e812bb8 --- /dev/null +++ b/src/mistralai/client/models/conversationhistory.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 60a51ff1682b + +from __future__ import annotations +from .agenthandoffentry import AgentHandoffEntry, AgentHandoffEntryTypedDict +from .functioncallentry import FunctionCallEntry, FunctionCallEntryTypedDict +from .functionresultentry import FunctionResultEntry, FunctionResultEntryTypedDict +from .messageinputentry import MessageInputEntry, MessageInputEntryTypedDict +from .messageoutputentry import MessageOutputEntry, MessageOutputEntryTypedDict +from .toolexecutionentry import ToolExecutionEntry, ToolExecutionEntryTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +EntryTypedDict = TypeAliasType( + "EntryTypedDict", + Union[ + FunctionResultEntryTypedDict, + MessageInputEntryTypedDict, + MessageOutputEntryTypedDict, + AgentHandoffEntryTypedDict, + ToolExecutionEntryTypedDict, + FunctionCallEntryTypedDict, + ], +) + + +Entry = TypeAliasType( + "Entry", + Union[ + FunctionResultEntry, + MessageInputEntry, + MessageOutputEntry, + AgentHandoffEntry, + ToolExecutionEntry, + FunctionCallEntry, + ], +) + + +class ConversationHistoryTypedDict(TypedDict): + r"""Retrieve all entries in a conversation.""" + + conversation_id: str + entries: List[EntryTypedDict] + object: Literal["conversation.history"] + + +class ConversationHistory(BaseModel): + r"""Retrieve all entries in a conversation.""" + + conversation_id: str + + entries: List[Entry] + + object: Annotated[ + Annotated[ + Optional[Literal["conversation.history"]], + AfterValidator(validate_const("conversation.history")), + ], + pydantic.Field(alias="object"), + ] = "conversation.history" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ConversationHistory.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/models/conversationinputs.py b/src/mistralai/client/models/conversationinputs.py similarity index 93% rename from src/mistralai/models/conversationinputs.py rename to src/mistralai/client/models/conversationinputs.py index 4d30cd76..7ce3ffc3 100644 --- a/src/mistralai/models/conversationinputs.py +++ b/src/mistralai/client/models/conversationinputs.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 711b769f2c40 from __future__ import annotations from .inputentries import InputEntries, InputEntriesTypedDict diff --git a/src/mistralai/client/models/conversationmessages.py b/src/mistralai/client/models/conversationmessages.py new file mode 100644 index 00000000..a7e13c71 --- /dev/null +++ b/src/mistralai/client/models/conversationmessages.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 011c39501c26 + +from __future__ import annotations +from .messageentries import MessageEntries, MessageEntriesTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class ConversationMessagesTypedDict(TypedDict): + r"""Similar to the conversation history but only keep the messages""" + + conversation_id: str + messages: List[MessageEntriesTypedDict] + object: Literal["conversation.messages"] + + +class ConversationMessages(BaseModel): + r"""Similar to the conversation history but only keep the messages""" + + conversation_id: str + + messages: List[MessageEntries] + + object: Annotated[ + Annotated[ + Optional[Literal["conversation.messages"]], + AfterValidator(validate_const("conversation.messages")), + ], + pydantic.Field(alias="object"), + ] = "conversation.messages" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ConversationMessages.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationpayload.py b/src/mistralai/client/models/conversationpayload.py new file mode 100644 index 00000000..6bfc5894 --- /dev/null +++ b/src/mistralai/client/models/conversationpayload.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4581218c84c1 + +from __future__ import annotations +from mistralai.client.types import BaseModel +import pydantic +from pydantic import ConfigDict +from typing import Any, Dict, List +from typing_extensions import TypedDict + + +class ConversationPayloadTypedDict(TypedDict): + messages: List[Dict[str, Any]] + + +class ConversationPayload(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + messages: List[Dict[str, Any]] + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/src/mistralai/client/models/conversationrequest.py b/src/mistralai/client/models/conversationrequest.py new file mode 100644 index 00000000..94fcb03b --- /dev/null +++ b/src/mistralai/client/models/conversationrequest.py @@ -0,0 +1,183 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 58e3ae67f149 + +from __future__ import annotations +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .conversationinputs import ConversationInputs, ConversationInputsTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .functiontool import FunctionTool, FunctionToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import Field, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ConversationRequestHandoffExecution = Literal[ + "client", + "server", +] + + +ConversationRequestToolTypedDict = TypeAliasType( + "ConversationRequestToolTypedDict", + Union[ + FunctionToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +ConversationRequestTool = Annotated[ + Union[ + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, + ], + Field(discriminator="type"), +] + + +ConversationRequestAgentVersionTypedDict = TypeAliasType( + "ConversationRequestAgentVersionTypedDict", Union[str, int] +) + + +ConversationRequestAgentVersion = TypeAliasType( + "ConversationRequestAgentVersion", Union[str, int] +) + + +class ConversationRequestTypedDict(TypedDict): + inputs: ConversationInputsTypedDict + stream: Literal[False] + store: NotRequired[Nullable[bool]] + handoff_execution: NotRequired[Nullable[ConversationRequestHandoffExecution]] + instructions: NotRequired[Nullable[str]] + tools: NotRequired[Nullable[List[ConversationRequestToolTypedDict]]] + completion_args: NotRequired[Nullable[CompletionArgsTypedDict]] + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + agent_id: NotRequired[Nullable[str]] + agent_version: NotRequired[Nullable[ConversationRequestAgentVersionTypedDict]] + model: NotRequired[Nullable[str]] + + +class ConversationRequest(BaseModel): + inputs: ConversationInputs + + stream: Annotated[ + Annotated[Optional[Literal[False]], AfterValidator(validate_const(False))], + pydantic.Field(alias="stream"), + ] = False + + store: OptionalNullable[bool] = UNSET + + handoff_execution: OptionalNullable[ConversationRequestHandoffExecution] = UNSET + + instructions: OptionalNullable[str] = UNSET + + tools: OptionalNullable[List[ConversationRequestTool]] = UNSET + + completion_args: OptionalNullable[CompletionArgs] = UNSET + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + agent_version: OptionalNullable[ConversationRequestAgentVersion] = UNSET + + model: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "stream", + "store", + "handoff_execution", + "instructions", + "tools", + "completion_args", + "guardrails", + "name", + "description", + "metadata", + "agent_id", + "agent_version", + "model", + ] + ) + nullable_fields = set( + [ + "store", + "handoff_execution", + "instructions", + "tools", + "completion_args", + "guardrails", + "name", + "description", + "metadata", + "agent_id", + "agent_version", + "model", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ConversationRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationresponse.py b/src/mistralai/client/models/conversationresponse.py new file mode 100644 index 00000000..64437b23 --- /dev/null +++ b/src/mistralai/client/models/conversationresponse.py @@ -0,0 +1,100 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ad7a8472c7bf + +from __future__ import annotations +from .agenthandoffentry import AgentHandoffEntry, AgentHandoffEntryTypedDict +from .conversationusageinfo import ConversationUsageInfo, ConversationUsageInfoTypedDict +from .functioncallentry import FunctionCallEntry, FunctionCallEntryTypedDict +from .messageoutputentry import MessageOutputEntry, MessageOutputEntryTypedDict +from .toolexecutionentry import ToolExecutionEntry, ToolExecutionEntryTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ConversationResponseOutputTypedDict = TypeAliasType( + "ConversationResponseOutputTypedDict", + Union[ + MessageOutputEntryTypedDict, + AgentHandoffEntryTypedDict, + ToolExecutionEntryTypedDict, + FunctionCallEntryTypedDict, + ], +) + + +ConversationResponseOutput = TypeAliasType( + "ConversationResponseOutput", + Union[MessageOutputEntry, AgentHandoffEntry, ToolExecutionEntry, FunctionCallEntry], +) + + +class ConversationResponseTypedDict(TypedDict): + r"""The response after appending new entries to the conversation.""" + + conversation_id: str + outputs: List[ConversationResponseOutputTypedDict] + usage: ConversationUsageInfoTypedDict + object: Literal["conversation.response"] + guardrails: NotRequired[Nullable[List[Dict[str, Any]]]] + + +class ConversationResponse(BaseModel): + r"""The response after appending new entries to the conversation.""" + + conversation_id: str + + outputs: List[ConversationResponseOutput] + + usage: ConversationUsageInfo + + object: Annotated[ + Annotated[ + Optional[Literal["conversation.response"]], + AfterValidator(validate_const("conversation.response")), + ], + pydantic.Field(alias="object"), + ] = "conversation.response" + + guardrails: OptionalNullable[List[Dict[str, Any]]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "guardrails"]) + nullable_fields = set(["guardrails"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ConversationResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationrestartrequest.py b/src/mistralai/client/models/conversationrestartrequest.py new file mode 100644 index 00000000..b6b03f1f --- /dev/null +++ b/src/mistralai/client/models/conversationrestartrequest.py @@ -0,0 +1,129 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 681d90d50514 + +from __future__ import annotations +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .conversationinputs import ConversationInputs, ConversationInputsTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ConversationRestartRequestHandoffExecution = Literal[ + "client", + "server", +] + + +ConversationRestartRequestAgentVersionTypedDict = TypeAliasType( + "ConversationRestartRequestAgentVersionTypedDict", Union[str, int] +) +r"""Specific version of the agent to use when restarting. If not provided, uses the current version.""" + + +ConversationRestartRequestAgentVersion = TypeAliasType( + "ConversationRestartRequestAgentVersion", Union[str, int] +) +r"""Specific version of the agent to use when restarting. If not provided, uses the current version.""" + + +class ConversationRestartRequestTypedDict(TypedDict): + r"""Request to restart a new conversation from a given entry in the conversation.""" + + from_entry_id: str + inputs: NotRequired[ConversationInputsTypedDict] + stream: Literal[False] + store: NotRequired[bool] + r"""Whether to store the results into our servers or not.""" + handoff_execution: NotRequired[ConversationRestartRequestHandoffExecution] + completion_args: NotRequired[CompletionArgsTypedDict] + r"""White-listed arguments from the completion API""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + r"""Custom metadata for the conversation.""" + agent_version: NotRequired[ + Nullable[ConversationRestartRequestAgentVersionTypedDict] + ] + r"""Specific version of the agent to use when restarting. If not provided, uses the current version.""" + + +class ConversationRestartRequest(BaseModel): + r"""Request to restart a new conversation from a given entry in the conversation.""" + + from_entry_id: str + + inputs: Optional[ConversationInputs] = None + + stream: Annotated[ + Annotated[Optional[Literal[False]], AfterValidator(validate_const(False))], + pydantic.Field(alias="stream"), + ] = False + + store: Optional[bool] = True + r"""Whether to store the results into our servers or not.""" + + handoff_execution: Optional[ConversationRestartRequestHandoffExecution] = "server" + + completion_args: Optional[CompletionArgs] = None + r"""White-listed arguments from the completion API""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + r"""Custom metadata for the conversation.""" + + agent_version: OptionalNullable[ConversationRestartRequestAgentVersion] = UNSET + r"""Specific version of the agent to use when restarting. If not provided, uses the current version.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "inputs", + "stream", + "store", + "handoff_execution", + "completion_args", + "guardrails", + "metadata", + "agent_version", + ] + ) + nullable_fields = set(["guardrails", "metadata", "agent_version"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ConversationRestartRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationrestartstreamrequest.py b/src/mistralai/client/models/conversationrestartstreamrequest.py new file mode 100644 index 00000000..41b7098f --- /dev/null +++ b/src/mistralai/client/models/conversationrestartstreamrequest.py @@ -0,0 +1,133 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 521c2b5bfb2b + +from __future__ import annotations +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .conversationinputs import ConversationInputs, ConversationInputsTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ConversationRestartStreamRequestHandoffExecution = Literal[ + "client", + "server", +] + + +ConversationRestartStreamRequestAgentVersionTypedDict = TypeAliasType( + "ConversationRestartStreamRequestAgentVersionTypedDict", Union[str, int] +) +r"""Specific version of the agent to use when restarting. If not provided, uses the current version.""" + + +ConversationRestartStreamRequestAgentVersion = TypeAliasType( + "ConversationRestartStreamRequestAgentVersion", Union[str, int] +) +r"""Specific version of the agent to use when restarting. If not provided, uses the current version.""" + + +class ConversationRestartStreamRequestTypedDict(TypedDict): + r"""Request to restart a new conversation from a given entry in the conversation.""" + + from_entry_id: str + inputs: NotRequired[ConversationInputsTypedDict] + stream: Literal[True] + store: NotRequired[bool] + r"""Whether to store the results into our servers or not.""" + handoff_execution: NotRequired[ConversationRestartStreamRequestHandoffExecution] + completion_args: NotRequired[CompletionArgsTypedDict] + r"""White-listed arguments from the completion API""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + r"""Custom metadata for the conversation.""" + agent_version: NotRequired[ + Nullable[ConversationRestartStreamRequestAgentVersionTypedDict] + ] + r"""Specific version of the agent to use when restarting. If not provided, uses the current version.""" + + +class ConversationRestartStreamRequest(BaseModel): + r"""Request to restart a new conversation from a given entry in the conversation.""" + + from_entry_id: str + + inputs: Optional[ConversationInputs] = None + + stream: Annotated[ + Annotated[Optional[Literal[True]], AfterValidator(validate_const(True))], + pydantic.Field(alias="stream"), + ] = True + + store: Optional[bool] = True + r"""Whether to store the results into our servers or not.""" + + handoff_execution: Optional[ConversationRestartStreamRequestHandoffExecution] = ( + "server" + ) + + completion_args: Optional[CompletionArgs] = None + r"""White-listed arguments from the completion API""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + r"""Custom metadata for the conversation.""" + + agent_version: OptionalNullable[ConversationRestartStreamRequestAgentVersion] = ( + UNSET + ) + r"""Specific version of the agent to use when restarting. If not provided, uses the current version.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "inputs", + "stream", + "store", + "handoff_execution", + "completion_args", + "guardrails", + "metadata", + "agent_version", + ] + ) + nullable_fields = set(["guardrails", "metadata", "agent_version"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ConversationRestartStreamRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationsource.py b/src/mistralai/client/models/conversationsource.py new file mode 100644 index 00000000..a3b93b61 --- /dev/null +++ b/src/mistralai/client/models/conversationsource.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 24d6a0861d4b + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ConversationSource = Union[ + Literal[ + "EXPLORER", + "UPLOADED_FILE", + "DIRECT_INPUT", + "PLAYGROUND", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/conversationstreamrequest.py b/src/mistralai/client/models/conversationstreamrequest.py new file mode 100644 index 00000000..a1afb267 --- /dev/null +++ b/src/mistralai/client/models/conversationstreamrequest.py @@ -0,0 +1,185 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 58d633507527 + +from __future__ import annotations +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .conversationinputs import ConversationInputs, ConversationInputsTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .functiontool import FunctionTool, FunctionToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import Field, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ConversationStreamRequestHandoffExecution = Literal[ + "client", + "server", +] + + +ConversationStreamRequestToolTypedDict = TypeAliasType( + "ConversationStreamRequestToolTypedDict", + Union[ + FunctionToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +ConversationStreamRequestTool = Annotated[ + Union[ + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, + ], + Field(discriminator="type"), +] + + +ConversationStreamRequestAgentVersionTypedDict = TypeAliasType( + "ConversationStreamRequestAgentVersionTypedDict", Union[str, int] +) + + +ConversationStreamRequestAgentVersion = TypeAliasType( + "ConversationStreamRequestAgentVersion", Union[str, int] +) + + +class ConversationStreamRequestTypedDict(TypedDict): + inputs: ConversationInputsTypedDict + stream: Literal[True] + store: NotRequired[Nullable[bool]] + handoff_execution: NotRequired[Nullable[ConversationStreamRequestHandoffExecution]] + instructions: NotRequired[Nullable[str]] + tools: NotRequired[Nullable[List[ConversationStreamRequestToolTypedDict]]] + completion_args: NotRequired[Nullable[CompletionArgsTypedDict]] + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + agent_id: NotRequired[Nullable[str]] + agent_version: NotRequired[Nullable[ConversationStreamRequestAgentVersionTypedDict]] + model: NotRequired[Nullable[str]] + + +class ConversationStreamRequest(BaseModel): + inputs: ConversationInputs + + stream: Annotated[ + Annotated[Optional[Literal[True]], AfterValidator(validate_const(True))], + pydantic.Field(alias="stream"), + ] = True + + store: OptionalNullable[bool] = UNSET + + handoff_execution: OptionalNullable[ConversationStreamRequestHandoffExecution] = ( + UNSET + ) + + instructions: OptionalNullable[str] = UNSET + + tools: OptionalNullable[List[ConversationStreamRequestTool]] = UNSET + + completion_args: OptionalNullable[CompletionArgs] = UNSET + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + agent_version: OptionalNullable[ConversationStreamRequestAgentVersion] = UNSET + + model: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "stream", + "store", + "handoff_execution", + "instructions", + "tools", + "completion_args", + "guardrails", + "name", + "description", + "metadata", + "agent_id", + "agent_version", + "model", + ] + ) + nullable_fields = set( + [ + "store", + "handoff_execution", + "instructions", + "tools", + "completion_args", + "guardrails", + "name", + "description", + "metadata", + "agent_id", + "agent_version", + "model", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ConversationStreamRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/conversationusageinfo.py b/src/mistralai/client/models/conversationusageinfo.py new file mode 100644 index 00000000..e717284f --- /dev/null +++ b/src/mistralai/client/models/conversationusageinfo.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6685e3b50b50 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class ConversationUsageInfoTypedDict(TypedDict): + prompt_tokens: NotRequired[int] + completion_tokens: NotRequired[int] + total_tokens: NotRequired[int] + connector_tokens: NotRequired[Nullable[int]] + connectors: NotRequired[Nullable[Dict[str, int]]] + + +class ConversationUsageInfo(BaseModel): + prompt_tokens: Optional[int] = 0 + + completion_tokens: Optional[int] = 0 + + total_tokens: Optional[int] = 0 + + connector_tokens: OptionalNullable[int] = UNSET + + connectors: OptionalNullable[Dict[str, int]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "prompt_tokens", + "completion_tokens", + "total_tokens", + "connector_tokens", + "connectors", + ] + ) + nullable_fields = set(["connector_tokens", "connectors"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/create_dataset_record_v1_observability_datasets_dataset_id_records_postop.py b/src/mistralai/client/models/create_dataset_record_v1_observability_datasets_dataset_id_records_postop.py new file mode 100644 index 00000000..03156fa3 --- /dev/null +++ b/src/mistralai/client/models/create_dataset_record_v1_observability_datasets_dataset_id_records_postop.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1ddc53a46c74 + +from __future__ import annotations +from .createdatasetrecordrequest import ( + CreateDatasetRecordRequest, + CreateDatasetRecordRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequestTypedDict( + TypedDict +): + dataset_id: str + create_dataset_record_request: CreateDatasetRecordRequestTypedDict + + +class CreateDatasetRecordV1ObservabilityDatasetsDatasetIDRecordsPostRequest(BaseModel): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + create_dataset_record_request: Annotated[ + CreateDatasetRecordRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/createagentrequest.py b/src/mistralai/client/models/createagentrequest.py new file mode 100644 index 00000000..b434619d --- /dev/null +++ b/src/mistralai/client/models/createagentrequest.py @@ -0,0 +1,137 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 442629bd914b + +from __future__ import annotations +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .functiontool import FunctionTool, FunctionToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import Field, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +CreateAgentRequestToolTypedDict = TypeAliasType( + "CreateAgentRequestToolTypedDict", + Union[ + FunctionToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +CreateAgentRequestTool = Annotated[ + Union[ + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, + ], + Field(discriminator="type"), +] + + +class CreateAgentRequestTypedDict(TypedDict): + model: str + name: str + instructions: NotRequired[Nullable[str]] + r"""Instruction prompt the model will follow during the conversation.""" + tools: NotRequired[List[CreateAgentRequestToolTypedDict]] + r"""List of tools which are available to the model during the conversation.""" + completion_args: NotRequired[CompletionArgsTypedDict] + r"""White-listed arguments from the completion API""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + description: NotRequired[Nullable[str]] + handoffs: NotRequired[Nullable[List[str]]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + version_message: NotRequired[Nullable[str]] + + +class CreateAgentRequest(BaseModel): + model: str + + name: str + + instructions: OptionalNullable[str] = UNSET + r"""Instruction prompt the model will follow during the conversation.""" + + tools: Optional[List[CreateAgentRequestTool]] = None + r"""List of tools which are available to the model during the conversation.""" + + completion_args: Optional[CompletionArgs] = None + r"""White-listed arguments from the completion API""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + description: OptionalNullable[str] = UNSET + + handoffs: OptionalNullable[List[str]] = UNSET + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + version_message: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "instructions", + "tools", + "completion_args", + "guardrails", + "description", + "handoffs", + "metadata", + "version_message", + ] + ) + nullable_fields = set( + [ + "instructions", + "guardrails", + "description", + "handoffs", + "metadata", + "version_message", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/createbatchjobrequest.py b/src/mistralai/client/models/createbatchjobrequest.py new file mode 100644 index 00000000..c74c1381 --- /dev/null +++ b/src/mistralai/client/models/createbatchjobrequest.py @@ -0,0 +1,100 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 56e24cd24e98 + +from __future__ import annotations +from .apiendpoint import APIEndpoint +from .batchrequest import BatchRequest, BatchRequestTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class CreateBatchJobRequestTypedDict(TypedDict): + endpoint: APIEndpoint + input_files: NotRequired[Nullable[List[str]]] + r"""A list of `.jsonl` files for batch inference. + Each line must be a JSON object with a `body` field containing the request payload: + ```json + {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} + {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} + ``` + """ + requests: NotRequired[Nullable[List[BatchRequestTypedDict]]] + model: NotRequired[Nullable[str]] + r"""The model to be used for batch inference.""" + agent_id: NotRequired[Nullable[str]] + r"""In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here.""" + metadata: NotRequired[Nullable[Dict[str, str]]] + r"""The metadata of your choice to be associated with the batch inference job.""" + timeout_hours: NotRequired[int] + r"""The timeout in hours for the batch inference job.""" + + +class CreateBatchJobRequest(BaseModel): + endpoint: APIEndpoint + + input_files: OptionalNullable[List[str]] = UNSET + r"""A list of `.jsonl` files for batch inference. + Each line must be a JSON object with a `body` field containing the request payload: + ```json + {\"custom_id\": \"0\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French cheese?\"}]}} + {\"custom_id\": \"1\", \"body\": {\"max_tokens\": 100, \"messages\": [{\"role\": \"user\", \"content\": \"What is the best French wine?\"}]}} + ``` + """ + + requests: OptionalNullable[List[BatchRequest]] = UNSET + + model: OptionalNullable[str] = UNSET + r"""The model to be used for batch inference.""" + + agent_id: OptionalNullable[str] = UNSET + r"""In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here.""" + + metadata: OptionalNullable[Dict[str, str]] = UNSET + r"""The metadata of your choice to be associated with the batch inference job.""" + + timeout_hours: Optional[int] = 24 + r"""The timeout in hours for the batch inference job.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "input_files", + "requests", + "model", + "agent_id", + "metadata", + "timeout_hours", + ] + ) + nullable_fields = set( + ["input_files", "requests", "model", "agent_id", "metadata"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/createcampaignrequest.py b/src/mistralai/client/models/createcampaignrequest.py new file mode 100644 index 00000000..b3957df9 --- /dev/null +++ b/src/mistralai/client/models/createcampaignrequest.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 60012b559aee + +from __future__ import annotations +from .filterpayload import FilterPayload, FilterPayloadTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class CreateCampaignRequestTypedDict(TypedDict): + search_params: FilterPayloadTypedDict + judge_id: str + name: str + description: str + max_nb_events: int + + +class CreateCampaignRequest(BaseModel): + search_params: FilterPayload + + judge_id: str + + name: str + + description: str + + max_nb_events: int diff --git a/src/mistralai/client/models/createconnectorrequest.py b/src/mistralai/client/models/createconnectorrequest.py new file mode 100644 index 00000000..18060ca3 --- /dev/null +++ b/src/mistralai/client/models/createconnectorrequest.py @@ -0,0 +1,93 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3da192d6491a + +from __future__ import annotations +from .authdata import AuthData, AuthDataTypedDict +from .resourcevisibility import ResourceVisibility +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class CreateConnectorRequestTypedDict(TypedDict): + name: str + r"""The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes.""" + description: str + r"""The description of the connector.""" + server: str + r"""The url of the MCP server.""" + title: NotRequired[Nullable[str]] + r"""Optional human-readable title for the connector.""" + icon_url: NotRequired[Nullable[str]] + r"""The optional url of the icon you want to associate to the connector.""" + visibility: NotRequired[ResourceVisibility] + headers: NotRequired[Nullable[Dict[str, Any]]] + r"""Optional organization-level headers to be sent with the request to the mcp server.""" + auth_data: NotRequired[Nullable[AuthDataTypedDict]] + r"""Optional additional authentication data for the connector.""" + system_prompt: NotRequired[Nullable[str]] + r"""Optional system prompt for the connector.""" + + +class CreateConnectorRequest(BaseModel): + name: str + r"""The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes.""" + + description: str + r"""The description of the connector.""" + + server: str + r"""The url of the MCP server.""" + + title: OptionalNullable[str] = UNSET + r"""Optional human-readable title for the connector.""" + + icon_url: OptionalNullable[str] = UNSET + r"""The optional url of the icon you want to associate to the connector.""" + + visibility: Optional[ResourceVisibility] = None + + headers: OptionalNullable[Dict[str, Any]] = UNSET + r"""Optional organization-level headers to be sent with the request to the mcp server.""" + + auth_data: OptionalNullable[AuthData] = UNSET + r"""Optional additional authentication data for the connector.""" + + system_prompt: OptionalNullable[str] = UNSET + r"""Optional system prompt for the connector.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["title", "icon_url", "visibility", "headers", "auth_data", "system_prompt"] + ) + nullable_fields = set( + ["title", "icon_url", "headers", "auth_data", "system_prompt"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/createdatasetrecordrequest.py b/src/mistralai/client/models/createdatasetrecordrequest.py new file mode 100644 index 00000000..6fd2bf96 --- /dev/null +++ b/src/mistralai/client/models/createdatasetrecordrequest.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9455e38a8c31 + +from __future__ import annotations +from .conversationpayload import ConversationPayload, ConversationPayloadTypedDict +from mistralai.client.types import BaseModel +from typing import Any, Dict +from typing_extensions import TypedDict + + +class CreateDatasetRecordRequestTypedDict(TypedDict): + payload: ConversationPayloadTypedDict + properties: Dict[str, Any] + + +class CreateDatasetRecordRequest(BaseModel): + payload: ConversationPayload + + properties: Dict[str, Any] diff --git a/src/mistralai/client/models/createdatasetrequest.py b/src/mistralai/client/models/createdatasetrequest.py new file mode 100644 index 00000000..ecffc52a --- /dev/null +++ b/src/mistralai/client/models/createdatasetrequest.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 046a094d3ef9 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class CreateDatasetRequestTypedDict(TypedDict): + name: str + description: str + + +class CreateDatasetRequest(BaseModel): + name: str + + description: str diff --git a/src/mistralai/client/models/createfileresponse.py b/src/mistralai/client/models/createfileresponse.py new file mode 100644 index 00000000..bafefc37 --- /dev/null +++ b/src/mistralai/client/models/createfileresponse.py @@ -0,0 +1,107 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fea5e4832dcc + +from __future__ import annotations +from .filepurpose import FilePurpose +from .filevisibility import FileVisibility +from .sampletype import SampleType +from .source import Source +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateFileResponseTypedDict(TypedDict): + id: str + r"""The unique identifier of the file.""" + object: str + r"""The object type, which is always \"file\".""" + size_bytes: int + r"""The size of the file, in bytes.""" + created_at: int + r"""The UNIX timestamp (in seconds) of the event.""" + filename: str + r"""The name of the uploaded file.""" + purpose: FilePurpose + sample_type: SampleType + source: Source + num_lines: NotRequired[Nullable[int]] + mimetype: NotRequired[Nullable[str]] + signature: NotRequired[Nullable[str]] + expires_at: NotRequired[Nullable[int]] + visibility: NotRequired[Nullable[FileVisibility]] + + +class CreateFileResponse(BaseModel): + id: str + r"""The unique identifier of the file.""" + + object: str + r"""The object type, which is always \"file\".""" + + size_bytes: Annotated[int, pydantic.Field(alias="bytes")] + r"""The size of the file, in bytes.""" + + created_at: int + r"""The UNIX timestamp (in seconds) of the event.""" + + filename: str + r"""The name of the uploaded file.""" + + purpose: FilePurpose + + sample_type: SampleType + + source: Source + + num_lines: OptionalNullable[int] = UNSET + + mimetype: OptionalNullable[str] = UNSET + + signature: OptionalNullable[str] = UNSET + + expires_at: OptionalNullable[int] = UNSET + + visibility: OptionalNullable[FileVisibility] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["num_lines", "mimetype", "signature", "expires_at", "visibility"] + ) + nullable_fields = set( + ["num_lines", "mimetype", "signature", "expires_at", "visibility"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CreateFileResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/createfinetuningjobrequest.py b/src/mistralai/client/models/createfinetuningjobrequest.py new file mode 100644 index 00000000..1f9c1e15 --- /dev/null +++ b/src/mistralai/client/models/createfinetuningjobrequest.py @@ -0,0 +1,149 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c60d2a45d66b + +from __future__ import annotations +from .classifiertarget import ClassifierTarget, ClassifierTargetTypedDict +from .classifiertrainingparameters import ( + ClassifierTrainingParameters, + ClassifierTrainingParametersTypedDict, +) +from .completiontrainingparameters import ( + CompletionTrainingParameters, + CompletionTrainingParametersTypedDict, +) +from .creategithubrepositoryrequest import ( + CreateGithubRepositoryRequest, + CreateGithubRepositoryRequestTypedDict, +) +from .finetuneablemodeltype import FineTuneableModelType +from .trainingfile import TrainingFile, TrainingFileTypedDict +from .wandbintegration import WandbIntegration, WandbIntegrationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +CreateFineTuningJobRequestIntegrationTypedDict = WandbIntegrationTypedDict + + +CreateFineTuningJobRequestIntegration = WandbIntegration + + +HyperparametersTypedDict = TypeAliasType( + "HyperparametersTypedDict", + Union[ClassifierTrainingParametersTypedDict, CompletionTrainingParametersTypedDict], +) + + +Hyperparameters = TypeAliasType( + "Hyperparameters", Union[ClassifierTrainingParameters, CompletionTrainingParameters] +) + + +CreateFineTuningJobRequestRepositoryTypedDict = CreateGithubRepositoryRequestTypedDict + + +CreateFineTuningJobRequestRepository = CreateGithubRepositoryRequest + + +class CreateFineTuningJobRequestTypedDict(TypedDict): + model: str + hyperparameters: HyperparametersTypedDict + training_files: NotRequired[List[TrainingFileTypedDict]] + validation_files: NotRequired[Nullable[List[str]]] + r"""A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files.""" + suffix: NotRequired[Nullable[str]] + r"""A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...`""" + integrations: NotRequired[ + Nullable[List[CreateFineTuningJobRequestIntegrationTypedDict]] + ] + r"""A list of integrations to enable for your fine-tuning job.""" + auto_start: NotRequired[bool] + r"""This field will be required in a future release.""" + invalid_sample_skip_percentage: NotRequired[float] + job_type: NotRequired[Nullable[FineTuneableModelType]] + repositories: NotRequired[ + Nullable[List[CreateFineTuningJobRequestRepositoryTypedDict]] + ] + classifier_targets: NotRequired[Nullable[List[ClassifierTargetTypedDict]]] + + +class CreateFineTuningJobRequest(BaseModel): + model: str + + hyperparameters: Hyperparameters + + training_files: Optional[List[TrainingFile]] = None + + validation_files: OptionalNullable[List[str]] = UNSET + r"""A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files.""" + + suffix: OptionalNullable[str] = UNSET + r"""A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...`""" + + integrations: OptionalNullable[List[CreateFineTuningJobRequestIntegration]] = UNSET + r"""A list of integrations to enable for your fine-tuning job.""" + + auto_start: Optional[bool] = None + r"""This field will be required in a future release.""" + + invalid_sample_skip_percentage: Optional[float] = 0 + + job_type: OptionalNullable[FineTuneableModelType] = UNSET + + repositories: OptionalNullable[List[CreateFineTuningJobRequestRepository]] = UNSET + + classifier_targets: OptionalNullable[List[ClassifierTarget]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "training_files", + "validation_files", + "suffix", + "integrations", + "auto_start", + "invalid_sample_skip_percentage", + "job_type", + "repositories", + "classifier_targets", + ] + ) + nullable_fields = set( + [ + "validation_files", + "suffix", + "integrations", + "job_type", + "repositories", + "classifier_targets", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/creategithubrepositoryrequest.py b/src/mistralai/client/models/creategithubrepositoryrequest.py new file mode 100644 index 00000000..a3f6cd61 --- /dev/null +++ b/src/mistralai/client/models/creategithubrepositoryrequest.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0814afcf63bb + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateGithubRepositoryRequestTypedDict(TypedDict): + name: str + owner: str + token: str + type: Literal["github"] + ref: NotRequired[Nullable[str]] + weight: NotRequired[float] + + +class CreateGithubRepositoryRequest(BaseModel): + name: str + + owner: str + + token: str + + type: Annotated[ + Annotated[Literal["github"], AfterValidator(validate_const("github"))], + pydantic.Field(alias="type"), + ] = "github" + + ref: OptionalNullable[str] = UNSET + + weight: Optional[float] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ref", "weight"]) + nullable_fields = set(["ref"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CreateGithubRepositoryRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/createingestionpipelineconfigurationrequest.py b/src/mistralai/client/models/createingestionpipelineconfigurationrequest.py new file mode 100644 index 00000000..068c8db9 --- /dev/null +++ b/src/mistralai/client/models/createingestionpipelineconfigurationrequest.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 480f219c27e5 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Dict +from typing_extensions import NotRequired, TypedDict + + +class CreateIngestionPipelineConfigurationRequestTypedDict(TypedDict): + name: str + pipeline_composition: NotRequired[Nullable[Dict[str, str]]] + + +class CreateIngestionPipelineConfigurationRequest(BaseModel): + name: str + + pipeline_composition: OptionalNullable[Dict[str, str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["pipeline_composition"]) + nullable_fields = set(["pipeline_composition"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/createjudgerequest.py b/src/mistralai/client/models/createjudgerequest.py new file mode 100644 index 00000000..7c30aa5f --- /dev/null +++ b/src/mistralai/client/models/createjudgerequest.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e606837a626e + +from __future__ import annotations +from .judgeclassificationoutput import ( + JudgeClassificationOutput, + JudgeClassificationOutputTypedDict, +) +from .judgeregressionoutput import JudgeRegressionOutput, JudgeRegressionOutputTypedDict +from mistralai.client.types import BaseModel +from pydantic import Field +from typing import List, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +CreateJudgeRequestOutputTypedDict = TypeAliasType( + "CreateJudgeRequestOutputTypedDict", + Union[JudgeClassificationOutputTypedDict, JudgeRegressionOutputTypedDict], +) + + +CreateJudgeRequestOutput = Annotated[ + Union[JudgeClassificationOutput, JudgeRegressionOutput], Field(discriminator="type") +] + + +class CreateJudgeRequestTypedDict(TypedDict): + name: str + description: str + model_name: str + output: CreateJudgeRequestOutputTypedDict + instructions: str + tools: List[str] + + +class CreateJudgeRequest(BaseModel): + name: str + + description: str + + model_name: str + + output: CreateJudgeRequestOutput + + instructions: str + + tools: List[str] diff --git a/src/mistralai/client/models/createlibraryrequest.py b/src/mistralai/client/models/createlibraryrequest.py new file mode 100644 index 00000000..e0357e92 --- /dev/null +++ b/src/mistralai/client/models/createlibraryrequest.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1c489bec2f53 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Literal +from typing_extensions import NotRequired, TypedDict + + +OwnerType = Literal[ + "User", + "Workspace", +] + + +class CreateLibraryRequestTypedDict(TypedDict): + name: str + description: NotRequired[Nullable[str]] + chunk_size: NotRequired[Nullable[int]] + r"""The size of the chunks (in characters) to split document text into. Must be between 256 and 32768.""" + owner_type: NotRequired[Nullable[OwnerType]] + r"""Determines who owns the created library. 'User' creates a private library accessible only to its owner. 'Workspace' creates a library shared with the workspace. Defaults to 'Workspace' for API key sessions. Only API keys with the 'Private and shared connectors' connector access scope can create private, user-owned libraries.""" + + +class CreateLibraryRequest(BaseModel): + name: str + + description: OptionalNullable[str] = UNSET + + chunk_size: OptionalNullable[int] = UNSET + r"""The size of the chunks (in characters) to split document text into. Must be between 256 and 32768.""" + + owner_type: OptionalNullable[OwnerType] = UNSET + r"""Determines who owns the created library. 'User' creates a private library accessible only to its owner. 'Workspace' creates a library shared with the workspace. Defaults to 'Workspace' for API key sessions. Only API keys with the 'Private and shared connectors' connector access scope can create private, user-owned libraries.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "chunk_size", "owner_type"]) + nullable_fields = set(["description", "chunk_size", "owner_type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/credentialscreateorupdate.py b/src/mistralai/client/models/credentialscreateorupdate.py new file mode 100644 index 00000000..0766a4d3 --- /dev/null +++ b/src/mistralai/client/models/credentialscreateorupdate.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9927546f2487 + +from __future__ import annotations +from .connectioncredentials import ConnectionCredentials, ConnectionCredentialsTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class CredentialsCreateOrUpdateTypedDict(TypedDict): + r"""Request to create or update non-OAuth2 credentials for a connector.""" + + name: str + r"""Name of the credentials. Use this name to access or modify your credentials.""" + is_default: NotRequired[Nullable[bool]] + r"""Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged.""" + credentials: NotRequired[Nullable[ConnectionCredentialsTypedDict]] + r"""The credential data (headers, bearer_token).""" + + +class CredentialsCreateOrUpdate(BaseModel): + r"""Request to create or update non-OAuth2 credentials for a connector.""" + + name: str + r"""Name of the credentials. Use this name to access or modify your credentials.""" + + is_default: OptionalNullable[bool] = UNSET + r"""Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged.""" + + credentials: OptionalNullable[ConnectionCredentials] = UNSET + r"""The credential data (headers, bearer_token).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["is_default", "credentials"]) + nullable_fields = set(["is_default", "credentials"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/credentialsresponse.py b/src/mistralai/client/models/credentialsresponse.py new file mode 100644 index 00000000..5cf9a198 --- /dev/null +++ b/src/mistralai/client/models/credentialsresponse.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 80cc6fb316f9 + +from __future__ import annotations +from .authenticationconfiguration import ( + AuthenticationConfiguration, + AuthenticationConfigurationTypedDict, +) +from .outboundauthenticationtype import OutboundAuthenticationType +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class CredentialsResponseTypedDict(TypedDict): + credentials: List[AuthenticationConfigurationTypedDict] + connector_preset_credentials_for_auth: NotRequired[List[OutboundAuthenticationType]] + + +class CredentialsResponse(BaseModel): + credentials: List[AuthenticationConfiguration] + + connector_preset_credentials_for_auth: Optional[ + List[OutboundAuthenticationType] + ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["connector_preset_credentials_for_auth"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/customconnector.py b/src/mistralai/client/models/customconnector.py new file mode 100644 index 00000000..f3a1e2ff --- /dev/null +++ b/src/mistralai/client/models/customconnector.py @@ -0,0 +1,108 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 14f3643f7703 + +from __future__ import annotations +from .apikeyauth import APIKeyAuth, APIKeyAuthTypedDict +from .oauth2tokenauth import OAuth2TokenAuth, OAuth2TokenAuthTypedDict +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +from functools import partial +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +from mistralai.client.utils.unions import parse_open_union +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator, BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +AuthorizationTypedDict = TypeAliasType( + "AuthorizationTypedDict", Union[OAuth2TokenAuthTypedDict, APIKeyAuthTypedDict] +) + + +class UnknownAuthorization(BaseModel): + r"""A Authorization variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_AUTHORIZATION_VARIANTS: dict[str, Any] = { + "api-key": APIKeyAuth, + "oauth2-token": OAuth2TokenAuth, +} + + +Authorization = Annotated[ + Union[APIKeyAuth, OAuth2TokenAuth, UnknownAuthorization], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_AUTHORIZATION_VARIANTS, + unknown_cls=UnknownAuthorization, + union_name="Authorization", + ) + ), +] + + +class CustomConnectorTypedDict(TypedDict): + connector_id: str + type: Literal["connector"] + authorization: NotRequired[Nullable[AuthorizationTypedDict]] + tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] + + +class CustomConnector(BaseModel): + connector_id: str + + type: Annotated[ + Annotated[Literal["connector"], AfterValidator(validate_const("connector"))], + pydantic.Field(alias="type"), + ] = "connector" + + authorization: OptionalNullable[Authorization] = UNSET + + tool_configuration: OptionalNullable[ToolConfiguration] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["authorization", "tool_configuration"]) + nullable_fields = set(["authorization", "tool_configuration"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CustomConnector.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/customtaskcanceledattributes.py b/src/mistralai/client/models/customtaskcanceledattributes.py new file mode 100644 index 00000000..cea2137e --- /dev/null +++ b/src/mistralai/client/models/customtaskcanceledattributes.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c20b8be67b8c + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class CustomTaskCanceledAttributesTypedDict(TypedDict): + r"""Attributes for custom task canceled events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + reason: NotRequired[Nullable[str]] + r"""Optional reason provided for the cancellation.""" + + +class CustomTaskCanceledAttributes(BaseModel): + r"""Attributes for custom task canceled events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + + reason: OptionalNullable[str] = UNSET + r"""Optional reason provided for the cancellation.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["reason"]) + nullable_fields = set(["reason"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/customtaskcanceledresponse.py b/src/mistralai/client/models/customtaskcanceledresponse.py new file mode 100644 index 00000000..7873b3ca --- /dev/null +++ b/src/mistralai/client/models/customtaskcanceledresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0eeb9d6cf409 + +from __future__ import annotations +from .customtaskcanceledattributes import ( + CustomTaskCanceledAttributes, + CustomTaskCanceledAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class CustomTaskCanceledResponseTypedDict(TypedDict): + r"""Emitted when a custom task is canceled. + + Indicates the task was explicitly stopped before completion. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: CustomTaskCanceledAttributesTypedDict + r"""Attributes for custom task canceled events.""" + event_type: Literal["CUSTOM_TASK_CANCELED"] + r"""Event type discriminator.""" + + +class CustomTaskCanceledResponse(BaseModel): + r"""Emitted when a custom task is canceled. + + Indicates the task was explicitly stopped before completion. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: CustomTaskCanceledAttributes + r"""Attributes for custom task canceled events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["CUSTOM_TASK_CANCELED"]], + AfterValidator(validate_const("CUSTOM_TASK_CANCELED")), + ], + pydantic.Field(alias="event_type"), + ] = "CUSTOM_TASK_CANCELED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CustomTaskCanceledResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/customtaskcompletedattributesresponse.py b/src/mistralai/client/models/customtaskcompletedattributesresponse.py new file mode 100644 index 00000000..afd48d76 --- /dev/null +++ b/src/mistralai/client/models/customtaskcompletedattributesresponse.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0b9fb891f354 + +from __future__ import annotations +from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class CustomTaskCompletedAttributesResponseTypedDict(TypedDict): + r"""Attributes for custom task completed events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + payload: JSONPayloadResponseTypedDict + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + +class CustomTaskCompletedAttributesResponse(BaseModel): + r"""Attributes for custom task completed events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + + payload: JSONPayloadResponse + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ diff --git a/src/mistralai/client/models/customtaskcompletedresponse.py b/src/mistralai/client/models/customtaskcompletedresponse.py new file mode 100644 index 00000000..5d2a8686 --- /dev/null +++ b/src/mistralai/client/models/customtaskcompletedresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 719b68571f4c + +from __future__ import annotations +from .customtaskcompletedattributesresponse import ( + CustomTaskCompletedAttributesResponse, + CustomTaskCompletedAttributesResponseTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class CustomTaskCompletedResponseTypedDict(TypedDict): + r"""Emitted when a custom task completes successfully. + + Contains the final result of the task execution. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: CustomTaskCompletedAttributesResponseTypedDict + r"""Attributes for custom task completed events.""" + event_type: Literal["CUSTOM_TASK_COMPLETED"] + r"""Event type discriminator.""" + + +class CustomTaskCompletedResponse(BaseModel): + r"""Emitted when a custom task completes successfully. + + Contains the final result of the task execution. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: CustomTaskCompletedAttributesResponse + r"""Attributes for custom task completed events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["CUSTOM_TASK_COMPLETED"]], + AfterValidator(validate_const("CUSTOM_TASK_COMPLETED")), + ], + pydantic.Field(alias="event_type"), + ] = "CUSTOM_TASK_COMPLETED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CustomTaskCompletedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/customtaskfailedattributes.py b/src/mistralai/client/models/customtaskfailedattributes.py new file mode 100644 index 00000000..b66d7d3c --- /dev/null +++ b/src/mistralai/client/models/customtaskfailedattributes.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ff33698df363 + +from __future__ import annotations +from .failure import Failure, FailureTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class CustomTaskFailedAttributesTypedDict(TypedDict): + r"""Attributes for custom task failed events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + failure: FailureTypedDict + r"""Represents an error or exception that occurred during execution.""" + + +class CustomTaskFailedAttributes(BaseModel): + r"""Attributes for custom task failed events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + + failure: Failure + r"""Represents an error or exception that occurred during execution.""" diff --git a/src/mistralai/client/models/customtaskfailedresponse.py b/src/mistralai/client/models/customtaskfailedresponse.py new file mode 100644 index 00000000..1f9835ec --- /dev/null +++ b/src/mistralai/client/models/customtaskfailedresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1cde7920833f + +from __future__ import annotations +from .customtaskfailedattributes import ( + CustomTaskFailedAttributes, + CustomTaskFailedAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class CustomTaskFailedResponseTypedDict(TypedDict): + r"""Emitted when a custom task fails. + + Contains details about the failure for debugging and error handling. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: CustomTaskFailedAttributesTypedDict + r"""Attributes for custom task failed events.""" + event_type: Literal["CUSTOM_TASK_FAILED"] + r"""Event type discriminator.""" + + +class CustomTaskFailedResponse(BaseModel): + r"""Emitted when a custom task fails. + + Contains details about the failure for debugging and error handling. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: CustomTaskFailedAttributes + r"""Attributes for custom task failed events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["CUSTOM_TASK_FAILED"]], + AfterValidator(validate_const("CUSTOM_TASK_FAILED")), + ], + pydantic.Field(alias="event_type"), + ] = "CUSTOM_TASK_FAILED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CustomTaskFailedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/customtaskinprogressattributesresponse.py b/src/mistralai/client/models/customtaskinprogressattributesresponse.py new file mode 100644 index 00000000..45ee5e42 --- /dev/null +++ b/src/mistralai/client/models/customtaskinprogressattributesresponse.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 895147a1a6a8 + +from __future__ import annotations +from .jsonpatchpayloadresponse import ( + JSONPatchPayloadResponse, + JSONPatchPayloadResponseTypedDict, +) +from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +PayloadTypedDict = TypeAliasType( + "PayloadTypedDict", + Union[JSONPayloadResponseTypedDict, JSONPatchPayloadResponseTypedDict], +) +r"""The current state or incremental update for the task.""" + + +class UnknownPayload(BaseModel): + r"""A Payload variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_PAYLOAD_VARIANTS: dict[str, Any] = { + "json": JSONPayloadResponse, + "json_patch": JSONPatchPayloadResponse, +} + + +Payload = Annotated[ + Union[JSONPayloadResponse, JSONPatchPayloadResponse, UnknownPayload], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_PAYLOAD_VARIANTS, + unknown_cls=UnknownPayload, + union_name="Payload", + ) + ), +] +r"""The current state or incremental update for the task.""" + + +class CustomTaskInProgressAttributesResponseTypedDict(TypedDict): + r"""Attributes for custom task in-progress events with streaming updates.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + payload: PayloadTypedDict + r"""The current state or incremental update for the task.""" + + +class CustomTaskInProgressAttributesResponse(BaseModel): + r"""Attributes for custom task in-progress events with streaming updates.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + + payload: Payload + r"""The current state or incremental update for the task.""" diff --git a/src/mistralai/client/models/customtaskinprogressresponse.py b/src/mistralai/client/models/customtaskinprogressresponse.py new file mode 100644 index 00000000..33c126f7 --- /dev/null +++ b/src/mistralai/client/models/customtaskinprogressresponse.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9d012ecb7626 + +from __future__ import annotations +from .customtaskinprogressattributesresponse import ( + CustomTaskInProgressAttributesResponse, + CustomTaskInProgressAttributesResponseTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class CustomTaskInProgressResponseTypedDict(TypedDict): + r"""Emitted during custom task execution to report progress. + + This event supports streaming updates via JSON or JSON Patch payloads, + enabling real-time progress tracking for long-running tasks. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: CustomTaskInProgressAttributesResponseTypedDict + r"""Attributes for custom task in-progress events with streaming updates.""" + event_type: Literal["CUSTOM_TASK_IN_PROGRESS"] + r"""Event type discriminator.""" + + +class CustomTaskInProgressResponse(BaseModel): + r"""Emitted during custom task execution to report progress. + + This event supports streaming updates via JSON or JSON Patch payloads, + enabling real-time progress tracking for long-running tasks. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: CustomTaskInProgressAttributesResponse + r"""Attributes for custom task in-progress events with streaming updates.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["CUSTOM_TASK_IN_PROGRESS"]], + AfterValidator(validate_const("CUSTOM_TASK_IN_PROGRESS")), + ], + pydantic.Field(alias="event_type"), + ] = "CUSTOM_TASK_IN_PROGRESS" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CustomTaskInProgressResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/customtaskstartedattributesresponse.py b/src/mistralai/client/models/customtaskstartedattributesresponse.py new file mode 100644 index 00000000..4f53ae8a --- /dev/null +++ b/src/mistralai/client/models/customtaskstartedattributesresponse.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6b8946c77018 + +from __future__ import annotations +from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CustomTaskStartedAttributesResponseTypedDict(TypedDict): + r"""Attributes for custom task started events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + payload: NotRequired[JSONPayloadResponseTypedDict] + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + +class CustomTaskStartedAttributesResponse(BaseModel): + r"""Attributes for custom task started events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + + payload: Optional[JSONPayloadResponse] = None + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["payload"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/customtaskstartedresponse.py b/src/mistralai/client/models/customtaskstartedresponse.py new file mode 100644 index 00000000..59d11fa8 --- /dev/null +++ b/src/mistralai/client/models/customtaskstartedresponse.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 02b330a5292e + +from __future__ import annotations +from .customtaskstartedattributesresponse import ( + CustomTaskStartedAttributesResponse, + CustomTaskStartedAttributesResponseTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class CustomTaskStartedResponseTypedDict(TypedDict): + r"""Emitted when a custom task begins execution. + + Custom tasks represent user-defined units of work within a workflow, + such as LLM calls, API requests, or data processing steps. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: CustomTaskStartedAttributesResponseTypedDict + r"""Attributes for custom task started events.""" + event_type: Literal["CUSTOM_TASK_STARTED"] + r"""Event type discriminator.""" + + +class CustomTaskStartedResponse(BaseModel): + r"""Emitted when a custom task begins execution. + + Custom tasks represent user-defined units of work within a workflow, + such as LLM calls, API requests, or data processing steps. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: CustomTaskStartedAttributesResponse + r"""Attributes for custom task started events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["CUSTOM_TASK_STARTED"]], + AfterValidator(validate_const("CUSTOM_TASK_STARTED")), + ], + pydantic.Field(alias="event_type"), + ] = "CUSTOM_TASK_STARTED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CustomTaskStartedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/customtasktimedoutattributes.py b/src/mistralai/client/models/customtasktimedoutattributes.py new file mode 100644 index 00000000..47517ab1 --- /dev/null +++ b/src/mistralai/client/models/customtasktimedoutattributes.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9cc865098add + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class CustomTaskTimedOutAttributesTypedDict(TypedDict): + r"""Attributes for custom task timed out events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + timeout_type: NotRequired[Nullable[str]] + r"""The type of timeout that occurred.""" + + +class CustomTaskTimedOutAttributes(BaseModel): + r"""Attributes for custom task timed out events.""" + + custom_task_id: str + r"""Unique identifier for the custom task within the workflow.""" + + custom_task_type: str + r"""The type/category of the custom task (e.g., 'llm_call', 'api_request').""" + + timeout_type: OptionalNullable[str] = UNSET + r"""The type of timeout that occurred.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["timeout_type"]) + nullable_fields = set(["timeout_type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/customtasktimedoutresponse.py b/src/mistralai/client/models/customtasktimedoutresponse.py new file mode 100644 index 00000000..7f274a53 --- /dev/null +++ b/src/mistralai/client/models/customtasktimedoutresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2dbbc78b85d1 + +from __future__ import annotations +from .customtasktimedoutattributes import ( + CustomTaskTimedOutAttributes, + CustomTaskTimedOutAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class CustomTaskTimedOutResponseTypedDict(TypedDict): + r"""Emitted when a custom task exceeds its timeout. + + Indicates the task did not complete within its configured time limit. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: CustomTaskTimedOutAttributesTypedDict + r"""Attributes for custom task timed out events.""" + event_type: Literal["CUSTOM_TASK_TIMED_OUT"] + r"""Event type discriminator.""" + + +class CustomTaskTimedOutResponse(BaseModel): + r"""Emitted when a custom task exceeds its timeout. + + Indicates the task did not complete within its configured time limit. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: CustomTaskTimedOutAttributes + r"""Attributes for custom task timed out events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["CUSTOM_TASK_TIMED_OUT"]], + AfterValidator(validate_const("CUSTOM_TASK_TIMED_OUT")), + ], + pydantic.Field(alias="event_type"), + ] = "CUSTOM_TASK_TIMED_OUT" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + CustomTaskTimedOutResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/dataset.py b/src/mistralai/client/models/dataset.py new file mode 100644 index 00000000..08ce979e --- /dev/null +++ b/src/mistralai/client/models/dataset.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cbf14670ee00 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class DatasetTypedDict(TypedDict): + id: str + created_at: datetime + updated_at: datetime + deleted_at: Nullable[datetime] + name: str + description: str + owner_id: str + workspace_id: str + + +class Dataset(BaseModel): + id: str + + created_at: datetime + + updated_at: datetime + + deleted_at: Nullable[datetime] + + name: str + + description: str + + owner_id: str + + workspace_id: str + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/datasetimporttask.py b/src/mistralai/client/models/datasetimporttask.py new file mode 100644 index 00000000..e8d90f12 --- /dev/null +++ b/src/mistralai/client/models/datasetimporttask.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c20f7db9633c + +from __future__ import annotations +from .basetaskstatus import BaseTaskStatus +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class DatasetImportTaskTypedDict(TypedDict): + id: str + created_at: datetime + updated_at: datetime + deleted_at: Nullable[datetime] + creator_id: str + dataset_id: str + workspace_id: str + status: BaseTaskStatus + progress: NotRequired[Nullable[int]] + message: NotRequired[Nullable[str]] + + +class DatasetImportTask(BaseModel): + id: str + + created_at: datetime + + updated_at: datetime + + deleted_at: Nullable[datetime] + + creator_id: str + + dataset_id: str + + workspace_id: str + + status: BaseTaskStatus + + progress: OptionalNullable[int] = UNSET + + message: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["progress", "message"]) + nullable_fields = set(["deleted_at", "progress", "message"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/datasetpreview.py b/src/mistralai/client/models/datasetpreview.py new file mode 100644 index 00000000..90676245 --- /dev/null +++ b/src/mistralai/client/models/datasetpreview.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 128c29db3f37 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class DatasetPreviewTypedDict(TypedDict): + id: str + created_at: datetime + updated_at: datetime + deleted_at: Nullable[datetime] + name: str + description: str + owner_id: str + workspace_id: str + + +class DatasetPreview(BaseModel): + id: str + + created_at: datetime + + updated_at: datetime + + deleted_at: Nullable[datetime] + + name: str + + description: str + + owner_id: str + + workspace_id: str + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/datasetrecord.py b/src/mistralai/client/models/datasetrecord.py new file mode 100644 index 00000000..39c92cce --- /dev/null +++ b/src/mistralai/client/models/datasetrecord.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 87ddebf2a0ce + +from __future__ import annotations +from .conversationpayload import ConversationPayload, ConversationPayloadTypedDict +from .conversationsource import ConversationSource +from datetime import datetime +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import TypedDict + + +class DatasetRecordTypedDict(TypedDict): + id: str + created_at: datetime + updated_at: datetime + deleted_at: Nullable[datetime] + dataset_id: str + payload: ConversationPayloadTypedDict + properties: Dict[str, Any] + source: ConversationSource + + +class DatasetRecord(BaseModel): + id: str + + created_at: datetime + + updated_at: datetime + + deleted_at: Nullable[datetime] + + dataset_id: str + + payload: ConversationPayload + + properties: Dict[str, Any] + + source: ConversationSource + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/delete_campaign_v1_observability_campaigns_campaign_id_deleteop.py b/src/mistralai/client/models/delete_campaign_v1_observability_campaigns_campaign_id_deleteop.py new file mode 100644 index 00000000..f33a3747 --- /dev/null +++ b/src/mistralai/client/models/delete_campaign_v1_observability_campaigns_campaign_id_deleteop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3d1cd35fecc6 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequestTypedDict(TypedDict): + campaign_id: str + + +class DeleteCampaignV1ObservabilityCampaignsCampaignIDDeleteRequest(BaseModel): + campaign_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/delete_dataset_record_v1_observability_dataset_records_dataset_record_id_deleteop.py b/src/mistralai/client/models/delete_dataset_record_v1_observability_dataset_records_dataset_record_id_deleteop.py new file mode 100644 index 00000000..ffeefca6 --- /dev/null +++ b/src/mistralai/client/models/delete_dataset_record_v1_observability_dataset_records_dataset_record_id_deleteop.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 66b2054bda8c + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequestTypedDict( + TypedDict +): + dataset_record_id: str + + +class DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequest( + BaseModel +): + dataset_record_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/delete_dataset_v1_observability_datasets_dataset_id_deleteop.py b/src/mistralai/client/models/delete_dataset_v1_observability_datasets_dataset_id_deleteop.py new file mode 100644 index 00000000..af869770 --- /dev/null +++ b/src/mistralai/client/models/delete_dataset_v1_observability_datasets_dataset_id_deleteop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 446419cd07d2 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequestTypedDict(TypedDict): + dataset_id: str + + +class DeleteDatasetV1ObservabilityDatasetsDatasetIDDeleteRequest(BaseModel): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/delete_judge_v1_observability_judges_judge_id_deleteop.py b/src/mistralai/client/models/delete_judge_v1_observability_judges_judge_id_deleteop.py new file mode 100644 index 00000000..c2f7b797 --- /dev/null +++ b/src/mistralai/client/models/delete_judge_v1_observability_judges_judge_id_deleteop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 415724e139bd + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequestTypedDict(TypedDict): + judge_id: str + + +class DeleteJudgeV1ObservabilityJudgesJudgeIDDeleteRequest(BaseModel): + judge_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/models/delete_model_v1_models_model_id_deleteop.py b/src/mistralai/client/models/delete_model_v1_models_model_id_deleteop.py similarity index 77% rename from src/mistralai/models/delete_model_v1_models_model_id_deleteop.py rename to src/mistralai/client/models/delete_model_v1_models_model_id_deleteop.py index 4acb8d53..199614f5 100644 --- a/src/mistralai/models/delete_model_v1_models_model_id_deleteop.py +++ b/src/mistralai/client/models/delete_model_v1_models_model_id_deleteop.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 767aba526e43 from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/delete_voice_v1_audio_voices_voice_id_deleteop.py b/src/mistralai/client/models/delete_voice_v1_audio_voices_voice_id_deleteop.py new file mode 100644 index 00000000..3ce38364 --- /dev/null +++ b/src/mistralai/client/models/delete_voice_v1_audio_voices_voice_id_deleteop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a84ce12a8251 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class DeleteVoiceV1AudioVoicesVoiceIDDeleteRequestTypedDict(TypedDict): + voice_id: str + + +class DeleteVoiceV1AudioVoicesVoiceIDDeleteRequest(BaseModel): + voice_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/deletebatchjobresponse.py b/src/mistralai/client/models/deletebatchjobresponse.py new file mode 100644 index 00000000..958f0c4f --- /dev/null +++ b/src/mistralai/client/models/deletebatchjobresponse.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 79a43aab6cf9 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DeleteBatchJobResponseTypedDict(TypedDict): + id: str + object: Literal["batch"] + deleted: NotRequired[bool] + + +class DeleteBatchJobResponse(BaseModel): + id: str + + object: Annotated[ + Annotated[Optional[Literal["batch"]], AfterValidator(validate_const("batch"))], + pydantic.Field(alias="object"), + ] = "batch" + + deleted: Optional[bool] = True + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "deleted"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + DeleteBatchJobResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/deletedatasetrecordsrequest.py b/src/mistralai/client/models/deletedatasetrecordsrequest.py new file mode 100644 index 00000000..8c33a963 --- /dev/null +++ b/src/mistralai/client/models/deletedatasetrecordsrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e7ef16596e54 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class DeleteDatasetRecordsRequestTypedDict(TypedDict): + dataset_record_ids: List[str] + + +class DeleteDatasetRecordsRequest(BaseModel): + dataset_record_ids: List[str] diff --git a/src/mistralai/client/models/deletefileresponse.py b/src/mistralai/client/models/deletefileresponse.py new file mode 100644 index 00000000..ffd0e0d0 --- /dev/null +++ b/src/mistralai/client/models/deletefileresponse.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3ee464763a32 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class DeleteFileResponseTypedDict(TypedDict): + id: str + r"""The ID of the deleted file.""" + object: str + r"""The object type that was deleted""" + deleted: bool + r"""The deletion status.""" + + +class DeleteFileResponse(BaseModel): + id: str + r"""The ID of the deleted file.""" + + object: str + r"""The object type that was deleted""" + + deleted: bool + r"""The deletion status.""" diff --git a/src/mistralai/client/models/deletemodelresponse.py b/src/mistralai/client/models/deletemodelresponse.py new file mode 100644 index 00000000..1e65e08f --- /dev/null +++ b/src/mistralai/client/models/deletemodelresponse.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8957175b7482 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class DeleteModelResponseTypedDict(TypedDict): + id: str + r"""The ID of the deleted model.""" + object: NotRequired[str] + r"""The object type that was deleted.""" + deleted: NotRequired[bool] + r"""The deletion status.""" + + +class DeleteModelResponse(BaseModel): + id: str + r"""The ID of the deleted model.""" + + object: Optional[str] = "model" + r"""The object type that was deleted.""" + + deleted: Optional[bool] = True + r"""The deletion status.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "deleted"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/deltamessage.py b/src/mistralai/client/models/deltamessage.py new file mode 100644 index 00000000..f0ca3282 --- /dev/null +++ b/src/mistralai/client/models/deltamessage.py @@ -0,0 +1,80 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 68f53d67a140 + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from .toolcall import ToolCall, ToolCallTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, List, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +DeltaMessageContentTypedDict = TypeAliasType( + "DeltaMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +DeltaMessageContent = TypeAliasType( + "DeltaMessageContent", Union[str, List[ContentChunk]] +) + + +class DeltaMessageTypedDict(TypedDict): + role: NotRequired[Nullable[str]] + content: NotRequired[Nullable[DeltaMessageContentTypedDict]] + tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] + tool_call_id: NotRequired[Nullable[str]] + index: NotRequired[Nullable[int]] + r"""If the completion returns multiple messages, this is to specify which message this delta is for.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + + +class DeltaMessage(BaseModel): + role: OptionalNullable[str] = UNSET + + content: OptionalNullable[DeltaMessageContent] = UNSET + + tool_calls: OptionalNullable[List[ToolCall]] = UNSET + + tool_call_id: OptionalNullable[str] = UNSET + + index: OptionalNullable[int] = UNSET + r"""If the completion returns multiple messages, this is to specify which message this delta is for.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["role", "content", "tool_calls", "tool_call_id", "index", "metadata"] + ) + nullable_fields = set( + ["role", "content", "tool_calls", "tool_call_id", "index", "metadata"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/deploymentdetailresponse.py b/src/mistralai/client/models/deploymentdetailresponse.py new file mode 100644 index 00000000..6bf22812 --- /dev/null +++ b/src/mistralai/client/models/deploymentdetailresponse.py @@ -0,0 +1,85 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7f4a17a1c7ca + +from __future__ import annotations +from .deploymentlocation import DeploymentLocation, DeploymentLocationTypedDict +from .deploymentworkerresponse import ( + DeploymentWorkerResponse, + DeploymentWorkerResponseTypedDict, +) +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class DeploymentDetailResponseTypedDict(TypedDict): + id: str + r"""Unique identifier of the deployment""" + name: str + r"""Deployment name""" + is_active: bool + r"""Whether at least one worker is currently live""" + created_at: datetime + r"""When the deployment was first registered""" + updated_at: datetime + r"""When the deployment was last updated""" + workers: List[DeploymentWorkerResponseTypedDict] + r"""Workers registered for the deployment""" + location: NotRequired[Nullable[DeploymentLocationTypedDict]] + r"""Where the deployment is running""" + + +class DeploymentDetailResponse(BaseModel): + id: str + r"""Unique identifier of the deployment""" + + name: str + r"""Deployment name""" + + is_active: bool + r"""Whether at least one worker is currently live""" + + created_at: datetime + r"""When the deployment was first registered""" + + updated_at: datetime + r"""When the deployment was last updated""" + + workers: List[DeploymentWorkerResponse] + r"""Workers registered for the deployment""" + + location: OptionalNullable[DeploymentLocation] = UNSET + r"""Where the deployment is running""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["location"]) + nullable_fields = set(["location"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/deploymentlistresponse.py b/src/mistralai/client/models/deploymentlistresponse.py new file mode 100644 index 00000000..7926cde7 --- /dev/null +++ b/src/mistralai/client/models/deploymentlistresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1f0b404ba621 + +from __future__ import annotations +from .deploymentresponse import DeploymentResponse, DeploymentResponseTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class DeploymentListResponseTypedDict(TypedDict): + deployments: List[DeploymentResponseTypedDict] + r"""List of deployments""" + + +class DeploymentListResponse(BaseModel): + deployments: List[DeploymentResponse] + r"""List of deployments""" diff --git a/src/mistralai/client/models/deploymentlocation.py b/src/mistralai/client/models/deploymentlocation.py new file mode 100644 index 00000000..52ce7993 --- /dev/null +++ b/src/mistralai/client/models/deploymentlocation.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c62839f1466c + +from __future__ import annotations +from .locationtype import LocationType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class DeploymentLocationTypedDict(TypedDict): + location_type: LocationType + k8s_cluster: NotRequired[Nullable[str]] + r"""K8s cluster name, if applicable""" + k8s_namespace: NotRequired[Nullable[str]] + r"""K8s namespace, if applicable""" + + +class DeploymentLocation(BaseModel): + location_type: LocationType + + k8s_cluster: OptionalNullable[str] = UNSET + r"""K8s cluster name, if applicable""" + + k8s_namespace: OptionalNullable[str] = UNSET + r"""K8s namespace, if applicable""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["k8s_cluster", "k8s_namespace"]) + nullable_fields = set(["k8s_cluster", "k8s_namespace"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/deploymentresponse.py b/src/mistralai/client/models/deploymentresponse.py new file mode 100644 index 00000000..0e316849 --- /dev/null +++ b/src/mistralai/client/models/deploymentresponse.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ea15ddd64402 + +from __future__ import annotations +from .deploymentlocation import DeploymentLocation, DeploymentLocationTypedDict +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class DeploymentResponseTypedDict(TypedDict): + id: str + r"""Unique identifier of the deployment""" + name: str + r"""Deployment name""" + is_active: bool + r"""Whether at least one worker is currently live""" + created_at: datetime + r"""When the deployment was first registered""" + updated_at: datetime + r"""When the deployment was last updated""" + location: NotRequired[Nullable[DeploymentLocationTypedDict]] + r"""Where the deployment is running""" + + +class DeploymentResponse(BaseModel): + id: str + r"""Unique identifier of the deployment""" + + name: str + r"""Deployment name""" + + is_active: bool + r"""Whether at least one worker is currently live""" + + created_at: datetime + r"""When the deployment was first registered""" + + updated_at: datetime + r"""When the deployment was last updated""" + + location: OptionalNullable[DeploymentLocation] = UNSET + r"""Where the deployment is running""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["location"]) + nullable_fields = set(["location"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/deploymentworkerresponse.py b/src/mistralai/client/models/deploymentworkerresponse.py new file mode 100644 index 00000000..2955dc48 --- /dev/null +++ b/src/mistralai/client/models/deploymentworkerresponse.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b11a9947bd19 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class DeploymentWorkerResponseTypedDict(TypedDict): + name: str + r"""Worker name""" + created_at: datetime + r"""When the worker first registered""" + updated_at: datetime + r"""When the worker last registered""" + is_active: bool + r"""Whether this worker's liveness key is currently alive""" + + +class DeploymentWorkerResponse(BaseModel): + name: str + r"""Worker name""" + + created_at: datetime + r"""When the worker first registered""" + + updated_at: datetime + r"""When the worker last registered""" + + is_active: bool + r"""Whether this worker's liveness key is currently alive""" diff --git a/src/mistralai/client/models/document.py b/src/mistralai/client/models/document.py new file mode 100644 index 00000000..8d1aea88 --- /dev/null +++ b/src/mistralai/client/models/document.py @@ -0,0 +1,131 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fbbf7428328c + +from __future__ import annotations +from .processstatus import ProcessStatus +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class DocumentTypedDict(TypedDict): + id: str + library_id: str + hash: Nullable[str] + mime_type: Nullable[str] + extension: Nullable[str] + size: Nullable[int] + name: str + created_at: datetime + process_status: ProcessStatus + uploaded_by_id: Nullable[str] + uploaded_by_type: str + processing_status: str + tokens_processing_total: int + summary: NotRequired[Nullable[str]] + last_processed_at: NotRequired[Nullable[datetime]] + number_of_pages: NotRequired[Nullable[int]] + tokens_processing_main_content: NotRequired[Nullable[int]] + tokens_processing_summary: NotRequired[Nullable[int]] + url: NotRequired[Nullable[str]] + attributes: NotRequired[Nullable[Dict[str, Any]]] + + +class Document(BaseModel): + id: str + + library_id: str + + hash: Nullable[str] + + mime_type: Nullable[str] + + extension: Nullable[str] + + size: Nullable[int] + + name: str + + created_at: datetime + + process_status: ProcessStatus + + uploaded_by_id: Nullable[str] + + uploaded_by_type: str + + processing_status: str + + tokens_processing_total: int + + summary: OptionalNullable[str] = UNSET + + last_processed_at: OptionalNullable[datetime] = UNSET + + number_of_pages: OptionalNullable[int] = UNSET + + tokens_processing_main_content: OptionalNullable[int] = UNSET + + tokens_processing_summary: OptionalNullable[int] = UNSET + + url: OptionalNullable[str] = UNSET + + attributes: OptionalNullable[Dict[str, Any]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "summary", + "last_processed_at", + "number_of_pages", + "tokens_processing_main_content", + "tokens_processing_summary", + "url", + "attributes", + ] + ) + nullable_fields = set( + [ + "hash", + "mime_type", + "extension", + "size", + "summary", + "last_processed_at", + "number_of_pages", + "uploaded_by_id", + "tokens_processing_main_content", + "tokens_processing_summary", + "url", + "attributes", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/documentlibrarytool.py b/src/mistralai/client/models/documentlibrarytool.py new file mode 100644 index 00000000..29f8d64a --- /dev/null +++ b/src/mistralai/client/models/documentlibrarytool.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3eb3c218f457 + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DocumentLibraryToolTypedDict(TypedDict): + library_ids: List[str] + r"""Ids of the library in which to search.""" + tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] + type: Literal["document_library"] + + +class DocumentLibraryTool(BaseModel): + library_ids: List[str] + r"""Ids of the library in which to search.""" + + tool_configuration: OptionalNullable[ToolConfiguration] = UNSET + + type: Annotated[ + Annotated[ + Literal["document_library"], + AfterValidator(validate_const("document_library")), + ], + pydantic.Field(alias="type"), + ] = "document_library" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_configuration"]) + nullable_fields = set(["tool_configuration"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + DocumentLibraryTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/models/documenttextcontent.py b/src/mistralai/client/models/documenttextcontent.py similarity index 77% rename from src/mistralai/models/documenttextcontent.py rename to src/mistralai/client/models/documenttextcontent.py index c02528c2..b6904cb4 100644 --- a/src/mistralai/models/documenttextcontent.py +++ b/src/mistralai/client/models/documenttextcontent.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e730005e44cb from __future__ import annotations -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel from typing_extensions import TypedDict diff --git a/src/mistralai/client/models/documenturlchunk.py b/src/mistralai/client/models/documenturlchunk.py new file mode 100644 index 00000000..f7a99ff8 --- /dev/null +++ b/src/mistralai/client/models/documenturlchunk.py @@ -0,0 +1,70 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4309807f6048 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DocumentURLChunkTypedDict(TypedDict): + document_url: str + type: Literal["document_url"] + document_name: NotRequired[Nullable[str]] + r"""The filename of the document""" + + +class DocumentURLChunk(BaseModel): + document_url: str + + type: Annotated[ + Annotated[ + Optional[Literal["document_url"]], + AfterValidator(validate_const("document_url")), + ], + pydantic.Field(alias="type"), + ] = "document_url" + + document_name: OptionalNullable[str] = UNSET + r"""The filename of the document""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "document_name"]) + nullable_fields = set(["document_name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + DocumentURLChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/embeddedresource.py b/src/mistralai/client/models/embeddedresource.py new file mode 100644 index 00000000..e16fedf8 --- /dev/null +++ b/src/mistralai/client/models/embeddedresource.py @@ -0,0 +1,110 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 94a23f656f72 + +from __future__ import annotations +from .annotations import Annotations, AnnotationsTypedDict +from .blobresourcecontents import BlobResourceContents, BlobResourceContentsTypedDict +from .textresourcecontents import TextResourceContents, TextResourceContentsTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ResourceTypedDict = TypeAliasType( + "ResourceTypedDict", + Union[TextResourceContentsTypedDict, BlobResourceContentsTypedDict], +) + + +Resource = TypeAliasType("Resource", Union[TextResourceContents, BlobResourceContents]) + + +class EmbeddedResourceTypedDict(TypedDict): + r"""The contents of a resource, embedded into a prompt or tool call result. + + It is up to the client how best to render embedded resources for the benefit + of the LLM and/or the user. + """ + + resource: ResourceTypedDict + type: Literal["resource"] + annotations: NotRequired[Nullable[AnnotationsTypedDict]] + meta: NotRequired[Nullable[Dict[str, Any]]] + + +class EmbeddedResource(BaseModel): + r"""The contents of a resource, embedded into a prompt or tool call result. + + It is up to the client how best to render embedded resources for the benefit + of the LLM and/or the user. + """ + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + resource: Resource + + type: Annotated[ + Annotated[Literal["resource"], AfterValidator(validate_const("resource"))], + pydantic.Field(alias="type"), + ] = "resource" + + annotations: OptionalNullable[Annotations] = UNSET + + meta: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["annotations", "_meta"]) + nullable_fields = set(["annotations", "_meta"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + EmbeddedResource.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/embeddingdtype.py b/src/mistralai/client/models/embeddingdtype.py new file mode 100644 index 00000000..732c4ebe --- /dev/null +++ b/src/mistralai/client/models/embeddingdtype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 77f9526a78df + +from __future__ import annotations +from typing import Literal + + +EmbeddingDtype = Literal[ + "float", + "int8", + "uint8", + "binary", + "ubinary", +] diff --git a/src/mistralai/client/models/embeddingrequest.py b/src/mistralai/client/models/embeddingrequest.py new file mode 100644 index 00000000..2ef747d8 --- /dev/null +++ b/src/mistralai/client/models/embeddingrequest.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: eadbe3f9040c + +from __future__ import annotations +from .embeddingdtype import EmbeddingDtype +from .encodingformat import EncodingFormat +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +EmbeddingRequestInputsTypedDict = TypeAliasType( + "EmbeddingRequestInputsTypedDict", Union[str, List[str]] +) +r"""Text to embed.""" + + +EmbeddingRequestInputs = TypeAliasType("EmbeddingRequestInputs", Union[str, List[str]]) +r"""Text to embed.""" + + +class EmbeddingRequestTypedDict(TypedDict): + model: str + r"""ID of the model to use.""" + inputs: EmbeddingRequestInputsTypedDict + r"""Text to embed.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + output_dimension: NotRequired[Nullable[int]] + r"""The dimension of the output embeddings when feature available. If not provided, a default output dimension will be used.""" + output_dtype: NotRequired[EmbeddingDtype] + encoding_format: NotRequired[EncodingFormat] + + +class EmbeddingRequest(BaseModel): + model: str + r"""ID of the model to use.""" + + inputs: Annotated[EmbeddingRequestInputs, pydantic.Field(alias="input")] + r"""Text to embed.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + output_dimension: OptionalNullable[int] = UNSET + r"""The dimension of the output embeddings when feature available. If not provided, a default output dimension will be used.""" + + output_dtype: Optional[EmbeddingDtype] = None + + encoding_format: Optional[EncodingFormat] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["metadata", "output_dimension", "output_dtype", "encoding_format"] + ) + nullable_fields = set(["metadata", "output_dimension"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + EmbeddingRequest.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/models/embeddingresponse.py b/src/mistralai/client/models/embeddingresponse.py similarity index 89% rename from src/mistralai/models/embeddingresponse.py rename to src/mistralai/client/models/embeddingresponse.py index aae6fa60..6ffd6894 100644 --- a/src/mistralai/models/embeddingresponse.py +++ b/src/mistralai/client/models/embeddingresponse.py @@ -1,9 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f7d790e84b65 from __future__ import annotations from .embeddingresponsedata import EmbeddingResponseData, EmbeddingResponseDataTypedDict from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel from typing import List from typing_extensions import TypedDict diff --git a/src/mistralai/client/models/embeddingresponsedata.py b/src/mistralai/client/models/embeddingresponsedata.py new file mode 100644 index 00000000..03b23a7c --- /dev/null +++ b/src/mistralai/client/models/embeddingresponsedata.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6d6ead6f3803 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class EmbeddingResponseDataTypedDict(TypedDict): + object: NotRequired[str] + embedding: NotRequired[List[float]] + index: NotRequired[int] + + +class EmbeddingResponseData(BaseModel): + object: Optional[str] = None + + embedding: Optional[List[float]] = None + + index: Optional[int] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "embedding", "index"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/encodedpayloadoptions.py b/src/mistralai/client/models/encodedpayloadoptions.py new file mode 100644 index 00000000..cc19b543 --- /dev/null +++ b/src/mistralai/client/models/encodedpayloadoptions.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 97955ebc2eb9 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +EncodedPayloadOptions = Union[ + Literal[ + "offloaded", + "encrypted", + "encrypted-partial", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/encodingformat.py b/src/mistralai/client/models/encodingformat.py new file mode 100644 index 00000000..4a39d029 --- /dev/null +++ b/src/mistralai/client/models/encodingformat.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b51ec296cc92 + +from __future__ import annotations +from typing import Literal + + +EncodingFormat = Literal[ + "float", + "base64", +] diff --git a/src/mistralai/client/models/entitytype.py b/src/mistralai/client/models/entitytype.py new file mode 100644 index 00000000..56d82cbe --- /dev/null +++ b/src/mistralai/client/models/entitytype.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 62d6a6a13288 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +EntityType = Union[ + Literal[ + "User", + "Workspace", + "Org", + ], + UnrecognizedStr, +] +r"""The type of entity, used to share a library.""" diff --git a/src/mistralai/client/models/event.py b/src/mistralai/client/models/event.py new file mode 100644 index 00000000..01157dfa --- /dev/null +++ b/src/mistralai/client/models/event.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e5a68ac2dd57 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class EventTypedDict(TypedDict): + name: str + r"""The name of the event.""" + created_at: int + r"""The UNIX timestamp (in seconds) of the event.""" + data: NotRequired[Nullable[Dict[str, Any]]] + + +class Event(BaseModel): + name: str + r"""The name of the event.""" + + created_at: int + r"""The UNIX timestamp (in seconds) of the event.""" + + data: OptionalNullable[Dict[str, Any]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["data"]) + nullable_fields = set(["data"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/eventprogressstatus.py b/src/mistralai/client/models/eventprogressstatus.py new file mode 100644 index 00000000..6fde1c39 --- /dev/null +++ b/src/mistralai/client/models/eventprogressstatus.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 48623263df72 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +EventProgressStatus = Union[ + Literal[ + "RUNNING", + "COMPLETED", + "FAILED", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/eventsource.py b/src/mistralai/client/models/eventsource.py new file mode 100644 index 00000000..1959cdec --- /dev/null +++ b/src/mistralai/client/models/eventsource.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8b926028b7b2 + +from __future__ import annotations +from typing import Literal + + +EventSource = Literal[ + "DATABASE", + "LIVE", + "HYBRID", +] diff --git a/src/mistralai/client/models/eventtype.py b/src/mistralai/client/models/eventtype.py new file mode 100644 index 00000000..a85321b2 --- /dev/null +++ b/src/mistralai/client/models/eventtype.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f70686df1fa5 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +EventType = Union[ + Literal[ + "EVENT", + "EVENT_PROGRESS", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop.py b/src/mistralai/client/models/execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop.py new file mode 100644 index 00000000..2e79ef25 --- /dev/null +++ b/src/mistralai/client/models/execute_workflow_registration_v1_workflows_registrations_workflow_registration_id_execute_postop.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3e2249825144 + +from __future__ import annotations +from .workflowexecutionrequest import ( + WorkflowExecutionRequest, + WorkflowExecutionRequestTypedDict, +) +from .workflowexecutionresponse import ( + WorkflowExecutionResponse, + WorkflowExecutionResponseTypedDict, +) +from .workflowexecutionsyncresponse import ( + WorkflowExecutionSyncResponse, + WorkflowExecutionSyncResponseTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing import Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequestTypedDict( + TypedDict +): + workflow_registration_id: str + workflow_execution_request: WorkflowExecutionRequestTypedDict + + +class ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequest( + BaseModel +): + workflow_registration_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + workflow_execution_request: Annotated[ + WorkflowExecutionRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostTypedDict = TypeAliasType( + "ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostTypedDict", + Union[WorkflowExecutionSyncResponseTypedDict, WorkflowExecutionResponseTypedDict], +) +r"""Successful Response""" + + +ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost = TypeAliasType( + "ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost", + Union[WorkflowExecutionSyncResponse, WorkflowExecutionResponse], +) +r"""Successful Response""" diff --git a/src/mistralai/client/models/execute_workflow_v1_workflows_workflow_identifier_execute_postop.py b/src/mistralai/client/models/execute_workflow_v1_workflows_workflow_identifier_execute_postop.py new file mode 100644 index 00000000..bd9496a2 --- /dev/null +++ b/src/mistralai/client/models/execute_workflow_v1_workflows_workflow_identifier_execute_postop.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5da876c66fc5 + +from __future__ import annotations +from .workflowexecutionrequest import ( + WorkflowExecutionRequest, + WorkflowExecutionRequestTypedDict, +) +from .workflowexecutionresponse import ( + WorkflowExecutionResponse, + WorkflowExecutionResponseTypedDict, +) +from .workflowexecutionsyncresponse import ( + WorkflowExecutionSyncResponse, + WorkflowExecutionSyncResponseTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing import Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequestTypedDict( + TypedDict +): + workflow_identifier: str + workflow_execution_request: WorkflowExecutionRequestTypedDict + + +class ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequest(BaseModel): + workflow_identifier: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + workflow_execution_request: Annotated[ + WorkflowExecutionRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostTypedDict = ( + TypeAliasType( + "ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostTypedDict", + Union[ + WorkflowExecutionSyncResponseTypedDict, WorkflowExecutionResponseTypedDict + ], + ) +) +r"""Successful Response""" + + +ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost = TypeAliasType( + "ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost", + Union[WorkflowExecutionSyncResponse, WorkflowExecutionResponse], +) +r"""Successful Response""" diff --git a/src/mistralai/client/models/executionconfig.py b/src/mistralai/client/models/executionconfig.py new file mode 100644 index 00000000..56b58ae3 --- /dev/null +++ b/src/mistralai/client/models/executionconfig.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 14518c40a13b + +from __future__ import annotations +from mistralai.client.types import BaseModel +import pydantic +from pydantic import ConfigDict +from typing import Any, Dict +from typing_extensions import TypedDict + + +class ExecutionConfigTypedDict(TypedDict): + r"""Not typed since mcp config can changed / not stable + we allow all extra fields and this is a dict + TODO: once mcp is stable, we need to type this + """ + + type: str + + +class ExecutionConfig(BaseModel): + r"""Not typed since mcp config can changed / not stable + we allow all extra fields and this is a dict + TODO: once mcp is stable, we need to type this + """ + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + type: str + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/src/mistralai/client/models/export_dataset_to_jsonl_v1_observability_datasets_dataset_id_exports_to_jsonl_getop.py b/src/mistralai/client/models/export_dataset_to_jsonl_v1_observability_datasets_dataset_id_exports_to_jsonl_getop.py new file mode 100644 index 00000000..07b4e58f --- /dev/null +++ b/src/mistralai/client/models/export_dataset_to_jsonl_v1_observability_datasets_dataset_id_exports_to_jsonl_getop.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 74f5f3183b64 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequestTypedDict( + TypedDict +): + dataset_id: str + + +class ExportDatasetToJsonlV1ObservabilityDatasetsDatasetIDExportsToJsonlGetRequest( + BaseModel +): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/exportdatasetresponse.py b/src/mistralai/client/models/exportdatasetresponse.py new file mode 100644 index 00000000..f1600cac --- /dev/null +++ b/src/mistralai/client/models/exportdatasetresponse.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 22cc29d258db + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ExportDatasetResponseTypedDict(TypedDict): + file_url: str + + +class ExportDatasetResponse(BaseModel): + file_url: str diff --git a/src/mistralai/client/models/failure.py b/src/mistralai/client/models/failure.py new file mode 100644 index 00000000..85ca77a5 --- /dev/null +++ b/src/mistralai/client/models/failure.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 596e38493eaa + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class FailureTypedDict(TypedDict): + r"""Represents an error or exception that occurred during execution.""" + + message: str + r"""A human-readable description of the failure.""" + + +class Failure(BaseModel): + r"""Represents an error or exception that occurred during execution.""" + + message: str + r"""A human-readable description of the failure.""" diff --git a/src/mistralai/client/models/feedresultchatcompletioneventpreview.py b/src/mistralai/client/models/feedresultchatcompletioneventpreview.py new file mode 100644 index 00000000..bf248758 --- /dev/null +++ b/src/mistralai/client/models/feedresultchatcompletioneventpreview.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 19109368b436 + +from __future__ import annotations +from .chatcompletioneventpreview import ( + ChatCompletionEventPreview, + ChatCompletionEventPreviewTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class FeedResultChatCompletionEventPreviewTypedDict(TypedDict): + results: NotRequired[List[ChatCompletionEventPreviewTypedDict]] + next: NotRequired[Nullable[str]] + cursor: NotRequired[Nullable[str]] + + +class FeedResultChatCompletionEventPreview(BaseModel): + results: Optional[List[ChatCompletionEventPreview]] = None + + next: OptionalNullable[str] = UNSET + + cursor: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "next", "cursor"]) + nullable_fields = set(["next", "cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/fetchcampaignstatusresponse.py b/src/mistralai/client/models/fetchcampaignstatusresponse.py new file mode 100644 index 00000000..6004892e --- /dev/null +++ b/src/mistralai/client/models/fetchcampaignstatusresponse.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b74b57603a4c + +from __future__ import annotations +from .basetaskstatus import BaseTaskStatus +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class FetchCampaignStatusResponseTypedDict(TypedDict): + status: BaseTaskStatus + + +class FetchCampaignStatusResponse(BaseModel): + status: BaseTaskStatus diff --git a/src/mistralai/client/models/fetchchatcompletionfieldoptionsresponse.py b/src/mistralai/client/models/fetchchatcompletionfieldoptionsresponse.py new file mode 100644 index 00000000..92c29e22 --- /dev/null +++ b/src/mistralai/client/models/fetchchatcompletionfieldoptionsresponse.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2191cab4638b + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +OptionTypedDict = TypeAliasType("OptionTypedDict", Union[str, bool]) + + +Option = TypeAliasType("Option", Union[str, bool]) + + +class FetchChatCompletionFieldOptionsResponseTypedDict(TypedDict): + options: NotRequired[Nullable[List[Nullable[OptionTypedDict]]]] + + +class FetchChatCompletionFieldOptionsResponse(BaseModel): + options: OptionalNullable[List[Nullable[Option]]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["options"]) + nullable_fields = set(["options"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/fetchfieldoptioncountsrequest.py b/src/mistralai/client/models/fetchfieldoptioncountsrequest.py new file mode 100644 index 00000000..e310f660 --- /dev/null +++ b/src/mistralai/client/models/fetchfieldoptioncountsrequest.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2fd8caa0697d + +from __future__ import annotations +from .filterpayload import FilterPayload, FilterPayloadTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class FetchFieldOptionCountsRequestTypedDict(TypedDict): + filter_params: NotRequired[Nullable[FilterPayloadTypedDict]] + + +class FetchFieldOptionCountsRequest(BaseModel): + filter_params: OptionalNullable[FilterPayload] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["filter_params"]) + nullable_fields = set(["filter_params"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/fetchfieldoptioncountsresponse.py b/src/mistralai/client/models/fetchfieldoptioncountsresponse.py new file mode 100644 index 00000000..4c9f9d0f --- /dev/null +++ b/src/mistralai/client/models/fetchfieldoptioncountsresponse.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 16ce9431fc7b + +from __future__ import annotations +from .fieldoptioncountitem import FieldOptionCountItem, FieldOptionCountItemTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class FetchFieldOptionCountsResponseTypedDict(TypedDict): + counts: List[FieldOptionCountItemTypedDict] + + +class FetchFieldOptionCountsResponse(BaseModel): + counts: List[FieldOptionCountItem] diff --git a/src/mistralai/client/models/fieldgroup.py b/src/mistralai/client/models/fieldgroup.py new file mode 100644 index 00000000..07f9e7c7 --- /dev/null +++ b/src/mistralai/client/models/fieldgroup.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 201353e45f89 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class FieldGroupTypedDict(TypedDict): + name: str + label: str + + +class FieldGroup(BaseModel): + name: str + + label: str diff --git a/src/mistralai/client/models/fieldoptioncountitem.py b/src/mistralai/client/models/fieldoptioncountitem.py new file mode 100644 index 00000000..0b50c148 --- /dev/null +++ b/src/mistralai/client/models/fieldoptioncountitem.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5b707a343930 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class FieldOptionCountItemTypedDict(TypedDict): + value: str + count: int + + +class FieldOptionCountItem(BaseModel): + value: str + + count: int diff --git a/src/mistralai/client/models/file.py b/src/mistralai/client/models/file.py new file mode 100644 index 00000000..528bc13a --- /dev/null +++ b/src/mistralai/client/models/file.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f972c39edfcf + +from __future__ import annotations +import io +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, MultipartFormMetadata +import pydantic +from pydantic import model_serializer +from typing import IO, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class FileTypedDict(TypedDict): + file_name: str + content: Union[bytes, IO[bytes], io.BufferedReader] + content_type: NotRequired[str] + + +class File(BaseModel): + file_name: Annotated[ + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) + ] + + content: Annotated[ + Union[bytes, IO[bytes], io.BufferedReader], + pydantic.Field(alias=""), + FieldMetadata(multipart=MultipartFormMetadata(content=True)), + ] + + content_type: Annotated[ + Optional[str], + pydantic.Field(alias="Content-Type"), + FieldMetadata(multipart=True), + ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["contentType"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/filechunk.py b/src/mistralai/client/models/filechunk.py new file mode 100644 index 00000000..6c9c8b0e --- /dev/null +++ b/src/mistralai/client/models/filechunk.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ff3c2d33ab1e + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class FileChunkTypedDict(TypedDict): + file_id: str + type: Literal["file"] + + +class FileChunk(BaseModel): + file_id: str + + type: Annotated[ + Annotated[Optional[Literal["file"]], AfterValidator(validate_const("file"))], + pydantic.Field(alias="type"), + ] = "file" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + FileChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/filepurpose.py b/src/mistralai/client/models/filepurpose.py new file mode 100644 index 00000000..49a5568f --- /dev/null +++ b/src/mistralai/client/models/filepurpose.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a11e7f9f2d45 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +FilePurpose = Union[ + Literal[ + "fine-tune", + "batch", + "ocr", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/files_api_routes_delete_fileop.py b/src/mistralai/client/models/files_api_routes_delete_fileop.py new file mode 100644 index 00000000..eaba274b --- /dev/null +++ b/src/mistralai/client/models/files_api_routes_delete_fileop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2f385cc6138f + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class FilesAPIRoutesDeleteFileRequestTypedDict(TypedDict): + file_id: str + + +class FilesAPIRoutesDeleteFileRequest(BaseModel): + file_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/files_api_routes_download_fileop.py b/src/mistralai/client/models/files_api_routes_download_fileop.py new file mode 100644 index 00000000..83de8e73 --- /dev/null +++ b/src/mistralai/client/models/files_api_routes_download_fileop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8184ee3577c3 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class FilesAPIRoutesDownloadFileRequestTypedDict(TypedDict): + file_id: str + + +class FilesAPIRoutesDownloadFileRequest(BaseModel): + file_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/files_api_routes_get_signed_urlop.py b/src/mistralai/client/models/files_api_routes_get_signed_urlop.py new file mode 100644 index 00000000..c381244b --- /dev/null +++ b/src/mistralai/client/models/files_api_routes_get_signed_urlop.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0a1a18c6431e + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class FilesAPIRoutesGetSignedURLRequestTypedDict(TypedDict): + file_id: str + expiry: NotRequired[int] + r"""Number of hours before the URL becomes invalid. Defaults to 24h. Must be between 1h and 168h.""" + + +class FilesAPIRoutesGetSignedURLRequest(BaseModel): + file_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + expiry: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 24 + r"""Number of hours before the URL becomes invalid. Defaults to 24h. Must be between 1h and 168h.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["expiry"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/files_api_routes_list_filesop.py b/src/mistralai/client/models/files_api_routes_list_filesop.py new file mode 100644 index 00000000..e18eaa6a --- /dev/null +++ b/src/mistralai/client/models/files_api_routes_list_filesop.py @@ -0,0 +1,109 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b2e92f2a29b4 + +from __future__ import annotations +from .filepurpose import FilePurpose +from .sampletype import SampleType +from .source import Source +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class FilesAPIRoutesListFilesRequestTypedDict(TypedDict): + page: NotRequired[int] + page_size: NotRequired[int] + include_total: NotRequired[bool] + sample_type: NotRequired[Nullable[List[SampleType]]] + source: NotRequired[Nullable[List[Source]]] + search: NotRequired[Nullable[str]] + purpose: NotRequired[Nullable[FilePurpose]] + mimetypes: NotRequired[Nullable[List[str]]] + + +class FilesAPIRoutesListFilesRequest(BaseModel): + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + + include_total: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + + sample_type: Annotated[ + OptionalNullable[List[SampleType]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + source: Annotated[ + OptionalNullable[List[Source]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + search: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + purpose: Annotated[ + OptionalNullable[FilePurpose], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + mimetypes: Annotated[ + OptionalNullable[List[str]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "page", + "page_size", + "include_total", + "sample_type", + "source", + "search", + "purpose", + "mimetypes", + ] + ) + nullable_fields = set( + ["sample_type", "source", "search", "purpose", "mimetypes"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/files_api_routes_retrieve_fileop.py b/src/mistralai/client/models/files_api_routes_retrieve_fileop.py new file mode 100644 index 00000000..5f8de05f --- /dev/null +++ b/src/mistralai/client/models/files_api_routes_retrieve_fileop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5d5dbb8d5f7a + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class FilesAPIRoutesRetrieveFileRequestTypedDict(TypedDict): + file_id: str + + +class FilesAPIRoutesRetrieveFileRequest(BaseModel): + file_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/files_api_routes_upload_fileop.py b/src/mistralai/client/models/files_api_routes_upload_fileop.py new file mode 100644 index 00000000..25efcff2 --- /dev/null +++ b/src/mistralai/client/models/files_api_routes_upload_fileop.py @@ -0,0 +1,87 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f13b84de6fa7 + +from __future__ import annotations +from .file import File, FileTypedDict +from .filepurpose import FilePurpose +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, MultipartFormMetadata +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +FilesAPIRoutesUploadFileFileVisibility = Literal[ + "workspace", + "user", +] + + +class MultiPartBodyParamsTypedDict(TypedDict): + file: FileTypedDict + r"""The File object (not file name) to be uploaded. + To upload a file and specify a custom file name you should format your request as such: + ```bash + file=@path/to/your/file.jsonl;filename=custom_name.jsonl + ``` + Otherwise, you can just keep the original file name: + ```bash + file=@path/to/your/file.jsonl + ``` + """ + expiry: NotRequired[Nullable[int]] + visibility: NotRequired[FilesAPIRoutesUploadFileFileVisibility] + purpose: NotRequired[FilePurpose] + + +class MultiPartBodyParams(BaseModel): + file: Annotated[File, FieldMetadata(multipart=MultipartFormMetadata(file=True))] + r"""The File object (not file name) to be uploaded. + To upload a file and specify a custom file name you should format your request as such: + ```bash + file=@path/to/your/file.jsonl;filename=custom_name.jsonl + ``` + Otherwise, you can just keep the original file name: + ```bash + file=@path/to/your/file.jsonl + ``` + """ + + expiry: Annotated[OptionalNullable[int], FieldMetadata(multipart=True)] = UNSET + + visibility: Annotated[ + Optional[FilesAPIRoutesUploadFileFileVisibility], FieldMetadata(multipart=True) + ] = "workspace" + + purpose: Annotated[Optional[FilePurpose], FieldMetadata(multipart=True)] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["expiry", "visibility", "purpose"]) + nullable_fields = set(["expiry"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/fileschema.py b/src/mistralai/client/models/fileschema.py new file mode 100644 index 00000000..ce64a16b --- /dev/null +++ b/src/mistralai/client/models/fileschema.py @@ -0,0 +1,107 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 19cde41ca32a + +from __future__ import annotations +from .filepurpose import FilePurpose +from .filevisibility import FileVisibility +from .sampletype import SampleType +from .source import Source +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class FileSchemaTypedDict(TypedDict): + id: str + r"""The unique identifier of the file.""" + object: str + r"""The object type, which is always \"file\".""" + size_bytes: int + r"""The size of the file, in bytes.""" + created_at: int + r"""The UNIX timestamp (in seconds) of the event.""" + filename: str + r"""The name of the uploaded file.""" + purpose: FilePurpose + sample_type: SampleType + source: Source + num_lines: NotRequired[Nullable[int]] + mimetype: NotRequired[Nullable[str]] + signature: NotRequired[Nullable[str]] + expires_at: NotRequired[Nullable[int]] + visibility: NotRequired[Nullable[FileVisibility]] + + +class FileSchema(BaseModel): + id: str + r"""The unique identifier of the file.""" + + object: str + r"""The object type, which is always \"file\".""" + + size_bytes: Annotated[int, pydantic.Field(alias="bytes")] + r"""The size of the file, in bytes.""" + + created_at: int + r"""The UNIX timestamp (in seconds) of the event.""" + + filename: str + r"""The name of the uploaded file.""" + + purpose: FilePurpose + + sample_type: SampleType + + source: Source + + num_lines: OptionalNullable[int] = UNSET + + mimetype: OptionalNullable[str] = UNSET + + signature: OptionalNullable[str] = UNSET + + expires_at: OptionalNullable[int] = UNSET + + visibility: OptionalNullable[FileVisibility] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["num_lines", "mimetype", "signature", "expires_at", "visibility"] + ) + nullable_fields = set( + ["num_lines", "mimetype", "signature", "expires_at", "visibility"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + FileSchema.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/filevisibility.py b/src/mistralai/client/models/filevisibility.py new file mode 100644 index 00000000..56cfe881 --- /dev/null +++ b/src/mistralai/client/models/filevisibility.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 11a670fa3b71 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +FileVisibility = Union[ + Literal[ + "workspace", + "user", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/filtercondition.py b/src/mistralai/client/models/filtercondition.py new file mode 100644 index 00000000..fe62d6dd --- /dev/null +++ b/src/mistralai/client/models/filtercondition.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ba62f90873c5 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UnrecognizedStr +from typing import Any, Literal, Union +from typing_extensions import TypedDict + + +Op = Union[ + Literal[ + "lt", + "lte", + "gt", + "gte", + "startswith", + "istartswith", + "endswith", + "iendswith", + "contains", + "icontains", + "matches", + "notcontains", + "inotcontains", + "eq", + "neq", + "isnull", + "includes", + "excludes", + "len_eq", + ], + UnrecognizedStr, +] + + +class FilterConditionTypedDict(TypedDict): + field: str + op: Op + value: Any + + +class FilterCondition(BaseModel): + field: str + + op: Op + + value: Any diff --git a/src/mistralai/client/models/filtergroup.py b/src/mistralai/client/models/filtergroup.py new file mode 100644 index 00000000..4e9815b7 --- /dev/null +++ b/src/mistralai/client/models/filtergroup.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: dbc0c34fbc2f + +from __future__ import annotations +from .filtercondition import FilterCondition, FilterConditionTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +class FilterGroupTypedDict(TypedDict): + and_: NotRequired[Nullable[List[AndTypedDict]]] + or_: NotRequired[Nullable[List[OrTypedDict]]] + + +class FilterGroup(BaseModel): + and_: Annotated[OptionalNullable[List[And]], pydantic.Field(alias="AND")] = UNSET + + or_: Annotated[OptionalNullable[List[Or]], pydantic.Field(alias="OR")] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["AND", "OR"]) + nullable_fields = set(["AND", "OR"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +OrTypedDict = TypeAliasType( + "OrTypedDict", Union["FilterGroupTypedDict", FilterConditionTypedDict] +) + + +Or = TypeAliasType("Or", Union["FilterGroup", FilterCondition]) + + +AndTypedDict = TypeAliasType( + "AndTypedDict", Union["FilterGroupTypedDict", FilterConditionTypedDict] +) + + +And = TypeAliasType("And", Union["FilterGroup", FilterCondition]) + + +try: + FilterGroup.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/filterpayload.py b/src/mistralai/client/models/filterpayload.py new file mode 100644 index 00000000..ced355f1 --- /dev/null +++ b/src/mistralai/client/models/filterpayload.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 56757b849f7a + +from __future__ import annotations +from .filtercondition import FilterCondition, FilterConditionTypedDict +from .filtergroup import FilterGroup, FilterGroupTypedDict +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Union +from typing_extensions import TypeAliasType, TypedDict + + +FiltersTypedDict = TypeAliasType( + "FiltersTypedDict", Union[FilterGroupTypedDict, FilterConditionTypedDict] +) + + +Filters = TypeAliasType("Filters", Union[FilterGroup, FilterCondition]) + + +class FilterPayloadTypedDict(TypedDict): + filters: Nullable[FiltersTypedDict] + + +class FilterPayload(BaseModel): + filters: Nullable[Filters] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/fimcompletionrequest.py b/src/mistralai/client/models/fimcompletionrequest.py new file mode 100644 index 00000000..65d132ea --- /dev/null +++ b/src/mistralai/client/models/fimcompletionrequest.py @@ -0,0 +1,137 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cf3558adc3ab + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +FIMCompletionRequestStopTypedDict = TypeAliasType( + "FIMCompletionRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +FIMCompletionRequestStop = TypeAliasType( + "FIMCompletionRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +class FIMCompletionRequestTypedDict(TypedDict): + model: str + r"""ID of the model with FIM to use.""" + prompt: str + r"""The text/code to complete.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[Nullable[float]] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + stop: NotRequired[Nullable[FIMCompletionRequestStopTypedDict]] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + suffix: NotRequired[Nullable[str]] + r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" + min_tokens: NotRequired[Nullable[int]] + r"""The minimum number of tokens to generate in the completion.""" + prompt_cache_key: NotRequired[Nullable[str]] + + +class FIMCompletionRequest(BaseModel): + model: str + r"""ID of the model with FIM to use.""" + + prompt: str + r"""The text/code to complete.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: OptionalNullable[float] = UNSET + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = False + r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" + + stop: OptionalNullable[FIMCompletionRequestStop] = UNSET + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + suffix: OptionalNullable[str] = UNSET + r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" + + min_tokens: OptionalNullable[int] = UNSET + r"""The minimum number of tokens to generate in the completion.""" + + prompt_cache_key: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "suffix", + "min_tokens", + "prompt_cache_key", + ] + ) + nullable_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stop", + "random_seed", + "metadata", + "suffix", + "min_tokens", + "prompt_cache_key", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/fimcompletionresponse.py b/src/mistralai/client/models/fimcompletionresponse.py new file mode 100644 index 00000000..1345a116 --- /dev/null +++ b/src/mistralai/client/models/fimcompletionresponse.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b860d2ba771e + +from __future__ import annotations +from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class FIMCompletionResponseTypedDict(TypedDict): + id: str + object: str + model: str + usage: UsageInfoTypedDict + created: int + choices: List[ChatCompletionChoiceTypedDict] + + +class FIMCompletionResponse(BaseModel): + id: str + + object: str + + model: str + + usage: UsageInfo + + created: int + + choices: List[ChatCompletionChoice] diff --git a/src/mistralai/client/models/fimcompletionstreamrequest.py b/src/mistralai/client/models/fimcompletionstreamrequest.py new file mode 100644 index 00000000..dc7ede38 --- /dev/null +++ b/src/mistralai/client/models/fimcompletionstreamrequest.py @@ -0,0 +1,135 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1d1ee09f1913 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +FIMCompletionStreamRequestStopTypedDict = TypeAliasType( + "FIMCompletionStreamRequestStopTypedDict", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +FIMCompletionStreamRequestStop = TypeAliasType( + "FIMCompletionStreamRequestStop", Union[str, List[str]] +) +r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + +class FIMCompletionStreamRequestTypedDict(TypedDict): + model: str + r"""ID of the model with FIM to use.""" + prompt: str + r"""The text/code to complete.""" + temperature: NotRequired[Nullable[float]] + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + top_p: NotRequired[Nullable[float]] + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + max_tokens: NotRequired[Nullable[int]] + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + stream: NotRequired[bool] + stop: NotRequired[Nullable[FIMCompletionStreamRequestStopTypedDict]] + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + random_seed: NotRequired[Nullable[int]] + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + suffix: NotRequired[Nullable[str]] + r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" + min_tokens: NotRequired[Nullable[int]] + r"""The minimum number of tokens to generate in the completion.""" + prompt_cache_key: NotRequired[Nullable[str]] + + +class FIMCompletionStreamRequest(BaseModel): + model: str + r"""ID of the model with FIM to use.""" + + prompt: str + r"""The text/code to complete.""" + + temperature: OptionalNullable[float] = UNSET + r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" + + top_p: OptionalNullable[float] = UNSET + r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" + + max_tokens: OptionalNullable[int] = UNSET + r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" + + stream: Optional[bool] = True + + stop: OptionalNullable[FIMCompletionStreamRequestStop] = UNSET + r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" + + random_seed: OptionalNullable[int] = UNSET + r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + suffix: OptionalNullable[str] = UNSET + r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" + + min_tokens: OptionalNullable[int] = UNSET + r"""The minimum number of tokens to generate in the completion.""" + + prompt_cache_key: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stream", + "stop", + "random_seed", + "metadata", + "suffix", + "min_tokens", + "prompt_cache_key", + ] + ) + nullable_fields = set( + [ + "temperature", + "top_p", + "max_tokens", + "stop", + "random_seed", + "metadata", + "suffix", + "min_tokens", + "prompt_cache_key", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/finetuneablemodeltype.py b/src/mistralai/client/models/finetuneablemodeltype.py new file mode 100644 index 00000000..7b924bd7 --- /dev/null +++ b/src/mistralai/client/models/finetuneablemodeltype.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 05e097395df3 + +from __future__ import annotations +from typing import Literal + + +FineTuneableModelType = Literal[ + "completion", + "classifier", +] diff --git a/src/mistralai/client/models/finetunedmodelcapabilities.py b/src/mistralai/client/models/finetunedmodelcapabilities.py new file mode 100644 index 00000000..b9ad2f9e --- /dev/null +++ b/src/mistralai/client/models/finetunedmodelcapabilities.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 475c805eab95 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class FineTunedModelCapabilitiesTypedDict(TypedDict): + completion_chat: NotRequired[bool] + completion_fim: NotRequired[bool] + function_calling: NotRequired[bool] + fine_tuning: NotRequired[bool] + classification: NotRequired[bool] + + +class FineTunedModelCapabilities(BaseModel): + completion_chat: Optional[bool] = True + + completion_fim: Optional[bool] = False + + function_calling: Optional[bool] = False + + fine_tuning: Optional[bool] = False + + classification: Optional[bool] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "completion_chat", + "completion_fim", + "function_calling", + "fine_tuning", + "classification", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/ftclassifierlossfunction.py b/src/mistralai/client/models/ftclassifierlossfunction.py new file mode 100644 index 00000000..ccb0f21b --- /dev/null +++ b/src/mistralai/client/models/ftclassifierlossfunction.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d21e2a36ab1f + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +FTClassifierLossFunction = Union[ + Literal[ + "single_class", + "multi_class", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/ftmodelcard.py b/src/mistralai/client/models/ftmodelcard.py new file mode 100644 index 00000000..bb7c52c8 --- /dev/null +++ b/src/mistralai/client/models/ftmodelcard.py @@ -0,0 +1,138 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c4f15eed2ca2 + +from __future__ import annotations +from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class FTModelCardTypedDict(TypedDict): + r"""Extra fields for fine-tuned models.""" + + id: str + capabilities: ModelCapabilitiesTypedDict + r"""This is populated by Harmattan, but some fields have a name + that we don't want to expose in the API. + """ + job: str + root: str + object: NotRequired[str] + created: NotRequired[int] + owned_by: NotRequired[str] + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + max_context_length: NotRequired[int] + aliases: NotRequired[List[str]] + deprecation: NotRequired[Nullable[datetime]] + deprecation_replacement_model: NotRequired[Nullable[str]] + default_model_temperature: NotRequired[Nullable[float]] + type: Literal["fine-tuned"] + archived: NotRequired[bool] + + +class FTModelCard(BaseModel): + r"""Extra fields for fine-tuned models.""" + + id: str + + capabilities: ModelCapabilities + r"""This is populated by Harmattan, but some fields have a name + that we don't want to expose in the API. + """ + + job: str + + root: str + + object: Optional[str] = "model" + + created: Optional[int] = None + + owned_by: Optional[str] = "mistralai" + + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + max_context_length: Optional[int] = 32768 + + aliases: Optional[List[str]] = None + + deprecation: OptionalNullable[datetime] = UNSET + + deprecation_replacement_model: OptionalNullable[str] = UNSET + + default_model_temperature: OptionalNullable[float] = UNSET + + type: Annotated[ + Annotated[Literal["fine-tuned"], AfterValidator(validate_const("fine-tuned"))], + pydantic.Field(alias="type"), + ] = "fine-tuned" + + archived: Optional[bool] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "object", + "created", + "owned_by", + "name", + "description", + "max_context_length", + "aliases", + "deprecation", + "deprecation_replacement_model", + "default_model_temperature", + "archived", + ] + ) + nullable_fields = set( + [ + "name", + "description", + "deprecation", + "deprecation_replacement_model", + "default_model_temperature", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + FTModelCard.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/function.py b/src/mistralai/client/models/function.py new file mode 100644 index 00000000..8a3267e8 --- /dev/null +++ b/src/mistralai/client/models/function.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 32275a9d8fee + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class FunctionTypedDict(TypedDict): + name: str + parameters: Dict[str, Any] + description: NotRequired[str] + strict: NotRequired[bool] + + +class Function(BaseModel): + name: str + + parameters: Dict[str, Any] + + description: Optional[str] = None + + strict: Optional[bool] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "strict"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/functioncall.py b/src/mistralai/client/models/functioncall.py new file mode 100644 index 00000000..527c3ad4 --- /dev/null +++ b/src/mistralai/client/models/functioncall.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 393fca552632 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Any, Dict, Union +from typing_extensions import TypeAliasType, TypedDict + + +ArgumentsTypedDict = TypeAliasType("ArgumentsTypedDict", Union[Dict[str, Any], str]) + + +Arguments = TypeAliasType("Arguments", Union[Dict[str, Any], str]) + + +class FunctionCallTypedDict(TypedDict): + name: str + arguments: ArgumentsTypedDict + + +class FunctionCall(BaseModel): + name: str + + arguments: Arguments diff --git a/src/mistralai/client/models/functioncallentry.py b/src/mistralai/client/models/functioncallentry.py new file mode 100644 index 00000000..a88d87ab --- /dev/null +++ b/src/mistralai/client/models/functioncallentry.py @@ -0,0 +1,124 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cd058446c0aa + +from __future__ import annotations +from .functioncallentryarguments import ( + FunctionCallEntryArguments, + FunctionCallEntryArgumentsTypedDict, +) +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +FunctionCallEntryConfirmationStatus = Union[ + Literal[ + "pending", + "allowed", + "denied", + ], + UnrecognizedStr, +] + + +class FunctionCallEntryTypedDict(TypedDict): + tool_call_id: str + name: str + arguments: FunctionCallEntryArgumentsTypedDict + object: Literal["entry"] + type: Literal["function.call"] + created_at: NotRequired[datetime] + completed_at: NotRequired[Nullable[datetime]] + agent_id: NotRequired[Nullable[str]] + model: NotRequired[Nullable[str]] + id: NotRequired[str] + confirmation_status: NotRequired[Nullable[FunctionCallEntryConfirmationStatus]] + + +class FunctionCallEntry(BaseModel): + tool_call_id: str + + name: str + + arguments: FunctionCallEntryArguments + + object: Annotated[ + Annotated[Optional[Literal["entry"]], AfterValidator(validate_const("entry"))], + pydantic.Field(alias="object"), + ] = "entry" + + type: Annotated[ + Annotated[ + Optional[Literal["function.call"]], + AfterValidator(validate_const("function.call")), + ], + pydantic.Field(alias="type"), + ] = "function.call" + + created_at: Optional[datetime] = None + + completed_at: OptionalNullable[datetime] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + model: OptionalNullable[str] = UNSET + + id: Optional[str] = None + + confirmation_status: OptionalNullable[FunctionCallEntryConfirmationStatus] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "object", + "type", + "created_at", + "completed_at", + "agent_id", + "model", + "id", + "confirmation_status", + ] + ) + nullable_fields = set( + ["completed_at", "agent_id", "model", "confirmation_status"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + FunctionCallEntry.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/models/functioncallentryarguments.py b/src/mistralai/client/models/functioncallentryarguments.py similarity index 93% rename from src/mistralai/models/functioncallentryarguments.py rename to src/mistralai/client/models/functioncallentryarguments.py index ac9e6227..afe81b24 100644 --- a/src/mistralai/models/functioncallentryarguments.py +++ b/src/mistralai/client/models/functioncallentryarguments.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3df3767a7b93 from __future__ import annotations from typing import Any, Dict, Union diff --git a/src/mistralai/client/models/functioncallevent.py b/src/mistralai/client/models/functioncallevent.py new file mode 100644 index 00000000..6e3c0715 --- /dev/null +++ b/src/mistralai/client/models/functioncallevent.py @@ -0,0 +1,103 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 23b120b8f122 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +FunctionCallEventConfirmationStatus = Union[ + Literal[ + "pending", + "allowed", + "denied", + ], + UnrecognizedStr, +] + + +class FunctionCallEventTypedDict(TypedDict): + id: str + name: str + tool_call_id: str + arguments: str + type: Literal["function.call.delta"] + created_at: NotRequired[datetime] + output_index: NotRequired[int] + model: NotRequired[Nullable[str]] + agent_id: NotRequired[Nullable[str]] + confirmation_status: NotRequired[Nullable[FunctionCallEventConfirmationStatus]] + + +class FunctionCallEvent(BaseModel): + id: str + + name: str + + tool_call_id: str + + arguments: str + + type: Annotated[ + Annotated[ + Literal["function.call.delta"], + AfterValidator(validate_const("function.call.delta")), + ], + pydantic.Field(alias="type"), + ] = "function.call.delta" + + created_at: Optional[datetime] = None + + output_index: Optional[int] = 0 + + model: OptionalNullable[str] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + confirmation_status: OptionalNullable[FunctionCallEventConfirmationStatus] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["created_at", "output_index", "model", "agent_id", "confirmation_status"] + ) + nullable_fields = set(["model", "agent_id", "confirmation_status"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + FunctionCallEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/functionname.py b/src/mistralai/client/models/functionname.py new file mode 100644 index 00000000..07d98a0e --- /dev/null +++ b/src/mistralai/client/models/functionname.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 000acafdb0c0 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class FunctionNameTypedDict(TypedDict): + r"""this restriction of `Function` is used to select a specific function to call""" + + name: str + + +class FunctionName(BaseModel): + r"""this restriction of `Function` is used to select a specific function to call""" + + name: str diff --git a/src/mistralai/client/models/functionresultentry.py b/src/mistralai/client/models/functionresultentry.py new file mode 100644 index 00000000..11576522 --- /dev/null +++ b/src/mistralai/client/models/functionresultentry.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 213df39bd5e6 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class FunctionResultEntryTypedDict(TypedDict): + tool_call_id: str + result: str + object: Literal["entry"] + type: Literal["function.result"] + created_at: NotRequired[datetime] + completed_at: NotRequired[Nullable[datetime]] + id: NotRequired[str] + + +class FunctionResultEntry(BaseModel): + tool_call_id: str + + result: str + + object: Annotated[ + Annotated[Optional[Literal["entry"]], AfterValidator(validate_const("entry"))], + pydantic.Field(alias="object"), + ] = "entry" + + type: Annotated[ + Annotated[ + Optional[Literal["function.result"]], + AfterValidator(validate_const("function.result")), + ], + pydantic.Field(alias="type"), + ] = "function.result" + + created_at: Optional[datetime] = None + + completed_at: OptionalNullable[datetime] = UNSET + + id: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "type", "created_at", "completed_at", "id"]) + nullable_fields = set(["completed_at"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + FunctionResultEntry.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/functiontool.py b/src/mistralai/client/models/functiontool.py new file mode 100644 index 00000000..eae87264 --- /dev/null +++ b/src/mistralai/client/models/functiontool.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2e9ef5800117 + +from __future__ import annotations +from .function import Function, FunctionTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class FunctionToolTypedDict(TypedDict): + function: FunctionTypedDict + type: Literal["function"] + + +class FunctionTool(BaseModel): + function: Function + + type: Annotated[ + Annotated[Literal["function"], AfterValidator(validate_const("function"))], + pydantic.Field(alias="type"), + ] = "function" + + +try: + FunctionTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/get_campaign_by_id_v1_observability_campaigns_campaign_id_getop.py b/src/mistralai/client/models/get_campaign_by_id_v1_observability_campaigns_campaign_id_getop.py new file mode 100644 index 00000000..a8446737 --- /dev/null +++ b/src/mistralai/client/models/get_campaign_by_id_v1_observability_campaigns_campaign_id_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 288520184035 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequestTypedDict(TypedDict): + campaign_id: str + + +class GetCampaignByIDV1ObservabilityCampaignsCampaignIDGetRequest(BaseModel): + campaign_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_campaign_selected_events_v1_observability_campaigns_campaign_id_selected_events_getop.py b/src/mistralai/client/models/get_campaign_selected_events_v1_observability_campaigns_campaign_id_selected_events_getop.py new file mode 100644 index 00000000..9db415bf --- /dev/null +++ b/src/mistralai/client/models/get_campaign_selected_events_v1_observability_campaigns_campaign_id_selected_events_getop.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 270800e2c264 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequestTypedDict( + TypedDict +): + campaign_id: str + page_size: NotRequired[int] + page: NotRequired[int] + + +class GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIDSelectedEventsGetRequest( + BaseModel +): + campaign_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_size", "page"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_campaign_status_by_id_v1_observability_campaigns_campaign_id_status_getop.py b/src/mistralai/client/models/get_campaign_status_by_id_v1_observability_campaigns_campaign_id_status_getop.py new file mode 100644 index 00000000..57ac4490 --- /dev/null +++ b/src/mistralai/client/models/get_campaign_status_by_id_v1_observability_campaigns_campaign_id_status_getop.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 853a43ee6b98 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequestTypedDict( + TypedDict +): + campaign_id: str + + +class GetCampaignStatusByIDV1ObservabilityCampaignsCampaignIDStatusGetRequest( + BaseModel +): + campaign_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_campaigns_v1_observability_campaigns_getop.py b/src/mistralai/client/models/get_campaigns_v1_observability_campaigns_getop.py new file mode 100644 index 00000000..4ff0c307 --- /dev/null +++ b/src/mistralai/client/models/get_campaigns_v1_observability_campaigns_getop.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 598a7340fc98 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetCampaignsV1ObservabilityCampaignsGetRequestTypedDict(TypedDict): + page_size: NotRequired[int] + page: NotRequired[int] + q: NotRequired[Nullable[str]] + + +class GetCampaignsV1ObservabilityCampaignsGetRequest(BaseModel): + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + + q: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_size", "page", "q"]) + nullable_fields = set(["q"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_chat_completion_event_v1_observability_chat_completion_events_event_id_getop.py b/src/mistralai/client/models/get_chat_completion_event_v1_observability_chat_completion_events_event_id_getop.py new file mode 100644 index 00000000..f39b0f56 --- /dev/null +++ b/src/mistralai/client/models/get_chat_completion_event_v1_observability_chat_completion_events_event_id_getop.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 98aff68bc7c7 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequestTypedDict( + TypedDict +): + event_id: str + + +class GetChatCompletionEventV1ObservabilityChatCompletionEventsEventIDGetRequest( + BaseModel +): + event_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_chat_completion_events_v1_observability_chat_completion_events_search_postop.py b/src/mistralai/client/models/get_chat_completion_events_v1_observability_chat_completion_events_search_postop.py new file mode 100644 index 00000000..b4af68e0 --- /dev/null +++ b/src/mistralai/client/models/get_chat_completion_events_v1_observability_chat_completion_events_search_postop.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 36957d0f73aa + +from __future__ import annotations +from .searchchatcompletioneventsrequest import ( + SearchChatCompletionEventsRequest, + SearchChatCompletionEventsRequestTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata, RequestMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequestTypedDict( + TypedDict +): + search_chat_completion_events_request: SearchChatCompletionEventsRequestTypedDict + page_size: NotRequired[int] + cursor: NotRequired[Nullable[str]] + + +class GetChatCompletionEventsV1ObservabilityChatCompletionEventsSearchPostRequest( + BaseModel +): + search_chat_completion_events_request: Annotated[ + SearchChatCompletionEventsRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + + cursor: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_size", "cursor"]) + nullable_fields = set(["cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_chat_completion_field_options_counts_v1_observability_chat_completion_fields_field_name_options_counts_postop.py b/src/mistralai/client/models/get_chat_completion_field_options_counts_v1_observability_chat_completion_fields_field_name_options_counts_postop.py new file mode 100644 index 00000000..f579260d --- /dev/null +++ b/src/mistralai/client/models/get_chat_completion_field_options_counts_v1_observability_chat_completion_fields_field_name_options_counts_postop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0b1bd06b24af + +from __future__ import annotations +from .fetchfieldoptioncountsrequest import ( + FetchFieldOptionCountsRequest, + FetchFieldOptionCountsRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequestTypedDict( + TypedDict +): + field_name: str + fetch_field_option_counts_request: FetchFieldOptionCountsRequestTypedDict + + +class GetChatCompletionFieldOptionsCountsV1ObservabilityChatCompletionFieldsFieldNameOptionsCountsPostRequest( + BaseModel +): + field_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + fetch_field_option_counts_request: Annotated[ + FetchFieldOptionCountsRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/get_chat_completion_field_options_v1_observability_chat_completion_fields_field_name_options_getop.py b/src/mistralai/client/models/get_chat_completion_field_options_v1_observability_chat_completion_fields_field_name_options_getop.py new file mode 100644 index 00000000..c044bb92 --- /dev/null +++ b/src/mistralai/client/models/get_chat_completion_field_options_v1_observability_chat_completion_fields_field_name_options_getop.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4fb7f3c0e51b + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +Operator = Literal[ + "lt", + "lte", + "gt", + "gte", + "startswith", + "istartswith", + "endswith", + "iendswith", + "contains", + "icontains", + "matches", + "notcontains", + "inotcontains", + "eq", + "neq", + "isnull", + "includes", + "excludes", + "len_eq", +] +r"""The operator to use for filtering options""" + + +class GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequestTypedDict( + TypedDict +): + field_name: str + operator: Operator + r"""The operator to use for filtering options""" + + +class GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetRequest( + BaseModel +): + field_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + operator: Annotated[ + Operator, FieldMetadata(query=QueryParamMetadata(style="form", explode=True)) + ] + r"""The operator to use for filtering options""" diff --git a/src/mistralai/client/models/get_dataset_by_id_v1_observability_datasets_dataset_id_getop.py b/src/mistralai/client/models/get_dataset_by_id_v1_observability_datasets_dataset_id_getop.py new file mode 100644 index 00000000..0259485d --- /dev/null +++ b/src/mistralai/client/models/get_dataset_by_id_v1_observability_datasets_dataset_id_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cfd3282e7f33 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequestTypedDict(TypedDict): + dataset_id: str + + +class GetDatasetByIDV1ObservabilityDatasetsDatasetIDGetRequest(BaseModel): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_dataset_import_task_v1_observability_datasets_dataset_id_tasks_task_id_getop.py b/src/mistralai/client/models/get_dataset_import_task_v1_observability_datasets_dataset_id_tasks_task_id_getop.py new file mode 100644 index 00000000..cf900d0e --- /dev/null +++ b/src/mistralai/client/models/get_dataset_import_task_v1_observability_datasets_dataset_id_tasks_task_id_getop.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b45f77cb328c + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequestTypedDict( + TypedDict +): + dataset_id: str + task_id: str + + +class GetDatasetImportTaskV1ObservabilityDatasetsDatasetIDTasksTaskIDGetRequest( + BaseModel +): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + task_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_dataset_import_tasks_v1_observability_datasets_dataset_id_tasks_getop.py b/src/mistralai/client/models/get_dataset_import_tasks_v1_observability_datasets_dataset_id_tasks_getop.py new file mode 100644 index 00000000..8213c023 --- /dev/null +++ b/src/mistralai/client/models/get_dataset_import_tasks_v1_observability_datasets_dataset_id_tasks_getop.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 07ece48f664d + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequestTypedDict( + TypedDict +): + dataset_id: str + page_size: NotRequired[int] + page: NotRequired[int] + + +class GetDatasetImportTasksV1ObservabilityDatasetsDatasetIDTasksGetRequest(BaseModel): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_size", "page"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_dataset_record_v1_observability_dataset_records_dataset_record_id_getop.py b/src/mistralai/client/models/get_dataset_record_v1_observability_dataset_records_dataset_record_id_getop.py new file mode 100644 index 00000000..0cb239df --- /dev/null +++ b/src/mistralai/client/models/get_dataset_record_v1_observability_dataset_records_dataset_record_id_getop.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6ea6a0dab32f + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequestTypedDict( + TypedDict +): + dataset_record_id: str + + +class GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequest(BaseModel): + dataset_record_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_dataset_records_v1_observability_datasets_dataset_id_records_getop.py b/src/mistralai/client/models/get_dataset_records_v1_observability_datasets_dataset_id_records_getop.py new file mode 100644 index 00000000..ed177823 --- /dev/null +++ b/src/mistralai/client/models/get_dataset_records_v1_observability_datasets_dataset_id_records_getop.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 77967c965aea + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequestTypedDict( + TypedDict +): + dataset_id: str + page_size: NotRequired[int] + page: NotRequired[int] + + +class GetDatasetRecordsV1ObservabilityDatasetsDatasetIDRecordsGetRequest(BaseModel): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_size", "page"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_datasets_v1_observability_datasets_getop.py b/src/mistralai/client/models/get_datasets_v1_observability_datasets_getop.py new file mode 100644 index 00000000..1d79f2d5 --- /dev/null +++ b/src/mistralai/client/models/get_datasets_v1_observability_datasets_getop.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3e4f4e2447ac + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetDatasetsV1ObservabilityDatasetsGetRequestTypedDict(TypedDict): + page_size: NotRequired[int] + page: NotRequired[int] + q: NotRequired[Nullable[str]] + + +class GetDatasetsV1ObservabilityDatasetsGetRequest(BaseModel): + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + + q: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_size", "page", "q"]) + nullable_fields = set(["q"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_deployment_v1_workflows_deployments_name_getop.py b/src/mistralai/client/models/get_deployment_v1_workflows_deployments_name_getop.py new file mode 100644 index 00000000..1f699bed --- /dev/null +++ b/src/mistralai/client/models/get_deployment_v1_workflows_deployments_name_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3fae92e2573a + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetDeploymentV1WorkflowsDeploymentsNameGetRequestTypedDict(TypedDict): + name: str + + +class GetDeploymentV1WorkflowsDeploymentsNameGetRequest(BaseModel): + name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_judge_by_id_v1_observability_judges_judge_id_getop.py b/src/mistralai/client/models/get_judge_by_id_v1_observability_judges_judge_id_getop.py new file mode 100644 index 00000000..375db2e9 --- /dev/null +++ b/src/mistralai/client/models/get_judge_by_id_v1_observability_judges_judge_id_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4201c3c5a891 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequestTypedDict(TypedDict): + judge_id: str + + +class GetJudgeByIDV1ObservabilityJudgesJudgeIDGetRequest(BaseModel): + judge_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_judges_v1_observability_judges_getop.py b/src/mistralai/client/models/get_judges_v1_observability_judges_getop.py new file mode 100644 index 00000000..b5d0980e --- /dev/null +++ b/src/mistralai/client/models/get_judges_v1_observability_judges_getop.py @@ -0,0 +1,80 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fa04e3db7781 + +from __future__ import annotations +from .judgeoutputtype import JudgeOutputType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetJudgesV1ObservabilityJudgesGetRequestTypedDict(TypedDict): + type_filter: NotRequired[Nullable[List[JudgeOutputType]]] + r"""Filter by judge output types""" + model_filter: NotRequired[Nullable[List[str]]] + r"""Filter by model names""" + page_size: NotRequired[int] + page: NotRequired[int] + q: NotRequired[Nullable[str]] + + +class GetJudgesV1ObservabilityJudgesGetRequest(BaseModel): + type_filter: Annotated[ + OptionalNullable[List[JudgeOutputType]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by judge output types""" + + model_filter: Annotated[ + OptionalNullable[List[str]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by model names""" + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + + q: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type_filter", "model_filter", "page_size", "page", "q"]) + nullable_fields = set(["type_filter", "model_filter", "q"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_run_history_v1_workflows_runs_run_id_history_getop.py b/src/mistralai/client/models/get_run_history_v1_workflows_runs_run_id_history_getop.py new file mode 100644 index 00000000..e2973679 --- /dev/null +++ b/src/mistralai/client/models/get_run_history_v1_workflows_runs_run_id_history_getop.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9d566ab77998 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequestTypedDict(TypedDict): + run_id: str + decode_payloads: NotRequired[bool] + + +class GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequest(BaseModel): + run_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + decode_payloads: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["decode_payloads"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_run_v1_workflows_runs_run_id_getop.py b/src/mistralai/client/models/get_run_v1_workflows_runs_run_id_getop.py new file mode 100644 index 00000000..d9b6758f --- /dev/null +++ b/src/mistralai/client/models/get_run_v1_workflows_runs_run_id_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 60463c59ff01 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetRunV1WorkflowsRunsRunIDGetRequestTypedDict(TypedDict): + run_id: str + + +class GetRunV1WorkflowsRunsRunIDGetRequest(BaseModel): + run_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_similar_chat_completion_events_v1_observability_chat_completion_events_event_id_similar_events_getop.py b/src/mistralai/client/models/get_similar_chat_completion_events_v1_observability_chat_completion_events_event_id_similar_events_getop.py new file mode 100644 index 00000000..7689415d --- /dev/null +++ b/src/mistralai/client/models/get_similar_chat_completion_events_v1_observability_chat_completion_events_event_id_similar_events_getop.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d651bdc06c1b + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequestTypedDict( + TypedDict +): + event_id: str + + +class GetSimilarChatCompletionEventsV1ObservabilityChatCompletionEventsEventIDSimilarEventsGetRequest( + BaseModel +): + event_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_stream_events_v1_workflows_events_stream_getop.py b/src/mistralai/client/models/get_stream_events_v1_workflows_events_stream_getop.py new file mode 100644 index 00000000..442a7a94 --- /dev/null +++ b/src/mistralai/client/models/get_stream_events_v1_workflows_events_stream_getop.py @@ -0,0 +1,182 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8dd6ce0e8d66 + +from __future__ import annotations +from .streameventssepayload import StreamEventSsePayload, StreamEventSsePayloadTypedDict +from .workfloweventtype import WorkflowEventType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +Scope = Literal[ + "activity", + "workflow", + "*", +] + + +class GetStreamEventsV1WorkflowsEventsStreamGetRequestTypedDict(TypedDict): + scope: NotRequired[Scope] + activity_name: NotRequired[str] + activity_id: NotRequired[str] + workflow_name: NotRequired[str] + workflow_exec_id: NotRequired[str] + root_workflow_exec_id: NotRequired[str] + parent_workflow_exec_id: NotRequired[str] + stream: NotRequired[str] + start_seq: NotRequired[int] + metadata_filters: NotRequired[Nullable[Dict[str, Any]]] + workflow_event_types: NotRequired[Nullable[List[WorkflowEventType]]] + last_event_id: NotRequired[Nullable[str]] + + +class GetStreamEventsV1WorkflowsEventsStreamGetRequest(BaseModel): + scope: Annotated[ + Optional[Scope], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "*" + + activity_name: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "*" + + activity_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "*" + + workflow_name: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "*" + + workflow_exec_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "*" + + root_workflow_exec_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "*" + + parent_workflow_exec_id: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "*" + + stream: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "*" + + start_seq: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + + metadata_filters: Annotated[ + OptionalNullable[Dict[str, Any]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + workflow_event_types: Annotated[ + OptionalNullable[List[WorkflowEventType]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + last_event_id: Annotated[ + OptionalNullable[str], + pydantic.Field(alias="last-event-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "scope", + "activity_name", + "activity_id", + "workflow_name", + "workflow_exec_id", + "root_workflow_exec_id", + "parent_workflow_exec_id", + "stream", + "start_seq", + "metadata_filters", + "workflow_event_types", + "last-event-id", + ] + ) + nullable_fields = set( + ["metadata_filters", "workflow_event_types", "last-event-id"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class GetStreamEventsV1WorkflowsEventsStreamGetResponseBodyTypedDict(TypedDict): + r"""Stream of Server-Sent Events (SSE)""" + + event: NotRequired[str] + data: NotRequired[StreamEventSsePayloadTypedDict] + id: NotRequired[str] + retry: NotRequired[int] + + +class GetStreamEventsV1WorkflowsEventsStreamGetResponseBody(BaseModel): + r"""Stream of Server-Sent Events (SSE)""" + + event: Optional[str] = None + + data: Optional[StreamEventSsePayload] = None + + id: Optional[str] = None + + retry: Optional[int] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event", "data", "id", "retry"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_voice_sample_audio_v1_audio_voices_voice_id_sample_getop.py b/src/mistralai/client/models/get_voice_sample_audio_v1_audio_voices_voice_id_sample_getop.py new file mode 100644 index 00000000..5d4cbbfd --- /dev/null +++ b/src/mistralai/client/models/get_voice_sample_audio_v1_audio_voices_voice_id_sample_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a5838063aee4 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequestTypedDict(TypedDict): + voice_id: str + + +class GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequest(BaseModel): + voice_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_voice_v1_audio_voices_voice_id_getop.py b/src/mistralai/client/models/get_voice_v1_audio_voices_voice_id_getop.py new file mode 100644 index 00000000..bd81442e --- /dev/null +++ b/src/mistralai/client/models/get_voice_v1_audio_voices_voice_id_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b6ca849d5005 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetVoiceV1AudioVoicesVoiceIDGetRequestTypedDict(TypedDict): + voice_id: str + + +class GetVoiceV1AudioVoicesVoiceIDGetRequest(BaseModel): + voice_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_workflow_events_v1_workflows_events_list_getop.py b/src/mistralai/client/models/get_workflow_events_v1_workflows_events_list_getop.py new file mode 100644 index 00000000..186c5548 --- /dev/null +++ b/src/mistralai/client/models/get_workflow_events_v1_workflows_events_list_getop.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9d6d093835d6 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetWorkflowEventsV1WorkflowsEventsListGetRequestTypedDict(TypedDict): + root_workflow_exec_id: NotRequired[Nullable[str]] + r"""Execution ID of the root workflow that initiated this execution chain.""" + workflow_exec_id: NotRequired[Nullable[str]] + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: NotRequired[Nullable[str]] + r"""Run ID of the workflow that emitted this event.""" + limit: NotRequired[int] + r"""Maximum number of events to return.""" + cursor: NotRequired[Nullable[str]] + r"""Cursor for pagination.""" + + +class GetWorkflowEventsV1WorkflowsEventsListGetRequest(BaseModel): + root_workflow_exec_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Execution ID of the root workflow that initiated this execution chain.""" + + workflow_exec_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Run ID of the workflow that emitted this event.""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Maximum number of events to return.""" + + cursor: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Cursor for pagination.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "root_workflow_exec_id", + "workflow_exec_id", + "workflow_run_id", + "limit", + "cursor", + ] + ) + nullable_fields = set( + ["root_workflow_exec_id", "workflow_exec_id", "workflow_run_id", "cursor"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_workflow_execution_history_v1_workflows_executions_execution_id_history_getop.py b/src/mistralai/client/models/get_workflow_execution_history_v1_workflows_executions_execution_id_history_getop.py new file mode 100644 index 00000000..c71a2305 --- /dev/null +++ b/src/mistralai/client/models/get_workflow_execution_history_v1_workflows_executions_execution_id_history_getop.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8d636c8cad1e + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequestTypedDict( + TypedDict +): + execution_id: str + decode_payloads: NotRequired[bool] + + +class GetWorkflowExecutionHistoryV1WorkflowsExecutionsExecutionIDHistoryGetRequest( + BaseModel +): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + decode_payloads: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["decode_payloads"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_workflow_execution_trace_eventsop.py b/src/mistralai/client/models/get_workflow_execution_trace_eventsop.py new file mode 100644 index 00000000..a60fb536 --- /dev/null +++ b/src/mistralai/client/models/get_workflow_execution_trace_eventsop.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 75438195bf19 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetWorkflowExecutionTraceEventsRequestTypedDict(TypedDict): + execution_id: str + merge_same_id_events: NotRequired[bool] + include_internal_events: NotRequired[bool] + + +class GetWorkflowExecutionTraceEventsRequest(BaseModel): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + merge_same_id_events: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + + include_internal_events: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["merge_same_id_events", "include_internal_events"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_workflow_execution_trace_otelop.py b/src/mistralai/client/models/get_workflow_execution_trace_otelop.py new file mode 100644 index 00000000..0abdd75f --- /dev/null +++ b/src/mistralai/client/models/get_workflow_execution_trace_otelop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f24457d6ea21 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetWorkflowExecutionTraceOtelRequestTypedDict(TypedDict): + execution_id: str + + +class GetWorkflowExecutionTraceOtelRequest(BaseModel): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_workflow_execution_trace_summaryop.py b/src/mistralai/client/models/get_workflow_execution_trace_summaryop.py new file mode 100644 index 00000000..54b080e0 --- /dev/null +++ b/src/mistralai/client/models/get_workflow_execution_trace_summaryop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e44e62e3c444 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetWorkflowExecutionTraceSummaryRequestTypedDict(TypedDict): + execution_id: str + + +class GetWorkflowExecutionTraceSummaryRequest(BaseModel): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_workflow_execution_v1_workflows_executions_execution_id_getop.py b/src/mistralai/client/models/get_workflow_execution_v1_workflows_executions_execution_id_getop.py new file mode 100644 index 00000000..c9926054 --- /dev/null +++ b/src/mistralai/client/models/get_workflow_execution_v1_workflows_executions_execution_id_getop.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 25bc5d3fec8d + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequestTypedDict( + TypedDict +): + execution_id: str + + +class GetWorkflowExecutionV1WorkflowsExecutionsExecutionIDGetRequest(BaseModel): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_workflow_metrics_v1_workflows_workflow_name_metrics_getop.py b/src/mistralai/client/models/get_workflow_metrics_v1_workflows_workflow_name_metrics_getop.py new file mode 100644 index 00000000..1d9c8989 --- /dev/null +++ b/src/mistralai/client/models/get_workflow_metrics_v1_workflows_workflow_name_metrics_getop.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 449550c7f76a + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequestTypedDict(TypedDict): + workflow_name: str + start_time: NotRequired[Nullable[datetime]] + r"""Filter workflows started after this time (ISO 8601)""" + end_time: NotRequired[Nullable[datetime]] + r"""Filter workflows started before this time (ISO 8601)""" + + +class GetWorkflowMetricsV1WorkflowsWorkflowNameMetricsGetRequest(BaseModel): + workflow_name: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + start_time: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter workflows started after this time (ISO 8601)""" + + end_time: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter workflows started before this time (ISO 8601)""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["start_time", "end_time"]) + nullable_fields = set(["start_time", "end_time"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_workflow_registration_v1_workflows_registrations_workflow_registration_id_getop.py b/src/mistralai/client/models/get_workflow_registration_v1_workflows_registrations_workflow_registration_id_getop.py new file mode 100644 index 00000000..fe7d639d --- /dev/null +++ b/src/mistralai/client/models/get_workflow_registration_v1_workflows_registrations_workflow_registration_id_getop.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a6b7d0f559ef + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequestTypedDict( + TypedDict +): + workflow_registration_id: str + with_workflow: NotRequired[bool] + r"""Whether to include the workflow definition""" + include_shared: NotRequired[bool] + r"""Whether to include shared workflow versions""" + + +class GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequest( + BaseModel +): + workflow_registration_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + with_workflow: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Whether to include the workflow definition""" + + include_shared: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Whether to include shared workflow versions""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["with_workflow", "include_shared"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_workflow_registrations_v1_workflows_registrations_getop.py b/src/mistralai/client/models/get_workflow_registrations_v1_workflows_registrations_getop.py new file mode 100644 index 00000000..d8cc7f6e --- /dev/null +++ b/src/mistralai/client/models/get_workflow_registrations_v1_workflows_registrations_getop.py @@ -0,0 +1,147 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 822f256b2372 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequestTypedDict(TypedDict): + workflow_id: NotRequired[Nullable[str]] + r"""The workflow ID to filter by""" + task_queue: NotRequired[Nullable[str]] + r"""The task queue to filter by""" + active_only: NotRequired[bool] + r"""Whether to only return active workflows versions""" + include_shared: NotRequired[bool] + r"""Whether to include shared workflow versions""" + workflow_search: NotRequired[Nullable[str]] + r"""The workflow name to filter by""" + archived: NotRequired[Nullable[bool]] + r"""Filter by archived state. False=exclude archived, True=only archived, None=include all""" + with_workflow: NotRequired[bool] + r"""Whether to include the workflow definition""" + available_in_chat_assistant: NotRequired[Nullable[bool]] + r"""Whether to only return workflows available in chat assistant""" + limit: NotRequired[int] + r"""The maximum number of workflows versions to return""" + cursor: NotRequired[Nullable[str]] + r"""The cursor for pagination""" + + +class GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequest(BaseModel): + workflow_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The workflow ID to filter by""" + + task_queue: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The task queue to filter by""" + + active_only: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Whether to only return active workflows versions""" + + include_shared: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Whether to include shared workflow versions""" + + workflow_search: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The workflow name to filter by""" + + archived: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by archived state. False=exclude archived, True=only archived, None=include all""" + + with_workflow: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Whether to include the workflow definition""" + + available_in_chat_assistant: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Whether to only return workflows available in chat assistant""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + r"""The maximum number of workflows versions to return""" + + cursor: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The cursor for pagination""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "workflow_id", + "task_queue", + "active_only", + "include_shared", + "workflow_search", + "archived", + "with_workflow", + "available_in_chat_assistant", + "limit", + "cursor", + ] + ) + nullable_fields = set( + [ + "workflow_id", + "task_queue", + "workflow_search", + "archived", + "available_in_chat_assistant", + "cursor", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/get_workflow_v1_workflows_workflow_identifier_getop.py b/src/mistralai/client/models/get_workflow_v1_workflows_workflow_identifier_getop.py new file mode 100644 index 00000000..20d0b6dd --- /dev/null +++ b/src/mistralai/client/models/get_workflow_v1_workflows_workflow_identifier_getop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 097af37374fd + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class GetWorkflowV1WorkflowsWorkflowIdentifierGetRequestTypedDict(TypedDict): + workflow_identifier: str + + +class GetWorkflowV1WorkflowsWorkflowIdentifierGetRequest(BaseModel): + workflow_identifier: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/get_workflows_v1_workflows_getop.py b/src/mistralai/client/models/get_workflows_v1_workflows_getop.py new file mode 100644 index 00000000..38ca4d72 --- /dev/null +++ b/src/mistralai/client/models/get_workflows_v1_workflows_getop.py @@ -0,0 +1,116 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a128585aee76 + +from __future__ import annotations +from .workflowlistresponse import WorkflowListResponse, WorkflowListResponseTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Awaitable, Callable, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetWorkflowsV1WorkflowsGetRequestTypedDict(TypedDict): + active_only: NotRequired[bool] + r"""Whether to only return active workflows""" + include_shared: NotRequired[bool] + r"""Whether to include shared workflows""" + available_in_chat_assistant: NotRequired[Nullable[bool]] + r"""Whether to only return workflows available in chat assistant""" + archived: NotRequired[Nullable[bool]] + r"""Filter by archived state. False=exclude archived, True=only archived, None=include all""" + cursor: NotRequired[Nullable[str]] + r"""The cursor for pagination""" + limit: NotRequired[int] + r"""The maximum number of workflows to return""" + + +class GetWorkflowsV1WorkflowsGetRequest(BaseModel): + active_only: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Whether to only return active workflows""" + + include_shared: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + r"""Whether to include shared workflows""" + + available_in_chat_assistant: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Whether to only return workflows available in chat assistant""" + + archived: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by archived state. False=exclude archived, True=only archived, None=include all""" + + cursor: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The cursor for pagination""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + r"""The maximum number of workflows to return""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "active_only", + "include_shared", + "available_in_chat_assistant", + "archived", + "cursor", + "limit", + ] + ) + nullable_fields = set(["available_in_chat_assistant", "archived", "cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class GetWorkflowsV1WorkflowsGetResponseTypedDict(TypedDict): + result: WorkflowListResponseTypedDict + + +class GetWorkflowsV1WorkflowsGetResponse(BaseModel): + next: Union[ + Callable[[], Optional[GetWorkflowsV1WorkflowsGetResponse]], + Callable[[], Awaitable[Optional[GetWorkflowsV1WorkflowsGetResponse]]], + ] + + result: WorkflowListResponse diff --git a/src/mistralai/client/models/getfileresponse.py b/src/mistralai/client/models/getfileresponse.py new file mode 100644 index 00000000..37c29bbb --- /dev/null +++ b/src/mistralai/client/models/getfileresponse.py @@ -0,0 +1,110 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 81919086e371 + +from __future__ import annotations +from .filepurpose import FilePurpose +from .filevisibility import FileVisibility +from .sampletype import SampleType +from .source import Source +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetFileResponseTypedDict(TypedDict): + id: str + r"""The unique identifier of the file.""" + object: str + r"""The object type, which is always \"file\".""" + size_bytes: int + r"""The size of the file, in bytes.""" + created_at: int + r"""The UNIX timestamp (in seconds) of the event.""" + filename: str + r"""The name of the uploaded file.""" + purpose: FilePurpose + sample_type: SampleType + source: Source + deleted: bool + num_lines: NotRequired[Nullable[int]] + mimetype: NotRequired[Nullable[str]] + signature: NotRequired[Nullable[str]] + expires_at: NotRequired[Nullable[int]] + visibility: NotRequired[Nullable[FileVisibility]] + + +class GetFileResponse(BaseModel): + id: str + r"""The unique identifier of the file.""" + + object: str + r"""The object type, which is always \"file\".""" + + size_bytes: Annotated[int, pydantic.Field(alias="bytes")] + r"""The size of the file, in bytes.""" + + created_at: int + r"""The UNIX timestamp (in seconds) of the event.""" + + filename: str + r"""The name of the uploaded file.""" + + purpose: FilePurpose + + sample_type: SampleType + + source: Source + + deleted: bool + + num_lines: OptionalNullable[int] = UNSET + + mimetype: OptionalNullable[str] = UNSET + + signature: OptionalNullable[str] = UNSET + + expires_at: OptionalNullable[int] = UNSET + + visibility: OptionalNullable[FileVisibility] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["num_lines", "mimetype", "signature", "expires_at", "visibility"] + ) + nullable_fields = set( + ["num_lines", "mimetype", "signature", "expires_at", "visibility"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + GetFileResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/getsignedurlresponse.py b/src/mistralai/client/models/getsignedurlresponse.py new file mode 100644 index 00000000..4ba95894 --- /dev/null +++ b/src/mistralai/client/models/getsignedurlresponse.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cee4e4197372 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class GetSignedURLResponseTypedDict(TypedDict): + url: str + + +class GetSignedURLResponse(BaseModel): + url: str diff --git a/src/mistralai/client/models/githubrepository.py b/src/mistralai/client/models/githubrepository.py new file mode 100644 index 00000000..4ec88aa8 --- /dev/null +++ b/src/mistralai/client/models/githubrepository.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4bc83ce18378 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GithubRepositoryTypedDict(TypedDict): + name: str + owner: str + commit_id: str + type: Literal["github"] + ref: NotRequired[Nullable[str]] + weight: NotRequired[float] + + +class GithubRepository(BaseModel): + name: str + + owner: str + + commit_id: str + + type: Annotated[ + Annotated[Literal["github"], AfterValidator(validate_const("github"))], + pydantic.Field(alias="type"), + ] = "github" + + ref: OptionalNullable[str] = UNSET + + weight: Optional[float] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ref", "weight"]) + nullable_fields = set(["ref"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + GithubRepository.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/guardrailconfig.py b/src/mistralai/client/models/guardrailconfig.py new file mode 100644 index 00000000..d152ec36 --- /dev/null +++ b/src/mistralai/client/models/guardrailconfig.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c72b74412547 + +from __future__ import annotations +from .moderationllmv1config import ModerationLlmv1Config, ModerationLlmv1ConfigTypedDict +from .moderationllmv2config import ModerationLlmv2Config, ModerationLlmv2ConfigTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class GuardrailConfigTypedDict(TypedDict): + block_on_error: NotRequired[bool] + r"""If true, return HTTP 403 and block request in the event of a server-side error""" + moderation_llm_v1: NotRequired[Nullable[ModerationLlmv1ConfigTypedDict]] + moderation_llm_v2: NotRequired[Nullable[ModerationLlmv2ConfigTypedDict]] + + +class GuardrailConfig(BaseModel): + block_on_error: Optional[bool] = False + r"""If true, return HTTP 403 and block request in the event of a server-side error""" + + moderation_llm_v1: OptionalNullable[ModerationLlmv1Config] = UNSET + + moderation_llm_v2: OptionalNullable[ModerationLlmv2Config] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["block_on_error", "moderation_llm_v1", "moderation_llm_v2"] + ) + nullable_fields = set(["moderation_llm_v1", "moderation_llm_v2"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/imagecontent.py b/src/mistralai/client/models/imagecontent.py new file mode 100644 index 00000000..e6363daa --- /dev/null +++ b/src/mistralai/client/models/imagecontent.py @@ -0,0 +1,94 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3abe7faee278 + +from __future__ import annotations +from .annotations import Annotations, AnnotationsTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ImageContentTypedDict(TypedDict): + r"""Image content for a message.""" + + data: str + mime_type: str + type: Literal["image"] + annotations: NotRequired[Nullable[AnnotationsTypedDict]] + meta: NotRequired[Nullable[Dict[str, Any]]] + + +class ImageContent(BaseModel): + r"""Image content for a message.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + data: str + + mime_type: Annotated[str, pydantic.Field(alias="mimeType")] + + type: Annotated[ + Annotated[Literal["image"], AfterValidator(validate_const("image"))], + pydantic.Field(alias="type"), + ] = "image" + + annotations: OptionalNullable[Annotations] = UNSET + + meta: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["annotations", "_meta"]) + nullable_fields = set(["annotations", "_meta"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + ImageContent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/imagedetail.py b/src/mistralai/client/models/imagedetail.py new file mode 100644 index 00000000..1982d357 --- /dev/null +++ b/src/mistralai/client/models/imagedetail.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c1084b549abb + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ImageDetail = Union[ + Literal[ + "low", + "auto", + "high", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/imagegenerationtool.py b/src/mistralai/client/models/imagegenerationtool.py new file mode 100644 index 00000000..0dd4a4d2 --- /dev/null +++ b/src/mistralai/client/models/imagegenerationtool.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e1532275faa0 + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ImageGenerationToolTypedDict(TypedDict): + tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] + type: Literal["image_generation"] + + +class ImageGenerationTool(BaseModel): + tool_configuration: OptionalNullable[ToolConfiguration] = UNSET + + type: Annotated[ + Annotated[ + Literal["image_generation"], + AfterValidator(validate_const("image_generation")), + ], + pydantic.Field(alias="type"), + ] = "image_generation" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_configuration"]) + nullable_fields = set(["tool_configuration"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ImageGenerationTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/imageurl.py b/src/mistralai/client/models/imageurl.py new file mode 100644 index 00000000..32efa67b --- /dev/null +++ b/src/mistralai/client/models/imageurl.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e4bbf5881fbf + +from __future__ import annotations +from .imagedetail import ImageDetail +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ImageURLTypedDict(TypedDict): + url: str + detail: NotRequired[Nullable[ImageDetail]] + + +class ImageURL(BaseModel): + url: str + + detail: OptionalNullable[ImageDetail] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["detail"]) + nullable_fields = set(["detail"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/imageurlchunk.py b/src/mistralai/client/models/imageurlchunk.py new file mode 100644 index 00000000..55a2023e --- /dev/null +++ b/src/mistralai/client/models/imageurlchunk.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 746fde62f637 + +from __future__ import annotations +from .imageurl import ImageURL, ImageURLTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ImageURLUnionTypedDict = TypeAliasType( + "ImageURLUnionTypedDict", Union[ImageURLTypedDict, str] +) + + +ImageURLUnion = TypeAliasType("ImageURLUnion", Union[ImageURL, str]) + + +class ImageURLChunkTypedDict(TypedDict): + r"""{\"type\":\"image_url\",\"image_url\":\"data:image/png;base64,iVBORw0\"}""" + + image_url: ImageURLUnionTypedDict + type: Literal["image_url"] + + +class ImageURLChunk(BaseModel): + r"""{\"type\":\"image_url\",\"image_url\":\"data:image/png;base64,iVBORw0\"}""" + + image_url: ImageURLUnion + + type: Annotated[ + Annotated[ + Optional[Literal["image_url"]], AfterValidator(validate_const("image_url")) + ], + pydantic.Field(alias="type"), + ] = "image_url" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ImageURLChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/importdatasetfromcampaignrequest.py b/src/mistralai/client/models/importdatasetfromcampaignrequest.py new file mode 100644 index 00000000..5db45e8e --- /dev/null +++ b/src/mistralai/client/models/importdatasetfromcampaignrequest.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ee475b85bfc7 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ImportDatasetFromCampaignRequestTypedDict(TypedDict): + campaign_id: str + + +class ImportDatasetFromCampaignRequest(BaseModel): + campaign_id: str diff --git a/src/mistralai/client/models/importdatasetfromdatasetrequest.py b/src/mistralai/client/models/importdatasetfromdatasetrequest.py new file mode 100644 index 00000000..ebf2a649 --- /dev/null +++ b/src/mistralai/client/models/importdatasetfromdatasetrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 77aea4882ccb + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ImportDatasetFromDatasetRequestTypedDict(TypedDict): + dataset_record_ids: List[str] + + +class ImportDatasetFromDatasetRequest(BaseModel): + dataset_record_ids: List[str] diff --git a/src/mistralai/client/models/importdatasetfromexplorerrequest.py b/src/mistralai/client/models/importdatasetfromexplorerrequest.py new file mode 100644 index 00000000..85df7af6 --- /dev/null +++ b/src/mistralai/client/models/importdatasetfromexplorerrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 852a3cbc1631 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ImportDatasetFromExplorerRequestTypedDict(TypedDict): + completion_event_ids: List[str] + + +class ImportDatasetFromExplorerRequest(BaseModel): + completion_event_ids: List[str] diff --git a/src/mistralai/client/models/importdatasetfromfilerequest.py b/src/mistralai/client/models/importdatasetfromfilerequest.py new file mode 100644 index 00000000..9a486776 --- /dev/null +++ b/src/mistralai/client/models/importdatasetfromfilerequest.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b2882fa57029 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ImportDatasetFromFileRequestTypedDict(TypedDict): + file_id: str + + +class ImportDatasetFromFileRequest(BaseModel): + file_id: str diff --git a/src/mistralai/client/models/importdatasetfromplaygroundrequest.py b/src/mistralai/client/models/importdatasetfromplaygroundrequest.py new file mode 100644 index 00000000..f5bd720d --- /dev/null +++ b/src/mistralai/client/models/importdatasetfromplaygroundrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8d809b14b144 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ImportDatasetFromPlaygroundRequestTypedDict(TypedDict): + conversation_ids: List[str] + + +class ImportDatasetFromPlaygroundRequest(BaseModel): + conversation_ids: List[str] diff --git a/src/mistralai/client/models/ingestionpipelineconfiguration.py b/src/mistralai/client/models/ingestionpipelineconfiguration.py new file mode 100644 index 00000000..5289c66d --- /dev/null +++ b/src/mistralai/client/models/ingestionpipelineconfiguration.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b4746c0f2c1c + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict +from typing_extensions import TypedDict + + +class IngestionPipelineConfigurationTypedDict(TypedDict): + id: str + author_id: str + name: str + created_at: datetime + modified_at: datetime + last_run_time: Nullable[datetime] + last_run_chunks_count: int + total_chunks_count: int + pipeline_composition: Nullable[Dict[str, str]] + + +class IngestionPipelineConfiguration(BaseModel): + id: str + + author_id: str + + name: str + + created_at: datetime + + modified_at: datetime + + last_run_time: Nullable[datetime] + + last_run_chunks_count: int + + total_chunks_count: int + + pipeline_composition: Nullable[Dict[str, str]] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/models/inputentries.py b/src/mistralai/client/models/inputentries.py similarity index 97% rename from src/mistralai/models/inputentries.py rename to src/mistralai/client/models/inputentries.py index 8ae29837..e2da5a80 100644 --- a/src/mistralai/models/inputentries.py +++ b/src/mistralai/client/models/inputentries.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 44727997dacb from __future__ import annotations from .agenthandoffentry import AgentHandoffEntry, AgentHandoffEntryTypedDict @@ -16,10 +17,10 @@ Union[ FunctionResultEntryTypedDict, MessageInputEntryTypedDict, - FunctionCallEntryTypedDict, - ToolExecutionEntryTypedDict, MessageOutputEntryTypedDict, AgentHandoffEntryTypedDict, + ToolExecutionEntryTypedDict, + FunctionCallEntryTypedDict, ], ) @@ -29,9 +30,9 @@ Union[ FunctionResultEntry, MessageInputEntry, - FunctionCallEntry, - ToolExecutionEntry, MessageOutputEntry, AgentHandoffEntry, + ToolExecutionEntry, + FunctionCallEntry, ], ) diff --git a/src/mistralai/client/models/inputs.py b/src/mistralai/client/models/inputs.py new file mode 100644 index 00000000..9ecd7f48 --- /dev/null +++ b/src/mistralai/client/models/inputs.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 84a8007518c7 + +from __future__ import annotations +from .instructrequest import InstructRequest, InstructRequestTypedDict +from typing import List, Union +from typing_extensions import TypeAliasType + + +InputsTypedDict = TypeAliasType( + "InputsTypedDict", Union[InstructRequestTypedDict, List[InstructRequestTypedDict]] +) +r"""Chat to classify""" + + +Inputs = TypeAliasType("Inputs", Union[InstructRequest, List[InstructRequest]]) +r"""Chat to classify""" diff --git a/src/mistralai/client/models/instructrequest.py b/src/mistralai/client/models/instructrequest.py new file mode 100644 index 00000000..e5f9cccf --- /dev/null +++ b/src/mistralai/client/models/instructrequest.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6d3ad9f896c7 + +from __future__ import annotations +from .assistantmessage import AssistantMessage, AssistantMessageTypedDict +from .systemmessage import SystemMessage, SystemMessageTypedDict +from .toolmessage import ToolMessage, ToolMessageTypedDict +from .usermessage import UserMessage, UserMessageTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import get_discriminator +from pydantic import Discriminator, Tag +from typing import List, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +InstructRequestMessageTypedDict = TypeAliasType( + "InstructRequestMessageTypedDict", + Union[ + SystemMessageTypedDict, + UserMessageTypedDict, + AssistantMessageTypedDict, + ToolMessageTypedDict, + ], +) + + +InstructRequestMessage = Annotated[ + Union[ + Annotated[AssistantMessage, Tag("assistant")], + Annotated[SystemMessage, Tag("system")], + Annotated[ToolMessage, Tag("tool")], + Annotated[UserMessage, Tag("user")], + ], + Discriminator(lambda m: get_discriminator(m, "role", "role")), +] + + +class InstructRequestTypedDict(TypedDict): + messages: List[InstructRequestMessageTypedDict] + + +class InstructRequest(BaseModel): + messages: List[InstructRequestMessage] diff --git a/src/mistralai/client/models/jobmetadata.py b/src/mistralai/client/models/jobmetadata.py new file mode 100644 index 00000000..deddb4e1 --- /dev/null +++ b/src/mistralai/client/models/jobmetadata.py @@ -0,0 +1,96 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cfbdde7fc0a2 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class JobMetadataTypedDict(TypedDict): + expected_duration_seconds: NotRequired[Nullable[int]] + r"""The approximated time (in seconds) for the fine-tuning process to complete.""" + cost: NotRequired[Nullable[float]] + r"""The cost of the fine-tuning job.""" + cost_currency: NotRequired[Nullable[str]] + r"""The currency used for the fine-tuning job cost.""" + train_tokens_per_step: NotRequired[Nullable[int]] + r"""The number of tokens consumed by one training step.""" + train_tokens: NotRequired[Nullable[int]] + r"""The total number of tokens used during the fine-tuning process.""" + data_tokens: NotRequired[Nullable[int]] + r"""The total number of tokens in the training dataset.""" + estimated_start_time: NotRequired[Nullable[int]] + + +class JobMetadata(BaseModel): + expected_duration_seconds: OptionalNullable[int] = UNSET + r"""The approximated time (in seconds) for the fine-tuning process to complete.""" + + cost: OptionalNullable[float] = UNSET + r"""The cost of the fine-tuning job.""" + + cost_currency: OptionalNullable[str] = UNSET + r"""The currency used for the fine-tuning job cost.""" + + train_tokens_per_step: OptionalNullable[int] = UNSET + r"""The number of tokens consumed by one training step.""" + + train_tokens: OptionalNullable[int] = UNSET + r"""The total number of tokens used during the fine-tuning process.""" + + data_tokens: OptionalNullable[int] = UNSET + r"""The total number of tokens in the training dataset.""" + + estimated_start_time: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "expected_duration_seconds", + "cost", + "cost_currency", + "train_tokens_per_step", + "train_tokens", + "data_tokens", + "estimated_start_time", + ] + ) + nullable_fields = set( + [ + "expected_duration_seconds", + "cost", + "cost_currency", + "train_tokens_per_step", + "train_tokens", + "data_tokens", + "estimated_start_time", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/jobs_api_routes_batch_cancel_batch_jobop.py b/src/mistralai/client/models/jobs_api_routes_batch_cancel_batch_jobop.py new file mode 100644 index 00000000..de2e6347 --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_batch_cancel_batch_jobop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b56cb6c17c95 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class JobsAPIRoutesBatchCancelBatchJobRequestTypedDict(TypedDict): + job_id: str + + +class JobsAPIRoutesBatchCancelBatchJobRequest(BaseModel): + job_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/jobs_api_routes_batch_delete_batch_jobop.py b/src/mistralai/client/models/jobs_api_routes_batch_delete_batch_jobop.py new file mode 100644 index 00000000..9fc4a7e7 --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_batch_delete_batch_jobop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8c43af108342 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class JobsAPIRoutesBatchDeleteBatchJobRequestTypedDict(TypedDict): + job_id: str + + +class JobsAPIRoutesBatchDeleteBatchJobRequest(BaseModel): + job_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/jobs_api_routes_batch_get_batch_jobop.py b/src/mistralai/client/models/jobs_api_routes_batch_get_batch_jobop.py new file mode 100644 index 00000000..683da4af --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_batch_get_batch_jobop.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 36b5a6b3ceee + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JobsAPIRoutesBatchGetBatchJobRequestTypedDict(TypedDict): + job_id: str + inline: NotRequired[Nullable[bool]] + + +class JobsAPIRoutesBatchGetBatchJobRequest(BaseModel): + job_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + inline: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["inline"]) + nullable_fields = set(["inline"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/jobs_api_routes_batch_get_batch_jobsop.py b/src/mistralai/client/models/jobs_api_routes_batch_get_batch_jobsop.py new file mode 100644 index 00000000..e5869656 --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_batch_get_batch_jobsop.py @@ -0,0 +1,121 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d8f0af99c94d + +from __future__ import annotations +from .batchjobstatus import BatchJobStatus +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Any, Dict, List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +OrderBy = Literal[ + "created", + "-created", +] + + +class JobsAPIRoutesBatchGetBatchJobsRequestTypedDict(TypedDict): + page: NotRequired[int] + page_size: NotRequired[int] + model: NotRequired[Nullable[str]] + agent_id: NotRequired[Nullable[str]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + created_after: NotRequired[Nullable[datetime]] + created_by_me: NotRequired[bool] + status: NotRequired[Nullable[List[BatchJobStatus]]] + order_by: NotRequired[OrderBy] + + +class JobsAPIRoutesBatchGetBatchJobsRequest(BaseModel): + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + + model: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + agent_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + metadata: Annotated[ + OptionalNullable[Dict[str, Any]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + created_after: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + created_by_me: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + + status: Annotated[ + OptionalNullable[List[BatchJobStatus]], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + order_by: Annotated[ + Optional[OrderBy], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "-created" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "page", + "page_size", + "model", + "agent_id", + "metadata", + "created_after", + "created_by_me", + "status", + "order_by", + ] + ) + nullable_fields = set( + ["model", "agent_id", "metadata", "created_after", "status"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py b/src/mistralai/client/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py similarity index 78% rename from src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py rename to src/mistralai/client/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py index d728efd1..9fa99837 100644 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py +++ b/src/mistralai/client/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 34f89d2af0ec from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py b/src/mistralai/client/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py new file mode 100644 index 00000000..56fa5340 --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d175c6e32ecb + +from __future__ import annotations +from .classifierfinetuningjobdetails import ( + ClassifierFineTuningJobDetails, + ClassifierFineTuningJobDetailsTypedDict, +) +from .completionfinetuningjobdetails import ( + CompletionFineTuningJobDetails, + CompletionFineTuningJobDetailsTypedDict, +) +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict(TypedDict): + job_id: str + r"""The ID of the job to cancel.""" + + +class JobsAPIRoutesFineTuningCancelFineTuningJobRequest(BaseModel): + job_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the job to cancel.""" + + +JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict = TypeAliasType( + "JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict", + Union[ + CompletionFineTuningJobDetailsTypedDict, ClassifierFineTuningJobDetailsTypedDict + ], +) +r"""OK""" + + +class UnknownJobsAPIRoutesFineTuningCancelFineTuningJobResponse(BaseModel): + r"""A JobsAPIRoutesFineTuningCancelFineTuningJobResponse variant the SDK doesn't recognize. Preserves the raw payload.""" + + job_type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_JOBS_API_ROUTES_FINE_TUNING_CANCEL_FINE_TUNING_JOB_RESPONSE_VARIANTS: dict[ + str, Any +] = { + "classifier": ClassifierFineTuningJobDetails, + "completion": CompletionFineTuningJobDetails, +} + + +JobsAPIRoutesFineTuningCancelFineTuningJobResponse = Annotated[ + Union[ + ClassifierFineTuningJobDetails, + CompletionFineTuningJobDetails, + UnknownJobsAPIRoutesFineTuningCancelFineTuningJobResponse, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="job_type", + variants=_JOBS_API_ROUTES_FINE_TUNING_CANCEL_FINE_TUNING_JOB_RESPONSE_VARIANTS, + unknown_cls=UnknownJobsAPIRoutesFineTuningCancelFineTuningJobResponse, + union_name="JobsAPIRoutesFineTuningCancelFineTuningJobResponse", + ) + ), +] +r"""OK""" diff --git a/src/mistralai/client/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py b/src/mistralai/client/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py new file mode 100644 index 00000000..db857f7d --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py @@ -0,0 +1,70 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 81651291187a + +from __future__ import annotations +from .classifierfinetuningjob import ( + ClassifierFineTuningJob, + ClassifierFineTuningJobTypedDict, +) +from .completionfinetuningjob import ( + CompletionFineTuningJob, + CompletionFineTuningJobTypedDict, +) +from .legacyjobmetadata import LegacyJobMetadata, LegacyJobMetadataTypedDict +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +ResponseTypedDict = TypeAliasType( + "ResponseTypedDict", + Union[ClassifierFineTuningJobTypedDict, CompletionFineTuningJobTypedDict], +) + + +class UnknownResponse(BaseModel): + r"""A Response variant the SDK doesn't recognize. Preserves the raw payload.""" + + job_type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_RESPONSE_VARIANTS: dict[str, Any] = { + "classifier": ClassifierFineTuningJob, + "completion": CompletionFineTuningJob, +} + + +Response = Annotated[ + Union[ClassifierFineTuningJob, CompletionFineTuningJob, UnknownResponse], + BeforeValidator( + partial( + parse_open_union, + disc_key="job_type", + variants=_RESPONSE_VARIANTS, + unknown_cls=UnknownResponse, + union_name="Response", + ) + ), +] + + +JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict = TypeAliasType( + "JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict", + Union[LegacyJobMetadataTypedDict, ResponseTypedDict], +) +r"""OK""" + + +JobsAPIRoutesFineTuningCreateFineTuningJobResponse = TypeAliasType( + "JobsAPIRoutesFineTuningCreateFineTuningJobResponse", + Union[LegacyJobMetadata, Response], +) +r"""OK""" diff --git a/src/mistralai/client/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py b/src/mistralai/client/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py new file mode 100644 index 00000000..ddd9c189 --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d910fd8fe2d6 + +from __future__ import annotations +from .classifierfinetuningjobdetails import ( + ClassifierFineTuningJobDetails, + ClassifierFineTuningJobDetailsTypedDict, +) +from .completionfinetuningjobdetails import ( + CompletionFineTuningJobDetails, + CompletionFineTuningJobDetailsTypedDict, +) +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict(TypedDict): + job_id: str + r"""The ID of the job to analyse.""" + + +class JobsAPIRoutesFineTuningGetFineTuningJobRequest(BaseModel): + job_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the job to analyse.""" + + +JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict = TypeAliasType( + "JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict", + Union[ + CompletionFineTuningJobDetailsTypedDict, ClassifierFineTuningJobDetailsTypedDict + ], +) +r"""OK""" + + +class UnknownJobsAPIRoutesFineTuningGetFineTuningJobResponse(BaseModel): + r"""A JobsAPIRoutesFineTuningGetFineTuningJobResponse variant the SDK doesn't recognize. Preserves the raw payload.""" + + job_type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_JOBS_API_ROUTES_FINE_TUNING_GET_FINE_TUNING_JOB_RESPONSE_VARIANTS: dict[str, Any] = { + "classifier": ClassifierFineTuningJobDetails, + "completion": CompletionFineTuningJobDetails, +} + + +JobsAPIRoutesFineTuningGetFineTuningJobResponse = Annotated[ + Union[ + ClassifierFineTuningJobDetails, + CompletionFineTuningJobDetails, + UnknownJobsAPIRoutesFineTuningGetFineTuningJobResponse, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="job_type", + variants=_JOBS_API_ROUTES_FINE_TUNING_GET_FINE_TUNING_JOB_RESPONSE_VARIANTS, + unknown_cls=UnknownJobsAPIRoutesFineTuningGetFineTuningJobResponse, + union_name="JobsAPIRoutesFineTuningGetFineTuningJobResponse", + ) + ), +] +r"""OK""" diff --git a/src/mistralai/client/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py b/src/mistralai/client/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py new file mode 100644 index 00000000..9b9aeb51 --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py @@ -0,0 +1,162 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cf43028824bf + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +JobsAPIRoutesFineTuningGetFineTuningJobsStatus = Literal[ + "QUEUED", + "STARTED", + "VALIDATING", + "VALIDATED", + "RUNNING", + "FAILED_VALIDATION", + "FAILED", + "SUCCESS", + "CANCELLED", + "CANCELLATION_REQUESTED", +] +r"""The current job state to filter on. When set, the other results are not displayed.""" + + +class JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict(TypedDict): + page: NotRequired[int] + r"""The page number of the results to be returned.""" + page_size: NotRequired[int] + r"""The number of items to return per page.""" + model: NotRequired[Nullable[str]] + r"""The model name used for fine-tuning to filter on. When set, the other results are not displayed.""" + created_after: NotRequired[Nullable[datetime]] + r"""The date/time to filter on. When set, the results for previous creation times are not displayed.""" + created_before: NotRequired[Nullable[datetime]] + created_by_me: NotRequired[bool] + r"""When set, only return results for jobs created by the API caller. Other results are not displayed.""" + status: NotRequired[Nullable[JobsAPIRoutesFineTuningGetFineTuningJobsStatus]] + r"""The current job state to filter on. When set, the other results are not displayed.""" + wandb_project: NotRequired[Nullable[str]] + r"""The Weights and Biases project to filter on. When set, the other results are not displayed.""" + wandb_name: NotRequired[Nullable[str]] + r"""The Weight and Biases run name to filter on. When set, the other results are not displayed.""" + suffix: NotRequired[Nullable[str]] + r"""The model suffix to filter on. When set, the other results are not displayed.""" + + +class JobsAPIRoutesFineTuningGetFineTuningJobsRequest(BaseModel): + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""The page number of the results to be returned.""" + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""The number of items to return per page.""" + + model: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The model name used for fine-tuning to filter on. When set, the other results are not displayed.""" + + created_after: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The date/time to filter on. When set, the results for previous creation times are not displayed.""" + + created_before: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + created_by_me: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""When set, only return results for jobs created by the API caller. Other results are not displayed.""" + + status: Annotated[ + OptionalNullable[JobsAPIRoutesFineTuningGetFineTuningJobsStatus], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The current job state to filter on. When set, the other results are not displayed.""" + + wandb_project: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The Weights and Biases project to filter on. When set, the other results are not displayed.""" + + wandb_name: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The Weight and Biases run name to filter on. When set, the other results are not displayed.""" + + suffix: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""The model suffix to filter on. When set, the other results are not displayed.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "page", + "page_size", + "model", + "created_after", + "created_before", + "created_by_me", + "status", + "wandb_project", + "wandb_name", + "suffix", + ] + ) + nullable_fields = set( + [ + "model", + "created_after", + "created_before", + "status", + "wandb_project", + "wandb_name", + "suffix", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py b/src/mistralai/client/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py new file mode 100644 index 00000000..cd25fa04 --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e7ff4a4a4edb + +from __future__ import annotations +from .classifierfinetuningjobdetails import ( + ClassifierFineTuningJobDetails, + ClassifierFineTuningJobDetailsTypedDict, +) +from .completionfinetuningjobdetails import ( + CompletionFineTuningJobDetails, + CompletionFineTuningJobDetailsTypedDict, +) +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict(TypedDict): + job_id: str + + +class JobsAPIRoutesFineTuningStartFineTuningJobRequest(BaseModel): + job_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + +JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict = TypeAliasType( + "JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict", + Union[ + CompletionFineTuningJobDetailsTypedDict, ClassifierFineTuningJobDetailsTypedDict + ], +) +r"""OK""" + + +class UnknownJobsAPIRoutesFineTuningStartFineTuningJobResponse(BaseModel): + r"""A JobsAPIRoutesFineTuningStartFineTuningJobResponse variant the SDK doesn't recognize. Preserves the raw payload.""" + + job_type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_JOBS_API_ROUTES_FINE_TUNING_START_FINE_TUNING_JOB_RESPONSE_VARIANTS: dict[str, Any] = { + "classifier": ClassifierFineTuningJobDetails, + "completion": CompletionFineTuningJobDetails, +} + + +JobsAPIRoutesFineTuningStartFineTuningJobResponse = Annotated[ + Union[ + ClassifierFineTuningJobDetails, + CompletionFineTuningJobDetails, + UnknownJobsAPIRoutesFineTuningStartFineTuningJobResponse, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="job_type", + variants=_JOBS_API_ROUTES_FINE_TUNING_START_FINE_TUNING_JOB_RESPONSE_VARIANTS, + unknown_cls=UnknownJobsAPIRoutesFineTuningStartFineTuningJobResponse, + union_name="JobsAPIRoutesFineTuningStartFineTuningJobResponse", + ) + ), +] +r"""OK""" diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py b/src/mistralai/client/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py similarity index 78% rename from src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py rename to src/mistralai/client/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py index a84274ff..fd01fe69 100644 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py +++ b/src/mistralai/client/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7cc1c80335a9 from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py b/src/mistralai/client/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py new file mode 100644 index 00000000..296070b4 --- /dev/null +++ b/src/mistralai/client/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6d9dc624aafd + +from __future__ import annotations +from .classifierfinetunedmodel import ( + ClassifierFineTunedModel, + ClassifierFineTunedModelTypedDict, +) +from .completionfinetunedmodel import ( + CompletionFineTunedModel, + CompletionFineTunedModelTypedDict, +) +from .updatemodelrequest import UpdateModelRequest, UpdateModelRequestTypedDict +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict(TypedDict): + model_id: str + r"""The ID of the model to update.""" + update_model_request: UpdateModelRequestTypedDict + + +class JobsAPIRoutesFineTuningUpdateFineTunedModelRequest(BaseModel): + model_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the model to update.""" + + update_model_request: Annotated[ + UpdateModelRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict = TypeAliasType( + "JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict", + Union[CompletionFineTunedModelTypedDict, ClassifierFineTunedModelTypedDict], +) +r"""OK""" + + +class UnknownJobsAPIRoutesFineTuningUpdateFineTunedModelResponse(BaseModel): + r"""A JobsAPIRoutesFineTuningUpdateFineTunedModelResponse variant the SDK doesn't recognize. Preserves the raw payload.""" + + model_type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_JOBS_API_ROUTES_FINE_TUNING_UPDATE_FINE_TUNED_MODEL_RESPONSE_VARIANTS: dict[ + str, Any +] = { + "classifier": ClassifierFineTunedModel, + "completion": CompletionFineTunedModel, +} + + +JobsAPIRoutesFineTuningUpdateFineTunedModelResponse = Annotated[ + Union[ + ClassifierFineTunedModel, + CompletionFineTunedModel, + UnknownJobsAPIRoutesFineTuningUpdateFineTunedModelResponse, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="model_type", + variants=_JOBS_API_ROUTES_FINE_TUNING_UPDATE_FINE_TUNED_MODEL_RESPONSE_VARIANTS, + unknown_cls=UnknownJobsAPIRoutesFineTuningUpdateFineTunedModelResponse, + union_name="JobsAPIRoutesFineTuningUpdateFineTunedModelResponse", + ) + ), +] +r"""OK""" diff --git a/src/mistralai/client/models/jsonpatch.py b/src/mistralai/client/models/jsonpatch.py new file mode 100644 index 00000000..d67657f5 --- /dev/null +++ b/src/mistralai/client/models/jsonpatch.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b7521bc9a558 + +from __future__ import annotations +from .jsonpatchadd import JSONPatchAdd, JSONPatchAddTypedDict +from .jsonpatchappend import JSONPatchAppend, JSONPatchAppendTypedDict +from .jsonpatchremove import JSONPatchRemove, JSONPatchRemoveTypedDict +from .jsonpatchreplace import JSONPatchReplace, JSONPatchReplaceTypedDict +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType + + +JSONPatchTypedDict = TypeAliasType( + "JSONPatchTypedDict", + Union[ + JSONPatchAppendTypedDict, + JSONPatchAddTypedDict, + JSONPatchReplaceTypedDict, + JSONPatchRemoveTypedDict, + ], +) + + +class UnknownJSONPatch(BaseModel): + r"""A JSONPatch variant the SDK doesn't recognize. Preserves the raw payload.""" + + op: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_JSON_PATCH_VARIANTS: dict[str, Any] = { + "add": JSONPatchAdd, + "append": JSONPatchAppend, + "remove": JSONPatchRemove, + "replace": JSONPatchReplace, +} + + +JSONPatch = Annotated[ + Union[ + JSONPatchAdd, + JSONPatchAppend, + JSONPatchRemove, + JSONPatchReplace, + UnknownJSONPatch, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="op", + variants=_JSON_PATCH_VARIANTS, + unknown_cls=UnknownJSONPatch, + union_name="JSONPatch", + ) + ), +] diff --git a/src/mistralai/client/models/jsonpatchadd.py b/src/mistralai/client/models/jsonpatchadd.py new file mode 100644 index 00000000..d4242f11 --- /dev/null +++ b/src/mistralai/client/models/jsonpatchadd.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fb2a1e58a6a5 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Any, Literal +from typing_extensions import Annotated, TypedDict + + +class JSONPatchAddTypedDict(TypedDict): + path: str + r"""A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations.""" + value: Any + r"""The value to use for the operation""" + op: Literal["add"] + r"""Add operation""" + + +class JSONPatchAdd(BaseModel): + path: str + r"""A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations.""" + + value: Any + r"""The value to use for the operation""" + + op: Annotated[ + Annotated[Literal["add"], AfterValidator(validate_const("add"))], + pydantic.Field(alias="op"), + ] = "add" + r"""Add operation""" + + +try: + JSONPatchAdd.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/jsonpatchappend.py b/src/mistralai/client/models/jsonpatchappend.py new file mode 100644 index 00000000..7181ddac --- /dev/null +++ b/src/mistralai/client/models/jsonpatchappend.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 61801f21f4b0 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class JSONPatchAppendTypedDict(TypedDict): + path: str + r"""A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations.""" + value: str + r"""The value to use for the operation. A string to append to the existing value""" + op: Literal["append"] + r"""'append' is an extension for efficient string concatenation in streaming scenarios.""" + + +class JSONPatchAppend(BaseModel): + path: str + r"""A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations.""" + + value: str + r"""The value to use for the operation. A string to append to the existing value""" + + op: Annotated[ + Annotated[Literal["append"], AfterValidator(validate_const("append"))], + pydantic.Field(alias="op"), + ] = "append" + r"""'append' is an extension for efficient string concatenation in streaming scenarios.""" + + +try: + JSONPatchAppend.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/jsonpatchpayloadresponse.py b/src/mistralai/client/models/jsonpatchpayloadresponse.py new file mode 100644 index 00000000..a0301f9a --- /dev/null +++ b/src/mistralai/client/models/jsonpatchpayloadresponse.py @@ -0,0 +1,88 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1b39f46f529f + +from __future__ import annotations +from .encodedpayloadoptions import EncodedPayloadOptions +from .jsonpatchpayloadvalueresponse import ( + JSONPatchPayloadValueResponse, + JSONPatchPayloadValueResponseTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JSONPatchPayloadResponseTypedDict(TypedDict): + r"""A payload containing a list of JSON Patch operations. + + Used for streaming incremental updates to workflow state. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + value: JSONPatchPayloadValueResponseTypedDict + type: Literal["json_patch"] + r"""Discriminator indicating this is a JSON Patch payload.""" + encoding_options: NotRequired[Nullable[List[EncodedPayloadOptions]]] + r"""Encoding options applied to the payload.""" + + +class JSONPatchPayloadResponse(BaseModel): + r"""A payload containing a list of JSON Patch operations. + + Used for streaming incremental updates to workflow state. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + value: JSONPatchPayloadValueResponse + + type: Annotated[ + Annotated[Literal["json_patch"], AfterValidator(validate_const("json_patch"))], + pydantic.Field(alias="type"), + ] = "json_patch" + r"""Discriminator indicating this is a JSON Patch payload.""" + + encoding_options: OptionalNullable[List[EncodedPayloadOptions]] = UNSET + r"""Encoding options applied to the payload.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["encoding_options"]) + nullable_fields = set(["encoding_options"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + JSONPatchPayloadResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/jsonpatchpayloadvalueresponse.py b/src/mistralai/client/models/jsonpatchpayloadvalueresponse.py new file mode 100644 index 00000000..d6ac1b6b --- /dev/null +++ b/src/mistralai/client/models/jsonpatchpayloadvalueresponse.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6cf0e3599e2c + +from __future__ import annotations +from .jsonpatch import JSONPatch, JSONPatchTypedDict +from typing import List, Union +from typing_extensions import TypeAliasType + + +JSONPatchPayloadValueResponseTypedDict = TypeAliasType( + "JSONPatchPayloadValueResponseTypedDict", Union[List[JSONPatchTypedDict], str] +) + + +JSONPatchPayloadValueResponse = TypeAliasType( + "JSONPatchPayloadValueResponse", Union[List[JSONPatch], str] +) diff --git a/src/mistralai/client/models/jsonpatchremove.py b/src/mistralai/client/models/jsonpatchremove.py new file mode 100644 index 00000000..5bcedf87 --- /dev/null +++ b/src/mistralai/client/models/jsonpatchremove.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e472e5b752ec + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Any, Literal +from typing_extensions import Annotated, TypedDict + + +class JSONPatchRemoveTypedDict(TypedDict): + path: str + r"""A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations.""" + value: Any + r"""The value to use for the operation""" + op: Literal["remove"] + r"""Remove operation""" + + +class JSONPatchRemove(BaseModel): + path: str + r"""A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations.""" + + value: Any + r"""The value to use for the operation""" + + op: Annotated[ + Annotated[Literal["remove"], AfterValidator(validate_const("remove"))], + pydantic.Field(alias="op"), + ] = "remove" + r"""Remove operation""" + + +try: + JSONPatchRemove.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/jsonpatchreplace.py b/src/mistralai/client/models/jsonpatchreplace.py new file mode 100644 index 00000000..3dd7aee6 --- /dev/null +++ b/src/mistralai/client/models/jsonpatchreplace.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 816f9df2f3c9 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Any, Literal +from typing_extensions import Annotated, TypedDict + + +class JSONPatchReplaceTypedDict(TypedDict): + path: str + r"""A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations.""" + value: Any + r"""The value to use for the operation""" + op: Literal["replace"] + r"""Replace operation""" + + +class JSONPatchReplace(BaseModel): + path: str + r"""A JSON Pointer (RFC 6901) identifying the target location within the document. Can be a string path (e.g., '/foo/bar'), '/', '', or an empty list [] for root-level operations.""" + + value: Any + r"""The value to use for the operation""" + + op: Annotated[ + Annotated[Literal["replace"], AfterValidator(validate_const("replace"))], + pydantic.Field(alias="op"), + ] = "replace" + r"""Replace operation""" + + +try: + JSONPatchReplace.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/jsonpayloadresponse.py b/src/mistralai/client/models/jsonpayloadresponse.py new file mode 100644 index 00000000..9de73d2c --- /dev/null +++ b/src/mistralai/client/models/jsonpayloadresponse.py @@ -0,0 +1,86 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ba3265f85453 + +from __future__ import annotations +from .encodedpayloadoptions import EncodedPayloadOptions +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JSONPayloadResponseTypedDict(TypedDict): + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + value: Any + r"""The JSON-serializable payload value. When encrypted, contains base64-encoded data.""" + type: Literal["json"] + r"""Discriminator indicating this is a raw JSON payload.""" + encoding_options: NotRequired[Nullable[List[EncodedPayloadOptions]]] + r"""Encoding options applied to the payload.""" + + +class JSONPayloadResponse(BaseModel): + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + value: Any + r"""The JSON-serializable payload value. When encrypted, contains base64-encoded data.""" + + type: Annotated[ + Annotated[Optional[Literal["json"]], AfterValidator(validate_const("json"))], + pydantic.Field(alias="type"), + ] = "json" + r"""Discriminator indicating this is a raw JSON payload.""" + + encoding_options: OptionalNullable[List[EncodedPayloadOptions]] = UNSET + r"""Encoding options applied to the payload.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "encoding_options"]) + nullable_fields = set(["encoding_options"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + JSONPayloadResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/jsonschema.py b/src/mistralai/client/models/jsonschema.py new file mode 100644 index 00000000..bc0bd6c4 --- /dev/null +++ b/src/mistralai/client/models/jsonschema.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e1fc1d8a434a + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JSONSchemaTypedDict(TypedDict): + name: str + schema_definition: Dict[str, Any] + description: NotRequired[Nullable[str]] + strict: NotRequired[bool] + + +class JSONSchema(BaseModel): + name: str + + schema_definition: Annotated[Dict[str, Any], pydantic.Field(alias="schema")] + + description: OptionalNullable[str] = UNSET + + strict: Optional[bool] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "strict"]) + nullable_fields = set(["description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + JSONSchema.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/judge.py b/src/mistralai/client/models/judge.py new file mode 100644 index 00000000..036aabb7 --- /dev/null +++ b/src/mistralai/client/models/judge.py @@ -0,0 +1,136 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d6adc687c2d9 + +from __future__ import annotations +from .judgeclassificationoutput import ( + JudgeClassificationOutput, + JudgeClassificationOutputTypedDict, +) +from .judgeregressionoutput import JudgeRegressionOutput, JudgeRegressionOutputTypedDict +from datetime import datetime +from functools import partial +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import BeforeValidator +from typing import Any, List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +JudgeOutputUnionTypedDict = TypeAliasType( + "JudgeOutputUnionTypedDict", + Union[JudgeClassificationOutputTypedDict, JudgeRegressionOutputTypedDict], +) + + +class UnknownJudgeOutputUnion(BaseModel): + r"""A JudgeOutputUnion variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_JUDGE_OUTPUT_UNION_VARIANTS: dict[str, Any] = { + "CLASSIFICATION": JudgeClassificationOutput, + "REGRESSION": JudgeRegressionOutput, +} + + +JudgeOutputUnion = Annotated[ + Union[JudgeClassificationOutput, JudgeRegressionOutput, UnknownJudgeOutputUnion], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_JUDGE_OUTPUT_UNION_VARIANTS, + unknown_cls=UnknownJudgeOutputUnion, + union_name="JudgeOutputUnion", + ) + ), +] + + +class JudgeTypedDict(TypedDict): + id: str + created_at: datetime + updated_at: datetime + deleted_at: Nullable[datetime] + owner_id: str + workspace_id: str + name: str + description: str + model_name: str + output: JudgeOutputUnionTypedDict + instructions: str + tools: List[str] + up_revision: NotRequired[Nullable[str]] + down_revision: NotRequired[Nullable[str]] + base_revision: NotRequired[Nullable[str]] + + +class Judge(BaseModel): + id: str + + created_at: datetime + + updated_at: datetime + + deleted_at: Nullable[datetime] + + owner_id: str + + workspace_id: str + + name: str + + description: str + + model_name: str + + output: JudgeOutputUnion + + instructions: str + + tools: List[str] + + up_revision: OptionalNullable[str] = UNSET + + down_revision: OptionalNullable[str] = UNSET + + base_revision: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["up_revision", "down_revision", "base_revision"]) + nullable_fields = set( + ["deleted_at", "up_revision", "down_revision", "base_revision"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/judge_chat_completion_event_v1_observability_chat_completion_events_event_id_live_judging_postop.py b/src/mistralai/client/models/judge_chat_completion_event_v1_observability_chat_completion_events_event_id_live_judging_postop.py new file mode 100644 index 00000000..a6b9c969 --- /dev/null +++ b/src/mistralai/client/models/judge_chat_completion_event_v1_observability_chat_completion_events_event_id_live_judging_postop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 98c823e7cc1b + +from __future__ import annotations +from .judgechatcompletioneventrequest import ( + JudgeChatCompletionEventRequest, + JudgeChatCompletionEventRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequestTypedDict( + TypedDict +): + event_id: str + judge_chat_completion_event_request: JudgeChatCompletionEventRequestTypedDict + + +class JudgeChatCompletionEventV1ObservabilityChatCompletionEventsEventIDLiveJudgingPostRequest( + BaseModel +): + event_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + judge_chat_completion_event_request: Annotated[ + JudgeChatCompletionEventRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/judge_conversation_v1_observability_judges_judge_id_live_judging_postop.py b/src/mistralai/client/models/judge_conversation_v1_observability_judges_judge_id_live_judging_postop.py new file mode 100644 index 00000000..4f211dd3 --- /dev/null +++ b/src/mistralai/client/models/judge_conversation_v1_observability_judges_judge_id_live_judging_postop.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a958f3e6b122 + +from __future__ import annotations +from .judgeconversationrequest import ( + JudgeConversationRequest, + JudgeConversationRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequestTypedDict( + TypedDict +): + judge_id: str + judge_conversation_request: JudgeConversationRequestTypedDict + + +class JudgeConversationV1ObservabilityJudgesJudgeIDLiveJudgingPostRequest(BaseModel): + judge_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + judge_conversation_request: Annotated[ + JudgeConversationRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/judge_dataset_record_v1_observability_dataset_records_dataset_record_id_live_judging_postop.py b/src/mistralai/client/models/judge_dataset_record_v1_observability_dataset_records_dataset_record_id_live_judging_postop.py new file mode 100644 index 00000000..4d54fa42 --- /dev/null +++ b/src/mistralai/client/models/judge_dataset_record_v1_observability_dataset_records_dataset_record_id_live_judging_postop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4749566fd16d + +from __future__ import annotations +from .judgedatasetrecordrequest import ( + JudgeDatasetRecordRequest, + JudgeDatasetRecordRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequestTypedDict( + TypedDict +): + dataset_record_id: str + judge_dataset_record_request: JudgeDatasetRecordRequestTypedDict + + +class JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequest( + BaseModel +): + dataset_record_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + judge_dataset_record_request: Annotated[ + JudgeDatasetRecordRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/judgechatcompletioneventrequest.py b/src/mistralai/client/models/judgechatcompletioneventrequest.py new file mode 100644 index 00000000..59c68801 --- /dev/null +++ b/src/mistralai/client/models/judgechatcompletioneventrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4fad8a510f7d + +from __future__ import annotations +from .createjudgerequest import CreateJudgeRequest, CreateJudgeRequestTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class JudgeChatCompletionEventRequestTypedDict(TypedDict): + judge_definition: CreateJudgeRequestTypedDict + + +class JudgeChatCompletionEventRequest(BaseModel): + judge_definition: CreateJudgeRequest diff --git a/src/mistralai/client/models/judgeclassificationoutput.py b/src/mistralai/client/models/judgeclassificationoutput.py new file mode 100644 index 00000000..aa799682 --- /dev/null +++ b/src/mistralai/client/models/judgeclassificationoutput.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 683ae72d0efa + +from __future__ import annotations +from .judgeclassificationoutputoption import ( + JudgeClassificationOutputOption, + JudgeClassificationOutputOptionTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import List, Literal +from typing_extensions import Annotated, TypedDict + + +class JudgeClassificationOutputTypedDict(TypedDict): + options: List[JudgeClassificationOutputOptionTypedDict] + type: Literal["CLASSIFICATION"] + + +class JudgeClassificationOutput(BaseModel): + options: List[JudgeClassificationOutputOption] + + type: Annotated[ + Annotated[ + Literal["CLASSIFICATION"], AfterValidator(validate_const("CLASSIFICATION")) + ], + pydantic.Field(alias="type"), + ] = "CLASSIFICATION" + + +try: + JudgeClassificationOutput.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/judgeclassificationoutputoption.py b/src/mistralai/client/models/judgeclassificationoutputoption.py new file mode 100644 index 00000000..64fad49f --- /dev/null +++ b/src/mistralai/client/models/judgeclassificationoutputoption.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c238f17d786b + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class JudgeClassificationOutputOptionTypedDict(TypedDict): + value: str + description: str + + +class JudgeClassificationOutputOption(BaseModel): + value: str + + description: str diff --git a/src/mistralai/client/models/judgeconversationrequest.py b/src/mistralai/client/models/judgeconversationrequest.py new file mode 100644 index 00000000..2c93f7b7 --- /dev/null +++ b/src/mistralai/client/models/judgeconversationrequest.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b8bfdade89a2 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, List +from typing_extensions import NotRequired, TypedDict + + +class JudgeConversationRequestTypedDict(TypedDict): + messages: List[Dict[str, Any]] + properties: NotRequired[Nullable[Dict[str, Any]]] + + +class JudgeConversationRequest(BaseModel): + messages: List[Dict[str, Any]] + + properties: OptionalNullable[Dict[str, Any]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["properties"]) + nullable_fields = set(["properties"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/judgedatasetrecordrequest.py b/src/mistralai/client/models/judgedatasetrecordrequest.py new file mode 100644 index 00000000..11499067 --- /dev/null +++ b/src/mistralai/client/models/judgedatasetrecordrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9ad8915328dd + +from __future__ import annotations +from .createjudgerequest import CreateJudgeRequest, CreateJudgeRequestTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class JudgeDatasetRecordRequestTypedDict(TypedDict): + judge_definition: CreateJudgeRequestTypedDict + + +class JudgeDatasetRecordRequest(BaseModel): + judge_definition: CreateJudgeRequest diff --git a/src/mistralai/client/models/judgeoutput.py b/src/mistralai/client/models/judgeoutput.py new file mode 100644 index 00000000..2224a797 --- /dev/null +++ b/src/mistralai/client/models/judgeoutput.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8c8099403e62 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Union +from typing_extensions import TypeAliasType, TypedDict + + +AnswerTypedDict = TypeAliasType("AnswerTypedDict", Union[str, float]) + + +Answer = TypeAliasType("Answer", Union[str, float]) + + +class JudgeOutputTypedDict(TypedDict): + analysis: str + answer: AnswerTypedDict + + +class JudgeOutput(BaseModel): + analysis: str + + answer: Answer diff --git a/src/mistralai/client/models/judgeoutputtype.py b/src/mistralai/client/models/judgeoutputtype.py new file mode 100644 index 00000000..4fa99498 --- /dev/null +++ b/src/mistralai/client/models/judgeoutputtype.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3f07e1eb25f9 + +from __future__ import annotations +from typing import Literal + + +JudgeOutputType = Literal[ + "REGRESSION", + "CLASSIFICATION", +] diff --git a/src/mistralai/client/models/judgeregressionoutput.py b/src/mistralai/client/models/judgeregressionoutput.py new file mode 100644 index 00000000..9bb8f9c1 --- /dev/null +++ b/src/mistralai/client/models/judgeregressionoutput.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c61d451066dc + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JudgeRegressionOutputTypedDict(TypedDict): + min_description: str + max_description: str + type: Literal["REGRESSION"] + min: NotRequired[float] + max: NotRequired[float] + + +class JudgeRegressionOutput(BaseModel): + min_description: str + + max_description: str + + type: Annotated[ + Annotated[Literal["REGRESSION"], AfterValidator(validate_const("REGRESSION"))], + pydantic.Field(alias="type"), + ] = "REGRESSION" + + min: Optional[float] = 0 + + max: Optional[float] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["min", "max"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + JudgeRegressionOutput.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/legacyjobmetadata.py b/src/mistralai/client/models/legacyjobmetadata.py new file mode 100644 index 00000000..143f0e7c --- /dev/null +++ b/src/mistralai/client/models/legacyjobmetadata.py @@ -0,0 +1,137 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0330b8930f65 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class LegacyJobMetadataTypedDict(TypedDict): + details: str + expected_duration_seconds: NotRequired[Nullable[int]] + r"""The approximated time (in seconds) for the fine-tuning process to complete.""" + cost: NotRequired[Nullable[float]] + r"""The cost of the fine-tuning job.""" + cost_currency: NotRequired[Nullable[str]] + r"""The currency used for the fine-tuning job cost.""" + train_tokens_per_step: NotRequired[Nullable[int]] + r"""The number of tokens consumed by one training step.""" + train_tokens: NotRequired[Nullable[int]] + r"""The total number of tokens used during the fine-tuning process.""" + data_tokens: NotRequired[Nullable[int]] + r"""The total number of tokens in the training dataset.""" + estimated_start_time: NotRequired[Nullable[int]] + deprecated: NotRequired[bool] + epochs: NotRequired[Nullable[float]] + r"""The number of complete passes through the entire training dataset.""" + training_steps: NotRequired[Nullable[int]] + r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" + object: Literal["job.metadata"] + + +class LegacyJobMetadata(BaseModel): + details: str + + expected_duration_seconds: OptionalNullable[int] = UNSET + r"""The approximated time (in seconds) for the fine-tuning process to complete.""" + + cost: OptionalNullable[float] = UNSET + r"""The cost of the fine-tuning job.""" + + cost_currency: OptionalNullable[str] = UNSET + r"""The currency used for the fine-tuning job cost.""" + + train_tokens_per_step: OptionalNullable[int] = UNSET + r"""The number of tokens consumed by one training step.""" + + train_tokens: OptionalNullable[int] = UNSET + r"""The total number of tokens used during the fine-tuning process.""" + + data_tokens: OptionalNullable[int] = UNSET + r"""The total number of tokens in the training dataset.""" + + estimated_start_time: OptionalNullable[int] = UNSET + + deprecated: Optional[bool] = True + + epochs: OptionalNullable[float] = UNSET + r"""The number of complete passes through the entire training dataset.""" + + training_steps: OptionalNullable[int] = UNSET + r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" + + object: Annotated[ + Annotated[ + Optional[Literal["job.metadata"]], + AfterValidator(validate_const("job.metadata")), + ], + pydantic.Field(alias="object"), + ] = "job.metadata" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "expected_duration_seconds", + "cost", + "cost_currency", + "train_tokens_per_step", + "train_tokens", + "data_tokens", + "estimated_start_time", + "deprecated", + "epochs", + "training_steps", + "object", + ] + ) + nullable_fields = set( + [ + "expected_duration_seconds", + "cost", + "cost_currency", + "train_tokens_per_step", + "train_tokens", + "data_tokens", + "estimated_start_time", + "epochs", + "training_steps", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + LegacyJobMetadata.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/libraries_delete_v1op.py b/src/mistralai/client/models/libraries_delete_v1op.py new file mode 100644 index 00000000..893ab53b --- /dev/null +++ b/src/mistralai/client/models/libraries_delete_v1op.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b2e8bbd19baa + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class LibrariesDeleteV1RequestTypedDict(TypedDict): + library_id: str + + +class LibrariesDeleteV1Request(BaseModel): + library_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/models/libraries_documents_delete_v1op.py b/src/mistralai/client/models/libraries_documents_delete_v1op.py similarity index 79% rename from src/mistralai/models/libraries_documents_delete_v1op.py rename to src/mistralai/client/models/libraries_documents_delete_v1op.py index c33710b0..0495832e 100644 --- a/src/mistralai/models/libraries_documents_delete_v1op.py +++ b/src/mistralai/client/models/libraries_documents_delete_v1op.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 81eb34382a3d from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/models/libraries_documents_get_extracted_text_signed_url_v1op.py b/src/mistralai/client/models/libraries_documents_get_extracted_text_signed_url_v1op.py similarity index 80% rename from src/mistralai/models/libraries_documents_get_extracted_text_signed_url_v1op.py rename to src/mistralai/client/models/libraries_documents_get_extracted_text_signed_url_v1op.py index e2459c1c..186baaed 100644 --- a/src/mistralai/models/libraries_documents_get_extracted_text_signed_url_v1op.py +++ b/src/mistralai/client/models/libraries_documents_get_extracted_text_signed_url_v1op.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a7417ebd6040 from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/models/libraries_documents_get_signed_url_v1op.py b/src/mistralai/client/models/libraries_documents_get_signed_url_v1op.py similarity index 79% rename from src/mistralai/models/libraries_documents_get_signed_url_v1op.py rename to src/mistralai/client/models/libraries_documents_get_signed_url_v1op.py index bc913ba5..ebcf85d7 100644 --- a/src/mistralai/models/libraries_documents_get_signed_url_v1op.py +++ b/src/mistralai/client/models/libraries_documents_get_signed_url_v1op.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d4b7b47913ba from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/models/libraries_documents_get_status_v1op.py b/src/mistralai/client/models/libraries_documents_get_status_v1op.py similarity index 79% rename from src/mistralai/models/libraries_documents_get_status_v1op.py rename to src/mistralai/client/models/libraries_documents_get_status_v1op.py index 08992d7c..1f484787 100644 --- a/src/mistralai/models/libraries_documents_get_status_v1op.py +++ b/src/mistralai/client/models/libraries_documents_get_status_v1op.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f314f73e909c from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/libraries_documents_get_text_content_v1op.py b/src/mistralai/client/models/libraries_documents_get_text_content_v1op.py new file mode 100644 index 00000000..3d2ad43d --- /dev/null +++ b/src/mistralai/client/models/libraries_documents_get_text_content_v1op.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1ca4e0c41321 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class LibrariesDocumentsGetTextContentV1RequestTypedDict(TypedDict): + library_id: str + document_id: str + page_start: NotRequired[Nullable[int]] + page_end: NotRequired[Nullable[int]] + + +class LibrariesDocumentsGetTextContentV1Request(BaseModel): + library_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + document_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + page_start: Annotated[ + OptionalNullable[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + page_end: Annotated[ + OptionalNullable[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_start", "page_end"]) + nullable_fields = set(["page_start", "page_end"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/models/libraries_documents_get_v1op.py b/src/mistralai/client/models/libraries_documents_get_v1op.py similarity index 79% rename from src/mistralai/models/libraries_documents_get_v1op.py rename to src/mistralai/client/models/libraries_documents_get_v1op.py index ff2bdedb..857dfbe6 100644 --- a/src/mistralai/models/libraries_documents_get_v1op.py +++ b/src/mistralai/client/models/libraries_documents_get_v1op.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 26ff35f0c69d from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/libraries_documents_list_v1op.py b/src/mistralai/client/models/libraries_documents_list_v1op.py new file mode 100644 index 00000000..afc474cb --- /dev/null +++ b/src/mistralai/client/models/libraries_documents_list_v1op.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 756f26de3cbe + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class LibrariesDocumentsListV1RequestTypedDict(TypedDict): + library_id: str + search: NotRequired[Nullable[str]] + page_size: NotRequired[int] + page: NotRequired[int] + filters_attributes: NotRequired[Nullable[str]] + sort_by: NotRequired[str] + sort_order: NotRequired[str] + + +class LibrariesDocumentsListV1Request(BaseModel): + library_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + search: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + + filters_attributes: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + sort_by: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "created_at" + + sort_order: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "desc" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "search", + "page_size", + "page", + "filters_attributes", + "sort_by", + "sort_order", + ] + ) + nullable_fields = set(["search", "filters_attributes"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/models/libraries_documents_reprocess_v1op.py b/src/mistralai/client/models/libraries_documents_reprocess_v1op.py similarity index 79% rename from src/mistralai/models/libraries_documents_reprocess_v1op.py rename to src/mistralai/client/models/libraries_documents_reprocess_v1op.py index 861993e7..a2f9ba2a 100644 --- a/src/mistralai/models/libraries_documents_reprocess_v1op.py +++ b/src/mistralai/client/models/libraries_documents_reprocess_v1op.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: dbbeb02fc336 from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/libraries_documents_update_v1op.py b/src/mistralai/client/models/libraries_documents_update_v1op.py new file mode 100644 index 00000000..7ad4231f --- /dev/null +++ b/src/mistralai/client/models/libraries_documents_update_v1op.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 734ba6c19f5f + +from __future__ import annotations +from .updatedocumentrequest import UpdateDocumentRequest, UpdateDocumentRequestTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class LibrariesDocumentsUpdateV1RequestTypedDict(TypedDict): + library_id: str + document_id: str + update_document_request: UpdateDocumentRequestTypedDict + + +class LibrariesDocumentsUpdateV1Request(BaseModel): + library_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + document_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_document_request: Annotated[ + UpdateDocumentRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/models/libraries_documents_upload_v1op.py b/src/mistralai/client/models/libraries_documents_upload_v1op.py similarity index 82% rename from src/mistralai/models/libraries_documents_upload_v1op.py rename to src/mistralai/client/models/libraries_documents_upload_v1op.py index 51f536cc..388633d1 100644 --- a/src/mistralai/models/libraries_documents_upload_v1op.py +++ b/src/mistralai/client/models/libraries_documents_upload_v1op.py @@ -1,9 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 744466971862 from __future__ import annotations from .file import File, FileTypedDict -from mistralai.types import BaseModel -from mistralai.utils import ( +from mistralai.client.types import BaseModel +from mistralai.client.utils import ( FieldMetadata, MultipartFormMetadata, PathParamMetadata, @@ -12,7 +13,7 @@ from typing_extensions import Annotated, TypedDict -class LibrariesDocumentsUploadV1DocumentUploadTypedDict(TypedDict): +class DocumentUploadTypedDict(TypedDict): file: FileTypedDict r"""The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such: @@ -26,7 +27,7 @@ class LibrariesDocumentsUploadV1DocumentUploadTypedDict(TypedDict): """ -class LibrariesDocumentsUploadV1DocumentUpload(BaseModel): +class DocumentUpload(BaseModel): file: Annotated[File, FieldMetadata(multipart=MultipartFormMetadata(file=True))] r"""The File object (not file name) to be uploaded. To upload a file and specify a custom file name you should format your request as such: @@ -42,7 +43,7 @@ class LibrariesDocumentsUploadV1DocumentUpload(BaseModel): class LibrariesDocumentsUploadV1RequestTypedDict(TypedDict): library_id: str - request_body: LibrariesDocumentsUploadV1DocumentUploadTypedDict + request_body: DocumentUploadTypedDict class LibrariesDocumentsUploadV1Request(BaseModel): @@ -51,6 +52,6 @@ class LibrariesDocumentsUploadV1Request(BaseModel): ] request_body: Annotated[ - LibrariesDocumentsUploadV1DocumentUpload, + DocumentUpload, FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")), ] diff --git a/src/mistralai/client/models/libraries_get_v1op.py b/src/mistralai/client/models/libraries_get_v1op.py new file mode 100644 index 00000000..7a51d605 --- /dev/null +++ b/src/mistralai/client/models/libraries_get_v1op.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d493f39e7ebb + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class LibrariesGetV1RequestTypedDict(TypedDict): + library_id: str + + +class LibrariesGetV1Request(BaseModel): + library_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/libraries_list_v1op.py b/src/mistralai/client/models/libraries_list_v1op.py new file mode 100644 index 00000000..cac06dad --- /dev/null +++ b/src/mistralai/client/models/libraries_list_v1op.py @@ -0,0 +1,73 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2d9b1b4deeb0 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class LibrariesListV1RequestTypedDict(TypedDict): + page_size: NotRequired[int] + page: NotRequired[int] + search: NotRequired[Nullable[str]] + r"""Case-insensitive search on the library name.""" + filter_owned_by_me: NotRequired[Nullable[bool]] + r"""Filter libraries by whether they were created by the current authenticated identity. Set to true for created by me, false for only libraries shared with me, or None to disable this filter.""" + + +class LibrariesListV1Request(BaseModel): + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + + search: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Case-insensitive search on the library name.""" + + filter_owned_by_me: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter libraries by whether they were created by the current authenticated identity. Set to true for created by me, false for only libraries shared with me, or None to disable this filter.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["page_size", "page", "search", "filter_owned_by_me"]) + nullable_fields = set(["search", "filter_owned_by_me"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/libraries_share_create_v1op.py b/src/mistralai/client/models/libraries_share_create_v1op.py new file mode 100644 index 00000000..9751045c --- /dev/null +++ b/src/mistralai/client/models/libraries_share_create_v1op.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: feaacfd46dd3 + +from __future__ import annotations +from .sharingrequest import SharingRequest, SharingRequestTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class LibrariesShareCreateV1RequestTypedDict(TypedDict): + library_id: str + sharing_request: SharingRequestTypedDict + + +class LibrariesShareCreateV1Request(BaseModel): + library_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + sharing_request: Annotated[ + SharingRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/models/libraries_share_delete_v1op.py b/src/mistralai/client/models/libraries_share_delete_v1op.py similarity index 80% rename from src/mistralai/models/libraries_share_delete_v1op.py rename to src/mistralai/client/models/libraries_share_delete_v1op.py index e29d556a..eca3f86a 100644 --- a/src/mistralai/models/libraries_share_delete_v1op.py +++ b/src/mistralai/client/models/libraries_share_delete_v1op.py @@ -1,9 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7f3a679ca384 from __future__ import annotations from .sharingdelete import SharingDelete, SharingDeleteTypedDict -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata from typing_extensions import Annotated, TypedDict diff --git a/src/mistralai/client/models/libraries_share_list_v1op.py b/src/mistralai/client/models/libraries_share_list_v1op.py new file mode 100644 index 00000000..895a2590 --- /dev/null +++ b/src/mistralai/client/models/libraries_share_list_v1op.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8f0af379bf1c + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class LibrariesShareListV1RequestTypedDict(TypedDict): + library_id: str + + +class LibrariesShareListV1Request(BaseModel): + library_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/libraries_update_v1op.py b/src/mistralai/client/models/libraries_update_v1op.py new file mode 100644 index 00000000..54b0ab70 --- /dev/null +++ b/src/mistralai/client/models/libraries_update_v1op.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 92c8d4132252 + +from __future__ import annotations +from .updatelibraryrequest import UpdateLibraryRequest, UpdateLibraryRequestTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class LibrariesUpdateV1RequestTypedDict(TypedDict): + library_id: str + update_library_request: UpdateLibraryRequestTypedDict + + +class LibrariesUpdateV1Request(BaseModel): + library_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_library_request: Annotated[ + UpdateLibraryRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/library.py b/src/mistralai/client/models/library.py new file mode 100644 index 00000000..0e09cfaa --- /dev/null +++ b/src/mistralai/client/models/library.py @@ -0,0 +1,122 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 028a34b08f9c + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class LibraryTypedDict(TypedDict): + id: str + name: str + created_at: datetime + updated_at: datetime + owner_id: Nullable[str] + owner_type: str + total_size: int + nb_documents: int + chunk_size: Nullable[int] + emoji: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + generated_description: NotRequired[Nullable[str]] + explicit_user_members_count: NotRequired[Nullable[int]] + explicit_workspace_members_count: NotRequired[Nullable[int]] + org_sharing_role: NotRequired[Nullable[str]] + generated_name: NotRequired[Nullable[str]] + r"""Generated Name""" + + +class Library(BaseModel): + id: str + + name: str + + created_at: datetime + + updated_at: datetime + + owner_id: Nullable[str] + + owner_type: str + + total_size: int + + nb_documents: int + + chunk_size: Nullable[int] + + emoji: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + generated_description: OptionalNullable[str] = UNSET + + explicit_user_members_count: OptionalNullable[int] = UNSET + + explicit_workspace_members_count: OptionalNullable[int] = UNSET + + org_sharing_role: Annotated[ + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET + + generated_name: OptionalNullable[str] = UNSET + r"""Generated Name""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "emoji", + "description", + "generated_description", + "explicit_user_members_count", + "explicit_workspace_members_count", + "org_sharing_role", + "generated_name", + ] + ) + nullable_fields = set( + [ + "owner_id", + "chunk_size", + "emoji", + "description", + "generated_description", + "explicit_user_members_count", + "explicit_workspace_members_count", + "org_sharing_role", + "generated_name", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/list_deployments_v1_workflows_deployments_getop.py b/src/mistralai/client/models/list_deployments_v1_workflows_deployments_getop.py new file mode 100644 index 00000000..066b8db1 --- /dev/null +++ b/src/mistralai/client/models/list_deployments_v1_workflows_deployments_getop.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0c6586ffcab0 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListDeploymentsV1WorkflowsDeploymentsGetRequestTypedDict(TypedDict): + active_only: NotRequired[bool] + workflow_name: NotRequired[Nullable[str]] + + +class ListDeploymentsV1WorkflowsDeploymentsGetRequest(BaseModel): + active_only: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = True + + workflow_name: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["active_only", "workflow_name"]) + nullable_fields = set(["workflow_name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/list_models_v1_models_getop.py b/src/mistralai/client/models/list_models_v1_models_getop.py new file mode 100644 index 00000000..1a42d9b0 --- /dev/null +++ b/src/mistralai/client/models/list_models_v1_models_getop.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1843a7aa68e5 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListModelsV1ModelsGetRequestTypedDict(TypedDict): + provider: NotRequired[Nullable[str]] + model: NotRequired[Nullable[str]] + + +class ListModelsV1ModelsGetRequest(BaseModel): + provider: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + model: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["provider", "model"]) + nullable_fields = set(["provider", "model"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/list_runs_v1_workflows_runs_getop.py b/src/mistralai/client/models/list_runs_v1_workflows_runs_getop.py new file mode 100644 index 00000000..3237a29a --- /dev/null +++ b/src/mistralai/client/models/list_runs_v1_workflows_runs_getop.py @@ -0,0 +1,136 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2f1b225158c3 + +from __future__ import annotations +from .workflowexecutionlistresponse import ( + WorkflowExecutionListResponse, + WorkflowExecutionListResponseTypedDict, +) +from .workflowexecutionstatus import WorkflowExecutionStatus +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Awaitable, Callable, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ListRunsV1WorkflowsRunsGetStatusTypedDict = TypeAliasType( + "ListRunsV1WorkflowsRunsGetStatusTypedDict", + Union[WorkflowExecutionStatus, List[WorkflowExecutionStatus]], +) +r"""Filter by workflow status""" + + +ListRunsV1WorkflowsRunsGetStatus = TypeAliasType( + "ListRunsV1WorkflowsRunsGetStatus", + Union[WorkflowExecutionStatus, List[WorkflowExecutionStatus]], +) +r"""Filter by workflow status""" + + +class ListRunsV1WorkflowsRunsGetRequestTypedDict(TypedDict): + workflow_identifier: NotRequired[Nullable[str]] + r"""Filter by workflow name or id""" + search: NotRequired[Nullable[str]] + r"""Search by workflow name, display name or id""" + status: NotRequired[Nullable[ListRunsV1WorkflowsRunsGetStatusTypedDict]] + r"""Filter by workflow status""" + user_id: NotRequired[Nullable[str]] + r"""Filter by user id. Use 'current' to filter by the authenticated user""" + page_size: NotRequired[int] + r"""Number of items per page""" + next_page_token: NotRequired[Nullable[str]] + r"""Token for the next page of results""" + + +class ListRunsV1WorkflowsRunsGetRequest(BaseModel): + workflow_identifier: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by workflow name or id""" + + search: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Search by workflow name, display name or id""" + + status: Annotated[ + OptionalNullable[ListRunsV1WorkflowsRunsGetStatus], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by workflow status""" + + user_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Filter by user id. Use 'current' to filter by the authenticated user""" + + page_size: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 50 + r"""Number of items per page""" + + next_page_token: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Token for the next page of results""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "workflow_identifier", + "search", + "status", + "user_id", + "page_size", + "next_page_token", + ] + ) + nullable_fields = set( + ["workflow_identifier", "search", "status", "user_id", "next_page_token"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class ListRunsV1WorkflowsRunsGetResponseTypedDict(TypedDict): + result: WorkflowExecutionListResponseTypedDict + + +class ListRunsV1WorkflowsRunsGetResponse(BaseModel): + next: Union[ + Callable[[], Optional[ListRunsV1WorkflowsRunsGetResponse]], + Callable[[], Awaitable[Optional[ListRunsV1WorkflowsRunsGetResponse]]], + ] + + result: WorkflowExecutionListResponse diff --git a/src/mistralai/client/models/list_voices_v1_audio_voices_getop.py b/src/mistralai/client/models/list_voices_v1_audio_voices_getop.py new file mode 100644 index 00000000..30161b33 --- /dev/null +++ b/src/mistralai/client/models/list_voices_v1_audio_voices_getop.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6b3ce5be1294 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +ListVoicesV1AudioVoicesGetType = Literal[ + "all", + "custom", + "preset", +] +r"""Filter the voices between customs and presets""" + + +class ListVoicesV1AudioVoicesGetRequestTypedDict(TypedDict): + limit: NotRequired[int] + r"""Maximum number of voices to return""" + offset: NotRequired[int] + r"""Offset for pagination""" + type: NotRequired[ListVoicesV1AudioVoicesGetType] + r"""Filter the voices between customs and presets""" + + +class ListVoicesV1AudioVoicesGetRequest(BaseModel): + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 10 + r"""Maximum number of voices to return""" + + offset: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 0 + r"""Offset for pagination""" + + type: Annotated[ + Optional[ListVoicesV1AudioVoicesGetType], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "all" + r"""Filter the voices between customs and presets""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["limit", "offset", "type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/listbatchjobsresponse.py b/src/mistralai/client/models/listbatchjobsresponse.py new file mode 100644 index 00000000..77265322 --- /dev/null +++ b/src/mistralai/client/models/listbatchjobsresponse.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 99d94c86a871 + +from __future__ import annotations +from .batchjob import BatchJob, BatchJobTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListBatchJobsResponseTypedDict(TypedDict): + total: int + data: NotRequired[List[BatchJobTypedDict]] + object: Literal["list"] + + +class ListBatchJobsResponse(BaseModel): + total: int + + data: Optional[List[BatchJob]] = None + + object: Annotated[ + Annotated[Optional[Literal["list"]], AfterValidator(validate_const("list"))], + pydantic.Field(alias="object"), + ] = "list" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["data", "object"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ListBatchJobsResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/listcampaignselectedeventsresponse.py b/src/mistralai/client/models/listcampaignselectedeventsresponse.py new file mode 100644 index 00000000..a6133ecc --- /dev/null +++ b/src/mistralai/client/models/listcampaignselectedeventsresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8e28cb9aff1a + +from __future__ import annotations +from .paginatedresultchatcompletioneventpreview import ( + PaginatedResultChatCompletionEventPreview, + PaginatedResultChatCompletionEventPreviewTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ListCampaignSelectedEventsResponseTypedDict(TypedDict): + completion_events: PaginatedResultChatCompletionEventPreviewTypedDict + + +class ListCampaignSelectedEventsResponse(BaseModel): + completion_events: PaginatedResultChatCompletionEventPreview diff --git a/src/mistralai/client/models/listcampaignsresponse.py b/src/mistralai/client/models/listcampaignsresponse.py new file mode 100644 index 00000000..741b1b21 --- /dev/null +++ b/src/mistralai/client/models/listcampaignsresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 307695cde5c2 + +from __future__ import annotations +from .paginatedresultcampaignpreview import ( + PaginatedResultCampaignPreview, + PaginatedResultCampaignPreviewTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ListCampaignsResponseTypedDict(TypedDict): + campaigns: PaginatedResultCampaignPreviewTypedDict + + +class ListCampaignsResponse(BaseModel): + campaigns: PaginatedResultCampaignPreview diff --git a/src/mistralai/client/models/listchatcompletionfieldsresponse.py b/src/mistralai/client/models/listchatcompletionfieldsresponse.py new file mode 100644 index 00000000..d260463a --- /dev/null +++ b/src/mistralai/client/models/listchatcompletionfieldsresponse.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2f8837a6a5c3 + +from __future__ import annotations +from .basefielddefinition import BaseFieldDefinition, BaseFieldDefinitionTypedDict +from .fieldgroup import FieldGroup, FieldGroupTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ListChatCompletionFieldsResponseTypedDict(TypedDict): + field_definitions: List[BaseFieldDefinitionTypedDict] + field_groups: List[FieldGroupTypedDict] + + +class ListChatCompletionFieldsResponse(BaseModel): + field_definitions: List[BaseFieldDefinition] + + field_groups: List[FieldGroup] diff --git a/src/mistralai/client/models/listdatasetimporttasksresponse.py b/src/mistralai/client/models/listdatasetimporttasksresponse.py new file mode 100644 index 00000000..15bea396 --- /dev/null +++ b/src/mistralai/client/models/listdatasetimporttasksresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f635c1a3d02b + +from __future__ import annotations +from .paginatedresultdatasetimporttask import ( + PaginatedResultDatasetImportTask, + PaginatedResultDatasetImportTaskTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ListDatasetImportTasksResponseTypedDict(TypedDict): + tasks: PaginatedResultDatasetImportTaskTypedDict + + +class ListDatasetImportTasksResponse(BaseModel): + tasks: PaginatedResultDatasetImportTask diff --git a/src/mistralai/client/models/listdatasetrecordsresponse.py b/src/mistralai/client/models/listdatasetrecordsresponse.py new file mode 100644 index 00000000..2341577a --- /dev/null +++ b/src/mistralai/client/models/listdatasetrecordsresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 13b97e8095c4 + +from __future__ import annotations +from .paginatedresultdatasetrecord import ( + PaginatedResultDatasetRecord, + PaginatedResultDatasetRecordTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ListDatasetRecordsResponseTypedDict(TypedDict): + records: PaginatedResultDatasetRecordTypedDict + + +class ListDatasetRecordsResponse(BaseModel): + records: PaginatedResultDatasetRecord diff --git a/src/mistralai/client/models/listdatasetsresponse.py b/src/mistralai/client/models/listdatasetsresponse.py new file mode 100644 index 00000000..a35e9a73 --- /dev/null +++ b/src/mistralai/client/models/listdatasetsresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e18de4849423 + +from __future__ import annotations +from .paginatedresultdatasetpreview import ( + PaginatedResultDatasetPreview, + PaginatedResultDatasetPreviewTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ListDatasetsResponseTypedDict(TypedDict): + datasets: PaginatedResultDatasetPreviewTypedDict + + +class ListDatasetsResponse(BaseModel): + datasets: PaginatedResultDatasetPreview diff --git a/src/mistralai/client/models/listdocumentsresponse.py b/src/mistralai/client/models/listdocumentsresponse.py new file mode 100644 index 00000000..c48b8c05 --- /dev/null +++ b/src/mistralai/client/models/listdocumentsresponse.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f593d8e66833 + +from __future__ import annotations +from .document import Document, DocumentTypedDict +from .paginationinfo import PaginationInfo, PaginationInfoTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ListDocumentsResponseTypedDict(TypedDict): + pagination: PaginationInfoTypedDict + data: List[DocumentTypedDict] + + +class ListDocumentsResponse(BaseModel): + pagination: PaginationInfo + + data: List[Document] diff --git a/src/mistralai/client/models/listfilesresponse.py b/src/mistralai/client/models/listfilesresponse.py new file mode 100644 index 00000000..37787dae --- /dev/null +++ b/src/mistralai/client/models/listfilesresponse.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 85d6d24c1a19 + +from __future__ import annotations +from .fileschema import FileSchema, FileSchemaTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ListFilesResponseTypedDict(TypedDict): + data: List[FileSchemaTypedDict] + object: str + total: NotRequired[Nullable[int]] + + +class ListFilesResponse(BaseModel): + data: List[FileSchema] + + object: str + + total: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["total"]) + nullable_fields = set(["total"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/listfinetuningjobsresponse.py b/src/mistralai/client/models/listfinetuningjobsresponse.py new file mode 100644 index 00000000..39547d57 --- /dev/null +++ b/src/mistralai/client/models/listfinetuningjobsresponse.py @@ -0,0 +1,100 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 118e05dbfbbd + +from __future__ import annotations +from .classifierfinetuningjob import ( + ClassifierFineTuningJob, + ClassifierFineTuningJobTypedDict, +) +from .completionfinetuningjob import ( + CompletionFineTuningJob, + CompletionFineTuningJobTypedDict, +) +from functools import partial +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +from mistralai.client.utils.unions import parse_open_union +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator, BeforeValidator +from typing import Any, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ListFineTuningJobsResponseDataTypedDict = TypeAliasType( + "ListFineTuningJobsResponseDataTypedDict", + Union[ClassifierFineTuningJobTypedDict, CompletionFineTuningJobTypedDict], +) + + +class UnknownListFineTuningJobsResponseData(BaseModel): + r"""A ListFineTuningJobsResponseData variant the SDK doesn't recognize. Preserves the raw payload.""" + + job_type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_LIST_FINE_TUNING_JOBS_RESPONSE_DATA_VARIANTS: dict[str, Any] = { + "classifier": ClassifierFineTuningJob, + "completion": CompletionFineTuningJob, +} + + +ListFineTuningJobsResponseData = Annotated[ + Union[ + ClassifierFineTuningJob, + CompletionFineTuningJob, + UnknownListFineTuningJobsResponseData, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="job_type", + variants=_LIST_FINE_TUNING_JOBS_RESPONSE_DATA_VARIANTS, + unknown_cls=UnknownListFineTuningJobsResponseData, + union_name="ListFineTuningJobsResponseData", + ) + ), +] + + +class ListFineTuningJobsResponseTypedDict(TypedDict): + total: int + data: NotRequired[List[ListFineTuningJobsResponseDataTypedDict]] + object: Literal["list"] + + +class ListFineTuningJobsResponse(BaseModel): + total: int + + data: Optional[List[ListFineTuningJobsResponseData]] = None + + object: Annotated[ + Annotated[Optional[Literal["list"]], AfterValidator(validate_const("list"))], + pydantic.Field(alias="object"), + ] = "list" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["data", "object"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ListFineTuningJobsResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/listjudgesresponse.py b/src/mistralai/client/models/listjudgesresponse.py new file mode 100644 index 00000000..0284cb99 --- /dev/null +++ b/src/mistralai/client/models/listjudgesresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: db389a8abc34 + +from __future__ import annotations +from .paginatedresultjudgepreview import ( + PaginatedResultJudgePreview, + PaginatedResultJudgePreviewTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ListJudgesResponseTypedDict(TypedDict): + judges: PaginatedResultJudgePreviewTypedDict + + +class ListJudgesResponse(BaseModel): + judges: PaginatedResultJudgePreview diff --git a/src/mistralai/client/models/listlibrariesresponse.py b/src/mistralai/client/models/listlibrariesresponse.py new file mode 100644 index 00000000..be4125f2 --- /dev/null +++ b/src/mistralai/client/models/listlibrariesresponse.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: df556a618365 + +from __future__ import annotations +from .library import Library, LibraryTypedDict +from .paginationinfo import PaginationInfo, PaginationInfoTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ListLibrariesResponseTypedDict(TypedDict): + pagination: PaginationInfoTypedDict + data: List[LibraryTypedDict] + + +class ListLibrariesResponse(BaseModel): + pagination: PaginationInfo + + data: List[Library] diff --git a/src/mistralai/client/models/listsharingresponse.py b/src/mistralai/client/models/listsharingresponse.py new file mode 100644 index 00000000..f3e6dc87 --- /dev/null +++ b/src/mistralai/client/models/listsharingresponse.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 487c6addf089 + +from __future__ import annotations +from .sharing import Sharing, SharingTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class ListSharingResponseTypedDict(TypedDict): + data: List[SharingTypedDict] + + +class ListSharingResponse(BaseModel): + data: List[Sharing] diff --git a/src/mistralai/client/models/listworkfloweventresponse.py b/src/mistralai/client/models/listworkfloweventresponse.py new file mode 100644 index 00000000..be99ccea --- /dev/null +++ b/src/mistralai/client/models/listworkfloweventresponse.py @@ -0,0 +1,170 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 20a423148117 + +from __future__ import annotations +from .activitytaskcompletedresponse import ( + ActivityTaskCompletedResponse, + ActivityTaskCompletedResponseTypedDict, +) +from .activitytaskfailedresponse import ( + ActivityTaskFailedResponse, + ActivityTaskFailedResponseTypedDict, +) +from .activitytaskretryingresponse import ( + ActivityTaskRetryingResponse, + ActivityTaskRetryingResponseTypedDict, +) +from .activitytaskstartedresponse import ( + ActivityTaskStartedResponse, + ActivityTaskStartedResponseTypedDict, +) +from .customtaskcanceledresponse import ( + CustomTaskCanceledResponse, + CustomTaskCanceledResponseTypedDict, +) +from .customtaskcompletedresponse import ( + CustomTaskCompletedResponse, + CustomTaskCompletedResponseTypedDict, +) +from .customtaskfailedresponse import ( + CustomTaskFailedResponse, + CustomTaskFailedResponseTypedDict, +) +from .customtaskinprogressresponse import ( + CustomTaskInProgressResponse, + CustomTaskInProgressResponseTypedDict, +) +from .customtaskstartedresponse import ( + CustomTaskStartedResponse, + CustomTaskStartedResponseTypedDict, +) +from .customtasktimedoutresponse import ( + CustomTaskTimedOutResponse, + CustomTaskTimedOutResponseTypedDict, +) +from .workflowexecutioncanceledresponse import ( + WorkflowExecutionCanceledResponse, + WorkflowExecutionCanceledResponseTypedDict, +) +from .workflowexecutioncompletedresponse import ( + WorkflowExecutionCompletedResponse, + WorkflowExecutionCompletedResponseTypedDict, +) +from .workflowexecutioncontinuedasnewresponse import ( + WorkflowExecutionContinuedAsNewResponse, + WorkflowExecutionContinuedAsNewResponseTypedDict, +) +from .workflowexecutionfailedresponse import ( + WorkflowExecutionFailedResponse, + WorkflowExecutionFailedResponseTypedDict, +) +from .workflowexecutionstartedresponse import ( + WorkflowExecutionStartedResponse, + WorkflowExecutionStartedResponseTypedDict, +) +from .workflowtaskfailedresponse import ( + WorkflowTaskFailedResponse, + WorkflowTaskFailedResponseTypedDict, +) +from .workflowtasktimedoutresponse import ( + WorkflowTaskTimedOutResponse, + WorkflowTaskTimedOutResponseTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +ListWorkflowEventResponseEventTypedDict = TypeAliasType( + "ListWorkflowEventResponseEventTypedDict", + Union[ + WorkflowExecutionStartedResponseTypedDict, + WorkflowExecutionCompletedResponseTypedDict, + WorkflowExecutionFailedResponseTypedDict, + WorkflowExecutionCanceledResponseTypedDict, + WorkflowExecutionContinuedAsNewResponseTypedDict, + WorkflowTaskTimedOutResponseTypedDict, + WorkflowTaskFailedResponseTypedDict, + CustomTaskStartedResponseTypedDict, + CustomTaskInProgressResponseTypedDict, + CustomTaskCompletedResponseTypedDict, + CustomTaskFailedResponseTypedDict, + CustomTaskTimedOutResponseTypedDict, + CustomTaskCanceledResponseTypedDict, + ActivityTaskStartedResponseTypedDict, + ActivityTaskCompletedResponseTypedDict, + ActivityTaskRetryingResponseTypedDict, + ActivityTaskFailedResponseTypedDict, + ], +) + + +ListWorkflowEventResponseEvent = TypeAliasType( + "ListWorkflowEventResponseEvent", + Union[ + WorkflowExecutionStartedResponse, + WorkflowExecutionCompletedResponse, + WorkflowExecutionFailedResponse, + WorkflowExecutionCanceledResponse, + WorkflowExecutionContinuedAsNewResponse, + WorkflowTaskTimedOutResponse, + WorkflowTaskFailedResponse, + CustomTaskStartedResponse, + CustomTaskInProgressResponse, + CustomTaskCompletedResponse, + CustomTaskFailedResponse, + CustomTaskTimedOutResponse, + CustomTaskCanceledResponse, + ActivityTaskStartedResponse, + ActivityTaskCompletedResponse, + ActivityTaskRetryingResponse, + ActivityTaskFailedResponse, + ], +) + + +class ListWorkflowEventResponseTypedDict(TypedDict): + events: List[ListWorkflowEventResponseEventTypedDict] + r"""List of workflow events.""" + next_cursor: NotRequired[Nullable[str]] + r"""Cursor for pagination.""" + + +class ListWorkflowEventResponse(BaseModel): + events: List[ListWorkflowEventResponseEvent] + r"""List of workflow events.""" + + next_cursor: OptionalNullable[str] = UNSET + r"""Cursor for pagination.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["next_cursor"]) + nullable_fields = set(["next_cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/locationtype.py b/src/mistralai/client/models/locationtype.py new file mode 100644 index 00000000..4e2ff2f6 --- /dev/null +++ b/src/mistralai/client/models/locationtype.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 72a73946b20e + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +LocationType = Union[ + Literal[ + "local", + "k8s", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/mcpservericon.py b/src/mistralai/client/models/mcpservericon.py new file mode 100644 index 00000000..293ab375 --- /dev/null +++ b/src/mistralai/client/models/mcpservericon.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a5b508a322d7 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MCPServerIconTypedDict(TypedDict): + r"""An icon for display in user interfaces.""" + + src: str + mime_type: NotRequired[Nullable[str]] + sizes: NotRequired[Nullable[List[str]]] + + +class MCPServerIcon(BaseModel): + r"""An icon for display in user interfaces.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + src: str + + mime_type: Annotated[OptionalNullable[str], pydantic.Field(alias="mimeType")] = ( + UNSET + ) + + sizes: OptionalNullable[List[str]] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["mimeType", "sizes"]) + nullable_fields = set(["mimeType", "sizes"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + MCPServerIcon.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/mcptool.py b/src/mistralai/client/models/mcptool.py new file mode 100644 index 00000000..908ff8ce --- /dev/null +++ b/src/mistralai/client/models/mcptool.py @@ -0,0 +1,122 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5a696c8478cb + +from __future__ import annotations +from .mcpservericon import MCPServerIcon, MCPServerIconTypedDict +from .mcptoolmeta import MCPToolMeta, MCPToolMetaTypedDict +from .toolannotations import ToolAnnotations, ToolAnnotationsTypedDict +from .toolexecution import ToolExecution, ToolExecutionTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MCPToolTypedDict(TypedDict): + name: str + input_schema: Dict[str, Any] + title: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + output_schema: NotRequired[Nullable[Dict[str, Any]]] + icons: NotRequired[Nullable[List[MCPServerIconTypedDict]]] + annotations: NotRequired[Nullable[ToolAnnotationsTypedDict]] + meta: NotRequired[Nullable[MCPToolMetaTypedDict]] + execution: NotRequired[Nullable[ToolExecutionTypedDict]] + + +class MCPTool(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + name: str + + input_schema: Annotated[Dict[str, Any], pydantic.Field(alias="inputSchema")] + + title: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + output_schema: Annotated[ + OptionalNullable[Dict[str, Any]], pydantic.Field(alias="outputSchema") + ] = UNSET + + icons: OptionalNullable[List[MCPServerIcon]] = UNSET + + annotations: OptionalNullable[ToolAnnotations] = UNSET + + meta: Annotated[OptionalNullable[MCPToolMeta], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + execution: OptionalNullable[ToolExecution] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "title", + "description", + "outputSchema", + "icons", + "annotations", + "_meta", + "execution", + ] + ) + nullable_fields = set( + [ + "title", + "description", + "outputSchema", + "icons", + "annotations", + "_meta", + "execution", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + MCPTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/mcptoolmeta.py b/src/mistralai/client/models/mcptoolmeta.py new file mode 100644 index 00000000..edbf39a9 --- /dev/null +++ b/src/mistralai/client/models/mcptoolmeta.py @@ -0,0 +1,87 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 07cf1c0762c9 + +from __future__ import annotations +from .mcpuitoolmeta import MCPUIToolMeta, MCPUIToolMetaTypedDict +from .turbinetoolmeta import TurbineToolMeta, TurbineToolMetaTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MCPToolMetaTypedDict(TypedDict): + r"""Typed _meta for MCP tools. + + Only the 'ui' field is typed. Other fields are allowed via extra=\"allow\". + """ + + ui: NotRequired[Nullable[MCPUIToolMetaTypedDict]] + ai_mistral_turbine: NotRequired[Nullable[TurbineToolMetaTypedDict]] + + +class MCPToolMeta(BaseModel): + r"""Typed _meta for MCP tools. + + Only the 'ui' field is typed. Other fields are allowed via extra=\"allow\". + """ + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + ui: OptionalNullable[MCPUIToolMeta] = UNSET + + ai_mistral_turbine: Annotated[ + OptionalNullable[TurbineToolMeta], pydantic.Field(alias="ai.mistral/turbine") + ] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ui", "ai.mistral/turbine"]) + nullable_fields = set(["ui", "ai.mistral/turbine"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + MCPToolMeta.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/mcpuitoolmeta.py b/src/mistralai/client/models/mcpuitoolmeta.py new file mode 100644 index 00000000..287192a6 --- /dev/null +++ b/src/mistralai/client/models/mcpuitoolmeta.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7c54fb6157a9 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +Visibility = Union[ + Literal[ + "model", + "app", + ], + UnrecognizedStr, +] + + +class MCPUIToolMetaTypedDict(TypedDict): + r"""UI metadata for tools that reference UI resources.""" + + resource_uri: NotRequired[Nullable[str]] + visibility: NotRequired[Nullable[List[Visibility]]] + + +class MCPUIToolMeta(BaseModel): + r"""UI metadata for tools that reference UI resources.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + resource_uri: Annotated[ + OptionalNullable[str], pydantic.Field(alias="resourceUri") + ] = UNSET + + visibility: OptionalNullable[List[Visibility]] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["resourceUri", "visibility"]) + nullable_fields = set(["resourceUri", "visibility"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + MCPUIToolMeta.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/models/messageentries.py b/src/mistralai/client/models/messageentries.py similarity index 95% rename from src/mistralai/models/messageentries.py rename to src/mistralai/client/models/messageentries.py index 9b1706de..a95098e0 100644 --- a/src/mistralai/models/messageentries.py +++ b/src/mistralai/client/models/messageentries.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e13f9009902b from __future__ import annotations from .messageinputentry import MessageInputEntry, MessageInputEntryTypedDict diff --git a/src/mistralai/models/messageinputcontentchunks.py b/src/mistralai/client/models/messageinputcontentchunks.py similarity index 96% rename from src/mistralai/models/messageinputcontentchunks.py rename to src/mistralai/client/models/messageinputcontentchunks.py index e90d8aa0..63cf14e7 100644 --- a/src/mistralai/models/messageinputcontentchunks.py +++ b/src/mistralai/client/models/messageinputcontentchunks.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 01025c12866a from __future__ import annotations from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict diff --git a/src/mistralai/client/models/messageinputentry.py b/src/mistralai/client/models/messageinputentry.py new file mode 100644 index 00000000..be271e31 --- /dev/null +++ b/src/mistralai/client/models/messageinputentry.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c0a4b5179095 + +from __future__ import annotations +from .messageinputcontentchunks import ( + MessageInputContentChunks, + MessageInputContentChunksTypedDict, +) +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +Role = Union[ + Literal[ + "assistant", + "user", + ], + UnrecognizedStr, +] + + +MessageInputEntryContentTypedDict = TypeAliasType( + "MessageInputEntryContentTypedDict", + Union[str, List[MessageInputContentChunksTypedDict]], +) + + +MessageInputEntryContent = TypeAliasType( + "MessageInputEntryContent", Union[str, List[MessageInputContentChunks]] +) + + +class MessageInputEntryTypedDict(TypedDict): + r"""Representation of an input message inside the conversation.""" + + role: Role + content: MessageInputEntryContentTypedDict + object: Literal["entry"] + type: Literal["message.input"] + created_at: NotRequired[datetime] + completed_at: NotRequired[Nullable[datetime]] + id: NotRequired[str] + prefix: NotRequired[bool] + + +class MessageInputEntry(BaseModel): + r"""Representation of an input message inside the conversation.""" + + role: Role + + content: MessageInputEntryContent + + object: Annotated[ + Annotated[Optional[Literal["entry"]], AfterValidator(validate_const("entry"))], + pydantic.Field(alias="object"), + ] = "entry" + + type: Annotated[ + Annotated[ + Optional[Literal["message.input"]], + AfterValidator(validate_const("message.input")), + ], + pydantic.Field(alias="type"), + ] = "message.input" + + created_at: Optional[datetime] = None + + completed_at: OptionalNullable[datetime] = UNSET + + id: Optional[str] = None + + prefix: Optional[bool] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["object", "type", "created_at", "completed_at", "id", "prefix"] + ) + nullable_fields = set(["completed_at"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + MessageInputEntry.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/models/messageoutputcontentchunks.py b/src/mistralai/client/models/messageoutputcontentchunks.py similarity index 97% rename from src/mistralai/models/messageoutputcontentchunks.py rename to src/mistralai/client/models/messageoutputcontentchunks.py index 136a7608..def7a4d2 100644 --- a/src/mistralai/models/messageoutputcontentchunks.py +++ b/src/mistralai/client/models/messageoutputcontentchunks.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2ed248515035 from __future__ import annotations from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict diff --git a/src/mistralai/client/models/messageoutputentry.py b/src/mistralai/client/models/messageoutputentry.py new file mode 100644 index 00000000..fd683ad3 --- /dev/null +++ b/src/mistralai/client/models/messageoutputentry.py @@ -0,0 +1,121 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a07577d2268d + +from __future__ import annotations +from .messageoutputcontentchunks import ( + MessageOutputContentChunks, + MessageOutputContentChunksTypedDict, +) +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +MessageOutputEntryContentTypedDict = TypeAliasType( + "MessageOutputEntryContentTypedDict", + Union[str, List[MessageOutputContentChunksTypedDict]], +) + + +MessageOutputEntryContent = TypeAliasType( + "MessageOutputEntryContent", Union[str, List[MessageOutputContentChunks]] +) + + +class MessageOutputEntryTypedDict(TypedDict): + content: MessageOutputEntryContentTypedDict + object: Literal["entry"] + type: Literal["message.output"] + created_at: NotRequired[datetime] + completed_at: NotRequired[Nullable[datetime]] + agent_id: NotRequired[Nullable[str]] + model: NotRequired[Nullable[str]] + id: NotRequired[str] + role: Literal["assistant"] + + +class MessageOutputEntry(BaseModel): + content: MessageOutputEntryContent + + object: Annotated[ + Annotated[Optional[Literal["entry"]], AfterValidator(validate_const("entry"))], + pydantic.Field(alias="object"), + ] = "entry" + + type: Annotated[ + Annotated[ + Optional[Literal["message.output"]], + AfterValidator(validate_const("message.output")), + ], + pydantic.Field(alias="type"), + ] = "message.output" + + created_at: Optional[datetime] = None + + completed_at: OptionalNullable[datetime] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + model: OptionalNullable[str] = UNSET + + id: Optional[str] = None + + role: Annotated[ + Annotated[ + Optional[Literal["assistant"]], AfterValidator(validate_const("assistant")) + ], + pydantic.Field(alias="role"), + ] = "assistant" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "object", + "type", + "created_at", + "completed_at", + "agent_id", + "model", + "id", + "role", + ] + ) + nullable_fields = set(["completed_at", "agent_id", "model"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + MessageOutputEntry.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/messageoutputevent.py b/src/mistralai/client/models/messageoutputevent.py new file mode 100644 index 00000000..8f5ecd43 --- /dev/null +++ b/src/mistralai/client/models/messageoutputevent.py @@ -0,0 +1,105 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a2bbf63615c6 + +from __future__ import annotations +from .outputcontentchunks import OutputContentChunks, OutputContentChunksTypedDict +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +MessageOutputEventContentTypedDict = TypeAliasType( + "MessageOutputEventContentTypedDict", Union[str, OutputContentChunksTypedDict] +) + + +MessageOutputEventContent = TypeAliasType( + "MessageOutputEventContent", Union[str, OutputContentChunks] +) + + +class MessageOutputEventTypedDict(TypedDict): + id: str + content: MessageOutputEventContentTypedDict + type: Literal["message.output.delta"] + created_at: NotRequired[datetime] + output_index: NotRequired[int] + content_index: NotRequired[int] + model: NotRequired[Nullable[str]] + agent_id: NotRequired[Nullable[str]] + role: Literal["assistant"] + + +class MessageOutputEvent(BaseModel): + id: str + + content: MessageOutputEventContent + + type: Annotated[ + Annotated[ + Literal["message.output.delta"], + AfterValidator(validate_const("message.output.delta")), + ], + pydantic.Field(alias="type"), + ] = "message.output.delta" + + created_at: Optional[datetime] = None + + output_index: Optional[int] = 0 + + content_index: Optional[int] = 0 + + model: OptionalNullable[str] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + role: Annotated[ + Annotated[ + Optional[Literal["assistant"]], AfterValidator(validate_const("assistant")) + ], + pydantic.Field(alias="role"), + ] = "assistant" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["created_at", "output_index", "content_index", "model", "agent_id", "role"] + ) + nullable_fields = set(["model", "agent_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + MessageOutputEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/messageresponse.py b/src/mistralai/client/models/messageresponse.py new file mode 100644 index 00000000..c8fbdff7 --- /dev/null +++ b/src/mistralai/client/models/messageresponse.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6b388bc155dd + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class MessageResponseTypedDict(TypedDict): + message: str + + +class MessageResponse(BaseModel): + message: str diff --git a/src/mistralai/client/models/messagetokens.py b/src/mistralai/client/models/messagetokens.py new file mode 100644 index 00000000..f3e292bd --- /dev/null +++ b/src/mistralai/client/models/messagetokens.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e2a5171d27c5 + +from __future__ import annotations +from .roles import Roles +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class MessageTokensTypedDict(TypedDict): + r"""Information on a single message included in a tokenized prompt as part of an InstructRequest.""" + + role: Roles + total_tokens: NotRequired[Nullable[int]] + truncated: NotRequired[bool] + usage_count: NotRequired[int] + + +class MessageTokens(BaseModel): + r"""Information on a single message included in a tokenized prompt as part of an InstructRequest.""" + + role: Roles + + total_tokens: OptionalNullable[int] = UNSET + + truncated: Optional[bool] = False + + usage_count: Optional[int] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["total_tokens", "truncated", "usage_count"]) + nullable_fields = set(["total_tokens"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/metric.py b/src/mistralai/client/models/metric.py new file mode 100644 index 00000000..8d059894 --- /dev/null +++ b/src/mistralai/client/models/metric.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c6a65acdd1a2 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class MetricTypedDict(TypedDict): + r"""Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase).""" + + train_loss: NotRequired[Nullable[float]] + valid_loss: NotRequired[Nullable[float]] + valid_mean_token_accuracy: NotRequired[Nullable[float]] + + +class Metric(BaseModel): + r"""Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase).""" + + train_loss: OptionalNullable[float] = UNSET + + valid_loss: OptionalNullable[float] = UNSET + + valid_mean_token_accuracy: OptionalNullable[float] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["train_loss", "valid_loss", "valid_mean_token_accuracy"]) + nullable_fields = set(["train_loss", "valid_loss", "valid_mean_token_accuracy"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/mistralpromptmode.py b/src/mistralai/client/models/mistralpromptmode.py new file mode 100644 index 00000000..9b91323e --- /dev/null +++ b/src/mistralai/client/models/mistralpromptmode.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 95abc4ec799a + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +MistralPromptMode = Union[Literal["reasoning",], UnrecognizedStr] +r"""Available options to the prompt_mode argument on the chat completion endpoint. +Values represent high-level intent. Assignment to actual SPs is handled internally. +System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc. +""" diff --git a/src/mistralai/client/models/modelcapabilities.py b/src/mistralai/client/models/modelcapabilities.py new file mode 100644 index 00000000..2206f9a7 --- /dev/null +++ b/src/mistralai/client/models/modelcapabilities.py @@ -0,0 +1,92 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 64d8a422ea29 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ModelCapabilitiesTypedDict(TypedDict): + r"""This is populated by Harmattan, but some fields have a name + that we don't want to expose in the API. + """ + + completion_chat: NotRequired[bool] + function_calling: NotRequired[bool] + reasoning: NotRequired[bool] + completion_fim: NotRequired[bool] + fine_tuning: NotRequired[bool] + vision: NotRequired[bool] + ocr: NotRequired[bool] + classification: NotRequired[bool] + moderation: NotRequired[bool] + audio: NotRequired[bool] + audio_transcription: NotRequired[bool] + audio_transcription_realtime: NotRequired[bool] + audio_speech: NotRequired[bool] + + +class ModelCapabilities(BaseModel): + r"""This is populated by Harmattan, but some fields have a name + that we don't want to expose in the API. + """ + + completion_chat: Optional[bool] = False + + function_calling: Optional[bool] = False + + reasoning: Optional[bool] = False + + completion_fim: Optional[bool] = False + + fine_tuning: Optional[bool] = False + + vision: Optional[bool] = False + + ocr: Optional[bool] = False + + classification: Optional[bool] = False + + moderation: Optional[bool] = False + + audio: Optional[bool] = False + + audio_transcription: Optional[bool] = False + + audio_transcription_realtime: Optional[bool] = False + + audio_speech: Optional[bool] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "completion_chat", + "function_calling", + "reasoning", + "completion_fim", + "fine_tuning", + "vision", + "ocr", + "classification", + "moderation", + "audio", + "audio_transcription", + "audio_transcription_realtime", + "audio_speech", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/modelconversation.py b/src/mistralai/client/models/modelconversation.py new file mode 100644 index 00000000..72ca957f --- /dev/null +++ b/src/mistralai/client/models/modelconversation.py @@ -0,0 +1,190 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fea0a651f888 + +from __future__ import annotations +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .functiontool import FunctionTool, FunctionToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from datetime import datetime +from functools import partial +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +from mistralai.client.utils.unions import parse_open_union +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator, BeforeValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ModelConversationToolTypedDict = TypeAliasType( + "ModelConversationToolTypedDict", + Union[ + FunctionToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +class UnknownModelConversationTool(BaseModel): + r"""A ModelConversationTool variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_MODEL_CONVERSATION_TOOL_VARIANTS: dict[str, Any] = { + "code_interpreter": CodeInterpreterTool, + "connector": CustomConnector, + "document_library": DocumentLibraryTool, + "function": FunctionTool, + "image_generation": ImageGenerationTool, + "web_search": WebSearchTool, + "web_search_premium": WebSearchPremiumTool, +} + + +ModelConversationTool = Annotated[ + Union[ + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, + UnknownModelConversationTool, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_MODEL_CONVERSATION_TOOL_VARIANTS, + unknown_cls=UnknownModelConversationTool, + union_name="ModelConversationTool", + ) + ), +] + + +class ModelConversationTypedDict(TypedDict): + id: str + created_at: datetime + updated_at: datetime + model: str + instructions: NotRequired[Nullable[str]] + r"""Instruction prompt the model will follow during the conversation.""" + tools: NotRequired[List[ModelConversationToolTypedDict]] + r"""List of tools which are available to the model during the conversation.""" + completion_args: NotRequired[CompletionArgsTypedDict] + r"""White-listed arguments from the completion API""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + name: NotRequired[Nullable[str]] + r"""Name given to the conversation.""" + description: NotRequired[Nullable[str]] + r"""Description of the what the conversation is about.""" + metadata: NotRequired[Nullable[Dict[str, Any]]] + r"""Custom metadata for the conversation.""" + object: Literal["conversation"] + + +class ModelConversation(BaseModel): + id: str + + created_at: datetime + + updated_at: datetime + + model: str + + instructions: OptionalNullable[str] = UNSET + r"""Instruction prompt the model will follow during the conversation.""" + + tools: Optional[List[ModelConversationTool]] = None + r"""List of tools which are available to the model during the conversation.""" + + completion_args: Optional[CompletionArgs] = None + r"""White-listed arguments from the completion API""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + name: OptionalNullable[str] = UNSET + r"""Name given to the conversation.""" + + description: OptionalNullable[str] = UNSET + r"""Description of the what the conversation is about.""" + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + r"""Custom metadata for the conversation.""" + + object: Annotated[ + Annotated[ + Optional[Literal["conversation"]], + AfterValidator(validate_const("conversation")), + ], + pydantic.Field(alias="object"), + ] = "conversation" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "instructions", + "tools", + "completion_args", + "guardrails", + "name", + "description", + "metadata", + "object", + ] + ) + nullable_fields = set( + ["instructions", "guardrails", "name", "description", "metadata"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ModelConversation.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/modellist.py b/src/mistralai/client/models/modellist.py new file mode 100644 index 00000000..a6020100 --- /dev/null +++ b/src/mistralai/client/models/modellist.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 00693c7eec60 + +from __future__ import annotations +from .basemodelcard import BaseModelCard, BaseModelCardTypedDict +from .ftmodelcard import FTModelCard, FTModelCardTypedDict +from functools import partial +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import BeforeValidator +from typing import Any, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ModelListDataTypedDict = TypeAliasType( + "ModelListDataTypedDict", Union[BaseModelCardTypedDict, FTModelCardTypedDict] +) + + +class UnknownModelListData(BaseModel): + r"""A ModelListData variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_MODEL_LIST_DATA_VARIANTS: dict[str, Any] = { + "base": BaseModelCard, + "fine-tuned": FTModelCard, +} + + +ModelListData = Annotated[ + Union[BaseModelCard, FTModelCard, UnknownModelListData], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_MODEL_LIST_DATA_VARIANTS, + unknown_cls=UnknownModelListData, + union_name="ModelListData", + ) + ), +] + + +class ModelListTypedDict(TypedDict): + object: NotRequired[str] + data: NotRequired[List[ModelListDataTypedDict]] + + +class ModelList(BaseModel): + object: Optional[str] = "list" + + data: Optional[List[ModelListData]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "data"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/moderationllmaction.py b/src/mistralai/client/models/moderationllmaction.py new file mode 100644 index 00000000..a2553f30 --- /dev/null +++ b/src/mistralai/client/models/moderationllmaction.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7b18ccbd8ca9 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ModerationLLMAction = Union[ + Literal[ + "none", + "block", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/moderationllmv1categorythresholds.py b/src/mistralai/client/models/moderationllmv1categorythresholds.py new file mode 100644 index 00000000..9a947d11 --- /dev/null +++ b/src/mistralai/client/models/moderationllmv1categorythresholds.py @@ -0,0 +1,94 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0c51d6766440 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ModerationLlmv1CategoryThresholdsTypedDict(TypedDict): + sexual: NotRequired[Nullable[float]] + hate_and_discrimination: NotRequired[Nullable[float]] + violence_and_threats: NotRequired[Nullable[float]] + dangerous_and_criminal_content: NotRequired[Nullable[float]] + selfharm: NotRequired[Nullable[float]] + health: NotRequired[Nullable[float]] + financial: NotRequired[Nullable[float]] + law: NotRequired[Nullable[float]] + pii: NotRequired[Nullable[float]] + + +class ModerationLlmv1CategoryThresholds(BaseModel): + sexual: OptionalNullable[float] = UNSET + + hate_and_discrimination: OptionalNullable[float] = UNSET + + violence_and_threats: OptionalNullable[float] = UNSET + + dangerous_and_criminal_content: OptionalNullable[float] = UNSET + + selfharm: OptionalNullable[float] = UNSET + + health: OptionalNullable[float] = UNSET + + financial: OptionalNullable[float] = UNSET + + law: OptionalNullable[float] = UNSET + + pii: OptionalNullable[float] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "sexual", + "hate_and_discrimination", + "violence_and_threats", + "dangerous_and_criminal_content", + "selfharm", + "health", + "financial", + "law", + "pii", + ] + ) + nullable_fields = set( + [ + "sexual", + "hate_and_discrimination", + "violence_and_threats", + "dangerous_and_criminal_content", + "selfharm", + "health", + "financial", + "law", + "pii", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/moderationllmv1config.py b/src/mistralai/client/models/moderationllmv1config.py new file mode 100644 index 00000000..fe597a9b --- /dev/null +++ b/src/mistralai/client/models/moderationllmv1config.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 483378b56394 + +from __future__ import annotations +from .moderationllmaction import ModerationLLMAction +from .moderationllmv1categorythresholds import ( + ModerationLlmv1CategoryThresholds, + ModerationLlmv1CategoryThresholdsTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ModerationLlmv1ConfigTypedDict(TypedDict): + model_name: NotRequired[str] + r"""Override model name. Should be omitted in general.""" + custom_category_thresholds: NotRequired[ + Nullable[ModerationLlmv1CategoryThresholdsTypedDict] + ] + ignore_other_categories: NotRequired[bool] + r"""If true, only evaluate categories in custom_category_thresholds; others are ignored.""" + action: NotRequired[ModerationLLMAction] + + +class ModerationLlmv1Config(BaseModel): + model_name: Optional[str] = "mistral-moderation-2411" + r"""Override model name. Should be omitted in general.""" + + custom_category_thresholds: OptionalNullable[ModerationLlmv1CategoryThresholds] = ( + UNSET + ) + + ignore_other_categories: Optional[bool] = False + r"""If true, only evaluate categories in custom_category_thresholds; others are ignored.""" + + action: Optional[ModerationLLMAction] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "model_name", + "custom_category_thresholds", + "ignore_other_categories", + "action", + ] + ) + nullable_fields = set(["custom_category_thresholds"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/moderationllmv2categorythresholds.py b/src/mistralai/client/models/moderationllmv2categorythresholds.py new file mode 100644 index 00000000..2ca952c5 --- /dev/null +++ b/src/mistralai/client/models/moderationllmv2categorythresholds.py @@ -0,0 +1,104 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4c2a8ff4d52b + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ModerationLlmv2CategoryThresholdsTypedDict(TypedDict): + sexual: NotRequired[Nullable[float]] + hate_and_discrimination: NotRequired[Nullable[float]] + violence_and_threats: NotRequired[Nullable[float]] + dangerous: NotRequired[Nullable[float]] + criminal: NotRequired[Nullable[float]] + selfharm: NotRequired[Nullable[float]] + health: NotRequired[Nullable[float]] + financial: NotRequired[Nullable[float]] + law: NotRequired[Nullable[float]] + pii: NotRequired[Nullable[float]] + jailbreaking: NotRequired[Nullable[float]] + + +class ModerationLlmv2CategoryThresholds(BaseModel): + sexual: OptionalNullable[float] = UNSET + + hate_and_discrimination: OptionalNullable[float] = UNSET + + violence_and_threats: OptionalNullable[float] = UNSET + + dangerous: OptionalNullable[float] = UNSET + + criminal: OptionalNullable[float] = UNSET + + selfharm: OptionalNullable[float] = UNSET + + health: OptionalNullable[float] = UNSET + + financial: OptionalNullable[float] = UNSET + + law: OptionalNullable[float] = UNSET + + pii: OptionalNullable[float] = UNSET + + jailbreaking: OptionalNullable[float] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "sexual", + "hate_and_discrimination", + "violence_and_threats", + "dangerous", + "criminal", + "selfharm", + "health", + "financial", + "law", + "pii", + "jailbreaking", + ] + ) + nullable_fields = set( + [ + "sexual", + "hate_and_discrimination", + "violence_and_threats", + "dangerous", + "criminal", + "selfharm", + "health", + "financial", + "law", + "pii", + "jailbreaking", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/moderationllmv2config.py b/src/mistralai/client/models/moderationllmv2config.py new file mode 100644 index 00000000..5cd8b7ca --- /dev/null +++ b/src/mistralai/client/models/moderationllmv2config.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bb511e7c628b + +from __future__ import annotations +from .moderationllmaction import ModerationLLMAction +from .moderationllmv2categorythresholds import ( + ModerationLlmv2CategoryThresholds, + ModerationLlmv2CategoryThresholdsTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ModerationLlmv2ConfigTypedDict(TypedDict): + model_name: NotRequired[str] + r"""Override model name. Should be omitted in general.""" + custom_category_thresholds: NotRequired[ + Nullable[ModerationLlmv2CategoryThresholdsTypedDict] + ] + ignore_other_categories: NotRequired[bool] + r"""If true, only evaluate categories in custom_category_thresholds; others are ignored.""" + action: NotRequired[ModerationLLMAction] + + +class ModerationLlmv2Config(BaseModel): + model_name: Optional[str] = "mistral-moderation-2603" + r"""Override model name. Should be omitted in general.""" + + custom_category_thresholds: OptionalNullable[ModerationLlmv2CategoryThresholds] = ( + UNSET + ) + + ignore_other_categories: Optional[bool] = False + r"""If true, only evaluate categories in custom_category_thresholds; others are ignored.""" + + action: Optional[ModerationLLMAction] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "model_name", + "custom_category_thresholds", + "ignore_other_categories", + "action", + ] + ) + nullable_fields = set(["custom_category_thresholds"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/moderationobject.py b/src/mistralai/client/models/moderationobject.py new file mode 100644 index 00000000..66f6a84b --- /dev/null +++ b/src/mistralai/client/models/moderationobject.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 132faad0549a + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class ModerationObjectTypedDict(TypedDict): + categories: NotRequired[Dict[str, bool]] + r"""Moderation result thresholds""" + category_scores: NotRequired[Dict[str, float]] + r"""Moderation result""" + + +class ModerationObject(BaseModel): + categories: Optional[Dict[str, bool]] = None + r"""Moderation result thresholds""" + + category_scores: Optional[Dict[str, float]] = None + r"""Moderation result""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["categories", "category_scores"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/models/moderationresponse.py b/src/mistralai/client/models/moderationresponse.py similarity index 86% rename from src/mistralai/models/moderationresponse.py rename to src/mistralai/client/models/moderationresponse.py index ed13cd6b..a8a8ec3d 100644 --- a/src/mistralai/models/moderationresponse.py +++ b/src/mistralai/client/models/moderationresponse.py @@ -1,8 +1,9 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 06bab279cb31 from __future__ import annotations from .moderationobject import ModerationObject, ModerationObjectTypedDict -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel from typing import List from typing_extensions import TypedDict diff --git a/src/mistralai/client/models/networkencodedinput.py b/src/mistralai/client/models/networkencodedinput.py new file mode 100644 index 00000000..70d92414 --- /dev/null +++ b/src/mistralai/client/models/networkencodedinput.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6dc5321dbe77 + +from __future__ import annotations +from .encodedpayloadoptions import EncodedPayloadOptions +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class NetworkEncodedInputTypedDict(TypedDict): + b64payload: str + r"""The encoded payload""" + encoding_options: NotRequired[List[EncodedPayloadOptions]] + r"""The encoding of the payload""" + empty: NotRequired[bool] + r"""Whether the payload is empty""" + + +class NetworkEncodedInput(BaseModel): + b64payload: str + r"""The encoded payload""" + + encoding_options: Optional[List[EncodedPayloadOptions]] = None + r"""The encoding of the payload""" + + empty: Optional[bool] = False + r"""Whether the payload is empty""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["encoding_options", "empty"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/oauth2token.py b/src/mistralai/client/models/oauth2token.py new file mode 100644 index 00000000..0887216b --- /dev/null +++ b/src/mistralai/client/models/oauth2token.py @@ -0,0 +1,79 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6153dd0f41bc + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class OAuth2TokenTypedDict(TypedDict): + access_token: str + token_type: Literal["Bearer"] + expires_in: NotRequired[Nullable[int]] + scope: NotRequired[Nullable[str]] + refresh_token: NotRequired[Nullable[str]] + expires_at: NotRequired[Nullable[datetime]] + + +class OAuth2Token(BaseModel): + access_token: str + + token_type: Annotated[ + Annotated[ + Optional[Literal["Bearer"]], AfterValidator(validate_const("Bearer")) + ], + pydantic.Field(alias="token_type"), + ] = "Bearer" + + expires_in: OptionalNullable[int] = UNSET + + scope: OptionalNullable[str] = UNSET + + refresh_token: OptionalNullable[str] = UNSET + + expires_at: OptionalNullable[datetime] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["token_type", "expires_in", "scope", "refresh_token", "expires_at"] + ) + nullable_fields = set(["expires_in", "scope", "refresh_token", "expires_at"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + OAuth2Token.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/oauth2tokenauth.py b/src/mistralai/client/models/oauth2tokenauth.py new file mode 100644 index 00000000..76ebfd0d --- /dev/null +++ b/src/mistralai/client/models/oauth2tokenauth.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 167c3b8a104e + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class OAuth2TokenAuthTypedDict(TypedDict): + value: str + type: Literal["oauth2-token"] + + +class OAuth2TokenAuth(BaseModel): + value: str + + type: Annotated[ + Annotated[ + Literal["oauth2-token"], AfterValidator(validate_const("oauth2-token")) + ], + pydantic.Field(alias="type"), + ] = "oauth2-token" + + +try: + OAuth2TokenAuth.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/observabilityerrorcode.py b/src/mistralai/client/models/observabilityerrorcode.py new file mode 100644 index 00000000..6c1826ed --- /dev/null +++ b/src/mistralai/client/models/observabilityerrorcode.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ae572b470a30 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ObservabilityErrorCode = Union[ + Literal[ + "UNKNOWN_ERROR", + "VALIDATION_ERROR", + "AUTH_FORBIDDEN", + "AUTH_FORBIDDEN_NOT_WORKSPACE_ADMIN", + "AUTH_FORBIDDEN_WORKSPACE_NOT_FOUND", + "AUTH_FORBIDDEN_ROLE_NOT_FOUND", + "AUTH_FORBIDDEN_ORG_NOT_WHITELISTED", + "AUTH_UNAUTHORIZED", + "FEATURE_NOT_SUPPORTED", + "FIELDS_BAD_REQUEST", + "FIELDS_NOT_FOUND", + "SEARCH_NOT_FOUND", + "SEARCH_BAD_REQUEST", + "SEARCH_SERVICE_UNAVAILABLE", + "DATABASE_ERROR", + "DATABASE_TIMEOUT", + "DATABASE_UNAVAILABLE", + "DATABASE_QUERY_ERROR", + "SEARCH_FILTER_TO_SQL_CONVERSION_ERROR", + "JUDGE_CONVERSATION_FORMAT_ERROR", + "JUDGE_MISTRAL_API_ERROR", + "JUDGE_MISTRAL_API_TIMEOUT", + "JUDGE_NAME_ALREADY_EXISTS", + "JUDGE_NOT_FOUND", + "JUDGE_ALREADY_HAS_NEW_VERSION", + "JUDGE_USED_IN_CAMPAIGN_CANNOT_BE_UPDATED", + "JUDGE_DID_NOT_CHANGE", + "CAMPAIGN_NOT_FOUND", + "CAMPAIGN_NO_MATCHING_EVENTS", + "DATASET_NOT_FOUND", + "DATASET_TASK_NOT_FOUND", + "DATASET_RECORD_NOT_FOUND", + "DATASET_RECORD_FORMAT_ERROR", + "AGENT_NOT_FOUND", + "AGENT_MISTRAL_API_ERROR", + "EVALUATION_NOT_FOUND", + "EVALUATION_CURRENTLY_RUNNING", + "EVALUATION_RECORD_NOT_FOUND", + "EVALUATION_RUN_NOT_FOUND", + "EVALUATION_RUN_TRANSITION_IS_INVALID", + "EVALUATION_RUN_TRANSITION_IS_RUNNING_ALREADY", + "EVALUATION_RUN_TRANSITION_ERROR", + "TEMPLATE_ERROR", + "TEMPLATE_SYNTAX_ERROR", + "PROJECT_NAME_ALREADY_EXISTS", + "EVALUATION_NAME_ALREADY_EXISTS", + "TRACES_FILTER_QUERY_PARSE_ERROR", + "TRACE_NOT_FOUND", + "SPAN_NOT_FOUND", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/observabilityerrordetail.py b/src/mistralai/client/models/observabilityerrordetail.py new file mode 100644 index 00000000..f1535352 --- /dev/null +++ b/src/mistralai/client/models/observabilityerrordetail.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cb6e8a484a38 + +from __future__ import annotations +from .observabilityerrorcode import ObservabilityErrorCode +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing_extensions import TypedDict + + +class ObservabilityErrorDetailTypedDict(TypedDict): + message: str + error_code: Nullable[ObservabilityErrorCode] + + +class ObservabilityErrorDetail(BaseModel): + message: str + + error_code: Nullable[ObservabilityErrorCode] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/ocrconfidencescore.py b/src/mistralai/client/models/ocrconfidencescore.py new file mode 100644 index 00000000..7fab8c9b --- /dev/null +++ b/src/mistralai/client/models/ocrconfidencescore.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 15b75862a7bd + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class OCRConfidenceScoreTypedDict(TypedDict): + r"""Confidence score for a token or word in OCR output.""" + + text: str + r"""The word or text segment""" + confidence: float + r"""Confidence score (0-1)""" + start_index: int + r"""Start index of the text in the page markdown string""" + + +class OCRConfidenceScore(BaseModel): + r"""Confidence score for a token or word in OCR output.""" + + text: str + r"""The word or text segment""" + + confidence: float + r"""Confidence score (0-1)""" + + start_index: int + r"""Start index of the text in the page markdown string""" diff --git a/src/mistralai/client/models/ocrimageobject.py b/src/mistralai/client/models/ocrimageobject.py new file mode 100644 index 00000000..583cc38b --- /dev/null +++ b/src/mistralai/client/models/ocrimageobject.py @@ -0,0 +1,87 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 685faeb41a80 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class OCRImageObjectTypedDict(TypedDict): + id: str + r"""Image ID for extracted image in a page""" + top_left_x: Nullable[int] + r"""X coordinate of top-left corner of the extracted image""" + top_left_y: Nullable[int] + r"""Y coordinate of top-left corner of the extracted image""" + bottom_right_x: Nullable[int] + r"""X coordinate of bottom-right corner of the extracted image""" + bottom_right_y: Nullable[int] + r"""Y coordinate of bottom-right corner of the extracted image""" + image_base64: NotRequired[Nullable[str]] + r"""Base64 string of the extracted image""" + image_annotation: NotRequired[Nullable[str]] + r"""Annotation of the extracted image in json str""" + + +class OCRImageObject(BaseModel): + id: str + r"""Image ID for extracted image in a page""" + + top_left_x: Nullable[int] + r"""X coordinate of top-left corner of the extracted image""" + + top_left_y: Nullable[int] + r"""Y coordinate of top-left corner of the extracted image""" + + bottom_right_x: Nullable[int] + r"""X coordinate of bottom-right corner of the extracted image""" + + bottom_right_y: Nullable[int] + r"""Y coordinate of bottom-right corner of the extracted image""" + + image_base64: OptionalNullable[str] = UNSET + r"""Base64 string of the extracted image""" + + image_annotation: OptionalNullable[str] = UNSET + r"""Annotation of the extracted image in json str""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["image_base64", "image_annotation"]) + nullable_fields = set( + [ + "top_left_x", + "top_left_y", + "bottom_right_x", + "bottom_right_y", + "image_base64", + "image_annotation", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/ocrpageconfidencescores.py b/src/mistralai/client/models/ocrpageconfidencescores.py new file mode 100644 index 00000000..622171d0 --- /dev/null +++ b/src/mistralai/client/models/ocrpageconfidencescores.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7e4a07e4bdfd + +from __future__ import annotations +from .ocrconfidencescore import OCRConfidenceScore, OCRConfidenceScoreTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class OCRPageConfidenceScoresTypedDict(TypedDict): + r"""Confidence scores for an OCR page at various granularities. + + Note on page-level stats: + - For 'page' granularity: average/minimum are computed from per-token exp(logprob). + - For 'word' granularity: average/minimum are computed from per-word confidence, + where each word's confidence is exp(mean(token_logprobs)) — a geometric mean + over the word's subword tokens. + """ + + average_page_confidence_score: float + r"""Average confidence score for the page""" + minimum_page_confidence_score: float + r"""Minimum confidence score for the page""" + word_confidence_scores: NotRequired[List[OCRConfidenceScoreTypedDict]] + r"""Word-level confidence scores (populated only for 'word' granularity)""" + + +class OCRPageConfidenceScores(BaseModel): + r"""Confidence scores for an OCR page at various granularities. + + Note on page-level stats: + - For 'page' granularity: average/minimum are computed from per-token exp(logprob). + - For 'word' granularity: average/minimum are computed from per-word confidence, + where each word's confidence is exp(mean(token_logprobs)) — a geometric mean + over the word's subword tokens. + """ + + average_page_confidence_score: float + r"""Average confidence score for the page""" + + minimum_page_confidence_score: float + r"""Minimum confidence score for the page""" + + word_confidence_scores: Optional[List[OCRConfidenceScore]] = None + r"""Word-level confidence scores (populated only for 'word' granularity)""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["word_confidence_scores"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/ocrpagedimensions.py b/src/mistralai/client/models/ocrpagedimensions.py new file mode 100644 index 00000000..847205c6 --- /dev/null +++ b/src/mistralai/client/models/ocrpagedimensions.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 02f763afbc9f + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class OCRPageDimensionsTypedDict(TypedDict): + dpi: int + r"""Dots per inch of the page-image""" + height: int + r"""Height of the image in pixels""" + width: int + r"""Width of the image in pixels""" + + +class OCRPageDimensions(BaseModel): + dpi: int + r"""Dots per inch of the page-image""" + + height: int + r"""Height of the image in pixels""" + + width: int + r"""Width of the image in pixels""" diff --git a/src/mistralai/client/models/ocrpageobject.py b/src/mistralai/client/models/ocrpageobject.py new file mode 100644 index 00000000..d77661aa --- /dev/null +++ b/src/mistralai/client/models/ocrpageobject.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 07a099f89487 + +from __future__ import annotations +from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict +from .ocrpageconfidencescores import ( + OCRPageConfidenceScores, + OCRPageConfidenceScoresTypedDict, +) +from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict +from .ocrtableobject import OCRTableObject, OCRTableObjectTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class OCRPageObjectTypedDict(TypedDict): + index: int + r"""The page index in a pdf document starting from 0""" + markdown: str + r"""The markdown string response of the page""" + images: List[OCRImageObjectTypedDict] + r"""List of all extracted images in the page""" + dimensions: Nullable[OCRPageDimensionsTypedDict] + r"""The dimensions of the PDF Page's screenshot image""" + tables: NotRequired[List[OCRTableObjectTypedDict]] + r"""List of all extracted tables in the page""" + hyperlinks: NotRequired[List[str]] + r"""List of all hyperlinks in the page""" + header: NotRequired[Nullable[str]] + r"""Header of the page""" + footer: NotRequired[Nullable[str]] + r"""Footer of the page""" + confidence_scores: NotRequired[Nullable[OCRPageConfidenceScoresTypedDict]] + r"""Confidence scores for the OCR page (populated when confidence_scores_granularity is set)""" + + +class OCRPageObject(BaseModel): + index: int + r"""The page index in a pdf document starting from 0""" + + markdown: str + r"""The markdown string response of the page""" + + images: List[OCRImageObject] + r"""List of all extracted images in the page""" + + dimensions: Nullable[OCRPageDimensions] + r"""The dimensions of the PDF Page's screenshot image""" + + tables: Optional[List[OCRTableObject]] = None + r"""List of all extracted tables in the page""" + + hyperlinks: Optional[List[str]] = None + r"""List of all hyperlinks in the page""" + + header: OptionalNullable[str] = UNSET + r"""Header of the page""" + + footer: OptionalNullable[str] = UNSET + r"""Footer of the page""" + + confidence_scores: OptionalNullable[OCRPageConfidenceScores] = UNSET + r"""Confidence scores for the OCR page (populated when confidence_scores_granularity is set)""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["tables", "hyperlinks", "header", "footer", "confidence_scores"] + ) + nullable_fields = set(["header", "footer", "dimensions", "confidence_scores"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/ocrrequest.py b/src/mistralai/client/models/ocrrequest.py new file mode 100644 index 00000000..2a16e712 --- /dev/null +++ b/src/mistralai/client/models/ocrrequest.py @@ -0,0 +1,165 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 36f204c64074 + +from __future__ import annotations +from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict +from .filechunk import FileChunk, FileChunkTypedDict +from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict +from .responseformat import ResponseFormat, ResponseFormatTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Literal, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +DocumentUnionTypedDict = TypeAliasType( + "DocumentUnionTypedDict", + Union[FileChunkTypedDict, ImageURLChunkTypedDict, DocumentURLChunkTypedDict], +) +r"""Document to run OCR on""" + + +DocumentUnion = TypeAliasType( + "DocumentUnion", Union[FileChunk, ImageURLChunk, DocumentURLChunk] +) +r"""Document to run OCR on""" + + +PagesTypedDict = TypeAliasType("PagesTypedDict", Union[str, List[int]]) +r"""Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0.""" + + +Pages = TypeAliasType("Pages", Union[str, List[int]]) +r"""Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0.""" + + +TableFormat = Literal[ + "markdown", + "html", +] + + +ConfidenceScoresGranularity = Literal[ + "word", + "page", +] + + +class OCRRequestTypedDict(TypedDict): + model: Nullable[str] + document: DocumentUnionTypedDict + r"""Document to run OCR on""" + pages: NotRequired[Nullable[PagesTypedDict]] + r"""Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0.""" + include_image_base64: NotRequired[Nullable[bool]] + r"""Include image URLs in response""" + image_limit: NotRequired[Nullable[int]] + r"""Max images to extract""" + image_min_size: NotRequired[Nullable[int]] + r"""Minimum height and width of image to extract""" + bbox_annotation_format: NotRequired[Nullable[ResponseFormatTypedDict]] + r"""Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field""" + document_annotation_format: NotRequired[Nullable[ResponseFormatTypedDict]] + r"""Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field""" + document_annotation_prompt: NotRequired[Nullable[str]] + r"""Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided.""" + table_format: NotRequired[Nullable[TableFormat]] + extract_header: NotRequired[bool] + extract_footer: NotRequired[bool] + confidence_scores_granularity: NotRequired[Nullable[ConfidenceScoresGranularity]] + r"""Granularity for confidence scores: 'word' (per-word scores) or 'page' (aggregate only). Defaults to None (no confidence scores) to keep response payload small.""" + + +class OCRRequest(BaseModel): + model: Nullable[str] + + document: DocumentUnion + r"""Document to run OCR on""" + + pages: OptionalNullable[Pages] = UNSET + r"""Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0.""" + + include_image_base64: OptionalNullable[bool] = UNSET + r"""Include image URLs in response""" + + image_limit: OptionalNullable[int] = UNSET + r"""Max images to extract""" + + image_min_size: OptionalNullable[int] = UNSET + r"""Minimum height and width of image to extract""" + + bbox_annotation_format: OptionalNullable[ResponseFormat] = UNSET + r"""Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field""" + + document_annotation_format: OptionalNullable[ResponseFormat] = UNSET + r"""Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field""" + + document_annotation_prompt: OptionalNullable[str] = UNSET + r"""Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided.""" + + table_format: OptionalNullable[TableFormat] = UNSET + + extract_header: Optional[bool] = None + + extract_footer: Optional[bool] = None + + confidence_scores_granularity: OptionalNullable[ConfidenceScoresGranularity] = UNSET + r"""Granularity for confidence scores: 'word' (per-word scores) or 'page' (aggregate only). Defaults to None (no confidence scores) to keep response payload small.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "pages", + "include_image_base64", + "image_limit", + "image_min_size", + "bbox_annotation_format", + "document_annotation_format", + "document_annotation_prompt", + "table_format", + "extract_header", + "extract_footer", + "confidence_scores_granularity", + ] + ) + nullable_fields = set( + [ + "model", + "pages", + "include_image_base64", + "image_limit", + "image_min_size", + "bbox_annotation_format", + "document_annotation_format", + "document_annotation_prompt", + "table_format", + "confidence_scores_granularity", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/ocrresponse.py b/src/mistralai/client/models/ocrresponse.py new file mode 100644 index 00000000..ff4b96c3 --- /dev/null +++ b/src/mistralai/client/models/ocrresponse.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2fdfc881ca56 + +from __future__ import annotations +from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict +from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class OCRResponseTypedDict(TypedDict): + pages: List[OCRPageObjectTypedDict] + r"""List of OCR info for pages.""" + model: str + r"""The model used to generate the OCR.""" + usage_info: OCRUsageInfoTypedDict + document_annotation: NotRequired[Nullable[str]] + r"""Formatted response in the request_format if provided in json str""" + + +class OCRResponse(BaseModel): + pages: List[OCRPageObject] + r"""List of OCR info for pages.""" + + model: str + r"""The model used to generate the OCR.""" + + usage_info: OCRUsageInfo + + document_annotation: OptionalNullable[str] = UNSET + r"""Formatted response in the request_format if provided in json str""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["document_annotation"]) + nullable_fields = set(["document_annotation"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/ocrtableobject.py b/src/mistralai/client/models/ocrtableobject.py new file mode 100644 index 00000000..1cb59527 --- /dev/null +++ b/src/mistralai/client/models/ocrtableobject.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d74dd0d2ddac + +from __future__ import annotations +from .ocrconfidencescore import OCRConfidenceScore, OCRConfidenceScoreTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +import pydantic +from pydantic import model_serializer +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +Format = Union[ + Literal[ + "markdown", + "html", + ], + UnrecognizedStr, +] +r"""Format of the table""" + + +class OCRTableObjectTypedDict(TypedDict): + id: str + r"""Table ID for extracted table in a page""" + content: str + r"""Content of the table in the given format""" + format_: Format + r"""Format of the table""" + word_confidence_scores: NotRequired[Nullable[List[OCRConfidenceScoreTypedDict]]] + r"""Per-word confidence scores for the table content. Returned when confidence_scores_granularity is set to 'word'.""" + + +class OCRTableObject(BaseModel): + id: str + r"""Table ID for extracted table in a page""" + + content: str + r"""Content of the table in the given format""" + + format_: Annotated[Format, pydantic.Field(alias="format")] + r"""Format of the table""" + + word_confidence_scores: OptionalNullable[List[OCRConfidenceScore]] = UNSET + r"""Per-word confidence scores for the table content. Returned when confidence_scores_granularity is set to 'word'.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["word_confidence_scores"]) + nullable_fields = set(["word_confidence_scores"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + OCRTableObject.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/ocrusageinfo.py b/src/mistralai/client/models/ocrusageinfo.py new file mode 100644 index 00000000..bfd748e0 --- /dev/null +++ b/src/mistralai/client/models/ocrusageinfo.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 272b7e1785d5 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class OCRUsageInfoTypedDict(TypedDict): + pages_processed: int + r"""Number of pages processed""" + doc_size_bytes: NotRequired[Nullable[int]] + r"""Document size in bytes""" + + +class OCRUsageInfo(BaseModel): + pages_processed: int + r"""Number of pages processed""" + + doc_size_bytes: OptionalNullable[int] = UNSET + r"""Document size in bytes""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["doc_size_bytes"]) + nullable_fields = set(["doc_size_bytes"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/outboundauthenticationtype.py b/src/mistralai/client/models/outboundauthenticationtype.py new file mode 100644 index 00000000..39da354a --- /dev/null +++ b/src/mistralai/client/models/outboundauthenticationtype.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 705e7172ba40 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +OutboundAuthenticationType = Union[ + Literal[ + "oauth2", + "bearer", + "none", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/models/outputcontentchunks.py b/src/mistralai/client/models/outputcontentchunks.py similarity index 97% rename from src/mistralai/models/outputcontentchunks.py rename to src/mistralai/client/models/outputcontentchunks.py index ad0c087e..1a115fe8 100644 --- a/src/mistralai/models/outputcontentchunks.py +++ b/src/mistralai/client/models/outputcontentchunks.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9ad9741f4975 from __future__ import annotations from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict diff --git a/src/mistralai/client/models/paginatedconnectors.py b/src/mistralai/client/models/paginatedconnectors.py new file mode 100644 index 00000000..291da111 --- /dev/null +++ b/src/mistralai/client/models/paginatedconnectors.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 17e125b1022c + +from __future__ import annotations +from .connector import Connector, ConnectorTypedDict +from .paginationresponse import PaginationResponse, PaginationResponseTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class PaginatedConnectorsTypedDict(TypedDict): + items: List[ConnectorTypedDict] + pagination: PaginationResponseTypedDict + + +class PaginatedConnectors(BaseModel): + items: List[Connector] + + pagination: PaginationResponse diff --git a/src/mistralai/client/models/paginatedresultcampaignpreview.py b/src/mistralai/client/models/paginatedresultcampaignpreview.py new file mode 100644 index 00000000..f6cfce37 --- /dev/null +++ b/src/mistralai/client/models/paginatedresultcampaignpreview.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6653cba0f982 + +from __future__ import annotations +from .campaign import Campaign, CampaignTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PaginatedResultCampaignPreviewTypedDict(TypedDict): + count: int + results: NotRequired[List[CampaignTypedDict]] + next: NotRequired[Nullable[str]] + previous: NotRequired[Nullable[str]] + + +class PaginatedResultCampaignPreview(BaseModel): + count: int + + results: Optional[List[Campaign]] = None + + next: OptionalNullable[str] = UNSET + + previous: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "next", "previous"]) + nullable_fields = set(["next", "previous"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/paginatedresultchatcompletioneventpreview.py b/src/mistralai/client/models/paginatedresultchatcompletioneventpreview.py new file mode 100644 index 00000000..e08443c1 --- /dev/null +++ b/src/mistralai/client/models/paginatedresultchatcompletioneventpreview.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8c640682ccf9 + +from __future__ import annotations +from .chatcompletioneventpreview import ( + ChatCompletionEventPreview, + ChatCompletionEventPreviewTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PaginatedResultChatCompletionEventPreviewTypedDict(TypedDict): + count: int + results: NotRequired[List[ChatCompletionEventPreviewTypedDict]] + next: NotRequired[Nullable[str]] + previous: NotRequired[Nullable[str]] + + +class PaginatedResultChatCompletionEventPreview(BaseModel): + count: int + + results: Optional[List[ChatCompletionEventPreview]] = None + + next: OptionalNullable[str] = UNSET + + previous: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "next", "previous"]) + nullable_fields = set(["next", "previous"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/paginatedresultdatasetimporttask.py b/src/mistralai/client/models/paginatedresultdatasetimporttask.py new file mode 100644 index 00000000..4b9f4881 --- /dev/null +++ b/src/mistralai/client/models/paginatedresultdatasetimporttask.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8fd0a8bad4e7 + +from __future__ import annotations +from .datasetimporttask import DatasetImportTask, DatasetImportTaskTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PaginatedResultDatasetImportTaskTypedDict(TypedDict): + count: int + results: NotRequired[List[DatasetImportTaskTypedDict]] + next: NotRequired[Nullable[str]] + previous: NotRequired[Nullable[str]] + + +class PaginatedResultDatasetImportTask(BaseModel): + count: int + + results: Optional[List[DatasetImportTask]] = None + + next: OptionalNullable[str] = UNSET + + previous: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "next", "previous"]) + nullable_fields = set(["next", "previous"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/paginatedresultdatasetpreview.py b/src/mistralai/client/models/paginatedresultdatasetpreview.py new file mode 100644 index 00000000..81746f35 --- /dev/null +++ b/src/mistralai/client/models/paginatedresultdatasetpreview.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bf20489474ce + +from __future__ import annotations +from .datasetpreview import DatasetPreview, DatasetPreviewTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PaginatedResultDatasetPreviewTypedDict(TypedDict): + count: int + results: NotRequired[List[DatasetPreviewTypedDict]] + next: NotRequired[Nullable[str]] + previous: NotRequired[Nullable[str]] + + +class PaginatedResultDatasetPreview(BaseModel): + count: int + + results: Optional[List[DatasetPreview]] = None + + next: OptionalNullable[str] = UNSET + + previous: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "next", "previous"]) + nullable_fields = set(["next", "previous"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/paginatedresultdatasetrecord.py b/src/mistralai/client/models/paginatedresultdatasetrecord.py new file mode 100644 index 00000000..d9aa8c8e --- /dev/null +++ b/src/mistralai/client/models/paginatedresultdatasetrecord.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2556a91b48c4 + +from __future__ import annotations +from .datasetrecord import DatasetRecord, DatasetRecordTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PaginatedResultDatasetRecordTypedDict(TypedDict): + count: int + results: NotRequired[List[DatasetRecordTypedDict]] + next: NotRequired[Nullable[str]] + previous: NotRequired[Nullable[str]] + + +class PaginatedResultDatasetRecord(BaseModel): + count: int + + results: Optional[List[DatasetRecord]] = None + + next: OptionalNullable[str] = UNSET + + previous: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "next", "previous"]) + nullable_fields = set(["next", "previous"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/paginatedresultjudgepreview.py b/src/mistralai/client/models/paginatedresultjudgepreview.py new file mode 100644 index 00000000..c61382f9 --- /dev/null +++ b/src/mistralai/client/models/paginatedresultjudgepreview.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4d5aab2705a0 + +from __future__ import annotations +from .judge import Judge, JudgeTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PaginatedResultJudgePreviewTypedDict(TypedDict): + count: int + results: NotRequired[List[JudgeTypedDict]] + next: NotRequired[Nullable[str]] + previous: NotRequired[Nullable[str]] + + +class PaginatedResultJudgePreview(BaseModel): + count: int + + results: Optional[List[Judge]] = None + + next: OptionalNullable[str] = UNSET + + previous: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["results", "next", "previous"]) + nullable_fields = set(["next", "previous"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/models/paginationinfo.py b/src/mistralai/client/models/paginationinfo.py similarity index 85% rename from src/mistralai/models/paginationinfo.py rename to src/mistralai/client/models/paginationinfo.py index 00d4f1ec..2b9dab62 100644 --- a/src/mistralai/models/paginationinfo.py +++ b/src/mistralai/client/models/paginationinfo.py @@ -1,7 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 48851e82d67e from __future__ import annotations -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel from typing_extensions import TypedDict diff --git a/src/mistralai/client/models/paginationresponse.py b/src/mistralai/client/models/paginationresponse.py new file mode 100644 index 00000000..a60640aa --- /dev/null +++ b/src/mistralai/client/models/paginationresponse.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d64678967bf0 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class PaginationResponseTypedDict(TypedDict): + page_size: int + next_cursor: NotRequired[Nullable[str]] + + +class PaginationResponse(BaseModel): + page_size: int + + next_cursor: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["next_cursor"]) + nullable_fields = set(["next_cursor"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/pause_schedule_v1_workflows_schedules_schedule_id_pause_postop.py b/src/mistralai/client/models/pause_schedule_v1_workflows_schedules_schedule_id_pause_postop.py new file mode 100644 index 00000000..2a53eaec --- /dev/null +++ b/src/mistralai/client/models/pause_schedule_v1_workflows_schedules_schedule_id_pause_postop.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 53799174e259 + +from __future__ import annotations +from .workflowschedulepauserequest import ( + WorkflowSchedulePauseRequest, + WorkflowSchedulePauseRequestTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequestTypedDict(TypedDict): + schedule_id: str + workflow_schedule_pause_request: NotRequired[ + Nullable[WorkflowSchedulePauseRequestTypedDict] + ] + + +class PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest(BaseModel): + schedule_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + workflow_schedule_pause_request: Annotated[ + OptionalNullable[WorkflowSchedulePauseRequest], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["WorkflowSchedulePauseRequest"]) + nullable_fields = set(["WorkflowSchedulePauseRequest"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/post_dataset_records_from_campaign_v1_observability_datasets_dataset_id_imports_from_campaign_postop.py b/src/mistralai/client/models/post_dataset_records_from_campaign_v1_observability_datasets_dataset_id_imports_from_campaign_postop.py new file mode 100644 index 00000000..3d572517 --- /dev/null +++ b/src/mistralai/client/models/post_dataset_records_from_campaign_v1_observability_datasets_dataset_id_imports_from_campaign_postop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3e8e390b7fa1 + +from __future__ import annotations +from .importdatasetfromcampaignrequest import ( + ImportDatasetFromCampaignRequest, + ImportDatasetFromCampaignRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequestTypedDict( + TypedDict +): + dataset_id: str + import_dataset_from_campaign_request: ImportDatasetFromCampaignRequestTypedDict + + +class PostDatasetRecordsFromCampaignV1ObservabilityDatasetsDatasetIDImportsFromCampaignPostRequest( + BaseModel +): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + import_dataset_from_campaign_request: Annotated[ + ImportDatasetFromCampaignRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/post_dataset_records_from_dataset_v1_observability_datasets_dataset_id_imports_from_dataset_postop.py b/src/mistralai/client/models/post_dataset_records_from_dataset_v1_observability_datasets_dataset_id_imports_from_dataset_postop.py new file mode 100644 index 00000000..aac48bd6 --- /dev/null +++ b/src/mistralai/client/models/post_dataset_records_from_dataset_v1_observability_datasets_dataset_id_imports_from_dataset_postop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d396e018c804 + +from __future__ import annotations +from .importdatasetfromdatasetrequest import ( + ImportDatasetFromDatasetRequest, + ImportDatasetFromDatasetRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequestTypedDict( + TypedDict +): + dataset_id: str + import_dataset_from_dataset_request: ImportDatasetFromDatasetRequestTypedDict + + +class PostDatasetRecordsFromDatasetV1ObservabilityDatasetsDatasetIDImportsFromDatasetPostRequest( + BaseModel +): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + import_dataset_from_dataset_request: Annotated[ + ImportDatasetFromDatasetRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/post_dataset_records_from_explorer_v1_observability_datasets_dataset_id_imports_from_explorer_postop.py b/src/mistralai/client/models/post_dataset_records_from_explorer_v1_observability_datasets_dataset_id_imports_from_explorer_postop.py new file mode 100644 index 00000000..6524c4d9 --- /dev/null +++ b/src/mistralai/client/models/post_dataset_records_from_explorer_v1_observability_datasets_dataset_id_imports_from_explorer_postop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 046c79ed47c7 + +from __future__ import annotations +from .importdatasetfromexplorerrequest import ( + ImportDatasetFromExplorerRequest, + ImportDatasetFromExplorerRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequestTypedDict( + TypedDict +): + dataset_id: str + import_dataset_from_explorer_request: ImportDatasetFromExplorerRequestTypedDict + + +class PostDatasetRecordsFromExplorerV1ObservabilityDatasetsDatasetIDImportsFromExplorerPostRequest( + BaseModel +): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + import_dataset_from_explorer_request: Annotated[ + ImportDatasetFromExplorerRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/post_dataset_records_from_file_v1_observability_datasets_dataset_id_imports_from_file_postop.py b/src/mistralai/client/models/post_dataset_records_from_file_v1_observability_datasets_dataset_id_imports_from_file_postop.py new file mode 100644 index 00000000..17f90d48 --- /dev/null +++ b/src/mistralai/client/models/post_dataset_records_from_file_v1_observability_datasets_dataset_id_imports_from_file_postop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6e93e5363630 + +from __future__ import annotations +from .importdatasetfromfilerequest import ( + ImportDatasetFromFileRequest, + ImportDatasetFromFileRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequestTypedDict( + TypedDict +): + dataset_id: str + import_dataset_from_file_request: ImportDatasetFromFileRequestTypedDict + + +class PostDatasetRecordsFromFileV1ObservabilityDatasetsDatasetIDImportsFromFilePostRequest( + BaseModel +): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + import_dataset_from_file_request: Annotated[ + ImportDatasetFromFileRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/post_dataset_records_from_playground_v1_observability_datasets_dataset_id_imports_from_playground_postop.py b/src/mistralai/client/models/post_dataset_records_from_playground_v1_observability_datasets_dataset_id_imports_from_playground_postop.py new file mode 100644 index 00000000..7423375a --- /dev/null +++ b/src/mistralai/client/models/post_dataset_records_from_playground_v1_observability_datasets_dataset_id_imports_from_playground_postop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 09334d96c26d + +from __future__ import annotations +from .importdatasetfromplaygroundrequest import ( + ImportDatasetFromPlaygroundRequest, + ImportDatasetFromPlaygroundRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequestTypedDict( + TypedDict +): + dataset_id: str + import_dataset_from_playground_request: ImportDatasetFromPlaygroundRequestTypedDict + + +class PostDatasetRecordsFromPlaygroundV1ObservabilityDatasetsDatasetIDImportsFromPlaygroundPostRequest( + BaseModel +): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + import_dataset_from_playground_request: Annotated[ + ImportDatasetFromPlaygroundRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/prediction.py b/src/mistralai/client/models/prediction.py new file mode 100644 index 00000000..614f4811 --- /dev/null +++ b/src/mistralai/client/models/prediction.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1cc842a069a5 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PredictionTypedDict(TypedDict): + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + type: Literal["content"] + content: NotRequired[str] + + +class Prediction(BaseModel): + r"""Enable users to specify an expected completion, optimizing response times by leveraging known or predictable content.""" + + type: Annotated[ + Annotated[ + Optional[Literal["content"]], AfterValidator(validate_const("content")) + ], + pydantic.Field(alias="type"), + ] = "content" + + content: Optional[str] = "" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "content"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + Prediction.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/processingstatus.py b/src/mistralai/client/models/processingstatus.py new file mode 100644 index 00000000..7e93308f --- /dev/null +++ b/src/mistralai/client/models/processingstatus.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 28146eaecfcf + +from __future__ import annotations +from .processstatus import ProcessStatus +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ProcessingStatusTypedDict(TypedDict): + document_id: str + process_status: ProcessStatus + processing_status: str + + +class ProcessingStatus(BaseModel): + document_id: str + + process_status: ProcessStatus + + processing_status: str diff --git a/src/mistralai/client/models/processstatus.py b/src/mistralai/client/models/processstatus.py new file mode 100644 index 00000000..15bdce20 --- /dev/null +++ b/src/mistralai/client/models/processstatus.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0205512146e6 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ProcessStatus = Union[ + Literal[ + "self_managed", + "missing_content", + "noop", + "done", + "todo", + "in_progress", + "error", + "waiting_for_capacity", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/prompttokensdetails.py b/src/mistralai/client/models/prompttokensdetails.py new file mode 100644 index 00000000..2c5186c0 --- /dev/null +++ b/src/mistralai/client/models/prompttokensdetails.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e6be33f2cd2d + +from __future__ import annotations +from .messagetokens import MessageTokens, MessageTokensTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class PromptTokensDetailsTypedDict(TypedDict): + r"""Token usage details for the prompt.""" + + messages: NotRequired[List[MessageTokensTypedDict]] + cached_tokens: NotRequired[int] + + +class PromptTokensDetails(BaseModel): + r"""Token usage details for the prompt.""" + + messages: Optional[List[MessageTokens]] = None + + cached_tokens: Optional[int] = 0 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["messages", "cached_tokens"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/publicauthenticationmethod.py b/src/mistralai/client/models/publicauthenticationmethod.py new file mode 100644 index 00000000..42e943a6 --- /dev/null +++ b/src/mistralai/client/models/publicauthenticationmethod.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 545ab7f24523 + +from __future__ import annotations +from .connectorauthenticationheader import ( + ConnectorAuthenticationHeader, + ConnectorAuthenticationHeaderTypedDict, +) +from .outboundauthenticationtype import OutboundAuthenticationType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class PublicAuthenticationMethodTypedDict(TypedDict): + r"""Public view of an authentication method, without secrets.""" + + method_type: OutboundAuthenticationType + has_default_credentials: bool + headers: NotRequired[Nullable[List[ConnectorAuthenticationHeaderTypedDict]]] + + +class PublicAuthenticationMethod(BaseModel): + r"""Public view of an authentication method, without secrets.""" + + method_type: OutboundAuthenticationType + + has_default_credentials: bool + + headers: OptionalNullable[List[ConnectorAuthenticationHeader]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["headers"]) + nullable_fields = set(["headers"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/query_workflow_execution_v1_workflows_executions_execution_id_queries_postop.py b/src/mistralai/client/models/query_workflow_execution_v1_workflows_executions_execution_id_queries_postop.py new file mode 100644 index 00000000..5598c4b6 --- /dev/null +++ b/src/mistralai/client/models/query_workflow_execution_v1_workflows_executions_execution_id_queries_postop.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 73826dbd3f5b + +from __future__ import annotations +from .queryinvocationbody import QueryInvocationBody, QueryInvocationBodyTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequestTypedDict( + TypedDict +): + execution_id: str + query_invocation_body: QueryInvocationBodyTypedDict + + +class QueryWorkflowExecutionV1WorkflowsExecutionsExecutionIDQueriesPostRequest( + BaseModel +): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + query_invocation_body: Annotated[ + QueryInvocationBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/querydefinition.py b/src/mistralai/client/models/querydefinition.py new file mode 100644 index 00000000..bc9b4f20 --- /dev/null +++ b/src/mistralai/client/models/querydefinition.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9648273c8b7d + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class QueryDefinitionTypedDict(TypedDict): + name: str + r"""Name of the query""" + input_schema: Dict[str, Any] + r"""Input JSON schema of the query's model""" + description: NotRequired[Nullable[str]] + r"""Description of the query""" + output_schema: NotRequired[Nullable[Dict[str, Any]]] + r"""Output JSON schema of the query's model""" + + +class QueryDefinition(BaseModel): + name: str + r"""Name of the query""" + + input_schema: Dict[str, Any] + r"""Input JSON schema of the query's model""" + + description: OptionalNullable[str] = UNSET + r"""Description of the query""" + + output_schema: OptionalNullable[Dict[str, Any]] = UNSET + r"""Output JSON schema of the query's model""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "output_schema"]) + nullable_fields = set(["description", "output_schema"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/queryinvocationbody.py b/src/mistralai/client/models/queryinvocationbody.py new file mode 100644 index 00000000..550e1d7b --- /dev/null +++ b/src/mistralai/client/models/queryinvocationbody.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d78662a1a9bf + +from __future__ import annotations +from .networkencodedinput import NetworkEncodedInput, NetworkEncodedInputTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +QueryInvocationBodyInputTypedDict = TypeAliasType( + "QueryInvocationBodyInputTypedDict", + Union[NetworkEncodedInputTypedDict, Dict[str, Any]], +) +r"""Input data for the query, matching its schema""" + + +QueryInvocationBodyInput = TypeAliasType( + "QueryInvocationBodyInput", Union[NetworkEncodedInput, Dict[str, Any]] +) +r"""Input data for the query, matching its schema""" + + +class QueryInvocationBodyTypedDict(TypedDict): + name: str + r"""The name of the query to request""" + input: NotRequired[Nullable[QueryInvocationBodyInputTypedDict]] + r"""Input data for the query, matching its schema""" + + +class QueryInvocationBody(BaseModel): + name: str + r"""The name of the query to request""" + + input: OptionalNullable[QueryInvocationBodyInput] = UNSET + r"""Input data for the query, matching its schema""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input"]) + nullable_fields = set(["input"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/queryworkflowresponse.py b/src/mistralai/client/models/queryworkflowresponse.py new file mode 100644 index 00000000..aed982d5 --- /dev/null +++ b/src/mistralai/client/models/queryworkflowresponse.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 30281fcedce6 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Any +from typing_extensions import TypedDict + + +class QueryWorkflowResponseTypedDict(TypedDict): + query_name: str + result: Any + r"""The result of the Query workflow call""" + + +class QueryWorkflowResponse(BaseModel): + query_name: str + + result: Any + r"""The result of the Query workflow call""" diff --git a/src/mistralai/client/models/realtimetranscriptionerror.py b/src/mistralai/client/models/realtimetranscriptionerror.py new file mode 100644 index 00000000..8ea1d425 --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptionerror.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8c2267378f48 + +from __future__ import annotations +from .realtimetranscriptionerrordetail import ( + RealtimeTranscriptionErrorDetail, + RealtimeTranscriptionErrorDetailTypedDict, +) +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class RealtimeTranscriptionErrorTypedDict(TypedDict): + error: RealtimeTranscriptionErrorDetailTypedDict + type: Literal["error"] + + +class RealtimeTranscriptionError(BaseModel): + error: RealtimeTranscriptionErrorDetail + + type: Annotated[ + Annotated[Optional[Literal["error"]], AfterValidator(validate_const("error"))], + pydantic.Field(alias="type"), + ] = "error" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + RealtimeTranscriptionError.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/realtimetranscriptionerrordetail.py b/src/mistralai/client/models/realtimetranscriptionerrordetail.py new file mode 100644 index 00000000..cec1f6ea --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptionerrordetail.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5bd25cdf9c7a + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Any, Dict, Union +from typing_extensions import TypeAliasType, TypedDict + + +RealtimeTranscriptionErrorDetailMessageTypedDict = TypeAliasType( + "RealtimeTranscriptionErrorDetailMessageTypedDict", Union[str, Dict[str, Any]] +) +r"""Human-readable error message.""" + + +RealtimeTranscriptionErrorDetailMessage = TypeAliasType( + "RealtimeTranscriptionErrorDetailMessage", Union[str, Dict[str, Any]] +) +r"""Human-readable error message.""" + + +class RealtimeTranscriptionErrorDetailTypedDict(TypedDict): + message: RealtimeTranscriptionErrorDetailMessageTypedDict + r"""Human-readable error message.""" + code: int + r"""Internal error code for debugging.""" + + +class RealtimeTranscriptionErrorDetail(BaseModel): + message: RealtimeTranscriptionErrorDetailMessage + r"""Human-readable error message.""" + + code: int + r"""Internal error code for debugging.""" diff --git a/src/mistralai/client/models/realtimetranscriptioninputaudioappend.py b/src/mistralai/client/models/realtimetranscriptioninputaudioappend.py new file mode 100644 index 00000000..82ce59fc --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptioninputaudioappend.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8b03cde6e115 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class RealtimeTranscriptionInputAudioAppendTypedDict(TypedDict): + audio: str + r"""Base64-encoded raw PCM bytes matching the current audio_format. Max decoded size: 262144 bytes.""" + type: Literal["input_audio.append"] + + +class RealtimeTranscriptionInputAudioAppend(BaseModel): + audio: str + r"""Base64-encoded raw PCM bytes matching the current audio_format. Max decoded size: 262144 bytes.""" + + type: Annotated[ + Annotated[ + Optional[Literal["input_audio.append"]], + AfterValidator(validate_const("input_audio.append")), + ], + pydantic.Field(alias="type"), + ] = "input_audio.append" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + RealtimeTranscriptionInputAudioAppend.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/realtimetranscriptioninputaudioend.py b/src/mistralai/client/models/realtimetranscriptioninputaudioend.py new file mode 100644 index 00000000..9b0a8709 --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptioninputaudioend.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c187ba1b551d + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class RealtimeTranscriptionInputAudioEndTypedDict(TypedDict): + type: Literal["input_audio.end"] + + +class RealtimeTranscriptionInputAudioEnd(BaseModel): + type: Annotated[ + Annotated[ + Optional[Literal["input_audio.end"]], + AfterValidator(validate_const("input_audio.end")), + ], + pydantic.Field(alias="type"), + ] = "input_audio.end" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + RealtimeTranscriptionInputAudioEnd.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/realtimetranscriptioninputaudioflush.py b/src/mistralai/client/models/realtimetranscriptioninputaudioflush.py new file mode 100644 index 00000000..fe728633 --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptioninputaudioflush.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b27b600c310e + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class RealtimeTranscriptionInputAudioFlushTypedDict(TypedDict): + type: Literal["input_audio.flush"] + + +class RealtimeTranscriptionInputAudioFlush(BaseModel): + type: Annotated[ + Annotated[ + Optional[Literal["input_audio.flush"]], + AfterValidator(validate_const("input_audio.flush")), + ], + pydantic.Field(alias="type"), + ] = "input_audio.flush" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + RealtimeTranscriptionInputAudioFlush.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/realtimetranscriptionsession.py b/src/mistralai/client/models/realtimetranscriptionsession.py new file mode 100644 index 00000000..e23c07ec --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptionsession.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 02517fa5411a + +from __future__ import annotations +from .audioformat import AudioFormat, AudioFormatTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class RealtimeTranscriptionSessionTypedDict(TypedDict): + request_id: str + model: str + audio_format: AudioFormatTypedDict + target_streaming_delay_ms: NotRequired[Nullable[int]] + + +class RealtimeTranscriptionSession(BaseModel): + request_id: str + + model: str + + audio_format: AudioFormat + + target_streaming_delay_ms: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["target_streaming_delay_ms"]) + nullable_fields = set(["target_streaming_delay_ms"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/realtimetranscriptionsessioncreated.py b/src/mistralai/client/models/realtimetranscriptionsessioncreated.py new file mode 100644 index 00000000..88da8764 --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptionsessioncreated.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4e3731f63a3c + +from __future__ import annotations +from .realtimetranscriptionsession import ( + RealtimeTranscriptionSession, + RealtimeTranscriptionSessionTypedDict, +) +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class RealtimeTranscriptionSessionCreatedTypedDict(TypedDict): + session: RealtimeTranscriptionSessionTypedDict + type: Literal["session.created"] + + +class RealtimeTranscriptionSessionCreated(BaseModel): + session: RealtimeTranscriptionSession + + type: Annotated[ + Annotated[ + Optional[Literal["session.created"]], + AfterValidator(validate_const("session.created")), + ], + pydantic.Field(alias="type"), + ] = "session.created" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + RealtimeTranscriptionSessionCreated.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/realtimetranscriptionsessionupdated.py b/src/mistralai/client/models/realtimetranscriptionsessionupdated.py new file mode 100644 index 00000000..474b2fa7 --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptionsessionupdated.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 686dc4f2450f + +from __future__ import annotations +from .realtimetranscriptionsession import ( + RealtimeTranscriptionSession, + RealtimeTranscriptionSessionTypedDict, +) +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class RealtimeTranscriptionSessionUpdatedTypedDict(TypedDict): + session: RealtimeTranscriptionSessionTypedDict + type: Literal["session.updated"] + + +class RealtimeTranscriptionSessionUpdated(BaseModel): + session: RealtimeTranscriptionSession + + type: Annotated[ + Annotated[ + Optional[Literal["session.updated"]], + AfterValidator(validate_const("session.updated")), + ], + pydantic.Field(alias="type"), + ] = "session.updated" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + RealtimeTranscriptionSessionUpdated.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/realtimetranscriptionsessionupdatemessage.py b/src/mistralai/client/models/realtimetranscriptionsessionupdatemessage.py new file mode 100644 index 00000000..4013d638 --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptionsessionupdatemessage.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4e1b3fd7c5a3 + +from __future__ import annotations +from .realtimetranscriptionsessionupdatepayload import ( + RealtimeTranscriptionSessionUpdatePayload, + RealtimeTranscriptionSessionUpdatePayloadTypedDict, +) +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class RealtimeTranscriptionSessionUpdateMessageTypedDict(TypedDict): + session: RealtimeTranscriptionSessionUpdatePayloadTypedDict + type: Literal["session.update"] + + +class RealtimeTranscriptionSessionUpdateMessage(BaseModel): + session: RealtimeTranscriptionSessionUpdatePayload + + type: Annotated[ + Annotated[ + Optional[Literal["session.update"]], + AfterValidator(validate_const("session.update")), + ], + pydantic.Field(alias="type"), + ] = "session.update" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + RealtimeTranscriptionSessionUpdateMessage.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/realtimetranscriptionsessionupdatepayload.py b/src/mistralai/client/models/realtimetranscriptionsessionupdatepayload.py new file mode 100644 index 00000000..d4ce43f7 --- /dev/null +++ b/src/mistralai/client/models/realtimetranscriptionsessionupdatepayload.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7033fdb33ad4 + +from __future__ import annotations +from .audioformat import AudioFormat, AudioFormatTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class RealtimeTranscriptionSessionUpdatePayloadTypedDict(TypedDict): + audio_format: NotRequired[Nullable[AudioFormatTypedDict]] + r"""Set before sending audio. Audio format updates are rejected after audio starts.""" + target_streaming_delay_ms: NotRequired[Nullable[int]] + r"""Set before sending audio. Streaming delay updates are rejected after audio starts.""" + + +class RealtimeTranscriptionSessionUpdatePayload(BaseModel): + audio_format: OptionalNullable[AudioFormat] = UNSET + r"""Set before sending audio. Audio format updates are rejected after audio starts.""" + + target_streaming_delay_ms: OptionalNullable[int] = UNSET + r"""Set before sending audio. Streaming delay updates are rejected after audio starts.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["audio_format", "target_streaming_delay_ms"]) + nullable_fields = set(["audio_format", "target_streaming_delay_ms"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/reasoningeffort.py b/src/mistralai/client/models/reasoningeffort.py new file mode 100644 index 00000000..e4dd2a33 --- /dev/null +++ b/src/mistralai/client/models/reasoningeffort.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b930a0a20654 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ReasoningEffort = Union[ + Literal[ + "none", + "high", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/referencechunk.py b/src/mistralai/client/models/referencechunk.py new file mode 100644 index 00000000..0ed4a737 --- /dev/null +++ b/src/mistralai/client/models/referencechunk.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 921acd3a224a + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +ReferenceIDTypedDict = TypeAliasType("ReferenceIDTypedDict", Union[int, str]) + + +ReferenceID = TypeAliasType("ReferenceID", Union[int, str]) + + +class ReferenceChunkTypedDict(TypedDict): + reference_ids: List[ReferenceIDTypedDict] + type: Literal["reference"] + + +class ReferenceChunk(BaseModel): + reference_ids: List[ReferenceID] + + type: Annotated[ + Annotated[ + Optional[Literal["reference"]], AfterValidator(validate_const("reference")) + ], + pydantic.Field(alias="type"), + ] = "reference" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ReferenceChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/requestsource.py b/src/mistralai/client/models/requestsource.py new file mode 100644 index 00000000..fc4433cb --- /dev/null +++ b/src/mistralai/client/models/requestsource.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3f2774d9e609 + +from __future__ import annotations +from typing import Literal + + +RequestSource = Literal[ + "api", + "playground", + "agent_builder_v1", +] diff --git a/src/mistralai/client/models/reset_workflow_v1_workflows_executions_execution_id_reset_postop.py b/src/mistralai/client/models/reset_workflow_v1_workflows_executions_execution_id_reset_postop.py new file mode 100644 index 00000000..eda20e53 --- /dev/null +++ b/src/mistralai/client/models/reset_workflow_v1_workflows_executions_execution_id_reset_postop.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3e9d229cd8ba + +from __future__ import annotations +from .resetinvocationbody import ResetInvocationBody, ResetInvocationBodyTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequestTypedDict(TypedDict): + execution_id: str + reset_invocation_body: ResetInvocationBodyTypedDict + + +class ResetWorkflowV1WorkflowsExecutionsExecutionIDResetPostRequest(BaseModel): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + reset_invocation_body: Annotated[ + ResetInvocationBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/resetinvocationbody.py b/src/mistralai/client/models/resetinvocationbody.py new file mode 100644 index 00000000..26c3389f --- /dev/null +++ b/src/mistralai/client/models/resetinvocationbody.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3c0a985a5a77 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ResetInvocationBodyTypedDict(TypedDict): + event_id: int + r"""The event ID to reset the workflow execution to""" + reason: NotRequired[Nullable[str]] + r"""Reason for resetting the workflow execution""" + exclude_signals: NotRequired[bool] + r"""Whether to exclude signals that happened after the reset point""" + exclude_updates: NotRequired[bool] + r"""Whether to exclude updates that happened after the reset point""" + + +class ResetInvocationBody(BaseModel): + event_id: int + r"""The event ID to reset the workflow execution to""" + + reason: OptionalNullable[str] = UNSET + r"""Reason for resetting the workflow execution""" + + exclude_signals: Optional[bool] = False + r"""Whether to exclude signals that happened after the reset point""" + + exclude_updates: Optional[bool] = False + r"""Whether to exclude updates that happened after the reset point""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["reason", "exclude_signals", "exclude_updates"]) + nullable_fields = set(["reason"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/resourcelink.py b/src/mistralai/client/models/resourcelink.py new file mode 100644 index 00000000..890c5be1 --- /dev/null +++ b/src/mistralai/client/models/resourcelink.py @@ -0,0 +1,140 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4251cc3c7797 + +from __future__ import annotations +from .annotations import Annotations, AnnotationsTypedDict +from .mcpservericon import MCPServerIcon, MCPServerIconTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, List, Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ResourceLinkTypedDict(TypedDict): + r"""A resource that the server is capable of reading, included in a prompt or tool call result. + + Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. + """ + + name: str + uri: str + title: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + mime_type: NotRequired[Nullable[str]] + size: NotRequired[Nullable[int]] + icons: NotRequired[Nullable[List[MCPServerIconTypedDict]]] + annotations: NotRequired[Nullable[AnnotationsTypedDict]] + meta: NotRequired[Nullable[Dict[str, Any]]] + type: Literal["resource_link"] + + +class ResourceLink(BaseModel): + r"""A resource that the server is capable of reading, included in a prompt or tool call result. + + Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. + """ + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + name: str + + uri: str + + title: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + mime_type: Annotated[OptionalNullable[str], pydantic.Field(alias="mimeType")] = ( + UNSET + ) + + size: OptionalNullable[int] = UNSET + + icons: OptionalNullable[List[MCPServerIcon]] = UNSET + + annotations: OptionalNullable[Annotations] = UNSET + + meta: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + type: Annotated[ + Annotated[ + Literal["resource_link"], AfterValidator(validate_const("resource_link")) + ], + pydantic.Field(alias="type"), + ] = "resource_link" + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "title", + "description", + "mimeType", + "size", + "icons", + "annotations", + "_meta", + ] + ) + nullable_fields = set( + [ + "title", + "description", + "mimeType", + "size", + "icons", + "annotations", + "_meta", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + ResourceLink.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/resourcevisibility.py b/src/mistralai/client/models/resourcevisibility.py new file mode 100644 index 00000000..56f91f15 --- /dev/null +++ b/src/mistralai/client/models/resourcevisibility.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b5819dd5f981 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ResourceVisibility = Union[ + Literal[ + "shared_global", + "shared_org", + "shared_workspace", + "private", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/responsedoneevent.py b/src/mistralai/client/models/responsedoneevent.py new file mode 100644 index 00000000..89a58bf7 --- /dev/null +++ b/src/mistralai/client/models/responsedoneevent.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cf8a686bf82c + +from __future__ import annotations +from .conversationusageinfo import ConversationUsageInfo, ConversationUsageInfoTypedDict +from datetime import datetime +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ResponseDoneEventTypedDict(TypedDict): + usage: ConversationUsageInfoTypedDict + type: Literal["conversation.response.done"] + created_at: NotRequired[datetime] + + +class ResponseDoneEvent(BaseModel): + usage: ConversationUsageInfo + + type: Annotated[ + Annotated[ + Literal["conversation.response.done"], + AfterValidator(validate_const("conversation.response.done")), + ], + pydantic.Field(alias="type"), + ] = "conversation.response.done" + + created_at: Optional[datetime] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["created_at"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ResponseDoneEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/responseerrorevent.py b/src/mistralai/client/models/responseerrorevent.py new file mode 100644 index 00000000..5326c4e8 --- /dev/null +++ b/src/mistralai/client/models/responseerrorevent.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b286d74e8724 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ResponseErrorEventTypedDict(TypedDict): + message: str + code: int + type: Literal["conversation.response.error"] + created_at: NotRequired[datetime] + + +class ResponseErrorEvent(BaseModel): + message: str + + code: int + + type: Annotated[ + Annotated[ + Literal["conversation.response.error"], + AfterValidator(validate_const("conversation.response.error")), + ], + pydantic.Field(alias="type"), + ] = "conversation.response.error" + + created_at: Optional[datetime] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["created_at"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ResponseErrorEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/responseformat.py b/src/mistralai/client/models/responseformat.py new file mode 100644 index 00000000..95141394 --- /dev/null +++ b/src/mistralai/client/models/responseformat.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6ab8bc8d22c0 + +from __future__ import annotations +from .jsonschema import JSONSchema, JSONSchemaTypedDict +from .responseformats import ResponseFormats +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ResponseFormatTypedDict(TypedDict): + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + type: NotRequired[ResponseFormats] + json_schema: NotRequired[Nullable[JSONSchemaTypedDict]] + + +class ResponseFormat(BaseModel): + r"""Specify the format that the model must output. By default it will use `{ \"type\": \"text\" }`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. Setting to `{ \"type\": \"json_schema\" }` enables JSON schema mode, which guarantees the message the model generates is in JSON and follows the schema you provide.""" + + type: Optional[ResponseFormats] = None + + json_schema: OptionalNullable[JSONSchema] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "json_schema"]) + nullable_fields = set(["json_schema"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/responseformats.py b/src/mistralai/client/models/responseformats.py new file mode 100644 index 00000000..21345778 --- /dev/null +++ b/src/mistralai/client/models/responseformats.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c4462a05fb08 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ResponseFormats = Union[ + Literal[ + "text", + "json_object", + "json_schema", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/responsestartedevent.py b/src/mistralai/client/models/responsestartedevent.py new file mode 100644 index 00000000..ca375042 --- /dev/null +++ b/src/mistralai/client/models/responsestartedevent.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 24f54ee8b0f2 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ResponseStartedEventTypedDict(TypedDict): + conversation_id: str + type: Literal["conversation.response.started"] + created_at: NotRequired[datetime] + + +class ResponseStartedEvent(BaseModel): + conversation_id: str + + type: Annotated[ + Annotated[ + Literal["conversation.response.started"], + AfterValidator(validate_const("conversation.response.started")), + ], + pydantic.Field(alias="type"), + ] = "conversation.response.started" + + created_at: Optional[datetime] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["created_at"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ResponseStartedEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/resume_schedule_v1_workflows_schedules_schedule_id_resume_postop.py b/src/mistralai/client/models/resume_schedule_v1_workflows_schedules_schedule_id_resume_postop.py new file mode 100644 index 00000000..101bef6a --- /dev/null +++ b/src/mistralai/client/models/resume_schedule_v1_workflows_schedules_schedule_id_resume_postop.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2daf20be73bb + +from __future__ import annotations +from .workflowschedulepauserequest import ( + WorkflowSchedulePauseRequest, + WorkflowSchedulePauseRequestTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequestTypedDict(TypedDict): + schedule_id: str + workflow_schedule_pause_request: NotRequired[ + Nullable[WorkflowSchedulePauseRequestTypedDict] + ] + + +class ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequest(BaseModel): + schedule_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + workflow_schedule_pause_request: Annotated[ + OptionalNullable[WorkflowSchedulePauseRequest], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["WorkflowSchedulePauseRequest"]) + nullable_fields = set(["WorkflowSchedulePauseRequest"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/retrieve_model_v1_models_model_id_getop.py b/src/mistralai/client/models/retrieve_model_v1_models_model_id_getop.py new file mode 100644 index 00000000..cd5955c1 --- /dev/null +++ b/src/mistralai/client/models/retrieve_model_v1_models_model_id_getop.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6fefa90ca351 + +from __future__ import annotations +from .basemodelcard import BaseModelCard, BaseModelCardTypedDict +from .ftmodelcard import FTModelCard, FTModelCardTypedDict +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +class RetrieveModelV1ModelsModelIDGetRequestTypedDict(TypedDict): + model_id: str + r"""The ID of the model to retrieve.""" + + +class RetrieveModelV1ModelsModelIDGetRequest(BaseModel): + model_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The ID of the model to retrieve.""" + + +ResponseRetrieveModelV1ModelsModelIDGetTypedDict = TypeAliasType( + "ResponseRetrieveModelV1ModelsModelIDGetTypedDict", + Union[BaseModelCardTypedDict, FTModelCardTypedDict], +) +r"""Successful Response""" + + +class UnknownResponseRetrieveModelV1ModelsModelIDGet(BaseModel): + r"""A ResponseRetrieveModelV1ModelsModelIDGet variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_RESPONSE_RETRIEVE_MODEL_V1_MODELS_MODEL_ID_GET_VARIANTS: dict[str, Any] = { + "base": BaseModelCard, + "fine-tuned": FTModelCard, +} + + +ResponseRetrieveModelV1ModelsModelIDGet = Annotated[ + Union[BaseModelCard, FTModelCard, UnknownResponseRetrieveModelV1ModelsModelIDGet], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_RESPONSE_RETRIEVE_MODEL_V1_MODELS_MODEL_ID_GET_VARIANTS, + unknown_cls=UnknownResponseRetrieveModelV1ModelsModelIDGet, + union_name="ResponseRetrieveModelV1ModelsModelIDGet", + ) + ), +] +r"""Successful Response""" diff --git a/src/mistralai/client/models/roles.py b/src/mistralai/client/models/roles.py new file mode 100644 index 00000000..ff36ebd7 --- /dev/null +++ b/src/mistralai/client/models/roles.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e41c04cf7422 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +Roles = Union[ + Literal[ + "system", + "user", + "assistant", + "tool", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/sampletype.py b/src/mistralai/client/models/sampletype.py new file mode 100644 index 00000000..dfec7cce --- /dev/null +++ b/src/mistralai/client/models/sampletype.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a9309422fed7 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +SampleType = Union[ + Literal[ + "pretrain", + "instruct", + "batch_request", + "batch_result", + "batch_error", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/scalarmetric.py b/src/mistralai/client/models/scalarmetric.py new file mode 100644 index 00000000..b9c70a77 --- /dev/null +++ b/src/mistralai/client/models/scalarmetric.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ae8eb1017da6 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Union +from typing_extensions import TypeAliasType, TypedDict + + +ScalarMetricValueTypedDict = TypeAliasType( + "ScalarMetricValueTypedDict", Union[int, float] +) + + +ScalarMetricValue = TypeAliasType("ScalarMetricValue", Union[int, float]) + + +class ScalarMetricTypedDict(TypedDict): + r"""Scalar metric with a single value.""" + + value: ScalarMetricValueTypedDict + + +class ScalarMetric(BaseModel): + r"""Scalar metric with a single value.""" + + value: ScalarMetricValue diff --git a/src/mistralai/client/models/schedulecalendar.py b/src/mistralai/client/models/schedulecalendar.py new file mode 100644 index 00000000..2cb179eb --- /dev/null +++ b/src/mistralai/client/models/schedulecalendar.py @@ -0,0 +1,80 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 76d72d187023 + +from __future__ import annotations +from .schedulerange import ScheduleRange, ScheduleRangeTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class ScheduleCalendarTypedDict(TypedDict): + second: NotRequired[List[ScheduleRangeTypedDict]] + minute: NotRequired[List[ScheduleRangeTypedDict]] + hour: NotRequired[List[ScheduleRangeTypedDict]] + day_of_month: NotRequired[List[ScheduleRangeTypedDict]] + month: NotRequired[List[ScheduleRangeTypedDict]] + year: NotRequired[List[ScheduleRangeTypedDict]] + day_of_week: NotRequired[List[ScheduleRangeTypedDict]] + comment: NotRequired[Nullable[str]] + + +class ScheduleCalendar(BaseModel): + second: Optional[List[ScheduleRange]] = None + + minute: Optional[List[ScheduleRange]] = None + + hour: Optional[List[ScheduleRange]] = None + + day_of_month: Optional[List[ScheduleRange]] = None + + month: Optional[List[ScheduleRange]] = None + + year: Optional[List[ScheduleRange]] = None + + day_of_week: Optional[List[ScheduleRange]] = None + + comment: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "second", + "minute", + "hour", + "day_of_month", + "month", + "year", + "day_of_week", + "comment", + ] + ) + nullable_fields = set(["comment"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/scheduledefinition.py b/src/mistralai/client/models/scheduledefinition.py new file mode 100644 index 00000000..58102293 --- /dev/null +++ b/src/mistralai/client/models/scheduledefinition.py @@ -0,0 +1,155 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6ea58a356f77 + +from __future__ import annotations +from .schedulecalendar import ScheduleCalendar, ScheduleCalendarTypedDict +from .scheduleinterval import ScheduleInterval, ScheduleIntervalTypedDict +from .schedulepolicy import SchedulePolicy, SchedulePolicyTypedDict +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class ScheduleDefinitionTypedDict(TypedDict): + r"""Specification of the times scheduled actions may occur. + + The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and + :py:attr:`cron_expressions` excluding anything in :py:attr:`skip`. + + Used for input where schedule_id is optional (can be provided or auto-generated). + """ + + input: Any + r"""Input to provide to the workflow when starting it.""" + calendars: NotRequired[List[ScheduleCalendarTypedDict]] + r"""Calendar-based specification of times.""" + intervals: NotRequired[List[ScheduleIntervalTypedDict]] + r"""Interval-based specification of times.""" + cron_expressions: NotRequired[List[str]] + r"""Cron-based specification of times.""" + skip: NotRequired[List[ScheduleCalendarTypedDict]] + r"""Set of calendar times to skip.""" + start_at: NotRequired[Nullable[datetime]] + r"""Time after which the first action may be run.""" + end_at: NotRequired[Nullable[datetime]] + r"""Time after which no more actions will be run.""" + jitter: NotRequired[Nullable[str]] + r"""Jitter to apply each action. + + An action's scheduled time will be incremented by a random value between 0 + and this value if present (but not past the next schedule). + + """ + time_zone_name: NotRequired[Nullable[str]] + r"""IANA time zone name, for example ``US/Central``.""" + policy: NotRequired[SchedulePolicyTypedDict] + schedule_id: NotRequired[Nullable[str]] + r"""Unique identifier for the schedule.""" + max_executions: NotRequired[Nullable[int]] + r"""Maximum number of times this schedule will trigger a workflow execution. Once this limit is reached, no further executions are triggered automatically. null means unlimited.""" + + +class ScheduleDefinition(BaseModel): + r"""Specification of the times scheduled actions may occur. + + The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and + :py:attr:`cron_expressions` excluding anything in :py:attr:`skip`. + + Used for input where schedule_id is optional (can be provided or auto-generated). + """ + + input: Any + r"""Input to provide to the workflow when starting it.""" + + calendars: Optional[List[ScheduleCalendar]] = None + r"""Calendar-based specification of times.""" + + intervals: Optional[List[ScheduleInterval]] = None + r"""Interval-based specification of times.""" + + cron_expressions: Optional[List[str]] = None + r"""Cron-based specification of times.""" + + skip: Optional[List[ScheduleCalendar]] = None + r"""Set of calendar times to skip.""" + + start_at: OptionalNullable[datetime] = UNSET + r"""Time after which the first action may be run.""" + + end_at: OptionalNullable[datetime] = UNSET + r"""Time after which no more actions will be run.""" + + jitter: OptionalNullable[str] = UNSET + r"""Jitter to apply each action. + + An action's scheduled time will be incremented by a random value between 0 + and this value if present (but not past the next schedule). + + """ + + time_zone_name: OptionalNullable[str] = UNSET + r"""IANA time zone name, for example ``US/Central``.""" + + policy: Optional[SchedulePolicy] = None + + schedule_id: OptionalNullable[str] = UNSET + r"""Unique identifier for the schedule.""" + + max_executions: OptionalNullable[int] = UNSET + r"""Maximum number of times this schedule will trigger a workflow execution. Once this limit is reached, no further executions are triggered automatically. null means unlimited.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "calendars", + "intervals", + "cron_expressions", + "skip", + "start_at", + "end_at", + "jitter", + "time_zone_name", + "policy", + "schedule_id", + "max_executions", + ] + ) + nullable_fields = set( + [ + "start_at", + "end_at", + "jitter", + "time_zone_name", + "schedule_id", + "max_executions", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/scheduledefinitionoutput.py b/src/mistralai/client/models/scheduledefinitionoutput.py new file mode 100644 index 00000000..8a9f2058 --- /dev/null +++ b/src/mistralai/client/models/scheduledefinitionoutput.py @@ -0,0 +1,184 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 69dc15b9a0d6 + +from __future__ import annotations +from .schedulecalendar import ScheduleCalendar, ScheduleCalendarTypedDict +from .schedulefutureexecution import ( + ScheduleFutureExecution, + ScheduleFutureExecutionTypedDict, +) +from .scheduleinterval import ScheduleInterval, ScheduleIntervalTypedDict +from .schedulepolicy import SchedulePolicy, SchedulePolicyTypedDict +from .schedulerecentexecution import ( + ScheduleRecentExecution, + ScheduleRecentExecutionTypedDict, +) +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class ScheduleDefinitionOutputTypedDict(TypedDict): + r"""Output representation of a schedule with required schedule_id. + + Used when returning schedules from the API where schedule_id is always present. + """ + + input: Any + r"""Input to provide to the workflow when starting it.""" + schedule_id: str + r"""Unique identifier for the schedule.""" + workflow_name: str + r"""Name of the workflow this schedule triggers.""" + paused: bool + r"""Whether the schedule is currently paused.""" + calendars: NotRequired[List[ScheduleCalendarTypedDict]] + r"""Calendar-based specification of times.""" + intervals: NotRequired[List[ScheduleIntervalTypedDict]] + r"""Interval-based specification of times.""" + cron_expressions: NotRequired[List[str]] + r"""Cron-based specification of times.""" + skip: NotRequired[List[ScheduleCalendarTypedDict]] + r"""Set of calendar times to skip.""" + start_at: NotRequired[Nullable[datetime]] + r"""Time after which the first action may be run.""" + end_at: NotRequired[Nullable[datetime]] + r"""Time after which no more actions will be run.""" + jitter: NotRequired[Nullable[str]] + r"""Jitter to apply each action. + + An action's scheduled time will be incremented by a random value between 0 + and this value if present (but not past the next schedule). + + """ + time_zone_name: NotRequired[Nullable[str]] + r"""IANA time zone name, for example ``US/Central``.""" + policy: NotRequired[SchedulePolicyTypedDict] + remaining_executions: NotRequired[Nullable[int]] + r"""Remaining workflow executions before this schedule stops triggering automatically. null means unlimited; 0 means the limit has been reached and the schedule is exhausted.""" + note: NotRequired[Nullable[str]] + r"""Human-readable note associated with the current pause or resume state.""" + future_executions: NotRequired[List[ScheduleFutureExecutionTypedDict]] + r"""Upcoming scheduled executions (10 next executions, earliest first).""" + recent_executions: NotRequired[List[ScheduleRecentExecutionTypedDict]] + r"""Most recent scheduled executions (10 most recent, newest last).""" + + +class ScheduleDefinitionOutput(BaseModel): + r"""Output representation of a schedule with required schedule_id. + + Used when returning schedules from the API where schedule_id is always present. + """ + + input: Any + r"""Input to provide to the workflow when starting it.""" + + schedule_id: str + r"""Unique identifier for the schedule.""" + + workflow_name: str + r"""Name of the workflow this schedule triggers.""" + + paused: bool + r"""Whether the schedule is currently paused.""" + + calendars: Optional[List[ScheduleCalendar]] = None + r"""Calendar-based specification of times.""" + + intervals: Optional[List[ScheduleInterval]] = None + r"""Interval-based specification of times.""" + + cron_expressions: Optional[List[str]] = None + r"""Cron-based specification of times.""" + + skip: Optional[List[ScheduleCalendar]] = None + r"""Set of calendar times to skip.""" + + start_at: OptionalNullable[datetime] = UNSET + r"""Time after which the first action may be run.""" + + end_at: OptionalNullable[datetime] = UNSET + r"""Time after which no more actions will be run.""" + + jitter: OptionalNullable[str] = UNSET + r"""Jitter to apply each action. + + An action's scheduled time will be incremented by a random value between 0 + and this value if present (but not past the next schedule). + + """ + + time_zone_name: OptionalNullable[str] = UNSET + r"""IANA time zone name, for example ``US/Central``.""" + + policy: Optional[SchedulePolicy] = None + + remaining_executions: OptionalNullable[int] = UNSET + r"""Remaining workflow executions before this schedule stops triggering automatically. null means unlimited; 0 means the limit has been reached and the schedule is exhausted.""" + + note: OptionalNullable[str] = UNSET + r"""Human-readable note associated with the current pause or resume state.""" + + future_executions: Optional[List[ScheduleFutureExecution]] = None + r"""Upcoming scheduled executions (10 next executions, earliest first).""" + + recent_executions: Optional[List[ScheduleRecentExecution]] = None + r"""Most recent scheduled executions (10 most recent, newest last).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "calendars", + "intervals", + "cron_expressions", + "skip", + "start_at", + "end_at", + "jitter", + "time_zone_name", + "policy", + "remaining_executions", + "note", + "future_executions", + "recent_executions", + ] + ) + nullable_fields = set( + [ + "start_at", + "end_at", + "jitter", + "time_zone_name", + "remaining_executions", + "note", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/schedulefutureexecution.py b/src/mistralai/client/models/schedulefutureexecution.py new file mode 100644 index 00000000..50f0491e --- /dev/null +++ b/src/mistralai/client/models/schedulefutureexecution.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 44bb85af3d44 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ScheduleFutureExecutionTypedDict(TypedDict): + scheduled_at: datetime + r"""Time the execution is scheduled to run.""" + + +class ScheduleFutureExecution(BaseModel): + scheduled_at: datetime + r"""Time the execution is scheduled to run.""" diff --git a/src/mistralai/client/models/scheduleinterval.py b/src/mistralai/client/models/scheduleinterval.py new file mode 100644 index 00000000..c01cf852 --- /dev/null +++ b/src/mistralai/client/models/scheduleinterval.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1d89c2043566 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ScheduleIntervalTypedDict(TypedDict): + every: str + offset: NotRequired[Nullable[str]] + + +class ScheduleInterval(BaseModel): + every: str + + offset: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["offset"]) + nullable_fields = set(["offset"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/scheduleoverlappolicy.py b/src/mistralai/client/models/scheduleoverlappolicy.py new file mode 100644 index 00000000..13db3947 --- /dev/null +++ b/src/mistralai/client/models/scheduleoverlappolicy.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a729c26f9c43 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedInt +from typing import Literal, Union + + +ScheduleOverlapPolicy = Union[ + Literal[ + 1, + 2, + 3, + 4, + 5, + 6, + ], + UnrecognizedInt, +] +r"""Controls what happens when a workflow would be started by a schedule but +one is already running. +""" diff --git a/src/mistralai/client/models/schedulepolicy.py b/src/mistralai/client/models/schedulepolicy.py new file mode 100644 index 00000000..9a507656 --- /dev/null +++ b/src/mistralai/client/models/schedulepolicy.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f326afe63958 + +from __future__ import annotations +from .scheduleoverlappolicy import ScheduleOverlapPolicy +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class SchedulePolicyTypedDict(TypedDict): + catchup_window_seconds: NotRequired[int] + r"""After a Temporal server is unavailable, amount of time in seconds in the past to execute missed actions.""" + overlap: NotRequired[ScheduleOverlapPolicy] + r"""Controls what happens when a workflow would be started by a schedule but + one is already running. + """ + pause_on_failure: NotRequired[bool] + r"""Whether to pause the schedule after a workflow failure.""" + + +class SchedulePolicy(BaseModel): + catchup_window_seconds: Optional[int] = 31536000 + r"""After a Temporal server is unavailable, amount of time in seconds in the past to execute missed actions.""" + + overlap: Optional[ScheduleOverlapPolicy] = None + r"""Controls what happens when a workflow would be started by a schedule but + one is already running. + """ + + pause_on_failure: Optional[bool] = False + r"""Whether to pause the schedule after a workflow failure.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["catchup_window_seconds", "overlap", "pause_on_failure"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/schedulerange.py b/src/mistralai/client/models/schedulerange.py new file mode 100644 index 00000000..e30eed16 --- /dev/null +++ b/src/mistralai/client/models/schedulerange.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f9d442a062b5 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ScheduleRangeTypedDict(TypedDict): + start: int + end: NotRequired[int] + step: NotRequired[int] + + +class ScheduleRange(BaseModel): + start: int + + end: Optional[int] = 0 + + step: Optional[int] = 0 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["end", "step"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/schedulerecentexecution.py b/src/mistralai/client/models/schedulerecentexecution.py new file mode 100644 index 00000000..ad46a70d --- /dev/null +++ b/src/mistralai/client/models/schedulerecentexecution.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 745d146d9413 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class ScheduleRecentExecutionTypedDict(TypedDict): + scheduled_at: datetime + r"""Time the execution was scheduled to run.""" + started_at: datetime + r"""Actual time the execution started.""" + execution_id: str + r"""ID of the workflow execution that was started.""" + + +class ScheduleRecentExecution(BaseModel): + scheduled_at: datetime + r"""Time the execution was scheduled to run.""" + + started_at: datetime + r"""Actual time the execution started.""" + + execution_id: str + r"""ID of the workflow execution that was started.""" diff --git a/src/mistralai/client/models/searchchatcompletioneventidsrequest.py b/src/mistralai/client/models/searchchatcompletioneventidsrequest.py new file mode 100644 index 00000000..64bb8f9f --- /dev/null +++ b/src/mistralai/client/models/searchchatcompletioneventidsrequest.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cabc8ef82d67 + +from __future__ import annotations +from .filterpayload import FilterPayload, FilterPayloadTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class SearchChatCompletionEventIdsRequestTypedDict(TypedDict): + search_params: FilterPayloadTypedDict + extra_fields: NotRequired[Nullable[List[str]]] + + +class SearchChatCompletionEventIdsRequest(BaseModel): + search_params: FilterPayload + + extra_fields: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["extra_fields"]) + nullable_fields = set(["extra_fields"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/searchchatcompletioneventidsresponse.py b/src/mistralai/client/models/searchchatcompletioneventidsresponse.py new file mode 100644 index 00000000..f4751159 --- /dev/null +++ b/src/mistralai/client/models/searchchatcompletioneventidsresponse.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a5f0bad3ba10 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class SearchChatCompletionEventIdsResponseTypedDict(TypedDict): + completion_event_ids: List[str] + + +class SearchChatCompletionEventIdsResponse(BaseModel): + completion_event_ids: List[str] diff --git a/src/mistralai/client/models/searchchatcompletioneventsrequest.py b/src/mistralai/client/models/searchchatcompletioneventsrequest.py new file mode 100644 index 00000000..bca27f16 --- /dev/null +++ b/src/mistralai/client/models/searchchatcompletioneventsrequest.py @@ -0,0 +1,51 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a437333780bc + +from __future__ import annotations +from .filterpayload import FilterPayload, FilterPayloadTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class SearchChatCompletionEventsRequestTypedDict(TypedDict): + search_params: FilterPayloadTypedDict + extra_fields: NotRequired[Nullable[List[str]]] + + +class SearchChatCompletionEventsRequest(BaseModel): + search_params: FilterPayload + + extra_fields: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["extra_fields"]) + nullable_fields = set(["extra_fields"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/searchchatcompletioneventsresponse.py b/src/mistralai/client/models/searchchatcompletioneventsresponse.py new file mode 100644 index 00000000..8b9b10b5 --- /dev/null +++ b/src/mistralai/client/models/searchchatcompletioneventsresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f96acbcd45f7 + +from __future__ import annotations +from .feedresultchatcompletioneventpreview import ( + FeedResultChatCompletionEventPreview, + FeedResultChatCompletionEventPreviewTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class SearchChatCompletionEventsResponseTypedDict(TypedDict): + completion_events: FeedResultChatCompletionEventPreviewTypedDict + + +class SearchChatCompletionEventsResponse(BaseModel): + completion_events: FeedResultChatCompletionEventPreview diff --git a/src/mistralai/client/models/security.py b/src/mistralai/client/models/security.py new file mode 100644 index 00000000..36b12953 --- /dev/null +++ b/src/mistralai/client/models/security.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c2ca0e2a36b7 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import FieldMetadata, SecurityMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SecurityTypedDict(TypedDict): + api_key: NotRequired[str] + + +class Security(BaseModel): + api_key: Annotated[ + Optional[str], + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="http", + sub_type="bearer", + field_name="Authorization", + ) + ), + ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ApiKey"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/shareenum.py b/src/mistralai/client/models/shareenum.py new file mode 100644 index 00000000..08ffeb7e --- /dev/null +++ b/src/mistralai/client/models/shareenum.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a0e2a7a16bf8 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ShareEnum = Union[ + Literal[ + "Viewer", + "Editor", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/sharing.py b/src/mistralai/client/models/sharing.py new file mode 100644 index 00000000..efa16203 --- /dev/null +++ b/src/mistralai/client/models/sharing.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 324f5ac27249 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class SharingTypedDict(TypedDict): + library_id: str + org_id: str + role: str + share_with_type: str + share_with_uuid: Nullable[str] + user_id: NotRequired[Nullable[str]] + + +class Sharing(BaseModel): + library_id: str + + org_id: str + + role: str + + share_with_type: str + + share_with_uuid: Nullable[str] + + user_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["user_id"]) + nullable_fields = set(["user_id", "share_with_uuid"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/sharingdelete.py b/src/mistralai/client/models/sharingdelete.py new file mode 100644 index 00000000..3472a506 --- /dev/null +++ b/src/mistralai/client/models/sharingdelete.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f5ecce372e06 + +from __future__ import annotations +from .entitytype import EntityType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class SharingDeleteTypedDict(TypedDict): + share_with_uuid: str + r"""The id of the entity (user, workspace or organization) to share with""" + share_with_type: EntityType + r"""The type of entity, used to share a library.""" + org_id: NotRequired[Nullable[str]] + + +class SharingDelete(BaseModel): + share_with_uuid: str + r"""The id of the entity (user, workspace or organization) to share with""" + + share_with_type: EntityType + r"""The type of entity, used to share a library.""" + + org_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["org_id"]) + nullable_fields = set(["org_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/sharingrequest.py b/src/mistralai/client/models/sharingrequest.py new file mode 100644 index 00000000..7c2d435c --- /dev/null +++ b/src/mistralai/client/models/sharingrequest.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2439b732dfae + +from __future__ import annotations +from .entitytype import EntityType +from .shareenum import ShareEnum +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class SharingRequestTypedDict(TypedDict): + level: ShareEnum + share_with_uuid: str + r"""The id of the entity (user, workspace or organization) to share with""" + share_with_type: EntityType + r"""The type of entity, used to share a library.""" + org_id: NotRequired[Nullable[str]] + + +class SharingRequest(BaseModel): + level: ShareEnum + + share_with_uuid: str + r"""The id of the entity (user, workspace or organization) to share with""" + + share_with_type: EntityType + r"""The type of entity, used to share a library.""" + + org_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["org_id"]) + nullable_fields = set(["org_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/signal_workflow_execution_v1_workflows_executions_execution_id_signals_postop.py b/src/mistralai/client/models/signal_workflow_execution_v1_workflows_executions_execution_id_signals_postop.py new file mode 100644 index 00000000..c61ed019 --- /dev/null +++ b/src/mistralai/client/models/signal_workflow_execution_v1_workflows_executions_execution_id_signals_postop.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 16c54f54e60f + +from __future__ import annotations +from .signalinvocationbody import SignalInvocationBody, SignalInvocationBodyTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequestTypedDict( + TypedDict +): + execution_id: str + signal_invocation_body: SignalInvocationBodyTypedDict + + +class SignalWorkflowExecutionV1WorkflowsExecutionsExecutionIDSignalsPostRequest( + BaseModel +): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + signal_invocation_body: Annotated[ + SignalInvocationBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/signaldefinition.py b/src/mistralai/client/models/signaldefinition.py new file mode 100644 index 00000000..434e1230 --- /dev/null +++ b/src/mistralai/client/models/signaldefinition.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f1c1ac98a427 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class SignalDefinitionTypedDict(TypedDict): + name: str + r"""Name of the signal""" + input_schema: Dict[str, Any] + r"""Input JSON schema of the signal's model""" + description: NotRequired[Nullable[str]] + r"""Description of the signal""" + + +class SignalDefinition(BaseModel): + name: str + r"""Name of the signal""" + + input_schema: Dict[str, Any] + r"""Input JSON schema of the signal's model""" + + description: OptionalNullable[str] = UNSET + r"""Description of the signal""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description"]) + nullable_fields = set(["description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/signalinvocationbody.py b/src/mistralai/client/models/signalinvocationbody.py new file mode 100644 index 00000000..3b7a1ff1 --- /dev/null +++ b/src/mistralai/client/models/signalinvocationbody.py @@ -0,0 +1,122 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0fd96a7c058b + +from __future__ import annotations +from .encodedpayloadoptions import EncodedPayloadOptions +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +class SignalInvocationBodyNetworkEncodedInputTypedDict(TypedDict): + b64payload: str + r"""The encoded payload""" + encoding_options: NotRequired[List[EncodedPayloadOptions]] + r"""The encoding of the payload""" + empty: NotRequired[bool] + r"""Whether the payload is empty""" + + +class SignalInvocationBodyNetworkEncodedInput(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + b64payload: str + r"""The encoded payload""" + + encoding_options: Optional[List[EncodedPayloadOptions]] = None + r"""The encoding of the payload""" + + empty: Optional[bool] = False + r"""Whether the payload is empty""" + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["encoding_options", "empty"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +SignalInvocationBodyInputTypedDict = TypeAliasType( + "SignalInvocationBodyInputTypedDict", + Union[SignalInvocationBodyNetworkEncodedInputTypedDict, Dict[str, Any]], +) +r"""Input data for the signal, matching its schema""" + + +SignalInvocationBodyInput = TypeAliasType( + "SignalInvocationBodyInput", + Union[SignalInvocationBodyNetworkEncodedInput, Dict[str, Any]], +) +r"""Input data for the signal, matching its schema""" + + +class SignalInvocationBodyTypedDict(TypedDict): + name: str + r"""The name of the signal to send""" + input: NotRequired[Nullable[SignalInvocationBodyInputTypedDict]] + r"""Input data for the signal, matching its schema""" + + +class SignalInvocationBody(BaseModel): + name: str + r"""The name of the signal to send""" + + input: OptionalNullable[SignalInvocationBodyInput] = UNSET + r"""Input data for the signal, matching its schema""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input"]) + nullable_fields = set(["input"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/signalworkflowresponse.py b/src/mistralai/client/models/signalworkflowresponse.py new file mode 100644 index 00000000..2d9ea356 --- /dev/null +++ b/src/mistralai/client/models/signalworkflowresponse.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e1844a7da20b + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class SignalWorkflowResponseTypedDict(TypedDict): + message: NotRequired[str] + + +class SignalWorkflowResponse(BaseModel): + message: Optional[str] = "Signal accepted" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["message"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/source.py b/src/mistralai/client/models/source.py new file mode 100644 index 00000000..fcea403c --- /dev/null +++ b/src/mistralai/client/models/source.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fcee60a4ea0d + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +Source = Union[ + Literal[ + "upload", + "repository", + "mistral", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/speech_v1_audio_speech_postop.py b/src/mistralai/client/models/speech_v1_audio_speech_postop.py new file mode 100644 index 00000000..3dbd044c --- /dev/null +++ b/src/mistralai/client/models/speech_v1_audio_speech_postop.py @@ -0,0 +1,107 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7ab5c1250642 + +from __future__ import annotations +from .speechstreamaudiodelta import ( + SpeechStreamAudioDelta, + SpeechStreamAudioDeltaTypedDict, +) +from .speechstreamdone import SpeechStreamDone, SpeechStreamDoneTypedDict +from .speechstreameventtypes import SpeechStreamEventTypes +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils import eventstreaming +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +SpeechV1AudioSpeechPostDataTypedDict = TypeAliasType( + "SpeechV1AudioSpeechPostDataTypedDict", + Union[SpeechStreamAudioDeltaTypedDict, SpeechStreamDoneTypedDict], +) + + +class UnknownSpeechV1AudioSpeechPostData(BaseModel): + r"""A SpeechV1AudioSpeechPostData variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_SPEECH_V1_AUDIO_SPEECH_POST_DATA_VARIANTS: dict[str, Any] = { + "speech.audio.delta": SpeechStreamAudioDelta, + "speech.audio.done": SpeechStreamDone, +} + + +SpeechV1AudioSpeechPostData = Annotated[ + Union[SpeechStreamAudioDelta, SpeechStreamDone, UnknownSpeechV1AudioSpeechPostData], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_SPEECH_V1_AUDIO_SPEECH_POST_DATA_VARIANTS, + unknown_cls=UnknownSpeechV1AudioSpeechPostData, + union_name="SpeechV1AudioSpeechPostData", + ) + ), +] + + +class SpeechStreamEventsTypedDict(TypedDict): + r"""Speech audio data.""" + + event: SpeechStreamEventTypes + data: SpeechV1AudioSpeechPostDataTypedDict + + +class SpeechStreamEvents(BaseModel): + r"""Speech audio data.""" + + event: SpeechStreamEventTypes + + data: SpeechV1AudioSpeechPostData + + +class SpeechResponseTypedDict(TypedDict): + r"""Speech audio data.""" + + audio_data: str + r"""Base64 encoded audio data""" + + +class SpeechResponse(BaseModel): + r"""Speech audio data.""" + + audio_data: str + r"""Base64 encoded audio data""" + + +SpeechV1AudioSpeechPostResponseTypedDict = TypeAliasType( + "SpeechV1AudioSpeechPostResponseTypedDict", + Union[ + SpeechResponseTypedDict, + Union[ + eventstreaming.EventStream[SpeechStreamEventsTypedDict], + eventstreaming.EventStreamAsync[SpeechStreamEventsTypedDict], + ], + ], +) + + +SpeechV1AudioSpeechPostResponse = TypeAliasType( + "SpeechV1AudioSpeechPostResponse", + Union[ + SpeechResponse, + Union[ + eventstreaming.EventStream[SpeechStreamEvents], + eventstreaming.EventStreamAsync[SpeechStreamEvents], + ], + ], +) diff --git a/src/mistralai/client/models/speechoutputformat.py b/src/mistralai/client/models/speechoutputformat.py new file mode 100644 index 00000000..f564d2af --- /dev/null +++ b/src/mistralai/client/models/speechoutputformat.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e6be9ec9e74c + +from __future__ import annotations +from typing import Literal + + +SpeechOutputFormat = Literal[ + "pcm", + "wav", + "mp3", + "flac", + "opus", +] diff --git a/src/mistralai/client/models/speechrequest.py b/src/mistralai/client/models/speechrequest.py new file mode 100644 index 00000000..c57df7a8 --- /dev/null +++ b/src/mistralai/client/models/speechrequest.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cf3bc148e629 + +from __future__ import annotations +from .speechoutputformat import SpeechOutputFormat +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class SpeechRequestTypedDict(TypedDict): + input: str + r"""Text to generate a speech from""" + model: NotRequired[Nullable[str]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + stream: NotRequired[bool] + voice_id: NotRequired[Nullable[str]] + r"""The preset or custom voice to use for generating the speech.""" + ref_audio: NotRequired[Nullable[str]] + r"""The audio reference for generating the speech.""" + response_format: NotRequired[SpeechOutputFormat] + + +class SpeechRequest(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + input: str + r"""Text to generate a speech from""" + + model: OptionalNullable[str] = UNSET + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + stream: Optional[bool] = False + + voice_id: OptionalNullable[str] = UNSET + r"""The preset or custom voice to use for generating the speech.""" + + ref_audio: OptionalNullable[str] = UNSET + r"""The audio reference for generating the speech.""" + + response_format: Optional[SpeechOutputFormat] = None + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["model", "metadata", "stream", "voice_id", "ref_audio", "response_format"] + ) + nullable_fields = set(["model", "metadata", "voice_id", "ref_audio"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/src/mistralai/client/models/speechstreamaudiodelta.py b/src/mistralai/client/models/speechstreamaudiodelta.py new file mode 100644 index 00000000..e3cc7053 --- /dev/null +++ b/src/mistralai/client/models/speechstreamaudiodelta.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ac66815396b1 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class SpeechStreamAudioDeltaTypedDict(TypedDict): + audio_data: str + type: Literal["speech.audio.delta"] + + +class SpeechStreamAudioDelta(BaseModel): + audio_data: str + + type: Annotated[ + Annotated[ + Literal["speech.audio.delta"], + AfterValidator(validate_const("speech.audio.delta")), + ], + pydantic.Field(alias="type"), + ] = "speech.audio.delta" + + +try: + SpeechStreamAudioDelta.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/speechstreamdone.py b/src/mistralai/client/models/speechstreamdone.py new file mode 100644 index 00000000..2febda7b --- /dev/null +++ b/src/mistralai/client/models/speechstreamdone.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2164b6526a81 + +from __future__ import annotations +from .usageinfo_dollar_defs import UsageInfoDollarDefs, UsageInfoDollarDefsTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class SpeechStreamDoneTypedDict(TypedDict): + usage: UsageInfoDollarDefsTypedDict + type: Literal["speech.audio.done"] + + +class SpeechStreamDone(BaseModel): + usage: UsageInfoDollarDefs + + type: Annotated[ + Annotated[ + Literal["speech.audio.done"], + AfterValidator(validate_const("speech.audio.done")), + ], + pydantic.Field(alias="type"), + ] = "speech.audio.done" + + +try: + SpeechStreamDone.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/speechstreameventtypes.py b/src/mistralai/client/models/speechstreameventtypes.py new file mode 100644 index 00000000..723a571b --- /dev/null +++ b/src/mistralai/client/models/speechstreameventtypes.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b76eee4fdf6a + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +SpeechStreamEventTypes = Union[ + Literal[ + "speech.audio.delta", + "speech.audio.done", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/ssetypes.py b/src/mistralai/client/models/ssetypes.py new file mode 100644 index 00000000..0add960b --- /dev/null +++ b/src/mistralai/client/models/ssetypes.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1733e4765106 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +SSETypes = Union[ + Literal[ + "conversation.response.started", + "conversation.response.done", + "conversation.response.error", + "message.output.delta", + "tool.execution.started", + "tool.execution.delta", + "tool.execution.done", + "agent.handoff.started", + "agent.handoff.done", + "function.call.delta", + ], + UnrecognizedStr, +] +r"""Server side events sent when streaming a conversation response.""" diff --git a/src/mistralai/client/models/stream_v1_workflows_executions_execution_id_stream_getop.py b/src/mistralai/client/models/stream_v1_workflows_executions_execution_id_stream_getop.py new file mode 100644 index 00000000..5282e52a --- /dev/null +++ b/src/mistralai/client/models/stream_v1_workflows_executions_execution_id_stream_getop.py @@ -0,0 +1,101 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 793a9301522f + +from __future__ import annotations +from .eventsource import EventSource +from .streameventssepayload import StreamEventSsePayload, StreamEventSsePayloadTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class StreamV1WorkflowsExecutionsExecutionIDStreamGetRequestTypedDict(TypedDict): + execution_id: str + event_source: NotRequired[Nullable[EventSource]] + last_event_id: NotRequired[Nullable[str]] + + +class StreamV1WorkflowsExecutionsExecutionIDStreamGetRequest(BaseModel): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + event_source: Annotated[ + OptionalNullable[EventSource], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + last_event_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_source", "last_event_id"]) + nullable_fields = set(["event_source", "last_event_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBodyTypedDict(TypedDict): + r"""Stream of Server-Sent Events (SSE)""" + + event: NotRequired[str] + data: NotRequired[StreamEventSsePayloadTypedDict] + id: NotRequired[str] + retry: NotRequired[int] + + +class StreamV1WorkflowsExecutionsExecutionIDStreamGetResponseBody(BaseModel): + r"""Stream of Server-Sent Events (SSE)""" + + event: Optional[str] = None + + data: Optional[StreamEventSsePayload] = None + + id: Optional[str] = None + + retry: Optional[int] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event", "data", "id", "retry"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/streameventssepayload.py b/src/mistralai/client/models/streameventssepayload.py new file mode 100644 index 00000000..2c662a65 --- /dev/null +++ b/src/mistralai/client/models/streameventssepayload.py @@ -0,0 +1,168 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c6becbbd80bc + +from __future__ import annotations +from .activitytaskcompletedresponse import ( + ActivityTaskCompletedResponse, + ActivityTaskCompletedResponseTypedDict, +) +from .activitytaskfailedresponse import ( + ActivityTaskFailedResponse, + ActivityTaskFailedResponseTypedDict, +) +from .activitytaskretryingresponse import ( + ActivityTaskRetryingResponse, + ActivityTaskRetryingResponseTypedDict, +) +from .activitytaskstartedresponse import ( + ActivityTaskStartedResponse, + ActivityTaskStartedResponseTypedDict, +) +from .customtaskcanceledresponse import ( + CustomTaskCanceledResponse, + CustomTaskCanceledResponseTypedDict, +) +from .customtaskcompletedresponse import ( + CustomTaskCompletedResponse, + CustomTaskCompletedResponseTypedDict, +) +from .customtaskfailedresponse import ( + CustomTaskFailedResponse, + CustomTaskFailedResponseTypedDict, +) +from .customtaskinprogressresponse import ( + CustomTaskInProgressResponse, + CustomTaskInProgressResponseTypedDict, +) +from .customtaskstartedresponse import ( + CustomTaskStartedResponse, + CustomTaskStartedResponseTypedDict, +) +from .customtasktimedoutresponse import ( + CustomTaskTimedOutResponse, + CustomTaskTimedOutResponseTypedDict, +) +from .streameventworkflowcontext import ( + StreamEventWorkflowContext, + StreamEventWorkflowContextTypedDict, +) +from .workflowexecutioncanceledresponse import ( + WorkflowExecutionCanceledResponse, + WorkflowExecutionCanceledResponseTypedDict, +) +from .workflowexecutioncompletedresponse import ( + WorkflowExecutionCompletedResponse, + WorkflowExecutionCompletedResponseTypedDict, +) +from .workflowexecutioncontinuedasnewresponse import ( + WorkflowExecutionContinuedAsNewResponse, + WorkflowExecutionContinuedAsNewResponseTypedDict, +) +from .workflowexecutionfailedresponse import ( + WorkflowExecutionFailedResponse, + WorkflowExecutionFailedResponseTypedDict, +) +from .workflowexecutionstartedresponse import ( + WorkflowExecutionStartedResponse, + WorkflowExecutionStartedResponseTypedDict, +) +from .workflowtaskfailedresponse import ( + WorkflowTaskFailedResponse, + WorkflowTaskFailedResponseTypedDict, +) +from .workflowtasktimedoutresponse import ( + WorkflowTaskTimedOutResponse, + WorkflowTaskTimedOutResponseTypedDict, +) +from datetime import datetime +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, Dict, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +StreamEventSsePayloadDataTypedDict = TypeAliasType( + "StreamEventSsePayloadDataTypedDict", + Union[ + WorkflowExecutionStartedResponseTypedDict, + WorkflowExecutionCompletedResponseTypedDict, + WorkflowExecutionFailedResponseTypedDict, + WorkflowExecutionCanceledResponseTypedDict, + WorkflowExecutionContinuedAsNewResponseTypedDict, + WorkflowTaskTimedOutResponseTypedDict, + WorkflowTaskFailedResponseTypedDict, + CustomTaskStartedResponseTypedDict, + CustomTaskInProgressResponseTypedDict, + CustomTaskCompletedResponseTypedDict, + CustomTaskFailedResponseTypedDict, + CustomTaskTimedOutResponseTypedDict, + CustomTaskCanceledResponseTypedDict, + ActivityTaskStartedResponseTypedDict, + ActivityTaskCompletedResponseTypedDict, + ActivityTaskRetryingResponseTypedDict, + ActivityTaskFailedResponseTypedDict, + ], +) + + +StreamEventSsePayloadData = TypeAliasType( + "StreamEventSsePayloadData", + Union[ + WorkflowExecutionStartedResponse, + WorkflowExecutionCompletedResponse, + WorkflowExecutionFailedResponse, + WorkflowExecutionCanceledResponse, + WorkflowExecutionContinuedAsNewResponse, + WorkflowTaskTimedOutResponse, + WorkflowTaskFailedResponse, + CustomTaskStartedResponse, + CustomTaskInProgressResponse, + CustomTaskCompletedResponse, + CustomTaskFailedResponse, + CustomTaskTimedOutResponse, + CustomTaskCanceledResponse, + ActivityTaskStartedResponse, + ActivityTaskCompletedResponse, + ActivityTaskRetryingResponse, + ActivityTaskFailedResponse, + ], +) + + +class StreamEventSsePayloadTypedDict(TypedDict): + stream: str + data: StreamEventSsePayloadDataTypedDict + workflow_context: StreamEventWorkflowContextTypedDict + broker_sequence: int + timestamp: NotRequired[datetime] + metadata: NotRequired[Dict[str, Any]] + + +class StreamEventSsePayload(BaseModel): + stream: str + + data: StreamEventSsePayloadData + + workflow_context: StreamEventWorkflowContext + + broker_sequence: int + + timestamp: Optional[datetime] = None + + metadata: Optional[Dict[str, Any]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["timestamp", "metadata"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/streameventworkflowcontext.py b/src/mistralai/client/models/streameventworkflowcontext.py new file mode 100644 index 00000000..f24de860 --- /dev/null +++ b/src/mistralai/client/models/streameventworkflowcontext.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 14c00c79de78 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class StreamEventWorkflowContextTypedDict(TypedDict): + namespace: str + workflow_name: str + workflow_exec_id: str + parent_workflow_exec_id: NotRequired[Nullable[str]] + root_workflow_exec_id: NotRequired[Nullable[str]] + + +class StreamEventWorkflowContext(BaseModel): + namespace: str + + workflow_name: str + + workflow_exec_id: str + + parent_workflow_exec_id: OptionalNullable[str] = UNSET + + root_workflow_exec_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["parent_workflow_exec_id", "root_workflow_exec_id"]) + nullable_fields = set(["parent_workflow_exec_id", "root_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/systemmessage.py b/src/mistralai/client/models/systemmessage.py new file mode 100644 index 00000000..2602cd2d --- /dev/null +++ b/src/mistralai/client/models/systemmessage.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 500ef6e85ba1 + +from __future__ import annotations +from .systemmessagecontentchunks import ( + SystemMessageContentChunks, + SystemMessageContentChunksTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +SystemMessageContentTypedDict = TypeAliasType( + "SystemMessageContentTypedDict", + Union[str, List[SystemMessageContentChunksTypedDict]], +) + + +SystemMessageContent = TypeAliasType( + "SystemMessageContent", Union[str, List[SystemMessageContentChunks]] +) + + +class SystemMessageTypedDict(TypedDict): + content: SystemMessageContentTypedDict + role: Literal["system"] + + +class SystemMessage(BaseModel): + content: SystemMessageContent + + role: Annotated[ + Annotated[Literal["system"], AfterValidator(validate_const("system"))], + pydantic.Field(alias="role"), + ] = "system" + + +try: + SystemMessage.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/systemmessagecontentchunks.py b/src/mistralai/client/models/systemmessagecontentchunks.py new file mode 100644 index 00000000..d480a219 --- /dev/null +++ b/src/mistralai/client/models/systemmessagecontentchunks.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 297e8905d5af + +from __future__ import annotations +from .textchunk import TextChunk, TextChunkTypedDict +from .thinkchunk import ThinkChunk, ThinkChunkTypedDict +from mistralai.client.utils import get_discriminator +from pydantic import Discriminator, Tag +from typing import Union +from typing_extensions import Annotated, TypeAliasType + + +SystemMessageContentChunksTypedDict = TypeAliasType( + "SystemMessageContentChunksTypedDict", + Union[TextChunkTypedDict, ThinkChunkTypedDict], +) + + +SystemMessageContentChunks = Annotated[ + Union[Annotated[TextChunk, Tag("text")], Annotated[ThinkChunk, Tag("thinking")]], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] diff --git a/src/mistralai/client/models/tempogettraceresponse.py b/src/mistralai/client/models/tempogettraceresponse.py new file mode 100644 index 00000000..8575b954 --- /dev/null +++ b/src/mistralai/client/models/tempogettraceresponse.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8bb3c013aa76 + +from __future__ import annotations +from .tempotracebatch import TempoTraceBatch, TempoTraceBatchTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class TempoGetTraceResponseTypedDict(TypedDict): + r"""Trace response in OpenTelemetry format. + + This is the unified trace format used across all trace providers (Tempo, ClickHouse, etc.). + Regardless of the underlying backend, all trace data is normalized to this Tempo-compatible + OpenTelemetry format to ensure consistency in the API response structure. + """ + + batches: NotRequired[List[TempoTraceBatchTypedDict]] + r"""The batches of the trace""" + + +class TempoGetTraceResponse(BaseModel): + r"""Trace response in OpenTelemetry format. + + This is the unified trace format used across all trace providers (Tempo, ClickHouse, etc.). + Regardless of the underlying backend, all trace data is normalized to this Tempo-compatible + OpenTelemetry format to ensure consistency in the API response structure. + """ + + batches: Optional[List[TempoTraceBatch]] = None + r"""The batches of the trace""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["batches"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/tempotraceattribute.py b/src/mistralai/client/models/tempotraceattribute.py new file mode 100644 index 00000000..dea530ea --- /dev/null +++ b/src/mistralai/client/models/tempotraceattribute.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7d0ec3402dc0 + +from __future__ import annotations +from .tempotraceattributearrayvalue import ( + TempoTraceAttributeArrayValue, + TempoTraceAttributeArrayValueTypedDict, +) +from .tempotraceattributeboolvalue import ( + TempoTraceAttributeBoolValue, + TempoTraceAttributeBoolValueTypedDict, +) +from .tempotraceattributeintvalue import ( + TempoTraceAttributeIntValue, + TempoTraceAttributeIntValueTypedDict, +) +from .tempotraceattributestringvalue import ( + TempoTraceAttributeStringValue, + TempoTraceAttributeStringValueTypedDict, +) +from mistralai.client.types import BaseModel +from typing import Union +from typing_extensions import TypeAliasType, TypedDict + + +TempoTraceAttributeValueTypedDict = TypeAliasType( + "TempoTraceAttributeValueTypedDict", + Union[ + TempoTraceAttributeStringValueTypedDict, + TempoTraceAttributeIntValueTypedDict, + TempoTraceAttributeBoolValueTypedDict, + TempoTraceAttributeArrayValueTypedDict, + ], +) +r"""The value of the attribute""" + + +TempoTraceAttributeValue = TypeAliasType( + "TempoTraceAttributeValue", + Union[ + TempoTraceAttributeStringValue, + TempoTraceAttributeIntValue, + TempoTraceAttributeBoolValue, + TempoTraceAttributeArrayValue, + ], +) +r"""The value of the attribute""" + + +class TempoTraceAttributeTypedDict(TypedDict): + key: str + r"""The key of the attribute""" + value: TempoTraceAttributeValueTypedDict + r"""The value of the attribute""" + + +class TempoTraceAttribute(BaseModel): + key: str + r"""The key of the attribute""" + + value: TempoTraceAttributeValue + r"""The value of the attribute""" diff --git a/src/mistralai/client/models/tempotraceattributearraycontainer.py b/src/mistralai/client/models/tempotraceattributearraycontainer.py new file mode 100644 index 00000000..08206037 --- /dev/null +++ b/src/mistralai/client/models/tempotraceattributearraycontainer.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: afca3b2e0b21 + +from __future__ import annotations +from .tempotraceattributearrayelement import ( + TempoTraceAttributeArrayElement, + TempoTraceAttributeArrayElementTypedDict, +) +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class TempoTraceAttributeArrayContainerTypedDict(TypedDict): + values: NotRequired[List[TempoTraceAttributeArrayElementTypedDict]] + r"""The values of the array""" + + +class TempoTraceAttributeArrayContainer(BaseModel): + values: Optional[List[TempoTraceAttributeArrayElement]] = None + r"""The values of the array""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["values"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/tempotraceattributearrayelement.py b/src/mistralai/client/models/tempotraceattributearrayelement.py new file mode 100644 index 00000000..6fa0ec60 --- /dev/null +++ b/src/mistralai/client/models/tempotraceattributearrayelement.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4f3b1d9264a3 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TempoTraceAttributeArrayElementTypedDict(TypedDict): + string_value: NotRequired[Nullable[str]] + r"""A string element in the array""" + int_value: NotRequired[Nullable[str]] + r"""An integer element in the array""" + bool_value: NotRequired[Nullable[bool]] + r"""A boolean element in the array""" + + +class TempoTraceAttributeArrayElement(BaseModel): + string_value: Annotated[ + OptionalNullable[str], pydantic.Field(alias="stringValue") + ] = UNSET + r"""A string element in the array""" + + int_value: Annotated[OptionalNullable[str], pydantic.Field(alias="intValue")] = ( + UNSET + ) + r"""An integer element in the array""" + + bool_value: Annotated[OptionalNullable[bool], pydantic.Field(alias="boolValue")] = ( + UNSET + ) + r"""A boolean element in the array""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["stringValue", "intValue", "boolValue"]) + nullable_fields = set(["stringValue", "intValue", "boolValue"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + TempoTraceAttributeArrayElement.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/tempotraceattributearrayvalue.py b/src/mistralai/client/models/tempotraceattributearrayvalue.py new file mode 100644 index 00000000..95fe337e --- /dev/null +++ b/src/mistralai/client/models/tempotraceattributearrayvalue.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d75dd416f9e3 + +from __future__ import annotations +from .tempotraceattributearraycontainer import ( + TempoTraceAttributeArrayContainer, + TempoTraceAttributeArrayContainerTypedDict, +) +from mistralai.client.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class TempoTraceAttributeArrayValueTypedDict(TypedDict): + array_value: TempoTraceAttributeArrayContainerTypedDict + + +class TempoTraceAttributeArrayValue(BaseModel): + array_value: Annotated[ + TempoTraceAttributeArrayContainer, pydantic.Field(alias="arrayValue") + ] + + +try: + TempoTraceAttributeArrayValue.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/tempotraceattributeboolvalue.py b/src/mistralai/client/models/tempotraceattributeboolvalue.py new file mode 100644 index 00000000..72fb79d0 --- /dev/null +++ b/src/mistralai/client/models/tempotraceattributeboolvalue.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c7c383a6c05f + +from __future__ import annotations +from mistralai.client.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class TempoTraceAttributeBoolValueTypedDict(TypedDict): + bool_value: bool + r"""The boolean value of the attribute""" + + +class TempoTraceAttributeBoolValue(BaseModel): + bool_value: Annotated[bool, pydantic.Field(alias="boolValue")] + r"""The boolean value of the attribute""" + + +try: + TempoTraceAttributeBoolValue.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/tempotraceattributeintvalue.py b/src/mistralai/client/models/tempotraceattributeintvalue.py new file mode 100644 index 00000000..6ffe7efe --- /dev/null +++ b/src/mistralai/client/models/tempotraceattributeintvalue.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c4659ad7a2a5 + +from __future__ import annotations +from mistralai.client.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class TempoTraceAttributeIntValueTypedDict(TypedDict): + int_value: str + r"""The integer value of the attribute""" + + +class TempoTraceAttributeIntValue(BaseModel): + int_value: Annotated[str, pydantic.Field(alias="intValue")] + r"""The integer value of the attribute""" + + +try: + TempoTraceAttributeIntValue.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/tempotraceattributestringvalue.py b/src/mistralai/client/models/tempotraceattributestringvalue.py new file mode 100644 index 00000000..f4dea639 --- /dev/null +++ b/src/mistralai/client/models/tempotraceattributestringvalue.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2dcdd05a5115 + +from __future__ import annotations +from mistralai.client.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class TempoTraceAttributeStringValueTypedDict(TypedDict): + string_value: str + r"""The string value of the attribute""" + + +class TempoTraceAttributeStringValue(BaseModel): + string_value: Annotated[str, pydantic.Field(alias="stringValue")] + r"""The string value of the attribute""" + + +try: + TempoTraceAttributeStringValue.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/tempotracebatch.py b/src/mistralai/client/models/tempotracebatch.py new file mode 100644 index 00000000..7f508047 --- /dev/null +++ b/src/mistralai/client/models/tempotracebatch.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 969acd9d6220 + +from __future__ import annotations +from .tempotraceresource import TempoTraceResource, TempoTraceResourceTypedDict +from .tempotracescopespan import TempoTraceScopeSpan, TempoTraceScopeSpanTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TempoTraceBatchTypedDict(TypedDict): + resource: TempoTraceResourceTypedDict + scope_spans: NotRequired[List[TempoTraceScopeSpanTypedDict]] + r"""The spans of the scope""" + + +class TempoTraceBatch(BaseModel): + resource: TempoTraceResource + + scope_spans: Annotated[ + Optional[List[TempoTraceScopeSpan]], pydantic.Field(alias="scopeSpans") + ] = None + r"""The spans of the scope""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["scopeSpans"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + TempoTraceBatch.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/tempotraceevent.py b/src/mistralai/client/models/tempotraceevent.py new file mode 100644 index 00000000..bda2115a --- /dev/null +++ b/src/mistralai/client/models/tempotraceevent.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 98dd1b838524 + +from __future__ import annotations +from .tempotraceattribute import TempoTraceAttribute, TempoTraceAttributeTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TempoTraceEventTypedDict(TypedDict): + name: str + r"""The name of the event""" + time_unix_nano: str + r"""The time of the event in Unix nano""" + attributes: NotRequired[List[TempoTraceAttributeTypedDict]] + r"""The attributes of the event""" + + +class TempoTraceEvent(BaseModel): + name: str + r"""The name of the event""" + + time_unix_nano: Annotated[str, pydantic.Field(alias="timeUnixNano")] + r"""The time of the event in Unix nano""" + + attributes: Optional[List[TempoTraceAttribute]] = None + r"""The attributes of the event""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["attributes"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + TempoTraceEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/tempotraceresource.py b/src/mistralai/client/models/tempotraceresource.py new file mode 100644 index 00000000..42c4d56a --- /dev/null +++ b/src/mistralai/client/models/tempotraceresource.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cc8a7ff3feea + +from __future__ import annotations +from .tempotraceattribute import TempoTraceAttribute, TempoTraceAttributeTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class TempoTraceResourceTypedDict(TypedDict): + attributes: NotRequired[List[TempoTraceAttributeTypedDict]] + r"""The attributes of the resource""" + + +class TempoTraceResource(BaseModel): + attributes: Optional[List[TempoTraceAttribute]] = None + r"""The attributes of the resource""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["attributes"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/tempotracescope.py b/src/mistralai/client/models/tempotracescope.py new file mode 100644 index 00000000..3e302f81 --- /dev/null +++ b/src/mistralai/client/models/tempotracescope.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a2da1a3b8198 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class TempoTraceScopeTypedDict(TypedDict): + name: str + r"""The name of the span""" + + +class TempoTraceScope(BaseModel): + name: str + r"""The name of the span""" diff --git a/src/mistralai/client/models/tempotracescopekind.py b/src/mistralai/client/models/tempotracescopekind.py new file mode 100644 index 00000000..a26d5c38 --- /dev/null +++ b/src/mistralai/client/models/tempotracescopekind.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 40c697c1e617 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +TempoTraceScopeKind = Union[ + Literal[ + "SPAN_KIND_INTERNAL", + "SPAN_KIND_SERVER", + "SPAN_KIND_CLIENT", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/tempotracescopespan.py b/src/mistralai/client/models/tempotracescopespan.py new file mode 100644 index 00000000..362f3c99 --- /dev/null +++ b/src/mistralai/client/models/tempotracescopespan.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cb248e9c0a00 + +from __future__ import annotations +from .tempotracescope import TempoTraceScope, TempoTraceScopeTypedDict +from .tempotracespan import TempoTraceSpan, TempoTraceSpanTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class TempoTraceScopeSpanTypedDict(TypedDict): + scope: TempoTraceScopeTypedDict + spans: NotRequired[List[TempoTraceSpanTypedDict]] + r"""The spans of the scope""" + + +class TempoTraceScopeSpan(BaseModel): + scope: TempoTraceScope + + spans: Optional[List[TempoTraceSpan]] = None + r"""The spans of the scope""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["spans"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/tempotracespan.py b/src/mistralai/client/models/tempotracespan.py new file mode 100644 index 00000000..51b181ba --- /dev/null +++ b/src/mistralai/client/models/tempotracespan.py @@ -0,0 +1,99 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f36568c83a96 + +from __future__ import annotations +from .tempotraceattribute import TempoTraceAttribute, TempoTraceAttributeTypedDict +from .tempotraceevent import TempoTraceEvent, TempoTraceEventTypedDict +from .tempotracescopekind import TempoTraceScopeKind +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TempoTraceSpanTypedDict(TypedDict): + trace_id: str + r"""The trace ID of the scope""" + span_id: str + r"""The span ID of the scope""" + name: str + r"""The name of the scope""" + kind: TempoTraceScopeKind + start_time_unix_nano: str + r"""The start time of the scope in Unix nano""" + end_time_unix_nano: str + r"""The end time of the scope in Unix nano""" + parent_span_id: NotRequired[Nullable[str]] + r"""The parent span ID of the scope""" + attributes: NotRequired[List[TempoTraceAttributeTypedDict]] + r"""The attributes of the scope""" + events: NotRequired[List[TempoTraceEventTypedDict]] + r"""The events of the scope""" + + +class TempoTraceSpan(BaseModel): + trace_id: Annotated[str, pydantic.Field(alias="traceId")] + r"""The trace ID of the scope""" + + span_id: Annotated[str, pydantic.Field(alias="spanId")] + r"""The span ID of the scope""" + + name: str + r"""The name of the scope""" + + kind: TempoTraceScopeKind + + start_time_unix_nano: Annotated[str, pydantic.Field(alias="startTimeUnixNano")] + r"""The start time of the scope in Unix nano""" + + end_time_unix_nano: Annotated[str, pydantic.Field(alias="endTimeUnixNano")] + r"""The end time of the scope in Unix nano""" + + parent_span_id: Annotated[ + OptionalNullable[str], pydantic.Field(alias="parentSpanId") + ] = UNSET + r"""The parent span ID of the scope""" + + attributes: Optional[List[TempoTraceAttribute]] = None + r"""The attributes of the scope""" + + events: Optional[List[TempoTraceEvent]] = None + r"""The events of the scope""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["parentSpanId", "attributes", "events"]) + nullable_fields = set(["parentSpanId"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + TempoTraceSpan.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/terminate_workflow_execution_v1_workflows_executions_execution_id_terminate_postop.py b/src/mistralai/client/models/terminate_workflow_execution_v1_workflows_executions_execution_id_terminate_postop.py new file mode 100644 index 00000000..771c1650 --- /dev/null +++ b/src/mistralai/client/models/terminate_workflow_execution_v1_workflows_executions_execution_id_terminate_postop.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 458eee7d2603 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequestTypedDict( + TypedDict +): + execution_id: str + + +class TerminateWorkflowExecutionV1WorkflowsExecutionsExecutionIDTerminatePostRequest( + BaseModel +): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/textchunk.py b/src/mistralai/client/models/textchunk.py new file mode 100644 index 00000000..bae970f3 --- /dev/null +++ b/src/mistralai/client/models/textchunk.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9c96fb86a9ab + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class TextChunkTypedDict(TypedDict): + text: str + type: Literal["text"] + + +class TextChunk(BaseModel): + text: str + + type: Annotated[ + Annotated[Optional[Literal["text"]], AfterValidator(validate_const("text"))], + pydantic.Field(alias="type"), + ] = "text" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + TextChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/textcontent.py b/src/mistralai/client/models/textcontent.py new file mode 100644 index 00000000..03de48d3 --- /dev/null +++ b/src/mistralai/client/models/textcontent.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 60805b9f7050 + +from __future__ import annotations +from .annotations import Annotations, AnnotationsTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TextContentTypedDict(TypedDict): + r"""Text content for a message.""" + + text: str + type: Literal["text"] + annotations: NotRequired[Nullable[AnnotationsTypedDict]] + meta: NotRequired[Nullable[Dict[str, Any]]] + + +class TextContent(BaseModel): + r"""Text content for a message.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + text: str + + type: Annotated[ + Annotated[Literal["text"], AfterValidator(validate_const("text"))], + pydantic.Field(alias="type"), + ] = "text" + + annotations: OptionalNullable[Annotations] = UNSET + + meta: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["annotations", "_meta"]) + nullable_fields = set(["annotations", "_meta"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + TextContent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/textresourcecontents.py b/src/mistralai/client/models/textresourcecontents.py new file mode 100644 index 00000000..c3f26a65 --- /dev/null +++ b/src/mistralai/client/models/textresourcecontents.py @@ -0,0 +1,87 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 58fe427f427f + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TextResourceContentsTypedDict(TypedDict): + r"""Text contents of a resource.""" + + uri: str + text: str + mime_type: NotRequired[Nullable[str]] + meta: NotRequired[Nullable[Dict[str, Any]]] + + +class TextResourceContents(BaseModel): + r"""Text contents of a resource.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + uri: str + + text: str + + mime_type: Annotated[OptionalNullable[str], pydantic.Field(alias="mimeType")] = ( + UNSET + ) + + meta: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_meta")] = ( + UNSET + ) + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["mimeType", "_meta"]) + nullable_fields = set(["mimeType", "_meta"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + TextResourceContents.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/thinkchunk.py b/src/mistralai/client/models/thinkchunk.py new file mode 100644 index 00000000..d2af3da6 --- /dev/null +++ b/src/mistralai/client/models/thinkchunk.py @@ -0,0 +1,88 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 294bfce193a4 + +from __future__ import annotations +from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict +from .textchunk import TextChunk, TextChunkTypedDict +from .toolreferencechunk import ToolReferenceChunk, ToolReferenceChunkTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ThinkingTypedDict = TypeAliasType( + "ThinkingTypedDict", + Union[TextChunkTypedDict, ReferenceChunkTypedDict, ToolReferenceChunkTypedDict], +) + + +Thinking = TypeAliasType( + "Thinking", Union[TextChunk, ReferenceChunk, ToolReferenceChunk] +) + + +class ThinkChunkTypedDict(TypedDict): + thinking: List[ThinkingTypedDict] + type: Literal["thinking"] + signature: NotRequired[Nullable[str]] + r"""Signature to replay some reasoning blocks across turns.""" + closed: NotRequired[bool] + r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" + + +class ThinkChunk(BaseModel): + thinking: List[Thinking] + + type: Annotated[ + Annotated[ + Optional[Literal["thinking"]], AfterValidator(validate_const("thinking")) + ], + pydantic.Field(alias="type"), + ] = "thinking" + + signature: OptionalNullable[str] = UNSET + r"""Signature to replay some reasoning blocks across turns.""" + + closed: Optional[bool] = None + r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "signature", "closed"]) + nullable_fields = set(["signature"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ThinkChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/timeseriesmetric.py b/src/mistralai/client/models/timeseriesmetric.py new file mode 100644 index 00000000..a0eb0c9c --- /dev/null +++ b/src/mistralai/client/models/timeseriesmetric.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7f91751795ac + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import List, Union +from typing_extensions import TypeAliasType, TypedDict + + +TimeSeriesMetricValue1TypedDict = TypeAliasType( + "TimeSeriesMetricValue1TypedDict", Union[int, float] +) + + +TimeSeriesMetricValue1 = TypeAliasType("TimeSeriesMetricValue1", Union[int, float]) + + +TimeSeriesMetricValue2TypedDict = TypeAliasType( + "TimeSeriesMetricValue2TypedDict", Union[int, TimeSeriesMetricValue1TypedDict] +) + + +TimeSeriesMetricValue2 = TypeAliasType( + "TimeSeriesMetricValue2", Union[int, TimeSeriesMetricValue1] +) + + +class TimeSeriesMetricTypedDict(TypedDict): + r"""Time-series metric with timestamp-value pairs.""" + + value: List[List[TimeSeriesMetricValue2TypedDict]] + + +class TimeSeriesMetric(BaseModel): + r"""Time-series metric with timestamp-value pairs.""" + + value: List[List[TimeSeriesMetricValue2]] diff --git a/src/mistralai/client/models/timestampgranularity.py b/src/mistralai/client/models/timestampgranularity.py new file mode 100644 index 00000000..8d377375 --- /dev/null +++ b/src/mistralai/client/models/timestampgranularity.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 68ddf8d702ea + +from __future__ import annotations +from typing import Literal + + +TimestampGranularity = Literal[ + "segment", + "word", +] diff --git a/src/mistralai/client/models/tool.py b/src/mistralai/client/models/tool.py new file mode 100644 index 00000000..a83a6d1c --- /dev/null +++ b/src/mistralai/client/models/tool.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 48b4f6f50fe9 + +from __future__ import annotations +from .function import Function, FunctionTypedDict +from mistralai.client.types import BaseModel, UnrecognizedStr +from mistralai.client.utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal, Union +from typing_extensions import Annotated, TypedDict + + +class ToolTypedDict(TypedDict): + function: FunctionTypedDict + type: Union[Literal["function"], UnrecognizedStr] + + +class Tool(BaseModel): + function: Function + + type: Annotated[ + Annotated[ + Union[Literal["function"], UnrecognizedStr], + AfterValidator(validate_const("function")), + ], + pydantic.Field(alias="type"), + ] = "function" + + +try: + Tool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolannotations.py b/src/mistralai/client/models/toolannotations.py new file mode 100644 index 00000000..b2e9b948 --- /dev/null +++ b/src/mistralai/client/models/toolannotations.py @@ -0,0 +1,126 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2ae257a35b01 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ToolAnnotationsTypedDict(TypedDict): + r"""Additional properties describing a Tool to clients. + + NOTE: all properties in ToolAnnotations are **hints**. + They are not guaranteed to provide a faithful description of + tool behavior (including descriptive properties like `title`). + + Clients should never make tool use decisions based on ToolAnnotations + received from untrusted servers. + """ + + title: NotRequired[Nullable[str]] + read_only_hint: NotRequired[Nullable[bool]] + destructive_hint: NotRequired[Nullable[bool]] + idempotent_hint: NotRequired[Nullable[bool]] + open_world_hint: NotRequired[Nullable[bool]] + + +class ToolAnnotations(BaseModel): + r"""Additional properties describing a Tool to clients. + + NOTE: all properties in ToolAnnotations are **hints**. + They are not guaranteed to provide a faithful description of + tool behavior (including descriptive properties like `title`). + + Clients should never make tool use decisions based on ToolAnnotations + received from untrusted servers. + """ + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + title: OptionalNullable[str] = UNSET + + read_only_hint: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="readOnlyHint") + ] = UNSET + + destructive_hint: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="destructiveHint") + ] = UNSET + + idempotent_hint: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="idempotentHint") + ] = UNSET + + open_world_hint: Annotated[ + OptionalNullable[bool], pydantic.Field(alias="openWorldHint") + ] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "title", + "readOnlyHint", + "destructiveHint", + "idempotentHint", + "openWorldHint", + ] + ) + nullable_fields = set( + [ + "title", + "readOnlyHint", + "destructiveHint", + "idempotentHint", + "openWorldHint", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + ToolAnnotations.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolcall.py b/src/mistralai/client/models/toolcall.py new file mode 100644 index 00000000..1424d879 --- /dev/null +++ b/src/mistralai/client/models/toolcall.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fb34a1a3f3c2 + +from __future__ import annotations +from .functioncall import FunctionCall, FunctionCallTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ToolCallTypedDict(TypedDict): + function: FunctionCallTypedDict + id: NotRequired[str] + type: NotRequired[str] + index: NotRequired[int] + + +class ToolCall(BaseModel): + function: FunctionCall + + id: Optional[str] = "null" + + type: Optional[str] = None + + index: Optional[int] = 0 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["id", "type", "index"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/toolcallconfirmation.py b/src/mistralai/client/models/toolcallconfirmation.py new file mode 100644 index 00000000..fd6eca50 --- /dev/null +++ b/src/mistralai/client/models/toolcallconfirmation.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f2e953cfb4fe + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +Confirmation = Literal[ + "allow", + "deny", +] + + +class ToolCallConfirmationTypedDict(TypedDict): + tool_call_id: str + confirmation: Confirmation + + +class ToolCallConfirmation(BaseModel): + tool_call_id: str + + confirmation: Confirmation diff --git a/src/mistralai/client/models/toolchoice.py b/src/mistralai/client/models/toolchoice.py new file mode 100644 index 00000000..e7a17d5c --- /dev/null +++ b/src/mistralai/client/models/toolchoice.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 14f7e4cc35b6 + +from __future__ import annotations +from .functionname import FunctionName, FunctionNameTypedDict +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ToolChoiceTypedDict(TypedDict): + r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" + + function: FunctionNameTypedDict + r"""this restriction of `Function` is used to select a specific function to call""" + type: NotRequired[str] + + +class ToolChoice(BaseModel): + r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" + + function: FunctionName + r"""this restriction of `Function` is used to select a specific function to call""" + + type: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/toolchoiceenum.py b/src/mistralai/client/models/toolchoiceenum.py new file mode 100644 index 00000000..d66c3d07 --- /dev/null +++ b/src/mistralai/client/models/toolchoiceenum.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c7798801f860 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ToolChoiceEnum = Union[ + Literal[ + "auto", + "none", + "any", + "required", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/toolconfiguration.py b/src/mistralai/client/models/toolconfiguration.py new file mode 100644 index 00000000..eb3d14e5 --- /dev/null +++ b/src/mistralai/client/models/toolconfiguration.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: faec24b75066 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ToolConfigurationTypedDict(TypedDict): + exclude: NotRequired[Nullable[List[str]]] + include: NotRequired[Nullable[List[str]]] + requires_confirmation: NotRequired[Nullable[List[str]]] + + +class ToolConfiguration(BaseModel): + exclude: OptionalNullable[List[str]] = UNSET + + include: OptionalNullable[List[str]] = UNSET + + requires_confirmation: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["exclude", "include", "requires_confirmation"]) + nullable_fields = set(["exclude", "include", "requires_confirmation"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/toolexecution.py b/src/mistralai/client/models/toolexecution.py new file mode 100644 index 00000000..9c55e7bb --- /dev/null +++ b/src/mistralai/client/models/toolexecution.py @@ -0,0 +1,87 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 69fcb691327a + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Literal, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +TaskSupport = Union[ + Literal[ + "forbidden", + "optional", + "required", + ], + UnrecognizedStr, +] + + +class ToolExecutionTypedDict(TypedDict): + r"""Execution-related properties for a tool.""" + + task_support: NotRequired[Nullable[TaskSupport]] + + +class ToolExecution(BaseModel): + r"""Execution-related properties for a tool.""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + task_support: Annotated[ + OptionalNullable[TaskSupport], pydantic.Field(alias="taskSupport") + ] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["taskSupport"]) + nullable_fields = set(["taskSupport"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + ToolExecution.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolexecutiondeltaevent.py b/src/mistralai/client/models/toolexecutiondeltaevent.py new file mode 100644 index 00000000..c2e40950 --- /dev/null +++ b/src/mistralai/client/models/toolexecutiondeltaevent.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: df8f17cf3e07 + +from __future__ import annotations +from .builtinconnectors import BuiltInConnectors +from datetime import datetime +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolExecutionDeltaEventNameTypedDict = TypeAliasType( + "ToolExecutionDeltaEventNameTypedDict", Union[BuiltInConnectors, str] +) + + +ToolExecutionDeltaEventName = TypeAliasType( + "ToolExecutionDeltaEventName", Union[BuiltInConnectors, str] +) + + +class ToolExecutionDeltaEventTypedDict(TypedDict): + id: str + name: ToolExecutionDeltaEventNameTypedDict + arguments: str + type: Literal["tool.execution.delta"] + created_at: NotRequired[datetime] + output_index: NotRequired[int] + + +class ToolExecutionDeltaEvent(BaseModel): + id: str + + name: ToolExecutionDeltaEventName + + arguments: str + + type: Annotated[ + Annotated[ + Literal["tool.execution.delta"], + AfterValidator(validate_const("tool.execution.delta")), + ], + pydantic.Field(alias="type"), + ] = "tool.execution.delta" + + created_at: Optional[datetime] = None + + output_index: Optional[int] = 0 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["created_at", "output_index"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ToolExecutionDeltaEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolexecutiondoneevent.py b/src/mistralai/client/models/toolexecutiondoneevent.py new file mode 100644 index 00000000..ec3b6918 --- /dev/null +++ b/src/mistralai/client/models/toolexecutiondoneevent.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 514fdee7d99f + +from __future__ import annotations +from .builtinconnectors import BuiltInConnectors +from datetime import datetime +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolExecutionDoneEventNameTypedDict = TypeAliasType( + "ToolExecutionDoneEventNameTypedDict", Union[BuiltInConnectors, str] +) + + +ToolExecutionDoneEventName = TypeAliasType( + "ToolExecutionDoneEventName", Union[BuiltInConnectors, str] +) + + +class ToolExecutionDoneEventTypedDict(TypedDict): + id: str + name: ToolExecutionDoneEventNameTypedDict + type: Literal["tool.execution.done"] + created_at: NotRequired[datetime] + output_index: NotRequired[int] + info: NotRequired[Dict[str, Any]] + + +class ToolExecutionDoneEvent(BaseModel): + id: str + + name: ToolExecutionDoneEventName + + type: Annotated[ + Annotated[ + Literal["tool.execution.done"], + AfterValidator(validate_const("tool.execution.done")), + ], + pydantic.Field(alias="type"), + ] = "tool.execution.done" + + created_at: Optional[datetime] = None + + output_index: Optional[int] = 0 + + info: Optional[Dict[str, Any]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["created_at", "output_index", "info"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ToolExecutionDoneEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolexecutionentry.py b/src/mistralai/client/models/toolexecutionentry.py new file mode 100644 index 00000000..226adce1 --- /dev/null +++ b/src/mistralai/client/models/toolexecutionentry.py @@ -0,0 +1,115 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 76db69eebe41 + +from __future__ import annotations +from .builtinconnectors import BuiltInConnectors +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolExecutionEntryNameTypedDict = TypeAliasType( + "ToolExecutionEntryNameTypedDict", Union[BuiltInConnectors, str] +) + + +ToolExecutionEntryName = TypeAliasType( + "ToolExecutionEntryName", Union[BuiltInConnectors, str] +) + + +class ToolExecutionEntryTypedDict(TypedDict): + name: ToolExecutionEntryNameTypedDict + arguments: str + object: Literal["entry"] + type: Literal["tool.execution"] + created_at: NotRequired[datetime] + completed_at: NotRequired[Nullable[datetime]] + agent_id: NotRequired[Nullable[str]] + model: NotRequired[Nullable[str]] + id: NotRequired[str] + info: NotRequired[Dict[str, Any]] + + +class ToolExecutionEntry(BaseModel): + name: ToolExecutionEntryName + + arguments: str + + object: Annotated[ + Annotated[Optional[Literal["entry"]], AfterValidator(validate_const("entry"))], + pydantic.Field(alias="object"), + ] = "entry" + + type: Annotated[ + Annotated[ + Optional[Literal["tool.execution"]], + AfterValidator(validate_const("tool.execution")), + ], + pydantic.Field(alias="type"), + ] = "tool.execution" + + created_at: Optional[datetime] = None + + completed_at: OptionalNullable[datetime] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + model: OptionalNullable[str] = UNSET + + id: Optional[str] = None + + info: Optional[Dict[str, Any]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "object", + "type", + "created_at", + "completed_at", + "agent_id", + "model", + "id", + "info", + ] + ) + nullable_fields = set(["completed_at", "agent_id", "model"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolExecutionEntry.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolexecutionstartedevent.py b/src/mistralai/client/models/toolexecutionstartedevent.py new file mode 100644 index 00000000..a4af27b8 --- /dev/null +++ b/src/mistralai/client/models/toolexecutionstartedevent.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 40fadb8e49a1 + +from __future__ import annotations +from .builtinconnectors import BuiltInConnectors +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolExecutionStartedEventNameTypedDict = TypeAliasType( + "ToolExecutionStartedEventNameTypedDict", Union[BuiltInConnectors, str] +) + + +ToolExecutionStartedEventName = TypeAliasType( + "ToolExecutionStartedEventName", Union[BuiltInConnectors, str] +) + + +class ToolExecutionStartedEventTypedDict(TypedDict): + id: str + name: ToolExecutionStartedEventNameTypedDict + arguments: str + type: Literal["tool.execution.started"] + created_at: NotRequired[datetime] + output_index: NotRequired[int] + model: NotRequired[Nullable[str]] + agent_id: NotRequired[Nullable[str]] + + +class ToolExecutionStartedEvent(BaseModel): + id: str + + name: ToolExecutionStartedEventName + + arguments: str + + type: Annotated[ + Annotated[ + Literal["tool.execution.started"], + AfterValidator(validate_const("tool.execution.started")), + ], + pydantic.Field(alias="type"), + ] = "tool.execution.started" + + created_at: Optional[datetime] = None + + output_index: Optional[int] = 0 + + model: OptionalNullable[str] = UNSET + + agent_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["created_at", "output_index", "model", "agent_id"]) + nullable_fields = set(["model", "agent_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolExecutionStartedEvent.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolfilechunk.py b/src/mistralai/client/models/toolfilechunk.py new file mode 100644 index 00000000..1d9e6118 --- /dev/null +++ b/src/mistralai/client/models/toolfilechunk.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 26c8aadf416a + +from __future__ import annotations +from .builtinconnectors import BuiltInConnectors +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolFileChunkToolTypedDict = TypeAliasType( + "ToolFileChunkToolTypedDict", Union[BuiltInConnectors, str] +) + + +ToolFileChunkTool = TypeAliasType("ToolFileChunkTool", Union[BuiltInConnectors, str]) + + +class ToolFileChunkTypedDict(TypedDict): + tool: ToolFileChunkToolTypedDict + file_id: str + type: Literal["tool_file"] + file_name: NotRequired[Nullable[str]] + file_type: NotRequired[Nullable[str]] + + +class ToolFileChunk(BaseModel): + tool: ToolFileChunkTool + + file_id: str + + type: Annotated[ + Annotated[ + Optional[Literal["tool_file"]], AfterValidator(validate_const("tool_file")) + ], + pydantic.Field(alias="type"), + ] = "tool_file" + + file_name: OptionalNullable[str] = UNSET + + file_type: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "file_name", "file_type"]) + nullable_fields = set(["file_name", "file_type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolFileChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolmessage.py b/src/mistralai/client/models/toolmessage.py new file mode 100644 index 00000000..0dc9e92f --- /dev/null +++ b/src/mistralai/client/models/toolmessage.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 15f1af161031 + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolMessageContentTypedDict = TypeAliasType( + "ToolMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]]) + + +class ToolMessageTypedDict(TypedDict): + content: Nullable[ToolMessageContentTypedDict] + role: Literal["tool"] + tool_call_id: NotRequired[Nullable[str]] + name: NotRequired[Nullable[str]] + + +class ToolMessage(BaseModel): + content: Nullable[ToolMessageContent] + + role: Annotated[ + Annotated[Literal["tool"], AfterValidator(validate_const("tool"))], + pydantic.Field(alias="role"), + ] = "tool" + + tool_call_id: OptionalNullable[str] = UNSET + + name: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_call_id", "name"]) + nullable_fields = set(["content", "tool_call_id", "name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolMessage.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/toolreferencechunk.py b/src/mistralai/client/models/toolreferencechunk.py new file mode 100644 index 00000000..391724ed --- /dev/null +++ b/src/mistralai/client/models/toolreferencechunk.py @@ -0,0 +1,88 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 822e9f3e70de + +from __future__ import annotations +from .builtinconnectors import BuiltInConnectors +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ToolReferenceChunkToolTypedDict = TypeAliasType( + "ToolReferenceChunkToolTypedDict", Union[BuiltInConnectors, str] +) + + +ToolReferenceChunkTool = TypeAliasType( + "ToolReferenceChunkTool", Union[BuiltInConnectors, str] +) + + +class ToolReferenceChunkTypedDict(TypedDict): + tool: ToolReferenceChunkToolTypedDict + title: str + type: Literal["tool_reference"] + url: NotRequired[Nullable[str]] + favicon: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + + +class ToolReferenceChunk(BaseModel): + tool: ToolReferenceChunkTool + + title: str + + type: Annotated[ + Annotated[ + Optional[Literal["tool_reference"]], + AfterValidator(validate_const("tool_reference")), + ], + pydantic.Field(alias="type"), + ] = "tool_reference" + + url: OptionalNullable[str] = UNSET + + favicon: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "url", "favicon", "description"]) + nullable_fields = set(["url", "favicon", "description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + ToolReferenceChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/tooltype.py b/src/mistralai/client/models/tooltype.py new file mode 100644 index 00000000..1a7781fc --- /dev/null +++ b/src/mistralai/client/models/tooltype.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cbe8c44aee50 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +ToolType = Union[ + Literal[ + "rag", + "image", + "code", + "event", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/trainingfile.py b/src/mistralai/client/models/trainingfile.py new file mode 100644 index 00000000..bdaba37a --- /dev/null +++ b/src/mistralai/client/models/trainingfile.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2edf9bce227d + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class TrainingFileTypedDict(TypedDict): + file_id: str + weight: NotRequired[float] + + +class TrainingFile(BaseModel): + file_id: str + + weight: Optional[float] = 1 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["weight"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/transcriptionresponse.py b/src/mistralai/client/models/transcriptionresponse.py new file mode 100644 index 00000000..c512a345 --- /dev/null +++ b/src/mistralai/client/models/transcriptionresponse.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 60896dbc6345 + +from __future__ import annotations +from .transcriptionsegmentchunk import ( + TranscriptionSegmentChunk, + TranscriptionSegmentChunkTypedDict, +) +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class TranscriptionResponseTypedDict(TypedDict): + model: str + text: str + usage: UsageInfoTypedDict + language: Nullable[str] + segments: NotRequired[List[TranscriptionSegmentChunkTypedDict]] + + +class TranscriptionResponse(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + model: str + + text: str + + usage: UsageInfo + + language: Nullable[str] + + segments: Optional[List[TranscriptionSegmentChunk]] = None + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["segments"]) + nullable_fields = set(["language"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/src/mistralai/client/models/transcriptionsegmentchunk.py b/src/mistralai/client/models/transcriptionsegmentchunk.py new file mode 100644 index 00000000..8a5a7162 --- /dev/null +++ b/src/mistralai/client/models/transcriptionsegmentchunk.py @@ -0,0 +1,93 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d1e6f3bdc74b + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TranscriptionSegmentChunkTypedDict(TypedDict): + text: str + start: float + end: float + type: Literal["transcription_segment"] + score: NotRequired[Nullable[float]] + speaker_id: NotRequired[Nullable[str]] + + +class TranscriptionSegmentChunk(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + text: str + + start: float + + end: float + + type: Annotated[ + Annotated[ + Optional[Literal["transcription_segment"]], + AfterValidator(validate_const("transcription_segment")), + ], + pydantic.Field(alias="type"), + ] = "transcription_segment" + + score: OptionalNullable[float] = UNSET + + speaker_id: OptionalNullable[str] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "score", "speaker_id"]) + nullable_fields = set(["score", "speaker_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + TranscriptionSegmentChunk.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/transcriptionstreamdone.py b/src/mistralai/client/models/transcriptionstreamdone.py new file mode 100644 index 00000000..89357277 --- /dev/null +++ b/src/mistralai/client/models/transcriptionstreamdone.py @@ -0,0 +1,92 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 066a9158ed09 + +from __future__ import annotations +from .transcriptionsegmentchunk import ( + TranscriptionSegmentChunk, + TranscriptionSegmentChunkTypedDict, +) +from .usageinfo import UsageInfo, UsageInfoTypedDict +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, List, Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TranscriptionStreamDoneTypedDict(TypedDict): + model: str + text: str + usage: UsageInfoTypedDict + language: Nullable[str] + segments: NotRequired[List[TranscriptionSegmentChunkTypedDict]] + type: Literal["transcription.done"] + + +class TranscriptionStreamDone(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + model: str + + text: str + + usage: UsageInfo + + language: Nullable[str] + + segments: Optional[List[TranscriptionSegmentChunk]] = None + + type: Annotated[ + Annotated[ + Literal["transcription.done"], + AfterValidator(validate_const("transcription.done")), + ], + pydantic.Field(alias="type"), + ] = "transcription.done" + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["segments"]) + nullable_fields = set(["language"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + TranscriptionStreamDone.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/transcriptionstreamevents.py b/src/mistralai/client/models/transcriptionstreamevents.py new file mode 100644 index 00000000..073fd99a --- /dev/null +++ b/src/mistralai/client/models/transcriptionstreamevents.py @@ -0,0 +1,88 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b50b3d74f16f + +from __future__ import annotations +from .transcriptionstreamdone import ( + TranscriptionStreamDone, + TranscriptionStreamDoneTypedDict, +) +from .transcriptionstreameventtypes import TranscriptionStreamEventTypes +from .transcriptionstreamlanguage import ( + TranscriptionStreamLanguage, + TranscriptionStreamLanguageTypedDict, +) +from .transcriptionstreamsegmentdelta import ( + TranscriptionStreamSegmentDelta, + TranscriptionStreamSegmentDeltaTypedDict, +) +from .transcriptionstreamtextdelta import ( + TranscriptionStreamTextDelta, + TranscriptionStreamTextDeltaTypedDict, +) +from functools import partial +from mistralai.client.types import BaseModel +from mistralai.client.utils.unions import parse_open_union +from pydantic import ConfigDict +from pydantic.functional_validators import BeforeValidator +from typing import Any, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +TranscriptionStreamEventsDataTypedDict = TypeAliasType( + "TranscriptionStreamEventsDataTypedDict", + Union[ + TranscriptionStreamTextDeltaTypedDict, + TranscriptionStreamLanguageTypedDict, + TranscriptionStreamSegmentDeltaTypedDict, + TranscriptionStreamDoneTypedDict, + ], +) + + +class UnknownTranscriptionStreamEventsData(BaseModel): + r"""A TranscriptionStreamEventsData variant the SDK doesn't recognize. Preserves the raw payload.""" + + type: Literal["UNKNOWN"] = "UNKNOWN" + raw: Any + is_unknown: Literal[True] = True + + model_config = ConfigDict(frozen=True) + + +_TRANSCRIPTION_STREAM_EVENTS_DATA_VARIANTS: dict[str, Any] = { + "transcription.done": TranscriptionStreamDone, + "transcription.language": TranscriptionStreamLanguage, + "transcription.segment": TranscriptionStreamSegmentDelta, + "transcription.text.delta": TranscriptionStreamTextDelta, +} + + +TranscriptionStreamEventsData = Annotated[ + Union[ + TranscriptionStreamDone, + TranscriptionStreamLanguage, + TranscriptionStreamSegmentDelta, + TranscriptionStreamTextDelta, + UnknownTranscriptionStreamEventsData, + ], + BeforeValidator( + partial( + parse_open_union, + disc_key="type", + variants=_TRANSCRIPTION_STREAM_EVENTS_DATA_VARIANTS, + unknown_cls=UnknownTranscriptionStreamEventsData, + union_name="TranscriptionStreamEventsData", + ) + ), +] + + +class TranscriptionStreamEventsTypedDict(TypedDict): + event: TranscriptionStreamEventTypes + data: TranscriptionStreamEventsDataTypedDict + + +class TranscriptionStreamEvents(BaseModel): + event: TranscriptionStreamEventTypes + + data: TranscriptionStreamEventsData diff --git a/src/mistralai/client/models/transcriptionstreameventtypes.py b/src/mistralai/client/models/transcriptionstreameventtypes.py new file mode 100644 index 00000000..c74bbb74 --- /dev/null +++ b/src/mistralai/client/models/transcriptionstreameventtypes.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6f71f6fbf4c5 + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +TranscriptionStreamEventTypes = Union[ + Literal[ + "transcription.language", + "transcription.segment", + "transcription.text.delta", + "transcription.done", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/transcriptionstreamlanguage.py b/src/mistralai/client/models/transcriptionstreamlanguage.py new file mode 100644 index 00000000..b6c61906 --- /dev/null +++ b/src/mistralai/client/models/transcriptionstreamlanguage.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e94333e4bc27 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal +from typing_extensions import Annotated, TypedDict + + +class TranscriptionStreamLanguageTypedDict(TypedDict): + audio_language: str + type: Literal["transcription.language"] + + +class TranscriptionStreamLanguage(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + audio_language: str + + type: Annotated[ + Annotated[ + Literal["transcription.language"], + AfterValidator(validate_const("transcription.language")), + ], + pydantic.Field(alias="type"), + ] = "transcription.language" + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + +try: + TranscriptionStreamLanguage.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/transcriptionstreamsegmentdelta.py b/src/mistralai/client/models/transcriptionstreamsegmentdelta.py new file mode 100644 index 00000000..38e7b0a3 --- /dev/null +++ b/src/mistralai/client/models/transcriptionstreamsegmentdelta.py @@ -0,0 +1,90 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c0a882ce57e5 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict, model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TranscriptionStreamSegmentDeltaTypedDict(TypedDict): + text: str + start: float + end: float + type: Literal["transcription.segment"] + speaker_id: NotRequired[Nullable[str]] + + +class TranscriptionStreamSegmentDelta(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + text: str + + start: float + + end: float + + type: Annotated[ + Annotated[ + Literal["transcription.segment"], + AfterValidator(validate_const("transcription.segment")), + ], + pydantic.Field(alias="type"), + ] = "transcription.segment" + + speaker_id: OptionalNullable[str] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["speaker_id"]) + nullable_fields = set(["speaker_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m + + +try: + TranscriptionStreamSegmentDelta.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/transcriptionstreamtextdelta.py b/src/mistralai/client/models/transcriptionstreamtextdelta.py new file mode 100644 index 00000000..42f0ffb7 --- /dev/null +++ b/src/mistralai/client/models/transcriptionstreamtextdelta.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6086dc081147 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import validate_const +import pydantic +from pydantic import ConfigDict +from pydantic.functional_validators import AfterValidator +from typing import Any, Dict, Literal +from typing_extensions import Annotated, TypedDict + + +class TranscriptionStreamTextDeltaTypedDict(TypedDict): + text: str + type: Literal["transcription.text.delta"] + + +class TranscriptionStreamTextDelta(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + text: str + + type: Annotated[ + Annotated[ + Literal["transcription.text.delta"], + AfterValidator(validate_const("transcription.text.delta")), + ], + pydantic.Field(alias="type"), + ] = "transcription.text.delta" + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + +try: + TranscriptionStreamTextDelta.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/turbinetoollocale.py b/src/mistralai/client/models/turbinetoollocale.py new file mode 100644 index 00000000..42682ee1 --- /dev/null +++ b/src/mistralai/client/models/turbinetoollocale.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2699936a7546 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Dict +from typing_extensions import NotRequired, TypedDict + + +class TurbineToolLocaleTypedDict(TypedDict): + name: NotRequired[Nullable[Dict[str, str]]] + description: NotRequired[Nullable[Dict[str, str]]] + usage_sentence: NotRequired[Nullable[Dict[str, str]]] + working_description: NotRequired[Nullable[Dict[str, str]]] + done_description: NotRequired[Nullable[Dict[str, str]]] + + +class TurbineToolLocale(BaseModel): + name: OptionalNullable[Dict[str, str]] = UNSET + + description: OptionalNullable[Dict[str, str]] = UNSET + + usage_sentence: OptionalNullable[Dict[str, str]] = UNSET + + working_description: OptionalNullable[Dict[str, str]] = UNSET + + done_description: OptionalNullable[Dict[str, str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "name", + "description", + "usage_sentence", + "working_description", + "done_description", + ] + ) + nullable_fields = set( + [ + "name", + "description", + "usage_sentence", + "working_description", + "done_description", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/turbinetoolmeta.py b/src/mistralai/client/models/turbinetoolmeta.py new file mode 100644 index 00000000..bcd4d5f2 --- /dev/null +++ b/src/mistralai/client/models/turbinetoolmeta.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cdb07c3837f7 + +from __future__ import annotations +from .tooltype import ToolType +from .turbinetoollocale import TurbineToolLocale, TurbineToolLocaleTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class TurbineToolMetaTypedDict(TypedDict): + locale: NotRequired[Nullable[TurbineToolLocaleTypedDict]] + tool_type: NotRequired[Nullable[ToolType]] + timeout: NotRequired[Nullable[float]] + private_execution: NotRequired[Nullable[bool]] + + +class TurbineToolMeta(BaseModel): + locale: OptionalNullable[TurbineToolLocale] = UNSET + + tool_type: OptionalNullable[ToolType] = UNSET + + timeout: OptionalNullable[float] = UNSET + + private_execution: OptionalNullable[bool] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["locale", "tool_type", "timeout", "private_execution"]) + nullable_fields = set(["locale", "tool_type", "timeout", "private_execution"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop.py b/src/mistralai/client/models/unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop.py new file mode 100644 index 00000000..3dc55512 --- /dev/null +++ b/src/mistralai/client/models/unarchive_workflow_v1_workflows_workflow_identifier_unarchive_putop.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9df426343c2c + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequestTypedDict( + TypedDict +): + workflow_identifier: str + + +class UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest(BaseModel): + workflow_identifier: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/unarchivemodelresponse.py b/src/mistralai/client/models/unarchivemodelresponse.py new file mode 100644 index 00000000..5cab4c2e --- /dev/null +++ b/src/mistralai/client/models/unarchivemodelresponse.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 22e2ccbb0c80 + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UnarchiveModelResponseTypedDict(TypedDict): + id: str + object: Literal["model"] + archived: NotRequired[bool] + + +class UnarchiveModelResponse(BaseModel): + id: str + + object: Annotated[ + Annotated[Optional[Literal["model"]], AfterValidator(validate_const("model"))], + pydantic.Field(alias="object"), + ] = "model" + + archived: Optional[bool] = False + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["object", "archived"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + UnarchiveModelResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/unschedule_workflow_v1_workflows_schedules_schedule_id_deleteop.py b/src/mistralai/client/models/unschedule_workflow_v1_workflows_schedules_schedule_id_deleteop.py new file mode 100644 index 00000000..eac992d5 --- /dev/null +++ b/src/mistralai/client/models/unschedule_workflow_v1_workflows_schedules_schedule_id_deleteop.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 114f67717003 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata +from typing_extensions import Annotated, TypedDict + + +class UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequestTypedDict(TypedDict): + schedule_id: str + + +class UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequest(BaseModel): + schedule_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] diff --git a/src/mistralai/client/models/update_dataset_record_payload_v1_observability_dataset_records_dataset_record_id_payload_putop.py b/src/mistralai/client/models/update_dataset_record_payload_v1_observability_dataset_records_dataset_record_id_payload_putop.py new file mode 100644 index 00000000..d5a2bd9d --- /dev/null +++ b/src/mistralai/client/models/update_dataset_record_payload_v1_observability_dataset_records_dataset_record_id_payload_putop.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fa5d55a9d6cf + +from __future__ import annotations +from .updatedatasetrecordpayloadrequest import ( + UpdateDatasetRecordPayloadRequest, + UpdateDatasetRecordPayloadRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequestTypedDict( + TypedDict +): + dataset_record_id: str + update_dataset_record_payload_request: UpdateDatasetRecordPayloadRequestTypedDict + + +class UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequest( + BaseModel +): + dataset_record_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_dataset_record_payload_request: Annotated[ + UpdateDatasetRecordPayloadRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/update_dataset_record_properties_v1_observability_dataset_records_dataset_record_id_properties_putop.py b/src/mistralai/client/models/update_dataset_record_properties_v1_observability_dataset_records_dataset_record_id_properties_putop.py new file mode 100644 index 00000000..b828aa80 --- /dev/null +++ b/src/mistralai/client/models/update_dataset_record_properties_v1_observability_dataset_records_dataset_record_id_properties_putop.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b0af26e00bfa + +from __future__ import annotations +from .updatedatasetrecordpropertiesrequest import ( + UpdateDatasetRecordPropertiesRequest, + UpdateDatasetRecordPropertiesRequestTypedDict, +) +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequestTypedDict( + TypedDict +): + dataset_record_id: str + update_dataset_record_properties_request: ( + UpdateDatasetRecordPropertiesRequestTypedDict + ) + + +class UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequest( + BaseModel +): + dataset_record_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_dataset_record_properties_request: Annotated[ + UpdateDatasetRecordPropertiesRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/update_dataset_v1_observability_datasets_dataset_id_patchop.py b/src/mistralai/client/models/update_dataset_v1_observability_datasets_dataset_id_patchop.py new file mode 100644 index 00000000..5a440564 --- /dev/null +++ b/src/mistralai/client/models/update_dataset_v1_observability_datasets_dataset_id_patchop.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7bb459765cba + +from __future__ import annotations +from .updatedatasetrequest import UpdateDatasetRequest, UpdateDatasetRequestTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequestTypedDict(TypedDict): + dataset_id: str + update_dataset_request: UpdateDatasetRequestTypedDict + + +class UpdateDatasetV1ObservabilityDatasetsDatasetIDPatchRequest(BaseModel): + dataset_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_dataset_request: Annotated[ + UpdateDatasetRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/update_judge_v1_observability_judges_judge_id_putop.py b/src/mistralai/client/models/update_judge_v1_observability_judges_judge_id_putop.py new file mode 100644 index 00000000..41c3a365 --- /dev/null +++ b/src/mistralai/client/models/update_judge_v1_observability_judges_judge_id_putop.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a1bace5342e6 + +from __future__ import annotations +from .updatejudgerequest import UpdateJudgeRequest, UpdateJudgeRequestTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequestTypedDict(TypedDict): + judge_id: str + update_judge_request: UpdateJudgeRequestTypedDict + + +class UpdateJudgeV1ObservabilityJudgesJudgeIDPutRequest(BaseModel): + judge_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_judge_request: Annotated[ + UpdateJudgeRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/update_run_info_v1_rag_ingestion_pipeline_configurations_id_run_info_putop.py b/src/mistralai/client/models/update_run_info_v1_rag_ingestion_pipeline_configurations_id_run_info_putop.py new file mode 100644 index 00000000..6b7d24d4 --- /dev/null +++ b/src/mistralai/client/models/update_run_info_v1_rag_ingestion_pipeline_configurations_id_run_info_putop.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2a14ebf4ef57 + +from __future__ import annotations +from .updateruninfo import UpdateRunInfo, UpdateRunInfoTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequestTypedDict( + TypedDict +): + id: str + update_run_info: UpdateRunInfoTypedDict + + +class UpdateRunInfoV1RagIngestionPipelineConfigurationsIDRunInfoPutRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_run_info: Annotated[ + UpdateRunInfo, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/update_voice_v1_audio_voices_voice_id_patchop.py b/src/mistralai/client/models/update_voice_v1_audio_voices_voice_id_patchop.py new file mode 100644 index 00000000..a11b626a --- /dev/null +++ b/src/mistralai/client/models/update_voice_v1_audio_voices_voice_id_patchop.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 399da05bd75e + +from __future__ import annotations +from .voiceupdaterequest import VoiceUpdateRequest, VoiceUpdateRequestTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateVoiceV1AudioVoicesVoiceIDPatchRequestTypedDict(TypedDict): + voice_id: str + voice_update_request: VoiceUpdateRequestTypedDict + + +class UpdateVoiceV1AudioVoicesVoiceIDPatchRequest(BaseModel): + voice_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + voice_update_request: Annotated[ + VoiceUpdateRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/update_workflow_execution_v1_workflows_executions_execution_id_updates_postop.py b/src/mistralai/client/models/update_workflow_execution_v1_workflows_executions_execution_id_updates_postop.py new file mode 100644 index 00000000..30ff2bae --- /dev/null +++ b/src/mistralai/client/models/update_workflow_execution_v1_workflows_executions_execution_id_updates_postop.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5799cc4ab66e + +from __future__ import annotations +from .updateinvocationbody import UpdateInvocationBody, UpdateInvocationBodyTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequestTypedDict( + TypedDict +): + execution_id: str + update_invocation_body: UpdateInvocationBodyTypedDict + + +class UpdateWorkflowExecutionV1WorkflowsExecutionsExecutionIDUpdatesPostRequest( + BaseModel +): + execution_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + update_invocation_body: Annotated[ + UpdateInvocationBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/update_workflow_v1_workflows_workflow_identifier_putop.py b/src/mistralai/client/models/update_workflow_v1_workflows_workflow_identifier_putop.py new file mode 100644 index 00000000..9ee9b6d2 --- /dev/null +++ b/src/mistralai/client/models/update_workflow_v1_workflows_workflow_identifier_putop.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c537bd5a9dd1 + +from __future__ import annotations +from .workflowupdaterequest import WorkflowUpdateRequest, WorkflowUpdateRequestTypedDict +from mistralai.client.types import BaseModel +from mistralai.client.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing_extensions import Annotated, TypedDict + + +class UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequestTypedDict(TypedDict): + workflow_identifier: str + workflow_update_request: WorkflowUpdateRequestTypedDict + + +class UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequest(BaseModel): + workflow_identifier: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + workflow_update_request: Annotated[ + WorkflowUpdateRequest, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] diff --git a/src/mistralai/client/models/updateagentrequest.py b/src/mistralai/client/models/updateagentrequest.py new file mode 100644 index 00000000..7bb9686b --- /dev/null +++ b/src/mistralai/client/models/updateagentrequest.py @@ -0,0 +1,146 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 914b4b2be67a + +from __future__ import annotations +from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict +from .completionargs import CompletionArgs, CompletionArgsTypedDict +from .customconnector import CustomConnector, CustomConnectorTypedDict +from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict +from .functiontool import FunctionTool, FunctionToolTypedDict +from .guardrailconfig import GuardrailConfig, GuardrailConfigTypedDict +from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict +from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict +from .websearchtool import WebSearchTool, WebSearchToolTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import Field, model_serializer +from typing import Any, Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +UpdateAgentRequestToolTypedDict = TypeAliasType( + "UpdateAgentRequestToolTypedDict", + Union[ + FunctionToolTypedDict, + WebSearchToolTypedDict, + WebSearchPremiumToolTypedDict, + CodeInterpreterToolTypedDict, + ImageGenerationToolTypedDict, + DocumentLibraryToolTypedDict, + CustomConnectorTypedDict, + ], +) + + +UpdateAgentRequestTool = Annotated[ + Union[ + CodeInterpreterTool, + CustomConnector, + DocumentLibraryTool, + FunctionTool, + ImageGenerationTool, + WebSearchTool, + WebSearchPremiumTool, + ], + Field(discriminator="type"), +] + + +class UpdateAgentRequestTypedDict(TypedDict): + instructions: NotRequired[Nullable[str]] + r"""Instruction prompt the model will follow during the conversation.""" + tools: NotRequired[List[UpdateAgentRequestToolTypedDict]] + r"""List of tools which are available to the model during the conversation.""" + completion_args: NotRequired[CompletionArgsTypedDict] + r"""White-listed arguments from the completion API""" + guardrails: NotRequired[Nullable[List[GuardrailConfigTypedDict]]] + model: NotRequired[Nullable[str]] + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + handoffs: NotRequired[Nullable[List[str]]] + deployment_chat: NotRequired[Nullable[bool]] + metadata: NotRequired[Nullable[Dict[str, Any]]] + version_message: NotRequired[Nullable[str]] + + +class UpdateAgentRequest(BaseModel): + instructions: OptionalNullable[str] = UNSET + r"""Instruction prompt the model will follow during the conversation.""" + + tools: Optional[List[UpdateAgentRequestTool]] = None + r"""List of tools which are available to the model during the conversation.""" + + completion_args: Optional[CompletionArgs] = None + r"""White-listed arguments from the completion API""" + + guardrails: OptionalNullable[List[GuardrailConfig]] = UNSET + + model: OptionalNullable[str] = UNSET + + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + handoffs: OptionalNullable[List[str]] = UNSET + + deployment_chat: OptionalNullable[bool] = UNSET + + metadata: OptionalNullable[Dict[str, Any]] = UNSET + + version_message: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "instructions", + "tools", + "completion_args", + "guardrails", + "model", + "name", + "description", + "handoffs", + "deployment_chat", + "metadata", + "version_message", + ] + ) + nullable_fields = set( + [ + "instructions", + "guardrails", + "model", + "name", + "description", + "handoffs", + "deployment_chat", + "metadata", + "version_message", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/updateconnectorrequest.py b/src/mistralai/client/models/updateconnectorrequest.py new file mode 100644 index 00000000..145091d4 --- /dev/null +++ b/src/mistralai/client/models/updateconnectorrequest.py @@ -0,0 +1,121 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a761cd154109 + +from __future__ import annotations +from .authdata import AuthData, AuthDataTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class UpdateConnectorRequestTypedDict(TypedDict): + title: NotRequired[Nullable[str]] + r"""Optional human-readable title for the connector.""" + name: NotRequired[Nullable[str]] + r"""The name of the connector.""" + description: NotRequired[Nullable[str]] + r"""The description of the connector.""" + icon_url: NotRequired[Nullable[str]] + r"""The optional url of the icon you want to associate to the connector.""" + system_prompt: NotRequired[Nullable[str]] + r"""Optional system prompt for the connector.""" + connection_config: NotRequired[Nullable[Dict[str, Any]]] + r"""Optional new connection config.""" + connection_secrets: NotRequired[Nullable[Dict[str, Any]]] + r"""Optional new connection secrets""" + server: NotRequired[Nullable[str]] + r"""New server url for your mcp connector.""" + headers: NotRequired[Nullable[Dict[str, Any]]] + r"""New headers for your mcp connector.""" + auth_data: NotRequired[Nullable[AuthDataTypedDict]] + r"""New authentication data for your mcp connector.""" + + +class UpdateConnectorRequest(BaseModel): + title: OptionalNullable[str] = UNSET + r"""Optional human-readable title for the connector.""" + + name: OptionalNullable[str] = UNSET + r"""The name of the connector.""" + + description: OptionalNullable[str] = UNSET + r"""The description of the connector.""" + + icon_url: OptionalNullable[str] = UNSET + r"""The optional url of the icon you want to associate to the connector.""" + + system_prompt: OptionalNullable[str] = UNSET + r"""Optional system prompt for the connector.""" + + connection_config: OptionalNullable[Dict[str, Any]] = UNSET + r"""Optional new connection config.""" + + connection_secrets: OptionalNullable[Dict[str, Any]] = UNSET + r"""Optional new connection secrets""" + + server: OptionalNullable[str] = UNSET + r"""New server url for your mcp connector.""" + + headers: OptionalNullable[Dict[str, Any]] = UNSET + r"""New headers for your mcp connector.""" + + auth_data: OptionalNullable[AuthData] = UNSET + r"""New authentication data for your mcp connector.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "title", + "name", + "description", + "icon_url", + "system_prompt", + "connection_config", + "connection_secrets", + "server", + "headers", + "auth_data", + ] + ) + nullable_fields = set( + [ + "title", + "name", + "description", + "icon_url", + "system_prompt", + "connection_config", + "connection_secrets", + "server", + "headers", + "auth_data", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/updatedatasetrecordpayloadrequest.py b/src/mistralai/client/models/updatedatasetrecordpayloadrequest.py new file mode 100644 index 00000000..155ea78d --- /dev/null +++ b/src/mistralai/client/models/updatedatasetrecordpayloadrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bd45f357a538 + +from __future__ import annotations +from .conversationpayload import ConversationPayload, ConversationPayloadTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class UpdateDatasetRecordPayloadRequestTypedDict(TypedDict): + payload: ConversationPayloadTypedDict + + +class UpdateDatasetRecordPayloadRequest(BaseModel): + payload: ConversationPayload diff --git a/src/mistralai/client/models/updatedatasetrecordpropertiesrequest.py b/src/mistralai/client/models/updatedatasetrecordpropertiesrequest.py new file mode 100644 index 00000000..ccba4a5c --- /dev/null +++ b/src/mistralai/client/models/updatedatasetrecordpropertiesrequest.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c457ead40a69 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Any, Dict +from typing_extensions import TypedDict + + +class UpdateDatasetRecordPropertiesRequestTypedDict(TypedDict): + properties: Dict[str, Any] + + +class UpdateDatasetRecordPropertiesRequest(BaseModel): + properties: Dict[str, Any] diff --git a/src/mistralai/client/models/updatedatasetrequest.py b/src/mistralai/client/models/updatedatasetrequest.py new file mode 100644 index 00000000..ddbaad12 --- /dev/null +++ b/src/mistralai/client/models/updatedatasetrequest.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bbb067caa23f + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class UpdateDatasetRequestTypedDict(TypedDict): + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + + +class UpdateDatasetRequest(BaseModel): + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "description"]) + nullable_fields = set(["name", "description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/updatedefinition.py b/src/mistralai/client/models/updatedefinition.py new file mode 100644 index 00000000..e878c876 --- /dev/null +++ b/src/mistralai/client/models/updatedefinition.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 143f97683a02 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class UpdateDefinitionTypedDict(TypedDict): + name: str + r"""Name of the update""" + input_schema: Dict[str, Any] + r"""Input JSON schema of the update's model""" + description: NotRequired[Nullable[str]] + r"""Description of the update""" + output_schema: NotRequired[Nullable[Dict[str, Any]]] + r"""Output JSON schema of the update's model""" + + +class UpdateDefinition(BaseModel): + name: str + r"""Name of the update""" + + input_schema: Dict[str, Any] + r"""Input JSON schema of the update's model""" + + description: OptionalNullable[str] = UNSET + r"""Description of the update""" + + output_schema: OptionalNullable[Dict[str, Any]] = UNSET + r"""Output JSON schema of the update's model""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "output_schema"]) + nullable_fields = set(["description", "output_schema"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/updatedocumentrequest.py b/src/mistralai/client/models/updatedocumentrequest.py new file mode 100644 index 00000000..5f67ea69 --- /dev/null +++ b/src/mistralai/client/models/updatedocumentrequest.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a8cfda07d337 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Dict, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +AttributesTypedDict = TypeAliasType( + "AttributesTypedDict", + Union[ + bool, str, int, float, datetime, List[str], List[int], List[float], List[bool] + ], +) + + +Attributes = TypeAliasType( + "Attributes", + Union[ + bool, str, int, float, datetime, List[str], List[int], List[float], List[bool] + ], +) + + +class UpdateDocumentRequestTypedDict(TypedDict): + name: NotRequired[str] + attributes: NotRequired[Nullable[Dict[str, AttributesTypedDict]]] + + +class UpdateDocumentRequest(BaseModel): + name: Optional[str] = None + + attributes: OptionalNullable[Dict[str, Attributes]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "attributes"]) + nullable_fields = set(["attributes"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/updateinvocationbody.py b/src/mistralai/client/models/updateinvocationbody.py new file mode 100644 index 00000000..a300bd20 --- /dev/null +++ b/src/mistralai/client/models/updateinvocationbody.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b8558eff0be0 + +from __future__ import annotations +from .networkencodedinput import NetworkEncodedInput, NetworkEncodedInputTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +UpdateInvocationBodyInputTypedDict = TypeAliasType( + "UpdateInvocationBodyInputTypedDict", + Union[NetworkEncodedInputTypedDict, Dict[str, Any]], +) +r"""Input data for the update, matching its schema""" + + +UpdateInvocationBodyInput = TypeAliasType( + "UpdateInvocationBodyInput", Union[NetworkEncodedInput, Dict[str, Any]] +) +r"""Input data for the update, matching its schema""" + + +class UpdateInvocationBodyTypedDict(TypedDict): + name: str + r"""The name of the update to request""" + input: NotRequired[Nullable[UpdateInvocationBodyInputTypedDict]] + r"""Input data for the update, matching its schema""" + + +class UpdateInvocationBody(BaseModel): + name: str + r"""The name of the update to request""" + + input: OptionalNullable[UpdateInvocationBodyInput] = UNSET + r"""Input data for the update, matching its schema""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input"]) + nullable_fields = set(["input"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/updatejudgerequest.py b/src/mistralai/client/models/updatejudgerequest.py new file mode 100644 index 00000000..04c86ab6 --- /dev/null +++ b/src/mistralai/client/models/updatejudgerequest.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f6ad6fb901a0 + +from __future__ import annotations +from .judgeclassificationoutput import ( + JudgeClassificationOutput, + JudgeClassificationOutputTypedDict, +) +from .judgeregressionoutput import JudgeRegressionOutput, JudgeRegressionOutputTypedDict +from mistralai.client.types import BaseModel +from pydantic import Field +from typing import List, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +UpdateJudgeRequestOutputTypedDict = TypeAliasType( + "UpdateJudgeRequestOutputTypedDict", + Union[JudgeClassificationOutputTypedDict, JudgeRegressionOutputTypedDict], +) + + +UpdateJudgeRequestOutput = Annotated[ + Union[JudgeClassificationOutput, JudgeRegressionOutput], Field(discriminator="type") +] + + +class UpdateJudgeRequestTypedDict(TypedDict): + name: str + description: str + model_name: str + output: UpdateJudgeRequestOutputTypedDict + instructions: str + tools: List[str] + + +class UpdateJudgeRequest(BaseModel): + name: str + + description: str + + model_name: str + + output: UpdateJudgeRequestOutput + + instructions: str + + tools: List[str] diff --git a/src/mistralai/client/models/updatelibraryrequest.py b/src/mistralai/client/models/updatelibraryrequest.py new file mode 100644 index 00000000..64af28c5 --- /dev/null +++ b/src/mistralai/client/models/updatelibraryrequest.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 51bc63885337 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class UpdateLibraryRequestTypedDict(TypedDict): + name: NotRequired[str] + description: NotRequired[Nullable[str]] + + +class UpdateLibraryRequest(BaseModel): + name: Optional[str] = None + + description: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "description"]) + nullable_fields = set(["description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/updatemodelrequest.py b/src/mistralai/client/models/updatemodelrequest.py new file mode 100644 index 00000000..0179ba14 --- /dev/null +++ b/src/mistralai/client/models/updatemodelrequest.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: fe649967751e + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class UpdateModelRequestTypedDict(TypedDict): + name: NotRequired[Nullable[str]] + description: NotRequired[Nullable[str]] + + +class UpdateModelRequest(BaseModel): + name: OptionalNullable[str] = UNSET + + description: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "description"]) + nullable_fields = set(["name", "description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/updateruninfo.py b/src/mistralai/client/models/updateruninfo.py new file mode 100644 index 00000000..91038d1d --- /dev/null +++ b/src/mistralai/client/models/updateruninfo.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4330bdaa00b9 + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class UpdateRunInfoTypedDict(TypedDict): + execution_time: datetime + chunks_count: int + + +class UpdateRunInfo(BaseModel): + execution_time: datetime + + chunks_count: int diff --git a/src/mistralai/client/models/updateworkflowresponse.py b/src/mistralai/client/models/updateworkflowresponse.py new file mode 100644 index 00000000..699bef98 --- /dev/null +++ b/src/mistralai/client/models/updateworkflowresponse.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f5dcf717a0a1 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Any +from typing_extensions import TypedDict + + +class UpdateWorkflowResponseTypedDict(TypedDict): + update_name: str + result: Any + r"""The result of the Update workflow call""" + + +class UpdateWorkflowResponse(BaseModel): + update_name: str + + result: Any + r"""The result of the Update workflow call""" diff --git a/src/mistralai/client/models/usageinfo.py b/src/mistralai/client/models/usageinfo.py new file mode 100644 index 00000000..f23699d0 --- /dev/null +++ b/src/mistralai/client/models/usageinfo.py @@ -0,0 +1,80 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 54adb9a3af16 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import ConfigDict, model_serializer +from typing import Any, Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class UsageInfoTypedDict(TypedDict): + prompt_tokens: NotRequired[int] + completion_tokens: NotRequired[int] + total_tokens: NotRequired[int] + prompt_audio_seconds: NotRequired[Nullable[int]] + + +class UsageInfo(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + + prompt_tokens: Optional[int] = 0 + + completion_tokens: Optional[int] = 0 + + total_tokens: Optional[int] = 0 + + prompt_audio_seconds: OptionalNullable[int] = UNSET + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "prompt_tokens", + "completion_tokens", + "total_tokens", + "prompt_audio_seconds", + ] + ) + nullable_fields = set(["prompt_audio_seconds"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v + + return m diff --git a/src/mistralai/client/models/usageinfo_dollar_defs.py b/src/mistralai/client/models/usageinfo_dollar_defs.py new file mode 100644 index 00000000..83bb2fe8 --- /dev/null +++ b/src/mistralai/client/models/usageinfo_dollar_defs.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d543506af998 + +from __future__ import annotations +from .prompttokensdetails import PromptTokensDetails, PromptTokensDetailsTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class UsageInfoDollarDefsTypedDict(TypedDict): + prompt_audio_seconds: NotRequired[Nullable[int]] + prompt_tokens: NotRequired[int] + total_tokens: NotRequired[int] + completion_tokens: NotRequired[Nullable[int]] + request_count: NotRequired[Nullable[int]] + prompt_tokens_details: NotRequired[Nullable[PromptTokensDetailsTypedDict]] + prompt_token_details: NotRequired[Nullable[PromptTokensDetailsTypedDict]] + num_cached_tokens: NotRequired[Nullable[int]] + + +class UsageInfoDollarDefs(BaseModel): + prompt_audio_seconds: OptionalNullable[int] = UNSET + + prompt_tokens: Optional[int] = 0 + + total_tokens: Optional[int] = 0 + + completion_tokens: OptionalNullable[int] = UNSET + + request_count: OptionalNullable[int] = UNSET + + prompt_tokens_details: OptionalNullable[PromptTokensDetails] = UNSET + + prompt_token_details: OptionalNullable[PromptTokensDetails] = UNSET + + num_cached_tokens: OptionalNullable[int] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "prompt_audio_seconds", + "prompt_tokens", + "total_tokens", + "completion_tokens", + "request_count", + "prompt_tokens_details", + "prompt_token_details", + "num_cached_tokens", + ] + ) + nullable_fields = set( + [ + "prompt_audio_seconds", + "completion_tokens", + "request_count", + "prompt_tokens_details", + "prompt_token_details", + "num_cached_tokens", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/usermessage.py b/src/mistralai/client/models/usermessage.py new file mode 100644 index 00000000..7b4b5563 --- /dev/null +++ b/src/mistralai/client/models/usermessage.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: cb583483acf4 + +from __future__ import annotations +from .contentchunk import ContentChunk, ContentChunkTypedDict +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, TypeAliasType, TypedDict + + +UserMessageContentTypedDict = TypeAliasType( + "UserMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] +) + + +UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]]) + + +class UserMessageTypedDict(TypedDict): + content: Nullable[UserMessageContentTypedDict] + role: Literal["user"] + + +class UserMessage(BaseModel): + content: Nullable[UserMessageContent] + + role: Annotated[ + Annotated[Literal["user"], AfterValidator(validate_const("user"))], + pydantic.Field(alias="role"), + ] = "user" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m + + +try: + UserMessage.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/validationerror.py b/src/mistralai/client/models/validationerror.py new file mode 100644 index 00000000..5fe796db --- /dev/null +++ b/src/mistralai/client/models/validationerror.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 15df3c7368ab + +from __future__ import annotations +from mistralai.client.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Any, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int]) + + +Loc = TypeAliasType("Loc", Union[str, int]) + + +class ContextTypedDict(TypedDict): + pass + + +class Context(BaseModel): + pass + + +class ValidationErrorTypedDict(TypedDict): + loc: List[LocTypedDict] + msg: str + type: str + input: NotRequired[Any] + ctx: NotRequired[ContextTypedDict] + + +class ValidationError(BaseModel): + loc: List[Loc] + + msg: str + + type: str + + input: Optional[Any] = None + + ctx: Optional[Context] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["input", "ctx"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/voicecreaterequest.py b/src/mistralai/client/models/voicecreaterequest.py new file mode 100644 index 00000000..99df178d --- /dev/null +++ b/src/mistralai/client/models/voicecreaterequest.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9a1752117dec + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class VoiceCreateRequestTypedDict(TypedDict): + r"""Request model for creating a new voice with base64 audio.""" + + name: str + sample_audio: str + r"""Base64-encoded audio file""" + slug: NotRequired[Nullable[str]] + languages: NotRequired[List[str]] + gender: NotRequired[Nullable[str]] + age: NotRequired[Nullable[int]] + tags: NotRequired[Nullable[List[str]]] + color: NotRequired[Nullable[str]] + retention_notice: NotRequired[int] + sample_filename: NotRequired[Nullable[str]] + r"""Original filename for extension detection""" + + +class VoiceCreateRequest(BaseModel): + r"""Request model for creating a new voice with base64 audio.""" + + name: str + + sample_audio: str + r"""Base64-encoded audio file""" + + slug: OptionalNullable[str] = UNSET + + languages: Optional[List[str]] = None + + gender: OptionalNullable[str] = UNSET + + age: OptionalNullable[int] = UNSET + + tags: OptionalNullable[List[str]] = UNSET + + color: OptionalNullable[str] = UNSET + + retention_notice: Optional[int] = 30 + + sample_filename: OptionalNullable[str] = UNSET + r"""Original filename for extension detection""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "slug", + "languages", + "gender", + "age", + "tags", + "color", + "retention_notice", + "sample_filename", + ] + ) + nullable_fields = set( + ["slug", "gender", "age", "tags", "color", "sample_filename"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/voicelistresponse.py b/src/mistralai/client/models/voicelistresponse.py new file mode 100644 index 00000000..eda768f5 --- /dev/null +++ b/src/mistralai/client/models/voicelistresponse.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: df4b1182d193 + +from __future__ import annotations +from .voiceresponse import VoiceResponse, VoiceResponseTypedDict +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class VoiceListResponseTypedDict(TypedDict): + r"""Schema for voice list response""" + + items: List[VoiceResponseTypedDict] + total: int + page: int + page_size: int + total_pages: int + + +class VoiceListResponse(BaseModel): + r"""Schema for voice list response""" + + items: List[VoiceResponse] + + total: int + + page: int + + page_size: int + + total_pages: int diff --git a/src/mistralai/client/models/voiceresponse.py b/src/mistralai/client/models/voiceresponse.py new file mode 100644 index 00000000..6fa3987b --- /dev/null +++ b/src/mistralai/client/models/voiceresponse.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 24138e419fae + +from __future__ import annotations +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class VoiceResponseTypedDict(TypedDict): + r"""Schema for voice response""" + + name: str + id: str + created_at: datetime + user_id: Nullable[str] + slug: NotRequired[Nullable[str]] + languages: NotRequired[List[str]] + gender: NotRequired[Nullable[str]] + age: NotRequired[Nullable[int]] + tags: NotRequired[Nullable[List[str]]] + color: NotRequired[Nullable[str]] + retention_notice: NotRequired[int] + + +class VoiceResponse(BaseModel): + r"""Schema for voice response""" + + name: str + + id: str + + created_at: datetime + + user_id: Nullable[str] + + slug: OptionalNullable[str] = UNSET + + languages: Optional[List[str]] = None + + gender: OptionalNullable[str] = UNSET + + age: OptionalNullable[int] = UNSET + + tags: OptionalNullable[List[str]] = UNSET + + color: OptionalNullable[str] = UNSET + + retention_notice: Optional[int] = 30 + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["slug", "languages", "gender", "age", "tags", "color", "retention_notice"] + ) + nullable_fields = set(["slug", "gender", "age", "tags", "color", "user_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/voiceupdaterequest.py b/src/mistralai/client/models/voiceupdaterequest.py new file mode 100644 index 00000000..717316b0 --- /dev/null +++ b/src/mistralai/client/models/voiceupdaterequest.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 798f8ff225de + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class VoiceUpdateRequestTypedDict(TypedDict): + r"""Request model for partially updating voice metadata.""" + + name: NotRequired[Nullable[str]] + languages: NotRequired[Nullable[List[str]]] + gender: NotRequired[Nullable[str]] + age: NotRequired[Nullable[int]] + tags: NotRequired[Nullable[List[str]]] + + +class VoiceUpdateRequest(BaseModel): + r"""Request model for partially updating voice metadata.""" + + name: OptionalNullable[str] = UNSET + + languages: OptionalNullable[List[str]] = UNSET + + gender: OptionalNullable[str] = UNSET + + age: OptionalNullable[int] = UNSET + + tags: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "languages", "gender", "age", "tags"]) + nullable_fields = set(["name", "languages", "gender", "age", "tags"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/wandbintegration.py b/src/mistralai/client/models/wandbintegration.py new file mode 100644 index 00000000..0e444bec --- /dev/null +++ b/src/mistralai/client/models/wandbintegration.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4823c1e80942 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WandbIntegrationTypedDict(TypedDict): + project: str + r"""The name of the project that the new run will be created under.""" + api_key: str + r"""The WandB API key to use for authentication.""" + type: Literal["wandb"] + name: NotRequired[Nullable[str]] + r"""A display name to set for the run. If not set, will use the job ID as the name.""" + run_name: NotRequired[Nullable[str]] + + +class WandbIntegration(BaseModel): + project: str + r"""The name of the project that the new run will be created under.""" + + api_key: str + r"""The WandB API key to use for authentication.""" + + type: Annotated[ + Annotated[Literal["wandb"], AfterValidator(validate_const("wandb"))], + pydantic.Field(alias="type"), + ] = "wandb" + + name: OptionalNullable[str] = UNSET + r"""A display name to set for the run. If not set, will use the job ID as the name.""" + + run_name: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "run_name"]) + nullable_fields = set(["name", "run_name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WandbIntegration.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/wandbintegrationresult.py b/src/mistralai/client/models/wandbintegrationresult.py new file mode 100644 index 00000000..e64bb27c --- /dev/null +++ b/src/mistralai/client/models/wandbintegrationresult.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8787b4ad5458 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WandbIntegrationResultTypedDict(TypedDict): + project: str + r"""The name of the project that the new run will be created under.""" + type: Literal["wandb"] + name: NotRequired[Nullable[str]] + r"""A display name to set for the run. If not set, will use the job ID as the name.""" + run_name: NotRequired[Nullable[str]] + url: NotRequired[Nullable[str]] + + +class WandbIntegrationResult(BaseModel): + project: str + r"""The name of the project that the new run will be created under.""" + + type: Annotated[ + Annotated[Literal["wandb"], AfterValidator(validate_const("wandb"))], + pydantic.Field(alias="type"), + ] = "wandb" + + name: OptionalNullable[str] = UNSET + r"""A display name to set for the run. If not set, will use the job ID as the name.""" + + run_name: OptionalNullable[str] = UNSET + + url: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "run_name", "url"]) + nullable_fields = set(["name", "run_name", "url"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WandbIntegrationResult.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/websearchpremiumtool.py b/src/mistralai/client/models/websearchpremiumtool.py new file mode 100644 index 00000000..5c929e94 --- /dev/null +++ b/src/mistralai/client/models/websearchpremiumtool.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bfe88af887e3 + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WebSearchPremiumToolTypedDict(TypedDict): + tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] + type: Literal["web_search_premium"] + + +class WebSearchPremiumTool(BaseModel): + tool_configuration: OptionalNullable[ToolConfiguration] = UNSET + + type: Annotated[ + Annotated[ + Literal["web_search_premium"], + AfterValidator(validate_const("web_search_premium")), + ], + pydantic.Field(alias="type"), + ] = "web_search_premium" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_configuration"]) + nullable_fields = set(["tool_configuration"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WebSearchPremiumTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/websearchtool.py b/src/mistralai/client/models/websearchtool.py new file mode 100644 index 00000000..f82b6ec1 --- /dev/null +++ b/src/mistralai/client/models/websearchtool.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 26b0903423e5 + +from __future__ import annotations +from .toolconfiguration import ToolConfiguration, ToolConfigurationTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WebSearchToolTypedDict(TypedDict): + tool_configuration: NotRequired[Nullable[ToolConfigurationTypedDict]] + type: Literal["web_search"] + + +class WebSearchTool(BaseModel): + tool_configuration: OptionalNullable[ToolConfiguration] = UNSET + + type: Annotated[ + Annotated[Literal["web_search"], AfterValidator(validate_const("web_search"))], + pydantic.Field(alias="type"), + ] = "web_search" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["tool_configuration"]) + nullable_fields = set(["tool_configuration"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WebSearchTool.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/workflow.py b/src/mistralai/client/models/workflow.py new file mode 100644 index 00000000..2eeac0dc --- /dev/null +++ b/src/mistralai/client/models/workflow.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1548cd73984e + +from __future__ import annotations +from .workflowtype import WorkflowType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class WorkflowTypedDict(TypedDict): + id: str + r"""Unique identifier of the workflow""" + name: str + r"""Name of the workflow""" + display_name: str + r"""Display name of the workflow""" + type: WorkflowType + customer_id: str + r"""Customer ID of the workflow""" + workspace_id: str + r"""Workspace ID of the workflow""" + description: NotRequired[Nullable[str]] + r"""Description of the workflow""" + shared_namespace: NotRequired[Nullable[str]] + r"""Reserved namespace for shared workflows (e.g., 'shared:my-shared-workflow')""" + available_in_chat_assistant: NotRequired[bool] + r"""Whether the workflow is available in chat assistant""" + is_technical: NotRequired[bool] + r"""Whether the workflow is technical (e.g. SDK-managed)""" + on_behalf_of: NotRequired[bool] + r"""Whether the workflow must run associated to a user's identity""" + archived: NotRequired[bool] + r"""Whether the workflow is archived""" + + +class Workflow(BaseModel): + id: str + r"""Unique identifier of the workflow""" + + name: str + r"""Name of the workflow""" + + display_name: str + r"""Display name of the workflow""" + + type: WorkflowType + + customer_id: str + r"""Customer ID of the workflow""" + + workspace_id: str + r"""Workspace ID of the workflow""" + + description: OptionalNullable[str] = UNSET + r"""Description of the workflow""" + + shared_namespace: OptionalNullable[str] = UNSET + r"""Reserved namespace for shared workflows (e.g., 'shared:my-shared-workflow')""" + + available_in_chat_assistant: Optional[bool] = False + r"""Whether the workflow is available in chat assistant""" + + is_technical: Optional[bool] = False + r"""Whether the workflow is technical (e.g. SDK-managed)""" + + on_behalf_of: Optional[bool] = False + r"""Whether the workflow must run associated to a user's identity""" + + archived: Optional[bool] = False + r"""Whether the workflow is archived""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "description", + "shared_namespace", + "available_in_chat_assistant", + "is_technical", + "on_behalf_of", + "archived", + ] + ) + nullable_fields = set(["description", "shared_namespace"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowarchiveresponse.py b/src/mistralai/client/models/workflowarchiveresponse.py new file mode 100644 index 00000000..18eeccf2 --- /dev/null +++ b/src/mistralai/client/models/workflowarchiveresponse.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 64c479b7f9da + +from __future__ import annotations +from .workflow import Workflow, WorkflowTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowArchiveResponseTypedDict(TypedDict): + workflow: WorkflowTypedDict + + +class WorkflowArchiveResponse(BaseModel): + workflow: Workflow diff --git a/src/mistralai/client/models/workflowbasicdefinition.py b/src/mistralai/client/models/workflowbasicdefinition.py new file mode 100644 index 00000000..d2f3db1f --- /dev/null +++ b/src/mistralai/client/models/workflowbasicdefinition.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 34623036478d + +from __future__ import annotations +from .workflowmetadata import WorkflowMetadata, WorkflowMetadataTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class WorkflowBasicDefinitionTypedDict(TypedDict): + id: str + name: str + r"""The name of the workflow""" + display_name: str + r"""The display name of the workflow""" + archived: bool + r"""Whether the workflow is archived""" + description: NotRequired[Nullable[str]] + r"""A description of the workflow""" + metadata: NotRequired[WorkflowMetadataTypedDict] + + +class WorkflowBasicDefinition(BaseModel): + id: str + + name: str + r"""The name of the workflow""" + + display_name: str + r"""The display name of the workflow""" + + archived: bool + r"""Whether the workflow is archived""" + + description: OptionalNullable[str] = UNSET + r"""A description of the workflow""" + + metadata: Optional[WorkflowMetadata] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["description", "metadata"]) + nullable_fields = set(["description"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowcodedefinition.py b/src/mistralai/client/models/workflowcodedefinition.py new file mode 100644 index 00000000..84444ce6 --- /dev/null +++ b/src/mistralai/client/models/workflowcodedefinition.py @@ -0,0 +1,97 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 36fd5b898ddd + +from __future__ import annotations +from .querydefinition import QueryDefinition, QueryDefinitionTypedDict +from .signaldefinition import SignalDefinition, SignalDefinitionTypedDict +from .updatedefinition import UpdateDefinition, UpdateDefinitionTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class WorkflowCodeDefinitionTypedDict(TypedDict): + input_schema: Dict[str, Any] + r"""Input schema of the workflow's run method""" + output_schema: NotRequired[Nullable[Dict[str, Any]]] + r"""Output schema of the workflow's run method""" + signals: NotRequired[List[SignalDefinitionTypedDict]] + r"""Signal handlers defined by the workflow""" + queries: NotRequired[List[QueryDefinitionTypedDict]] + r"""Query handlers defined by the workflow""" + updates: NotRequired[List[UpdateDefinitionTypedDict]] + r"""Update handlers defined by the workflow""" + enforce_determinism: NotRequired[bool] + r"""Whether the workflow enforces deterministic execution""" + execution_timeout: NotRequired[float] + r"""Maximum total execution time including retries and continue-as-new""" + plugin_metadata: NotRequired[Nullable[Dict[str, Any]]] + r"""Plugin-specific metadata (e.g. connector declarations)""" + + +class WorkflowCodeDefinition(BaseModel): + input_schema: Dict[str, Any] + r"""Input schema of the workflow's run method""" + + output_schema: OptionalNullable[Dict[str, Any]] = UNSET + r"""Output schema of the workflow's run method""" + + signals: Optional[List[SignalDefinition]] = None + r"""Signal handlers defined by the workflow""" + + queries: Optional[List[QueryDefinition]] = None + r"""Query handlers defined by the workflow""" + + updates: Optional[List[UpdateDefinition]] = None + r"""Update handlers defined by the workflow""" + + enforce_determinism: Optional[bool] = False + r"""Whether the workflow enforces deterministic execution""" + + execution_timeout: Optional[float] = None + r"""Maximum total execution time including retries and continue-as-new""" + + plugin_metadata: OptionalNullable[Dict[str, Any]] = UNSET + r"""Plugin-specific metadata (e.g. connector declarations)""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "output_schema", + "signals", + "queries", + "updates", + "enforce_determinism", + "execution_timeout", + "plugin_metadata", + ] + ) + nullable_fields = set(["output_schema", "plugin_metadata"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workfloweventtype.py b/src/mistralai/client/models/workfloweventtype.py new file mode 100644 index 00000000..8c386b01 --- /dev/null +++ b/src/mistralai/client/models/workfloweventtype.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b4aeeb03b57a + +from __future__ import annotations +from typing import Literal + + +WorkflowEventType = Literal[ + "WORKFLOW_EXECUTION_STARTED", + "WORKFLOW_EXECUTION_COMPLETED", + "WORKFLOW_EXECUTION_FAILED", + "WORKFLOW_EXECUTION_CANCELED", + "WORKFLOW_EXECUTION_CONTINUED_AS_NEW", + "WORKFLOW_TASK_TIMED_OUT", + "WORKFLOW_TASK_FAILED", + "CUSTOM_TASK_STARTED", + "CUSTOM_TASK_IN_PROGRESS", + "CUSTOM_TASK_COMPLETED", + "CUSTOM_TASK_FAILED", + "CUSTOM_TASK_TIMED_OUT", + "CUSTOM_TASK_CANCELED", + "ACTIVITY_TASK_STARTED", + "ACTIVITY_TASK_COMPLETED", + "ACTIVITY_TASK_RETRYING", + "ACTIVITY_TASK_FAILED", +] diff --git a/src/mistralai/client/models/workflowexecutioncanceledattributes.py b/src/mistralai/client/models/workflowexecutioncanceledattributes.py new file mode 100644 index 00000000..6c06bfa9 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutioncanceledattributes.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c0802a5de5e5 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionCanceledAttributesTypedDict(TypedDict): + r"""Attributes for workflow execution canceled events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + reason: NotRequired[Nullable[str]] + r"""Optional reason provided for the cancellation.""" + + +class WorkflowExecutionCanceledAttributes(BaseModel): + r"""Attributes for workflow execution canceled events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + + reason: OptionalNullable[str] = UNSET + r"""Optional reason provided for the cancellation.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["reason"]) + nullable_fields = set(["reason"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutioncanceledresponse.py b/src/mistralai/client/models/workflowexecutioncanceledresponse.py new file mode 100644 index 00000000..ee1c4e71 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutioncanceledresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bcc392d67222 + +from __future__ import annotations +from .workflowexecutioncanceledattributes import ( + WorkflowExecutionCanceledAttributes, + WorkflowExecutionCanceledAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class WorkflowExecutionCanceledResponseTypedDict(TypedDict): + r"""Emitted when a workflow execution is canceled. + + This is a terminal event indicating the workflow was explicitly canceled. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: WorkflowExecutionCanceledAttributesTypedDict + r"""Attributes for workflow execution canceled events.""" + event_type: Literal["WORKFLOW_EXECUTION_CANCELED"] + r"""Event type discriminator.""" + + +class WorkflowExecutionCanceledResponse(BaseModel): + r"""Emitted when a workflow execution is canceled. + + This is a terminal event indicating the workflow was explicitly canceled. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: WorkflowExecutionCanceledAttributes + r"""Attributes for workflow execution canceled events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["WORKFLOW_EXECUTION_CANCELED"]], + AfterValidator(validate_const("WORKFLOW_EXECUTION_CANCELED")), + ], + pydantic.Field(alias="event_type"), + ] = "WORKFLOW_EXECUTION_CANCELED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WorkflowExecutionCanceledResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/workflowexecutioncompletedattributesresponse.py b/src/mistralai/client/models/workflowexecutioncompletedattributesresponse.py new file mode 100644 index 00000000..1fe0c248 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutioncompletedattributesresponse.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f831331b0eb1 + +from __future__ import annotations +from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowExecutionCompletedAttributesResponseTypedDict(TypedDict): + r"""Attributes for workflow execution completed events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + result: JSONPayloadResponseTypedDict + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + +class WorkflowExecutionCompletedAttributesResponse(BaseModel): + r"""Attributes for workflow execution completed events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + + result: JSONPayloadResponse + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ diff --git a/src/mistralai/client/models/workflowexecutioncompletedresponse.py b/src/mistralai/client/models/workflowexecutioncompletedresponse.py new file mode 100644 index 00000000..17716668 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutioncompletedresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a1bec20dfb0e + +from __future__ import annotations +from .workflowexecutioncompletedattributesresponse import ( + WorkflowExecutionCompletedAttributesResponse, + WorkflowExecutionCompletedAttributesResponseTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class WorkflowExecutionCompletedResponseTypedDict(TypedDict): + r"""Emitted when a workflow execution completes successfully. + + This is a terminal event indicating the workflow finished without errors. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: WorkflowExecutionCompletedAttributesResponseTypedDict + r"""Attributes for workflow execution completed events.""" + event_type: Literal["WORKFLOW_EXECUTION_COMPLETED"] + r"""Event type discriminator.""" + + +class WorkflowExecutionCompletedResponse(BaseModel): + r"""Emitted when a workflow execution completes successfully. + + This is a terminal event indicating the workflow finished without errors. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: WorkflowExecutionCompletedAttributesResponse + r"""Attributes for workflow execution completed events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["WORKFLOW_EXECUTION_COMPLETED"]], + AfterValidator(validate_const("WORKFLOW_EXECUTION_COMPLETED")), + ], + pydantic.Field(alias="event_type"), + ] = "WORKFLOW_EXECUTION_COMPLETED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WorkflowExecutionCompletedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/workflowexecutioncontinuedasnewattributesresponse.py b/src/mistralai/client/models/workflowexecutioncontinuedasnewattributesresponse.py new file mode 100644 index 00000000..2ddbf0af --- /dev/null +++ b/src/mistralai/client/models/workflowexecutioncontinuedasnewattributesresponse.py @@ -0,0 +1,46 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2dd61dcd7b48 + +from __future__ import annotations +from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowExecutionContinuedAsNewAttributesResponseTypedDict(TypedDict): + r"""Attributes for workflow execution continued-as-new events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + new_execution_run_id: str + r"""The run ID of the new workflow execution that continues this workflow.""" + workflow_name: str + r"""The registered name of the continued workflow.""" + input: JSONPayloadResponseTypedDict + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + +class WorkflowExecutionContinuedAsNewAttributesResponse(BaseModel): + r"""Attributes for workflow execution continued-as-new events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + + new_execution_run_id: str + r"""The run ID of the new workflow execution that continues this workflow.""" + + workflow_name: str + r"""The registered name of the continued workflow.""" + + input: JSONPayloadResponse + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ diff --git a/src/mistralai/client/models/workflowexecutioncontinuedasnewresponse.py b/src/mistralai/client/models/workflowexecutioncontinuedasnewresponse.py new file mode 100644 index 00000000..0f60a5be --- /dev/null +++ b/src/mistralai/client/models/workflowexecutioncontinuedasnewresponse.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: be26cd87dcb3 + +from __future__ import annotations +from .workflowexecutioncontinuedasnewattributesresponse import ( + WorkflowExecutionContinuedAsNewAttributesResponse, + WorkflowExecutionContinuedAsNewAttributesResponseTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class WorkflowExecutionContinuedAsNewResponseTypedDict(TypedDict): + r"""Emitted when a workflow continues as a new execution. + + This occurs when a workflow uses continue-as-new to reset its history + while maintaining logical continuity. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: WorkflowExecutionContinuedAsNewAttributesResponseTypedDict + r"""Attributes for workflow execution continued-as-new events.""" + event_type: Literal["WORKFLOW_EXECUTION_CONTINUED_AS_NEW"] + r"""Event type discriminator.""" + + +class WorkflowExecutionContinuedAsNewResponse(BaseModel): + r"""Emitted when a workflow continues as a new execution. + + This occurs when a workflow uses continue-as-new to reset its history + while maintaining logical continuity. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: WorkflowExecutionContinuedAsNewAttributesResponse + r"""Attributes for workflow execution continued-as-new events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["WORKFLOW_EXECUTION_CONTINUED_AS_NEW"]], + AfterValidator(validate_const("WORKFLOW_EXECUTION_CONTINUED_AS_NEW")), + ], + pydantic.Field(alias="event_type"), + ] = "WORKFLOW_EXECUTION_CONTINUED_AS_NEW" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WorkflowExecutionContinuedAsNewResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/workflowexecutionfailedattributes.py b/src/mistralai/client/models/workflowexecutionfailedattributes.py new file mode 100644 index 00000000..1e61f344 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionfailedattributes.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: dbb7fb36a4fd + +from __future__ import annotations +from .failure import Failure, FailureTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowExecutionFailedAttributesTypedDict(TypedDict): + r"""Attributes for workflow execution failed events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + failure: FailureTypedDict + r"""Represents an error or exception that occurred during execution.""" + + +class WorkflowExecutionFailedAttributes(BaseModel): + r"""Attributes for workflow execution failed events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + + failure: Failure + r"""Represents an error or exception that occurred during execution.""" diff --git a/src/mistralai/client/models/workflowexecutionfailedresponse.py b/src/mistralai/client/models/workflowexecutionfailedresponse.py new file mode 100644 index 00000000..687d33a9 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionfailedresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a0836009f9de + +from __future__ import annotations +from .workflowexecutionfailedattributes import ( + WorkflowExecutionFailedAttributes, + WorkflowExecutionFailedAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class WorkflowExecutionFailedResponseTypedDict(TypedDict): + r"""Emitted when a workflow execution fails due to an unhandled exception. + + This is a terminal event indicating the workflow ended with an error. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: WorkflowExecutionFailedAttributesTypedDict + r"""Attributes for workflow execution failed events.""" + event_type: Literal["WORKFLOW_EXECUTION_FAILED"] + r"""Event type discriminator.""" + + +class WorkflowExecutionFailedResponse(BaseModel): + r"""Emitted when a workflow execution fails due to an unhandled exception. + + This is a terminal event indicating the workflow ended with an error. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: WorkflowExecutionFailedAttributes + r"""Attributes for workflow execution failed events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["WORKFLOW_EXECUTION_FAILED"]], + AfterValidator(validate_const("WORKFLOW_EXECUTION_FAILED")), + ], + pydantic.Field(alias="event_type"), + ] = "WORKFLOW_EXECUTION_FAILED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WorkflowExecutionFailedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/workflowexecutionlistresponse.py b/src/mistralai/client/models/workflowexecutionlistresponse.py new file mode 100644 index 00000000..b992bc8e --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionlistresponse.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c2b2e1ab4821 + +from __future__ import annotations +from .workflowexecutionwithoutresultresponse import ( + WorkflowExecutionWithoutResultResponse, + WorkflowExecutionWithoutResultResponseTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionListResponseTypedDict(TypedDict): + r"""Deprecated: use WorkflowRunListResponse instead. Will be removed in the next major version.""" + + executions: List[WorkflowExecutionWithoutResultResponseTypedDict] + r"""A list of workflow executions""" + next_page_token: NotRequired[Nullable[str]] + r"""Token to use for fetching the next page of results. Null if this is the last page.""" + + +class WorkflowExecutionListResponse(BaseModel): + r"""Deprecated: use WorkflowRunListResponse instead. Will be removed in the next major version.""" + + executions: List[WorkflowExecutionWithoutResultResponse] + r"""A list of workflow executions""" + + next_page_token: OptionalNullable[str] = UNSET + r"""Token to use for fetching the next page of results. Null if this is the last page.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["next_page_token"]) + nullable_fields = set(["next_page_token"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutionprogresstraceevent.py b/src/mistralai/client/models/workflowexecutionprogresstraceevent.py new file mode 100644 index 00000000..ffebdb82 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionprogresstraceevent.py @@ -0,0 +1,100 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6ea7078aaca3 + +from __future__ import annotations +from .eventprogressstatus import EventProgressStatus +from .eventtype import EventType +from .workflowexecutiontracesummaryattributesvalues import ( + WorkflowExecutionTraceSummaryAttributesValues, + WorkflowExecutionTraceSummaryAttributesValuesTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionProgressTraceEventTypedDict(TypedDict): + name: str + r"""Name of the event""" + id: str + r"""The ID of the event""" + timestamp_unix_nano: int + r"""The timestamp of the event in nanoseconds since the Unix epoch""" + attributes: Dict[ + str, Nullable[WorkflowExecutionTraceSummaryAttributesValuesTypedDict] + ] + r"""The attributes of the event""" + start_time_unix_ms: int + r"""The start time of the event in milliseconds since the Unix epoch""" + type: NotRequired[EventType] + internal: NotRequired[bool] + r"""Whether the event is internal""" + status: NotRequired[EventProgressStatus] + end_time_unix_ms: NotRequired[Nullable[int]] + r"""The end time of the event in milliseconds since the Unix epoch""" + error: NotRequired[Nullable[str]] + r"""The error message, if any""" + + +class WorkflowExecutionProgressTraceEvent(BaseModel): + name: str + r"""Name of the event""" + + id: str + r"""The ID of the event""" + + timestamp_unix_nano: int + r"""The timestamp of the event in nanoseconds since the Unix epoch""" + + attributes: Dict[str, Nullable[WorkflowExecutionTraceSummaryAttributesValues]] + r"""The attributes of the event""" + + start_time_unix_ms: int + r"""The start time of the event in milliseconds since the Unix epoch""" + + type: Optional[EventType] = None + + internal: Optional[bool] = False + r"""Whether the event is internal""" + + status: Optional[EventProgressStatus] = None + + end_time_unix_ms: OptionalNullable[int] = UNSET + r"""The end time of the event in milliseconds since the Unix epoch""" + + error: OptionalNullable[str] = UNSET + r"""The error message, if any""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["type", "internal", "status", "end_time_unix_ms", "error"] + ) + nullable_fields = set(["end_time_unix_ms", "error"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutionrequest.py b/src/mistralai/client/models/workflowexecutionrequest.py new file mode 100644 index 00000000..ea5e752d --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionrequest.py @@ -0,0 +1,109 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 806340497ed4 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WorkflowExecutionRequestTypedDict(TypedDict): + execution_id: NotRequired[Nullable[str]] + r"""Allows you to specify a custom execution ID. If not provided, a random ID will be generated.""" + input: NotRequired[Nullable[Any]] + r"""The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema.""" + wait_for_result: NotRequired[bool] + r"""If true, wait for the workflow to complete and return the result directly.""" + timeout_seconds: NotRequired[Nullable[float]] + r"""Maximum time to wait for completion when wait_for_result is true.""" + custom_tracing_attributes: NotRequired[Nullable[Dict[str, str]]] + extensions: NotRequired[Nullable[Dict[str, Any]]] + r"""Plugin-specific data to propagate into WorkflowContext.extensions at execution time.""" + task_queue: NotRequired[Nullable[str]] + r"""Deprecated. Use deployment_name instead.""" + deployment_name: NotRequired[Nullable[str]] + r"""Name of the deployment to route this execution to""" + + +class WorkflowExecutionRequest(BaseModel): + execution_id: OptionalNullable[str] = UNSET + r"""Allows you to specify a custom execution ID. If not provided, a random ID will be generated.""" + + input: OptionalNullable[Any] = UNSET + r"""The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema.""" + + wait_for_result: Optional[bool] = False + r"""If true, wait for the workflow to complete and return the result directly.""" + + timeout_seconds: OptionalNullable[float] = UNSET + r"""Maximum time to wait for completion when wait_for_result is true.""" + + custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET + + extensions: OptionalNullable[Dict[str, Any]] = UNSET + r"""Plugin-specific data to propagate into WorkflowContext.extensions at execution time.""" + + task_queue: Annotated[ + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET + r"""Deprecated. Use deployment_name instead.""" + + deployment_name: OptionalNullable[str] = UNSET + r"""Name of the deployment to route this execution to""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "execution_id", + "input", + "wait_for_result", + "timeout_seconds", + "custom_tracing_attributes", + "extensions", + "task_queue", + "deployment_name", + ] + ) + nullable_fields = set( + [ + "execution_id", + "input", + "timeout_seconds", + "custom_tracing_attributes", + "extensions", + "task_queue", + "deployment_name", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutionresponse.py b/src/mistralai/client/models/workflowexecutionresponse.py new file mode 100644 index 00000000..83179054 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionresponse.py @@ -0,0 +1,105 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 758786637be5 + +from __future__ import annotations +from .workflowexecutionstatus import WorkflowExecutionStatus +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionResponseTypedDict(TypedDict): + workflow_name: str + r"""The name of the workflow""" + execution_id: str + r"""The ID of the workflow execution""" + root_execution_id: str + r"""The root execution ID of the workflow execution""" + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + start_time: datetime + r"""The start time of the workflow execution""" + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + result: Nullable[Any] + r"""The result of the workflow execution, if available""" + parent_execution_id: NotRequired[Nullable[str]] + r"""The parent execution ID of the workflow execution""" + run_id: NotRequired[Nullable[str]] + r"""The unique run identifier (database UUID)""" + total_duration_ms: NotRequired[Nullable[int]] + r"""The total duration of the trace in milliseconds""" + + +class WorkflowExecutionResponse(BaseModel): + workflow_name: str + r"""The name of the workflow""" + + execution_id: str + r"""The ID of the workflow execution""" + + root_execution_id: str + r"""The root execution ID of the workflow execution""" + + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + + start_time: datetime + r"""The start time of the workflow execution""" + + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + + result: Nullable[Any] + r"""The result of the workflow execution, if available""" + + parent_execution_id: OptionalNullable[str] = UNSET + r"""The parent execution ID of the workflow execution""" + + run_id: OptionalNullable[str] = UNSET + r"""The unique run identifier (database UUID)""" + + total_duration_ms: OptionalNullable[int] = UNSET + r"""The total duration of the trace in milliseconds""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["parent_execution_id", "run_id", "total_duration_ms"]) + nullable_fields = set( + [ + "parent_execution_id", + "run_id", + "status", + "end_time", + "total_duration_ms", + "result", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutionstartedattributesresponse.py b/src/mistralai/client/models/workflowexecutionstartedattributesresponse.py new file mode 100644 index 00000000..59746a61 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionstartedattributesresponse.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d2276919a895 + +from __future__ import annotations +from .jsonpayloadresponse import JSONPayloadResponse, JSONPayloadResponseTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionStartedAttributesResponseTypedDict(TypedDict): + r"""Attributes for workflow execution started events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + workflow_name: str + r"""The registered name of the workflow being executed.""" + input: JSONPayloadResponseTypedDict + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + display_name: NotRequired[Nullable[str]] + r"""The user-friendly display name of the workflow, if available.""" + + +class WorkflowExecutionStartedAttributesResponse(BaseModel): + r"""Attributes for workflow execution started events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + + workflow_name: str + r"""The registered name of the workflow being executed.""" + + input: JSONPayloadResponse + r"""A payload containing arbitrary JSON data. + + Used for complete state snapshots or final results. + When encrypted, the value field contains base64-encoded encrypted data + and encoding_options indicates the type of encryption applied. + """ + + display_name: OptionalNullable[str] = UNSET + r"""The user-friendly display name of the workflow, if available.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["display_name"]) + nullable_fields = set(["display_name"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutionstartedresponse.py b/src/mistralai/client/models/workflowexecutionstartedresponse.py new file mode 100644 index 00000000..fa1e46a0 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionstartedresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e1a597c911ea + +from __future__ import annotations +from .workflowexecutionstartedattributesresponse import ( + WorkflowExecutionStartedAttributesResponse, + WorkflowExecutionStartedAttributesResponseTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class WorkflowExecutionStartedResponseTypedDict(TypedDict): + r"""Emitted when a workflow execution begins. + + This is the first event in any workflow execution lifecycle. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: WorkflowExecutionStartedAttributesResponseTypedDict + r"""Attributes for workflow execution started events.""" + event_type: Literal["WORKFLOW_EXECUTION_STARTED"] + r"""Event type discriminator.""" + + +class WorkflowExecutionStartedResponse(BaseModel): + r"""Emitted when a workflow execution begins. + + This is the first event in any workflow execution lifecycle. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: WorkflowExecutionStartedAttributesResponse + r"""Attributes for workflow execution started events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["WORKFLOW_EXECUTION_STARTED"]], + AfterValidator(validate_const("WORKFLOW_EXECUTION_STARTED")), + ], + pydantic.Field(alias="event_type"), + ] = "WORKFLOW_EXECUTION_STARTED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WorkflowExecutionStartedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/workflowexecutionstatus.py b/src/mistralai/client/models/workflowexecutionstatus.py new file mode 100644 index 00000000..611f3aa1 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionstatus.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 56a16810d5de + +from __future__ import annotations +from mistralai.client.types import UnrecognizedStr +from typing import Literal, Union + + +WorkflowExecutionStatus = Union[ + Literal[ + "RUNNING", + "COMPLETED", + "FAILED", + "CANCELED", + "TERMINATED", + "CONTINUED_AS_NEW", + "TIMED_OUT", + "RETRYING_AFTER_ERROR", + ], + UnrecognizedStr, +] diff --git a/src/mistralai/client/models/workflowexecutionsyncresponse.py b/src/mistralai/client/models/workflowexecutionsyncresponse.py new file mode 100644 index 00000000..6ed0f038 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionsyncresponse.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ef77c54a11b5 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing import Any +from typing_extensions import TypedDict + + +class WorkflowExecutionSyncResponseTypedDict(TypedDict): + r"""Response model for synchronous workflow execution""" + + workflow_name: str + r"""Name of the workflow that was executed""" + execution_id: str + r"""ID of the workflow execution""" + result: Any + r"""The result of the workflow execution""" + + +class WorkflowExecutionSyncResponse(BaseModel): + r"""Response model for synchronous workflow execution""" + + workflow_name: str + r"""Name of the workflow that was executed""" + + execution_id: str + r"""ID of the workflow execution""" + + result: Any + r"""The result of the workflow execution""" diff --git a/src/mistralai/client/models/workflowexecutiontraceevent.py b/src/mistralai/client/models/workflowexecutiontraceevent.py new file mode 100644 index 00000000..f74cd5ab --- /dev/null +++ b/src/mistralai/client/models/workflowexecutiontraceevent.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 584e0a98082a + +from __future__ import annotations +from .eventtype import EventType +from .workflowexecutiontracesummaryattributesvalues import ( + WorkflowExecutionTraceSummaryAttributesValues, + WorkflowExecutionTraceSummaryAttributesValuesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionTraceEventTypedDict(TypedDict): + name: str + r"""Name of the event""" + id: str + r"""The ID of the event""" + timestamp_unix_nano: int + r"""The timestamp of the event in nanoseconds since the Unix epoch""" + attributes: Dict[ + str, Nullable[WorkflowExecutionTraceSummaryAttributesValuesTypedDict] + ] + r"""The attributes of the event""" + type: NotRequired[EventType] + internal: NotRequired[bool] + r"""Whether the event is internal""" + + +class WorkflowExecutionTraceEvent(BaseModel): + name: str + r"""Name of the event""" + + id: str + r"""The ID of the event""" + + timestamp_unix_nano: int + r"""The timestamp of the event in nanoseconds since the Unix epoch""" + + attributes: Dict[str, Nullable[WorkflowExecutionTraceSummaryAttributesValues]] + r"""The attributes of the event""" + + type: Optional[EventType] = None + + internal: Optional[bool] = False + r"""Whether the event is internal""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "internal"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutiontraceeventsresponse.py b/src/mistralai/client/models/workflowexecutiontraceeventsresponse.py new file mode 100644 index 00000000..22853e9b --- /dev/null +++ b/src/mistralai/client/models/workflowexecutiontraceeventsresponse.py @@ -0,0 +1,135 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 94d92762ccb7 + +from __future__ import annotations +from .workflowexecutionprogresstraceevent import ( + WorkflowExecutionProgressTraceEvent, + WorkflowExecutionProgressTraceEventTypedDict, +) +from .workflowexecutionstatus import WorkflowExecutionStatus +from .workflowexecutiontraceevent import ( + WorkflowExecutionTraceEvent, + WorkflowExecutionTraceEventTypedDict, +) +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict + + +WorkflowExecutionTraceEventsResponseEventTypedDict = TypeAliasType( + "WorkflowExecutionTraceEventsResponseEventTypedDict", + Union[ + WorkflowExecutionTraceEventTypedDict, + WorkflowExecutionProgressTraceEventTypedDict, + ], +) + + +WorkflowExecutionTraceEventsResponseEvent = TypeAliasType( + "WorkflowExecutionTraceEventsResponseEvent", + Union[WorkflowExecutionTraceEvent, WorkflowExecutionProgressTraceEvent], +) + + +class WorkflowExecutionTraceEventsResponseTypedDict(TypedDict): + workflow_name: str + r"""The name of the workflow""" + execution_id: str + r"""The ID of the workflow execution""" + root_execution_id: str + r"""The root execution ID of the workflow execution""" + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + start_time: datetime + r"""The start time of the workflow execution""" + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + result: Nullable[Any] + r"""The result of the workflow execution, if available""" + parent_execution_id: NotRequired[Nullable[str]] + r"""The parent execution ID of the workflow execution""" + run_id: NotRequired[Nullable[str]] + r"""The unique run identifier (database UUID)""" + total_duration_ms: NotRequired[Nullable[int]] + r"""The total duration of the trace in milliseconds""" + events: NotRequired[List[WorkflowExecutionTraceEventsResponseEventTypedDict]] + r"""The events of the workflow execution""" + + +class WorkflowExecutionTraceEventsResponse(BaseModel): + workflow_name: str + r"""The name of the workflow""" + + execution_id: str + r"""The ID of the workflow execution""" + + root_execution_id: str + r"""The root execution ID of the workflow execution""" + + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + + start_time: datetime + r"""The start time of the workflow execution""" + + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + + result: Nullable[Any] + r"""The result of the workflow execution, if available""" + + parent_execution_id: OptionalNullable[str] = UNSET + r"""The parent execution ID of the workflow execution""" + + run_id: OptionalNullable[str] = UNSET + r"""The unique run identifier (database UUID)""" + + total_duration_ms: OptionalNullable[int] = UNSET + r"""The total duration of the trace in milliseconds""" + + events: Optional[List[WorkflowExecutionTraceEventsResponseEvent]] = None + r"""The events of the workflow execution""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["parent_execution_id", "run_id", "total_duration_ms", "events"] + ) + nullable_fields = set( + [ + "parent_execution_id", + "run_id", + "status", + "end_time", + "total_duration_ms", + "result", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutiontraceotelresponse.py b/src/mistralai/client/models/workflowexecutiontraceotelresponse.py new file mode 100644 index 00000000..46f5404e --- /dev/null +++ b/src/mistralai/client/models/workflowexecutiontraceotelresponse.py @@ -0,0 +1,131 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7531bf461dc2 + +from __future__ import annotations +from .tempogettraceresponse import TempoGetTraceResponse, TempoGetTraceResponseTypedDict +from .workflowexecutionstatus import WorkflowExecutionStatus +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionTraceOTelResponseTypedDict(TypedDict): + workflow_name: str + r"""The name of the workflow""" + execution_id: str + r"""The ID of the workflow execution""" + root_execution_id: str + r"""The root execution ID of the workflow execution""" + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + start_time: datetime + r"""The start time of the workflow execution""" + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + result: Nullable[Any] + r"""The result of the workflow execution, if available""" + data_source: str + r"""The data source of the trace""" + parent_execution_id: NotRequired[Nullable[str]] + r"""The parent execution ID of the workflow execution""" + run_id: NotRequired[Nullable[str]] + r"""The unique run identifier (database UUID)""" + total_duration_ms: NotRequired[Nullable[int]] + r"""The total duration of the trace in milliseconds""" + otel_trace_id: NotRequired[Nullable[str]] + r"""The ID of the trace""" + otel_trace_data: NotRequired[Nullable[TempoGetTraceResponseTypedDict]] + r"""The raw OpenTelemetry trace data""" + + +class WorkflowExecutionTraceOTelResponse(BaseModel): + workflow_name: str + r"""The name of the workflow""" + + execution_id: str + r"""The ID of the workflow execution""" + + root_execution_id: str + r"""The root execution ID of the workflow execution""" + + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + + start_time: datetime + r"""The start time of the workflow execution""" + + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + + result: Nullable[Any] + r"""The result of the workflow execution, if available""" + + data_source: str + r"""The data source of the trace""" + + parent_execution_id: OptionalNullable[str] = UNSET + r"""The parent execution ID of the workflow execution""" + + run_id: OptionalNullable[str] = UNSET + r"""The unique run identifier (database UUID)""" + + total_duration_ms: OptionalNullable[int] = UNSET + r"""The total duration of the trace in milliseconds""" + + otel_trace_id: OptionalNullable[str] = UNSET + r"""The ID of the trace""" + + otel_trace_data: OptionalNullable[TempoGetTraceResponse] = UNSET + r"""The raw OpenTelemetry trace data""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "parent_execution_id", + "run_id", + "total_duration_ms", + "otel_trace_id", + "otel_trace_data", + ] + ) + nullable_fields = set( + [ + "parent_execution_id", + "run_id", + "status", + "end_time", + "total_duration_ms", + "result", + "otel_trace_id", + "otel_trace_data", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutiontracesummaryattributesvalues.py b/src/mistralai/client/models/workflowexecutiontracesummaryattributesvalues.py new file mode 100644 index 00000000..1957662c --- /dev/null +++ b/src/mistralai/client/models/workflowexecutiontracesummaryattributesvalues.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5e3448a39a40 + +from __future__ import annotations +from typing import Any, List, Union +from typing_extensions import TypeAliasType + + +WorkflowExecutionTraceSummaryAttributesValuesTypedDict = TypeAliasType( + "WorkflowExecutionTraceSummaryAttributesValuesTypedDict", + Union[str, int, float, bool, List[Any]], +) + + +WorkflowExecutionTraceSummaryAttributesValues = TypeAliasType( + "WorkflowExecutionTraceSummaryAttributesValues", + Union[str, int, float, bool, List[Any]], +) diff --git a/src/mistralai/client/models/workflowexecutiontracesummaryresponse.py b/src/mistralai/client/models/workflowexecutiontracesummaryresponse.py new file mode 100644 index 00000000..92e9a2a7 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutiontracesummaryresponse.py @@ -0,0 +1,117 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2ea199810f5f + +from __future__ import annotations +from .workflowexecutionstatus import WorkflowExecutionStatus +from .workflowexecutiontracesummaryspan import ( + WorkflowExecutionTraceSummarySpan, + WorkflowExecutionTraceSummarySpanTypedDict, +) +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionTraceSummaryResponseTypedDict(TypedDict): + workflow_name: str + r"""The name of the workflow""" + execution_id: str + r"""The ID of the workflow execution""" + root_execution_id: str + r"""The root execution ID of the workflow execution""" + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + start_time: datetime + r"""The start time of the workflow execution""" + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + result: Nullable[Any] + r"""The result of the workflow execution, if available""" + parent_execution_id: NotRequired[Nullable[str]] + r"""The parent execution ID of the workflow execution""" + run_id: NotRequired[Nullable[str]] + r"""The unique run identifier (database UUID)""" + total_duration_ms: NotRequired[Nullable[int]] + r"""The total duration of the trace in milliseconds""" + span_tree: NotRequired[Nullable[WorkflowExecutionTraceSummarySpanTypedDict]] + r"""The root span of the trace""" + + +class WorkflowExecutionTraceSummaryResponse(BaseModel): + workflow_name: str + r"""The name of the workflow""" + + execution_id: str + r"""The ID of the workflow execution""" + + root_execution_id: str + r"""The root execution ID of the workflow execution""" + + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + + start_time: datetime + r"""The start time of the workflow execution""" + + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + + result: Nullable[Any] + r"""The result of the workflow execution, if available""" + + parent_execution_id: OptionalNullable[str] = UNSET + r"""The parent execution ID of the workflow execution""" + + run_id: OptionalNullable[str] = UNSET + r"""The unique run identifier (database UUID)""" + + total_duration_ms: OptionalNullable[int] = UNSET + r"""The total duration of the trace in milliseconds""" + + span_tree: OptionalNullable[WorkflowExecutionTraceSummarySpan] = UNSET + r"""The root span of the trace""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["parent_execution_id", "run_id", "total_duration_ms", "span_tree"] + ) + nullable_fields = set( + [ + "parent_execution_id", + "run_id", + "status", + "end_time", + "total_duration_ms", + "result", + "span_tree", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutiontracesummaryspan.py b/src/mistralai/client/models/workflowexecutiontracesummaryspan.py new file mode 100644 index 00000000..e80db90f --- /dev/null +++ b/src/mistralai/client/models/workflowexecutiontracesummaryspan.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 750353cbd052 + +from __future__ import annotations +from .workflowexecutiontraceevent import ( + WorkflowExecutionTraceEvent, + WorkflowExecutionTraceEventTypedDict, +) +from .workflowexecutiontracesummaryattributesvalues import ( + WorkflowExecutionTraceSummaryAttributesValues, + WorkflowExecutionTraceSummaryAttributesValuesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionTraceSummarySpanTypedDict(TypedDict): + span_id: str + r"""The ID of the span""" + name: str + r"""The name of the span""" + start_time_unix_nano: int + r"""The start time of the span in nanoseconds since the Unix epoch""" + end_time_unix_nano: Nullable[int] + r"""The end time of the span in nanoseconds since the Unix epoch""" + attributes: Dict[ + str, Nullable[WorkflowExecutionTraceSummaryAttributesValuesTypedDict] + ] + r"""The attributes of the span""" + events: List[WorkflowExecutionTraceEventTypedDict] + r"""The events of the span""" + children: NotRequired[List[WorkflowExecutionTraceSummarySpanTypedDict]] + r"""The child spans of the span""" + + +class WorkflowExecutionTraceSummarySpan(BaseModel): + span_id: str + r"""The ID of the span""" + + name: str + r"""The name of the span""" + + start_time_unix_nano: int + r"""The start time of the span in nanoseconds since the Unix epoch""" + + end_time_unix_nano: Nullable[int] + r"""The end time of the span in nanoseconds since the Unix epoch""" + + attributes: Dict[str, Nullable[WorkflowExecutionTraceSummaryAttributesValues]] + r"""The attributes of the span""" + + events: List[WorkflowExecutionTraceEvent] + r"""The events of the span""" + + children: Optional[List[WorkflowExecutionTraceSummarySpan]] = None + r"""The child spans of the span""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["children"]) + nullable_fields = set(["end_time_unix_nano"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowexecutionwithoutresultresponse.py b/src/mistralai/client/models/workflowexecutionwithoutresultresponse.py new file mode 100644 index 00000000..5e7fe852 --- /dev/null +++ b/src/mistralai/client/models/workflowexecutionwithoutresultresponse.py @@ -0,0 +1,92 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: dd70ba8def79 + +from __future__ import annotations +from .workflowexecutionstatus import WorkflowExecutionStatus +from datetime import datetime +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class WorkflowExecutionWithoutResultResponseTypedDict(TypedDict): + workflow_name: str + r"""The name of the workflow""" + execution_id: str + r"""The ID of the workflow execution""" + root_execution_id: str + r"""The root execution ID of the workflow execution""" + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + start_time: datetime + r"""The start time of the workflow execution""" + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + parent_execution_id: NotRequired[Nullable[str]] + r"""The parent execution ID of the workflow execution""" + run_id: NotRequired[Nullable[str]] + r"""The unique run identifier (database UUID)""" + total_duration_ms: NotRequired[Nullable[int]] + r"""The total duration of the trace in milliseconds""" + + +class WorkflowExecutionWithoutResultResponse(BaseModel): + workflow_name: str + r"""The name of the workflow""" + + execution_id: str + r"""The ID of the workflow execution""" + + root_execution_id: str + r"""The root execution ID of the workflow execution""" + + status: Nullable[WorkflowExecutionStatus] + r"""The status of the workflow execution""" + + start_time: datetime + r"""The start time of the workflow execution""" + + end_time: Nullable[datetime] + r"""The end time of the workflow execution, if available""" + + parent_execution_id: OptionalNullable[str] = UNSET + r"""The parent execution ID of the workflow execution""" + + run_id: OptionalNullable[str] = UNSET + r"""The unique run identifier (database UUID)""" + + total_duration_ms: OptionalNullable[int] = UNSET + r"""The total duration of the trace in milliseconds""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["parent_execution_id", "run_id", "total_duration_ms"]) + nullable_fields = set( + ["parent_execution_id", "run_id", "status", "end_time", "total_duration_ms"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowgetresponse.py b/src/mistralai/client/models/workflowgetresponse.py new file mode 100644 index 00000000..ef1391c9 --- /dev/null +++ b/src/mistralai/client/models/workflowgetresponse.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 230f55a36ebf + +from __future__ import annotations +from .workflowwithworkerstatus import ( + WorkflowWithWorkerStatus, + WorkflowWithWorkerStatusTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowGetResponseTypedDict(TypedDict): + workflow: WorkflowWithWorkerStatusTypedDict + + +class WorkflowGetResponse(BaseModel): + workflow: WorkflowWithWorkerStatus diff --git a/src/mistralai/client/models/workflowlistresponse.py b/src/mistralai/client/models/workflowlistresponse.py new file mode 100644 index 00000000..a6497e82 --- /dev/null +++ b/src/mistralai/client/models/workflowlistresponse.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b255b05e7395 + +from __future__ import annotations +from .workflowbasicdefinition import ( + WorkflowBasicDefinition, + WorkflowBasicDefinitionTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List +from typing_extensions import TypedDict + + +class WorkflowListResponseTypedDict(TypedDict): + workflows: List[WorkflowBasicDefinitionTypedDict] + r"""A list of workflows""" + next_cursor: Nullable[str] + + +class WorkflowListResponse(BaseModel): + workflows: List[WorkflowBasicDefinition] + r"""A list of workflows""" + + next_cursor: Nullable[str] + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowmetadata.py b/src/mistralai/client/models/workflowmetadata.py new file mode 100644 index 00000000..59752539 --- /dev/null +++ b/src/mistralai/client/models/workflowmetadata.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0435707d6944 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class WorkflowMetadataTypedDict(TypedDict): + shared_namespace: NotRequired[Nullable[str]] + r"""Namespace for shared workflows, None if user-owned""" + + +class WorkflowMetadata(BaseModel): + shared_namespace: OptionalNullable[str] = UNSET + r"""Namespace for shared workflows, None if user-owned""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["shared_namespace"]) + nullable_fields = set(["shared_namespace"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowmetrics.py b/src/mistralai/client/models/workflowmetrics.py new file mode 100644 index 00000000..d80bb3db --- /dev/null +++ b/src/mistralai/client/models/workflowmetrics.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 471fb1e10716 + +from __future__ import annotations +from .scalarmetric import ScalarMetric, ScalarMetricTypedDict +from .timeseriesmetric import TimeSeriesMetric, TimeSeriesMetricTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowMetricsTypedDict(TypedDict): + r"""Complete metrics for a specific workflow. + + This type combines all metric categories. + """ + + execution_count: ScalarMetricTypedDict + r"""Scalar metric with a single value.""" + success_count: ScalarMetricTypedDict + r"""Scalar metric with a single value.""" + error_count: ScalarMetricTypedDict + r"""Scalar metric with a single value.""" + average_latency_ms: ScalarMetricTypedDict + r"""Scalar metric with a single value.""" + latency_over_time: TimeSeriesMetricTypedDict + r"""Time-series metric with timestamp-value pairs.""" + retry_rate: ScalarMetricTypedDict + r"""Scalar metric with a single value.""" + + +class WorkflowMetrics(BaseModel): + r"""Complete metrics for a specific workflow. + + This type combines all metric categories. + """ + + execution_count: ScalarMetric + r"""Scalar metric with a single value.""" + + success_count: ScalarMetric + r"""Scalar metric with a single value.""" + + error_count: ScalarMetric + r"""Scalar metric with a single value.""" + + average_latency_ms: ScalarMetric + r"""Scalar metric with a single value.""" + + latency_over_time: TimeSeriesMetric + r"""Time-series metric with timestamp-value pairs.""" + + retry_rate: ScalarMetric + r"""Scalar metric with a single value.""" diff --git a/src/mistralai/client/models/workflowregistration.py b/src/mistralai/client/models/workflowregistration.py new file mode 100644 index 00000000..7c65801d --- /dev/null +++ b/src/mistralai/client/models/workflowregistration.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2b937728c88b + +from __future__ import annotations +from .workflow import Workflow, WorkflowTypedDict +from .workflowcodedefinition import ( + WorkflowCodeDefinition, + WorkflowCodeDefinitionTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WorkflowRegistrationTypedDict(TypedDict): + id: str + r"""Unique identifier of the workflow registration""" + definition: WorkflowCodeDefinitionTypedDict + workflow_id: str + r"""Workflow ID of the workflow""" + deployment_id: NotRequired[Nullable[str]] + r"""Deployment ID this registration belongs to""" + task_queue: NotRequired[Nullable[str]] + r"""Deprecated. Use deployment_id instead. Will be removed in a future release.""" + workflow: NotRequired[Nullable[WorkflowTypedDict]] + r"""Workflow of the workflow registration""" + compatible_with_chat_assistant: NotRequired[bool] + r"""Whether the workflow is compatible with chat assistant""" + + +class WorkflowRegistration(BaseModel): + id: str + r"""Unique identifier of the workflow registration""" + + definition: WorkflowCodeDefinition + + workflow_id: str + r"""Workflow ID of the workflow""" + + deployment_id: OptionalNullable[str] = UNSET + r"""Deployment ID this registration belongs to""" + + task_queue: Annotated[ + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET + r"""Deprecated. Use deployment_id instead. Will be removed in a future release.""" + + workflow: OptionalNullable[Workflow] = UNSET + r"""Workflow of the workflow registration""" + + compatible_with_chat_assistant: Optional[bool] = False + r"""Whether the workflow is compatible with chat assistant""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "deployment_id", + "task_queue", + "workflow", + "compatible_with_chat_assistant", + ] + ) + nullable_fields = set(["deployment_id", "task_queue", "workflow"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowregistrationgetresponse.py b/src/mistralai/client/models/workflowregistrationgetresponse.py new file mode 100644 index 00000000..3105856d --- /dev/null +++ b/src/mistralai/client/models/workflowregistrationgetresponse.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: f063656f22ae + +from __future__ import annotations +from .workflowregistrationwithworkerstatus import ( + WorkflowRegistrationWithWorkerStatus, + WorkflowRegistrationWithWorkerStatusTypedDict, +) +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowRegistrationGetResponseTypedDict(TypedDict): + workflow_registration: WorkflowRegistrationWithWorkerStatusTypedDict + workflow_version: WorkflowRegistrationWithWorkerStatusTypedDict + + +class WorkflowRegistrationGetResponse(BaseModel): + workflow_registration: WorkflowRegistrationWithWorkerStatus + + workflow_version: WorkflowRegistrationWithWorkerStatus diff --git a/src/mistralai/client/models/workflowregistrationlistresponse.py b/src/mistralai/client/models/workflowregistrationlistresponse.py new file mode 100644 index 00000000..e66f219b --- /dev/null +++ b/src/mistralai/client/models/workflowregistrationlistresponse.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3752e5b776db + +from __future__ import annotations +from .workflowregistration import WorkflowRegistration, WorkflowRegistrationTypedDict +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List +from typing_extensions import TypedDict + + +class WorkflowRegistrationListResponseTypedDict(TypedDict): + workflow_registrations: List[WorkflowRegistrationTypedDict] + r"""A list of workflow registrations""" + next_cursor: Nullable[str] + workflow_versions: List[WorkflowRegistrationTypedDict] + r"""Deprecated: use workflow_registrations""" + + +class WorkflowRegistrationListResponse(BaseModel): + workflow_registrations: List[WorkflowRegistration] + r"""A list of workflow registrations""" + + next_cursor: Nullable[str] + + workflow_versions: List[WorkflowRegistration] + r"""Deprecated: use workflow_registrations""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowregistrationwithworkerstatus.py b/src/mistralai/client/models/workflowregistrationwithworkerstatus.py new file mode 100644 index 00000000..62c379d9 --- /dev/null +++ b/src/mistralai/client/models/workflowregistrationwithworkerstatus.py @@ -0,0 +1,100 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 23b661b9496f + +from __future__ import annotations +from .workflow import Workflow, WorkflowTypedDict +from .workflowcodedefinition import ( + WorkflowCodeDefinition, + WorkflowCodeDefinitionTypedDict, +) +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WorkflowRegistrationWithWorkerStatusTypedDict(TypedDict): + id: str + r"""Unique identifier of the workflow registration""" + definition: WorkflowCodeDefinitionTypedDict + workflow_id: str + r"""Workflow ID of the workflow""" + active: bool + r"""Whether the workflow registration is active""" + deployment_id: NotRequired[Nullable[str]] + r"""Deployment ID this registration belongs to""" + task_queue: NotRequired[Nullable[str]] + r"""Deprecated. Use deployment_id instead. Will be removed in a future release.""" + workflow: NotRequired[Nullable[WorkflowTypedDict]] + r"""Workflow of the workflow registration""" + compatible_with_chat_assistant: NotRequired[bool] + r"""Whether the workflow is compatible with chat assistant""" + + +class WorkflowRegistrationWithWorkerStatus(BaseModel): + id: str + r"""Unique identifier of the workflow registration""" + + definition: WorkflowCodeDefinition + + workflow_id: str + r"""Workflow ID of the workflow""" + + active: bool + r"""Whether the workflow registration is active""" + + deployment_id: OptionalNullable[str] = UNSET + r"""Deployment ID this registration belongs to""" + + task_queue: Annotated[ + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET + r"""Deprecated. Use deployment_id instead. Will be removed in a future release.""" + + workflow: OptionalNullable[Workflow] = UNSET + r"""Workflow of the workflow registration""" + + compatible_with_chat_assistant: Optional[bool] = False + r"""Whether the workflow is compatible with chat assistant""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "deployment_id", + "task_queue", + "workflow", + "compatible_with_chat_assistant", + ] + ) + nullable_fields = set(["deployment_id", "task_queue", "workflow"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowschedulelistresponse.py b/src/mistralai/client/models/workflowschedulelistresponse.py new file mode 100644 index 00000000..3c9eb3d7 --- /dev/null +++ b/src/mistralai/client/models/workflowschedulelistresponse.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e5247c5183bb + +from __future__ import annotations +from .scheduledefinitionoutput import ( + ScheduleDefinitionOutput, + ScheduleDefinitionOutputTypedDict, +) +from mistralai.client.types import BaseModel +from typing import List +from typing_extensions import TypedDict + + +class WorkflowScheduleListResponseTypedDict(TypedDict): + schedules: List[ScheduleDefinitionOutputTypedDict] + r"""A list of workflow schedules""" + + +class WorkflowScheduleListResponse(BaseModel): + schedules: List[ScheduleDefinitionOutput] + r"""A list of workflow schedules""" diff --git a/src/mistralai/client/models/workflowschedulepauserequest.py b/src/mistralai/client/models/workflowschedulepauserequest.py new file mode 100644 index 00000000..a27f2e90 --- /dev/null +++ b/src/mistralai/client/models/workflowschedulepauserequest.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: da7b9a522bcb + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class WorkflowSchedulePauseRequestTypedDict(TypedDict): + note: NotRequired[Nullable[str]] + r"""Optional note recorded in Temporal when pausing or resuming a schedule""" + + +class WorkflowSchedulePauseRequest(BaseModel): + note: OptionalNullable[str] = UNSET + r"""Optional note recorded in Temporal when pausing or resuming a schedule""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["note"]) + nullable_fields = set(["note"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowschedulerequest.py b/src/mistralai/client/models/workflowschedulerequest.py new file mode 100644 index 00000000..2ded66b9 --- /dev/null +++ b/src/mistralai/client/models/workflowschedulerequest.py @@ -0,0 +1,115 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2d8256704c6b + +from __future__ import annotations +from .scheduledefinition import ScheduleDefinition, ScheduleDefinitionTypedDict +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WorkflowScheduleRequestTypedDict(TypedDict): + schedule: ScheduleDefinitionTypedDict + r"""Specification of the times scheduled actions may occur. + + The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and + :py:attr:`cron_expressions` excluding anything in :py:attr:`skip`. + + Used for input where schedule_id is optional (can be provided or auto-generated). + """ + workflow_registration_id: NotRequired[Nullable[str]] + r"""The ID of the workflow registration to schedule""" + workflow_version_id: NotRequired[Nullable[str]] + r"""Deprecated: use workflow_registration_id""" + workflow_identifier: NotRequired[Nullable[str]] + r"""The name or ID of the workflow to schedule""" + workflow_task_queue: NotRequired[Nullable[str]] + r"""Deprecated. Use deployment_name instead.""" + schedule_id: NotRequired[Nullable[str]] + r"""Allows you to specify a custom schedule ID. If not provided, a random ID will be generated.""" + deployment_name: NotRequired[Nullable[str]] + r"""Name of the deployment to route this schedule to""" + + +class WorkflowScheduleRequest(BaseModel): + schedule: ScheduleDefinition + r"""Specification of the times scheduled actions may occur. + + The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and + :py:attr:`cron_expressions` excluding anything in :py:attr:`skip`. + + Used for input where schedule_id is optional (can be provided or auto-generated). + """ + + workflow_registration_id: OptionalNullable[str] = UNSET + r"""The ID of the workflow registration to schedule""" + + workflow_version_id: OptionalNullable[str] = UNSET + r"""Deprecated: use workflow_registration_id""" + + workflow_identifier: OptionalNullable[str] = UNSET + r"""The name or ID of the workflow to schedule""" + + workflow_task_queue: Annotated[ + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ), + ] = UNSET + r"""Deprecated. Use deployment_name instead.""" + + schedule_id: OptionalNullable[str] = UNSET + r"""Allows you to specify a custom schedule ID. If not provided, a random ID will be generated.""" + + deployment_name: OptionalNullable[str] = UNSET + r"""Name of the deployment to route this schedule to""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "workflow_registration_id", + "workflow_version_id", + "workflow_identifier", + "workflow_task_queue", + "schedule_id", + "deployment_name", + ] + ) + nullable_fields = set( + [ + "workflow_registration_id", + "workflow_version_id", + "workflow_identifier", + "workflow_task_queue", + "schedule_id", + "deployment_name", + ] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowscheduleresponse.py b/src/mistralai/client/models/workflowscheduleresponse.py new file mode 100644 index 00000000..d74ba1da --- /dev/null +++ b/src/mistralai/client/models/workflowscheduleresponse.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c77172c4a9f6 + +from __future__ import annotations +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowScheduleResponseTypedDict(TypedDict): + schedule_id: str + r"""The ID of the schedule""" + + +class WorkflowScheduleResponse(BaseModel): + schedule_id: str + r"""The ID of the schedule""" diff --git a/src/mistralai/client/models/workflowtaskfailedattributes.py b/src/mistralai/client/models/workflowtaskfailedattributes.py new file mode 100644 index 00000000..49444347 --- /dev/null +++ b/src/mistralai/client/models/workflowtaskfailedattributes.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c4c09c4d5ea7 + +from __future__ import annotations +from .failure import Failure, FailureTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowTaskFailedAttributesTypedDict(TypedDict): + r"""Attributes for workflow task failed events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + failure: FailureTypedDict + r"""Represents an error or exception that occurred during execution.""" + + +class WorkflowTaskFailedAttributes(BaseModel): + r"""Attributes for workflow task failed events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + + failure: Failure + r"""Represents an error or exception that occurred during execution.""" diff --git a/src/mistralai/client/models/workflowtaskfailedresponse.py b/src/mistralai/client/models/workflowtaskfailedresponse.py new file mode 100644 index 00000000..154145e3 --- /dev/null +++ b/src/mistralai/client/models/workflowtaskfailedresponse.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a02b01867b7f + +from __future__ import annotations +from .workflowtaskfailedattributes import ( + WorkflowTaskFailedAttributes, + WorkflowTaskFailedAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class WorkflowTaskFailedResponseTypedDict(TypedDict): + r"""Emitted when a workflow task fails. + + This indicates an error occurred during workflow task execution, + which may trigger a retry depending on configuration. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: WorkflowTaskFailedAttributesTypedDict + r"""Attributes for workflow task failed events.""" + event_type: Literal["WORKFLOW_TASK_FAILED"] + r"""Event type discriminator.""" + + +class WorkflowTaskFailedResponse(BaseModel): + r"""Emitted when a workflow task fails. + + This indicates an error occurred during workflow task execution, + which may trigger a retry depending on configuration. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: WorkflowTaskFailedAttributes + r"""Attributes for workflow task failed events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["WORKFLOW_TASK_FAILED"]], + AfterValidator(validate_const("WORKFLOW_TASK_FAILED")), + ], + pydantic.Field(alias="event_type"), + ] = "WORKFLOW_TASK_FAILED" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WorkflowTaskFailedResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/workflowtasktimedoutattributes.py b/src/mistralai/client/models/workflowtasktimedoutattributes.py new file mode 100644 index 00000000..1824990e --- /dev/null +++ b/src/mistralai/client/models/workflowtasktimedoutattributes.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 43369570cb96 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class WorkflowTaskTimedOutAttributesTypedDict(TypedDict): + r"""Attributes for workflow task timed out events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + timeout_type: NotRequired[Nullable[str]] + r"""The type of timeout that occurred (e.g., 'START_TO_CLOSE', 'SCHEDULE_TO_START').""" + + +class WorkflowTaskTimedOutAttributes(BaseModel): + r"""Attributes for workflow task timed out events.""" + + task_id: str + r"""Unique identifier for the task within the workflow execution.""" + + timeout_type: OptionalNullable[str] = UNSET + r"""The type of timeout that occurred (e.g., 'START_TO_CLOSE', 'SCHEDULE_TO_START').""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["timeout_type"]) + nullable_fields = set(["timeout_type"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowtasktimedoutresponse.py b/src/mistralai/client/models/workflowtasktimedoutresponse.py new file mode 100644 index 00000000..2c3350e0 --- /dev/null +++ b/src/mistralai/client/models/workflowtasktimedoutresponse.py @@ -0,0 +1,114 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8b7540c47083 + +from __future__ import annotations +from .workflowtasktimedoutattributes import ( + WorkflowTaskTimedOutAttributes, + WorkflowTaskTimedOutAttributesTypedDict, +) +from mistralai.client.types import BaseModel, Nullable, UNSET_SENTINEL +from mistralai.client.utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional +from typing_extensions import Annotated, TypedDict + + +class WorkflowTaskTimedOutResponseTypedDict(TypedDict): + r"""Emitted when a workflow task times out. + + This indicates the workflow task (a unit of workflow execution) exceeded + its configured timeout. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + attributes: WorkflowTaskTimedOutAttributesTypedDict + r"""Attributes for workflow task timed out events.""" + event_type: Literal["WORKFLOW_TASK_TIMED_OUT"] + r"""Event type discriminator.""" + + +class WorkflowTaskTimedOutResponse(BaseModel): + r"""Emitted when a workflow task times out. + + This indicates the workflow task (a unit of workflow execution) exceeded + its configured timeout. + """ + + event_id: str + r"""Unique identifier for this event instance.""" + + event_timestamp: int + r"""Unix timestamp in nanoseconds when the event was created.""" + + root_workflow_exec_id: str + r"""Execution ID of the root workflow that initiated this execution chain.""" + + parent_workflow_exec_id: Nullable[str] + r"""Execution ID of the parent workflow that initiated this execution. If this is a root workflow, this field is not set.""" + + workflow_exec_id: str + r"""Execution ID of the workflow that emitted this event.""" + + workflow_run_id: str + r"""Run ID of the workflow execution. Changes on continue-as-new while workflow_exec_id stays the same.""" + + workflow_name: str + r"""The registered name of the workflow that emitted this event.""" + + attributes: WorkflowTaskTimedOutAttributes + r"""Attributes for workflow task timed out events.""" + + event_type: Annotated[ + Annotated[ + Optional[Literal["WORKFLOW_TASK_TIMED_OUT"]], + AfterValidator(validate_const("WORKFLOW_TASK_TIMED_OUT")), + ], + pydantic.Field(alias="event_type"), + ] = "WORKFLOW_TASK_TIMED_OUT" + r"""Event type discriminator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["event_type"]) + nullable_fields = set(["parent_workflow_exec_id"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +try: + WorkflowTaskTimedOutResponse.model_rebuild() +except NameError: + pass diff --git a/src/mistralai/client/models/workflowtype.py b/src/mistralai/client/models/workflowtype.py new file mode 100644 index 00000000..67858c88 --- /dev/null +++ b/src/mistralai/client/models/workflowtype.py @@ -0,0 +1,8 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 01f37d193b17 + +from __future__ import annotations +from typing import Literal + + +WorkflowType = Literal["code",] diff --git a/src/mistralai/client/models/workflowunarchiveresponse.py b/src/mistralai/client/models/workflowunarchiveresponse.py new file mode 100644 index 00000000..16717856 --- /dev/null +++ b/src/mistralai/client/models/workflowunarchiveresponse.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 30bdd050feac + +from __future__ import annotations +from .workflow import Workflow, WorkflowTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowUnarchiveResponseTypedDict(TypedDict): + workflow: WorkflowTypedDict + + +class WorkflowUnarchiveResponse(BaseModel): + workflow: Workflow diff --git a/src/mistralai/client/models/workflowupdaterequest.py b/src/mistralai/client/models/workflowupdaterequest.py new file mode 100644 index 00000000..480fa47d --- /dev/null +++ b/src/mistralai/client/models/workflowupdaterequest.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 8f3878d3c7c7 + +from __future__ import annotations +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class WorkflowUpdateRequestTypedDict(TypedDict): + display_name: NotRequired[Nullable[str]] + r"""New display name value""" + description: NotRequired[Nullable[str]] + r"""New description value""" + available_in_chat_assistant: NotRequired[Nullable[bool]] + r"""Whether to make the workflow available in the chat assistant""" + + +class WorkflowUpdateRequest(BaseModel): + display_name: OptionalNullable[str] = UNSET + r"""New display name value""" + + description: OptionalNullable[str] = UNSET + r"""New description value""" + + available_in_chat_assistant: OptionalNullable[bool] = UNSET + r"""Whether to make the workflow available in the chat assistant""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + ["display_name", "description", "available_in_chat_assistant"] + ) + nullable_fields = set( + ["display_name", "description", "available_in_chat_assistant"] + ) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/client/models/workflowupdateresponse.py b/src/mistralai/client/models/workflowupdateresponse.py new file mode 100644 index 00000000..3336e448 --- /dev/null +++ b/src/mistralai/client/models/workflowupdateresponse.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 0ae165cc7a82 + +from __future__ import annotations +from .workflow import Workflow, WorkflowTypedDict +from mistralai.client.types import BaseModel +from typing_extensions import TypedDict + + +class WorkflowUpdateResponseTypedDict(TypedDict): + workflow: WorkflowTypedDict + + +class WorkflowUpdateResponse(BaseModel): + workflow: Workflow diff --git a/src/mistralai/client/models/workflowwithworkerstatus.py b/src/mistralai/client/models/workflowwithworkerstatus.py new file mode 100644 index 00000000..81030e21 --- /dev/null +++ b/src/mistralai/client/models/workflowwithworkerstatus.py @@ -0,0 +1,117 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e1055203af7d + +from __future__ import annotations +from .workflowtype import WorkflowType +from mistralai.client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class WorkflowWithWorkerStatusTypedDict(TypedDict): + id: str + r"""Unique identifier of the workflow""" + name: str + r"""Name of the workflow""" + display_name: str + r"""Display name of the workflow""" + type: WorkflowType + customer_id: str + r"""Customer ID of the workflow""" + workspace_id: str + r"""Workspace ID of the workflow""" + active: bool + r"""Whether the workflow is active""" + description: NotRequired[Nullable[str]] + r"""Description of the workflow""" + shared_namespace: NotRequired[Nullable[str]] + r"""Reserved namespace for shared workflows (e.g., 'shared:my-shared-workflow')""" + available_in_chat_assistant: NotRequired[bool] + r"""Whether the workflow is available in chat assistant""" + is_technical: NotRequired[bool] + r"""Whether the workflow is technical (e.g. SDK-managed)""" + on_behalf_of: NotRequired[bool] + r"""Whether the workflow must run associated to a user's identity""" + archived: NotRequired[bool] + r"""Whether the workflow is archived""" + + +class WorkflowWithWorkerStatus(BaseModel): + id: str + r"""Unique identifier of the workflow""" + + name: str + r"""Name of the workflow""" + + display_name: str + r"""Display name of the workflow""" + + type: WorkflowType + + customer_id: str + r"""Customer ID of the workflow""" + + workspace_id: str + r"""Workspace ID of the workflow""" + + active: bool + r"""Whether the workflow is active""" + + description: OptionalNullable[str] = UNSET + r"""Description of the workflow""" + + shared_namespace: OptionalNullable[str] = UNSET + r"""Reserved namespace for shared workflows (e.g., 'shared:my-shared-workflow')""" + + available_in_chat_assistant: Optional[bool] = False + r"""Whether the workflow is available in chat assistant""" + + is_technical: Optional[bool] = False + r"""Whether the workflow is technical (e.g. SDK-managed)""" + + on_behalf_of: Optional[bool] = False + r"""Whether the workflow must run associated to a user's identity""" + + archived: Optional[bool] = False + r"""Whether the workflow is archived""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "description", + "shared_namespace", + "available_in_chat_assistant", + "is_technical", + "on_behalf_of", + "archived", + ] + ) + nullable_fields = set(["description", "shared_namespace"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/mistralai/models_.py b/src/mistralai/client/models_.py similarity index 84% rename from src/mistralai/models_.py rename to src/mistralai/client/models_.py index b6cc3186..2a00325f 100644 --- a/src/mistralai/models_.py +++ b/src/mistralai/client/models_.py @@ -1,11 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1d277958a843 from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Mapping, Optional @@ -15,6 +16,8 @@ class Models(BaseSDK): def list( self, *, + provider: OptionalNullable[str] = UNSET, + model: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -24,6 +27,8 @@ def list( List all models available to the user. + :param provider: + :param model: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -34,16 +39,25 @@ def list( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.ListModelsV1ModelsGetRequest( + provider=provider, + model=model, + ) + req = self._build_request( method="GET", path="/v1/models", base_url=base_url, url_variables=url_variables, - request=None, + request=request, request_body_required=False, request_has_path_params=False, request_has_query_params=True, @@ -51,6 +65,7 @@ def list( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -67,7 +82,7 @@ def list( config=self.sdk_configuration, base_url=base_url or "", operation_id="list_models_v1_models_get", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -82,21 +97,23 @@ def list( return unmarshal_json_response(models.ModelList, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def list_async( self, *, + provider: OptionalNullable[str] = UNSET, + model: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -106,6 +123,8 @@ async def list_async( List all models available to the user. + :param provider: + :param model: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -116,16 +135,25 @@ async def list_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: base_url = self._get_url(base_url, url_variables) + + request = models.ListModelsV1ModelsGetRequest( + provider=provider, + model=model, + ) + req = self._build_request_async( method="GET", path="/v1/models", base_url=base_url, url_variables=url_variables, - request=None, + request=request, request_body_required=False, request_has_path_params=False, request_has_query_params=True, @@ -133,6 +161,7 @@ async def list_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -149,7 +178,7 @@ async def list_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="list_models_v1_models_get", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -164,17 +193,17 @@ async def list_async( return unmarshal_json_response(models.ModelList, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def retrieve( self, @@ -184,7 +213,7 @@ def retrieve( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet: + ) -> models.ResponseRetrieveModelV1ModelsModelIDGet: r"""Retrieve Model Retrieve information about a model. @@ -200,6 +229,9 @@ def retrieve( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -222,6 +254,7 @@ def retrieve( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -238,7 +271,7 @@ def retrieve( config=self.sdk_configuration, base_url=base_url or "", operation_id="retrieve_model_v1_models__model_id__get", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -251,22 +284,21 @@ def retrieve( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return unmarshal_json_response( - models.RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet, - http_res, + models.ResponseRetrieveModelV1ModelsModelIDGet, http_res ) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def retrieve_async( self, @@ -276,7 +308,7 @@ async def retrieve_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet: + ) -> models.ResponseRetrieveModelV1ModelsModelIDGet: r"""Retrieve Model Retrieve information about a model. @@ -292,6 +324,9 @@ async def retrieve_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -314,6 +349,7 @@ async def retrieve_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -330,7 +366,7 @@ async def retrieve_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="retrieve_model_v1_models__model_id__get", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -343,22 +379,21 @@ async def retrieve_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return unmarshal_json_response( - models.RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet, - http_res, + models.ResponseRetrieveModelV1ModelsModelIDGet, http_res ) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def delete( self, @@ -368,7 +403,7 @@ def delete( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DeleteModelOut: + ) -> models.DeleteModelResponse: r"""Delete Model Delete a fine-tuned model. @@ -384,6 +419,9 @@ def delete( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -406,6 +444,7 @@ def delete( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -422,7 +461,7 @@ def delete( config=self.sdk_configuration, base_url=base_url or "", operation_id="delete_model_v1_models__model_id__delete", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -434,20 +473,20 @@ def delete( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.DeleteModelOut, http_res) + return unmarshal_json_response(models.DeleteModelResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def delete_async( self, @@ -457,7 +496,7 @@ async def delete_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.DeleteModelOut: + ) -> models.DeleteModelResponse: r"""Delete Model Delete a fine-tuned model. @@ -473,6 +512,9 @@ async def delete_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -495,6 +537,7 @@ async def delete_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -511,7 +554,7 @@ async def delete_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="delete_model_v1_models__model_id__delete", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -523,20 +566,20 @@ async def delete_async( response_data: Any = None if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.DeleteModelOut, http_res) + return unmarshal_json_response(models.DeleteModelResponse, http_res) if utils.match_response(http_res, "422", "application/json"): response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res + errors.HTTPValidationErrorData, http_res ) - raise models.HTTPValidationError(response_data, http_res) + raise errors.HTTPValidationError(response_data, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def update( self, @@ -566,6 +609,9 @@ def update( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -573,7 +619,7 @@ def update( request = models.JobsAPIRoutesFineTuningUpdateFineTunedModelRequest( model_id=model_id, - update_ft_model_in=models.UpdateFTModelIn( + update_model_request=models.UpdateModelRequest( name=name, description=description, ), @@ -593,8 +639,13 @@ def update( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.update_ft_model_in, False, False, "json", models.UpdateFTModelIn + request.update_model_request, + False, + False, + "json", + models.UpdateModelRequest, ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -611,7 +662,7 @@ def update( config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_update_fine_tuned_model", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -627,12 +678,12 @@ def update( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def update_async( self, @@ -662,6 +713,9 @@ async def update_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -669,7 +723,7 @@ async def update_async( request = models.JobsAPIRoutesFineTuningUpdateFineTunedModelRequest( model_id=model_id, - update_ft_model_in=models.UpdateFTModelIn( + update_model_request=models.UpdateModelRequest( name=name, description=description, ), @@ -689,8 +743,13 @@ async def update_async( http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.update_ft_model_in, False, False, "json", models.UpdateFTModelIn + request.update_model_request, + False, + False, + "json", + models.UpdateModelRequest, ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -707,7 +766,7 @@ async def update_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_update_fine_tuned_model", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -723,12 +782,12 @@ async def update_async( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def archive( self, @@ -738,7 +797,7 @@ def archive( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ArchiveFTModelOut: + ) -> models.ArchiveModelResponse: r"""Archive Fine Tuned Model Archive a fine-tuned model. @@ -754,6 +813,9 @@ def archive( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -776,6 +838,7 @@ def archive( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -792,7 +855,7 @@ def archive( config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_archive_fine_tuned_model", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -803,15 +866,15 @@ def archive( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ArchiveFTModelOut, http_res) + return unmarshal_json_response(models.ArchiveModelResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def archive_async( self, @@ -821,7 +884,7 @@ async def archive_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ArchiveFTModelOut: + ) -> models.ArchiveModelResponse: r"""Archive Fine Tuned Model Archive a fine-tuned model. @@ -837,6 +900,9 @@ async def archive_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -859,6 +925,7 @@ async def archive_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -875,7 +942,7 @@ async def archive_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_archive_fine_tuned_model", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -886,15 +953,15 @@ async def archive_async( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ArchiveFTModelOut, http_res) + return unmarshal_json_response(models.ArchiveModelResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def unarchive( self, @@ -904,7 +971,7 @@ def unarchive( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.UnarchiveFTModelOut: + ) -> models.UnarchiveModelResponse: r"""Unarchive Fine Tuned Model Un-archive a fine-tuned model. @@ -920,6 +987,9 @@ def unarchive( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -942,6 +1012,7 @@ def unarchive( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -958,7 +1029,7 @@ def unarchive( config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_unarchive_fine_tuned_model", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -969,15 +1040,15 @@ def unarchive( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.UnarchiveFTModelOut, http_res) + return unmarshal_json_response(models.UnarchiveModelResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def unarchive_async( self, @@ -987,7 +1058,7 @@ async def unarchive_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.UnarchiveFTModelOut: + ) -> models.UnarchiveModelResponse: r"""Unarchive Fine Tuned Model Un-archive a fine-tuned model. @@ -1003,6 +1074,9 @@ async def unarchive_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -1025,6 +1099,7 @@ async def unarchive_async( accept_header_value="application/json", http_headers=http_headers, security=self.sdk_configuration.security, + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -1041,7 +1116,7 @@ async def unarchive_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="jobs_api_routes_fine_tuning_unarchive_fine_tuned_model", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -1052,12 +1127,12 @@ async def unarchive_async( ) if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.UnarchiveFTModelOut, http_res) + return unmarshal_json_response(models.UnarchiveModelResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/observability.py b/src/mistralai/client/observability.py new file mode 100644 index 00000000..4057909e --- /dev/null +++ b/src/mistralai/client/observability.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 453a1d06d130 + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from mistralai.client.campaigns import Campaigns +from mistralai.client.chat_completion_events import ChatCompletionEvents +from mistralai.client.datasets import Datasets +from mistralai.client.judges import Judges +from typing import Optional + + +class Observability(BaseSDK): + chat_completion_events: ChatCompletionEvents + judges: Judges + campaigns: Campaigns + datasets: Datasets + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.chat_completion_events = ChatCompletionEvents( + self.sdk_configuration, parent_ref=self.parent_ref + ) + self.judges = Judges(self.sdk_configuration, parent_ref=self.parent_ref) + self.campaigns = Campaigns(self.sdk_configuration, parent_ref=self.parent_ref) + self.datasets = Datasets(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/mistralai/client/ocr.py b/src/mistralai/client/ocr.py new file mode 100644 index 00000000..c290b1bb --- /dev/null +++ b/src/mistralai/client/ocr.py @@ -0,0 +1,294 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2f804a12fc62 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import Nullable, OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional, Union + + +class Ocr(BaseSDK): + r"""OCR API""" + + def process( + self, + *, + model: Nullable[str], + document: Union[models.DocumentUnion, models.DocumentUnionTypedDict], + pages: OptionalNullable[Union[models.Pages, models.PagesTypedDict]] = UNSET, + include_image_base64: OptionalNullable[bool] = UNSET, + image_limit: OptionalNullable[int] = UNSET, + image_min_size: OptionalNullable[int] = UNSET, + bbox_annotation_format: OptionalNullable[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = UNSET, + document_annotation_format: OptionalNullable[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = UNSET, + document_annotation_prompt: OptionalNullable[str] = UNSET, + table_format: OptionalNullable[models.TableFormat] = UNSET, + extract_header: Optional[bool] = None, + extract_footer: Optional[bool] = None, + confidence_scores_granularity: OptionalNullable[ + models.ConfidenceScoresGranularity + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.OCRResponse: + r"""OCR + + :param model: + :param document: Document to run OCR on + :param pages: Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0. + :param include_image_base64: Include image URLs in response + :param image_limit: Max images to extract + :param image_min_size: Minimum height and width of image to extract + :param bbox_annotation_format: Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field + :param document_annotation_format: Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field + :param document_annotation_prompt: Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided. + :param table_format: + :param extract_header: + :param extract_footer: + :param confidence_scores_granularity: Granularity for confidence scores: 'word' (per-word scores) or 'page' (aggregate only). Defaults to None (no confidence scores) to keep response payload small. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.OCRRequest( + model=model, + document=utils.get_pydantic_model(document, models.DocumentUnion), + pages=pages, + include_image_base64=include_image_base64, + image_limit=image_limit, + image_min_size=image_min_size, + bbox_annotation_format=utils.get_pydantic_model( + bbox_annotation_format, OptionalNullable[models.ResponseFormat] + ), + document_annotation_format=utils.get_pydantic_model( + document_annotation_format, OptionalNullable[models.ResponseFormat] + ), + document_annotation_prompt=document_annotation_prompt, + table_format=table_format, + extract_header=extract_header, + extract_footer=extract_footer, + confidence_scores_granularity=confidence_scores_granularity, + ) + + req = self._build_request( + method="POST", + path="/v1/ocr", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.OCRRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="ocr_v1_ocr_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.OCRResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def process_async( + self, + *, + model: Nullable[str], + document: Union[models.DocumentUnion, models.DocumentUnionTypedDict], + pages: OptionalNullable[Union[models.Pages, models.PagesTypedDict]] = UNSET, + include_image_base64: OptionalNullable[bool] = UNSET, + image_limit: OptionalNullable[int] = UNSET, + image_min_size: OptionalNullable[int] = UNSET, + bbox_annotation_format: OptionalNullable[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = UNSET, + document_annotation_format: OptionalNullable[ + Union[models.ResponseFormat, models.ResponseFormatTypedDict] + ] = UNSET, + document_annotation_prompt: OptionalNullable[str] = UNSET, + table_format: OptionalNullable[models.TableFormat] = UNSET, + extract_header: Optional[bool] = None, + extract_footer: Optional[bool] = None, + confidence_scores_granularity: OptionalNullable[ + models.ConfidenceScoresGranularity + ] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.OCRResponse: + r"""OCR + + :param model: + :param document: Document to run OCR on + :param pages: Specific pages to process. Accepts a list of integers or a string of comma-separated numbers and ranges (e.g. '0,1,2' or '0-5' or '0,2-4'). Page numbers start from 0. + :param include_image_base64: Include image URLs in response + :param image_limit: Max images to extract + :param image_min_size: Minimum height and width of image to extract + :param bbox_annotation_format: Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field + :param document_annotation_format: Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field + :param document_annotation_prompt: Optional prompt to guide the model in extracting structured output from the entire document. A document_annotation_format must be provided. + :param table_format: + :param extract_header: + :param extract_footer: + :param confidence_scores_granularity: Granularity for confidence scores: 'word' (per-word scores) or 'page' (aggregate only). Defaults to None (no confidence scores) to keep response payload small. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.OCRRequest( + model=model, + document=utils.get_pydantic_model(document, models.DocumentUnion), + pages=pages, + include_image_base64=include_image_base64, + image_limit=image_limit, + image_min_size=image_min_size, + bbox_annotation_format=utils.get_pydantic_model( + bbox_annotation_format, OptionalNullable[models.ResponseFormat] + ), + document_annotation_format=utils.get_pydantic_model( + document_annotation_format, OptionalNullable[models.ResponseFormat] + ), + document_annotation_prompt=document_annotation_prompt, + table_format=table_format, + extract_header=extract_header, + extract_footer=extract_footer, + confidence_scores_granularity=confidence_scores_granularity, + ) + + req = self._build_request_async( + method="POST", + path="/v1/ocr", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.OCRRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="ocr_v1_ocr_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.OCRResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/py.typed b/src/mistralai/client/py.typed similarity index 100% rename from src/mistralai/py.typed rename to src/mistralai/client/py.typed diff --git a/src/mistralai/client/rag.py b/src/mistralai/client/rag.py new file mode 100644 index 00000000..091b0270 --- /dev/null +++ b/src/mistralai/client/rag.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 2c2b641de1b6 + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from mistralai.client.ingestion_pipeline_configurations import ( + IngestionPipelineConfigurations, +) +from typing import Optional + + +class Rag(BaseSDK): + ingestion_pipeline_configurations: IngestionPipelineConfigurations + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.ingestion_pipeline_configurations = IngestionPipelineConfigurations( + self.sdk_configuration, parent_ref=self.parent_ref + ) diff --git a/src/mistralai/client/records.py b/src/mistralai/client/records.py new file mode 100644 index 00000000..2ac04c2f --- /dev/null +++ b/src/mistralai/client/records.py @@ -0,0 +1,1214 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 10f90c990bd8 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional, Union + + +class Records(BaseSDK): + def fetch( + self, + *, + dataset_record_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetRecord: + r"""Get the content of a given conversation from a dataset + + :param dataset_record_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequest( + dataset_record_id=dataset_record_id, + ) + + req = self._build_request( + method="GET", + path="/v1/observability/dataset-records/{dataset_record_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_record_v1_observability_dataset_records__dataset_record_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DatasetRecord, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def fetch_async( + self, + *, + dataset_record_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.DatasetRecord: + r"""Get the content of a given conversation from a dataset + + :param dataset_record_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDGetRequest( + dataset_record_id=dataset_record_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/observability/dataset-records/{dataset_record_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_dataset_record_v1_observability_dataset_records__dataset_record_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.DatasetRecord, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + dataset_record_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a record from a dataset + + :param dataset_record_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequest( + dataset_record_id=dataset_record_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/observability/dataset-records/{dataset_record_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_dataset_record_v1_observability_dataset_records__dataset_record_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + dataset_record_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete a record from a dataset + + :param dataset_record_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDDeleteRequest( + dataset_record_id=dataset_record_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/observability/dataset-records/{dataset_record_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_dataset_record_v1_observability_dataset_records__dataset_record_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def bulk_delete( + self, + *, + dataset_record_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete multiple records from datasets + + :param dataset_record_ids: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteDatasetRecordsRequest( + dataset_record_ids=dataset_record_ids, + ) + + req = self._build_request( + method="POST", + path="/v1/observability/dataset-records/bulk-delete", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.DeleteDatasetRecordsRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_dataset_records_v1_observability_dataset_records_bulk_delete_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def bulk_delete_async( + self, + *, + dataset_record_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Delete multiple records from datasets + + :param dataset_record_ids: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteDatasetRecordsRequest( + dataset_record_ids=dataset_record_ids, + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/dataset-records/bulk-delete", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.DeleteDatasetRecordsRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_dataset_records_v1_observability_dataset_records_bulk_delete_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def judge( + self, + *, + dataset_record_id: str, + judge_definition: Union[ + models.CreateJudgeRequest, models.CreateJudgeRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JudgeOutput: + r"""Run Judge on a dataset record based on the given options + + :param dataset_record_id: + :param judge_definition: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequest( + dataset_record_id=dataset_record_id, + judge_dataset_record_request=models.JudgeDatasetRecordRequest( + judge_definition=utils.get_pydantic_model( + judge_definition, models.CreateJudgeRequest + ), + ), + ) + + req = self._build_request( + method="POST", + path="/v1/observability/dataset-records/{dataset_record_id}/live-judging", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.judge_dataset_record_request, + False, + False, + "json", + models.JudgeDatasetRecordRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="judge_dataset_record_v1_observability_dataset_records__dataset_record_id__live_judging_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.JudgeOutput, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def judge_async( + self, + *, + dataset_record_id: str, + judge_definition: Union[ + models.CreateJudgeRequest, models.CreateJudgeRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.JudgeOutput: + r"""Run Judge on a dataset record based on the given options + + :param dataset_record_id: + :param judge_definition: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.JudgeDatasetRecordV1ObservabilityDatasetRecordsDatasetRecordIDLiveJudgingPostRequest( + dataset_record_id=dataset_record_id, + judge_dataset_record_request=models.JudgeDatasetRecordRequest( + judge_definition=utils.get_pydantic_model( + judge_definition, models.CreateJudgeRequest + ), + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/observability/dataset-records/{dataset_record_id}/live-judging", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.judge_dataset_record_request, + False, + False, + "json", + models.JudgeDatasetRecordRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="judge_dataset_record_v1_observability_dataset_records__dataset_record_id__live_judging_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.JudgeOutput, http_res) + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update_payload( + self, + *, + dataset_record_id: str, + payload: Union[models.ConversationPayload, models.ConversationPayloadTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Update a dataset record conversation payload + + :param dataset_record_id: + :param payload: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequest( + dataset_record_id=dataset_record_id, + update_dataset_record_payload_request=models.UpdateDatasetRecordPayloadRequest( + payload=utils.get_pydantic_model(payload, models.ConversationPayload), + ), + ) + + req = self._build_request( + method="PUT", + path="/v1/observability/dataset-records/{dataset_record_id}/payload", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_dataset_record_payload_request, + False, + False, + "json", + models.UpdateDatasetRecordPayloadRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_dataset_record_payload_v1_observability_dataset_records__dataset_record_id__payload_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_payload_async( + self, + *, + dataset_record_id: str, + payload: Union[models.ConversationPayload, models.ConversationPayloadTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Update a dataset record conversation payload + + :param dataset_record_id: + :param payload: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateDatasetRecordPayloadV1ObservabilityDatasetRecordsDatasetRecordIDPayloadPutRequest( + dataset_record_id=dataset_record_id, + update_dataset_record_payload_request=models.UpdateDatasetRecordPayloadRequest( + payload=utils.get_pydantic_model(payload, models.ConversationPayload), + ), + ) + + req = self._build_request_async( + method="PUT", + path="/v1/observability/dataset-records/{dataset_record_id}/payload", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_dataset_record_payload_request, + False, + False, + "json", + models.UpdateDatasetRecordPayloadRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_dataset_record_payload_v1_observability_dataset_records__dataset_record_id__payload_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update_properties( + self, + *, + dataset_record_id: str, + properties: Dict[str, Any], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Update conversation properties + + :param dataset_record_id: + :param properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequest( + dataset_record_id=dataset_record_id, + update_dataset_record_properties_request=models.UpdateDatasetRecordPropertiesRequest( + properties=properties, + ), + ) + + req = self._build_request( + method="PUT", + path="/v1/observability/dataset-records/{dataset_record_id}/properties", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_dataset_record_properties_request, + False, + False, + "json", + models.UpdateDatasetRecordPropertiesRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_dataset_record_properties_v1_observability_dataset_records__dataset_record_id__properties_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_properties_async( + self, + *, + dataset_record_id: str, + properties: Dict[str, Any], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Update conversation properties + + :param dataset_record_id: + :param properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateDatasetRecordPropertiesV1ObservabilityDatasetRecordsDatasetRecordIDPropertiesPutRequest( + dataset_record_id=dataset_record_id, + update_dataset_record_properties_request=models.UpdateDatasetRecordPropertiesRequest( + properties=properties, + ), + ) + + req = self._build_request_async( + method="PUT", + path="/v1/observability/dataset-records/{dataset_record_id}/properties", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_dataset_record_properties_request, + False, + False, + "json", + models.UpdateDatasetRecordPropertiesRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_dataset_record_properties_v1_observability_dataset_records__dataset_record_id__properties_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "404", "408", "409", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["400", "404", "408", "409", "422"], "application/json" + ): + response_data = unmarshal_json_response( + errors.ObservabilityErrorData, http_res + ) + raise errors.ObservabilityError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/runs.py b/src/mistralai/client/runs.py new file mode 100644 index 00000000..d1a242fb --- /dev/null +++ b/src/mistralai/client/runs.py @@ -0,0 +1,682 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 4297d58aeb21 + +from .basesdk import BaseSDK +from jsonpath import JSONPath +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union + + +class Runs(BaseSDK): + def list_runs( + self, + *, + workflow_identifier: OptionalNullable[str] = UNSET, + search: OptionalNullable[str] = UNSET, + status: OptionalNullable[ + Union[ + models.ListRunsV1WorkflowsRunsGetStatus, + models.ListRunsV1WorkflowsRunsGetStatusTypedDict, + ] + ] = UNSET, + user_id: OptionalNullable[str] = UNSET, + page_size: Optional[int] = 50, + next_page_token: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ListRunsV1WorkflowsRunsGetResponse]: + r"""List Runs + + :param workflow_identifier: Filter by workflow name or id + :param search: Search by workflow name, display name or id + :param status: Filter by workflow status + :param user_id: Filter by user id. Use 'current' to filter by the authenticated user + :param page_size: Number of items per page + :param next_page_token: Token for the next page of results + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListRunsV1WorkflowsRunsGetRequest( + workflow_identifier=workflow_identifier, + search=search, + status=status, + user_id=user_id, + page_size=page_size, + next_page_token=next_page_token, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/runs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="list_runs_v1_workflows_runs_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.ListRunsV1WorkflowsRunsGetResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + next_cursor = JSONPath("$.next_page_token").parse(body) + + if len(next_cursor) == 0: + return None + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return None + results = JSONPath("$.executions").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.page_size if isinstance(request.page_size, int) else 50 + if len(results[0]) < limit: + return None + + return self.list_runs( + workflow_identifier=workflow_identifier, + search=search, + status=status, + user_id=user_id, + page_size=page_size, + next_page_token=next_cursor, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.ListRunsV1WorkflowsRunsGetResponse( + result=unmarshal_json_response( + models.WorkflowExecutionListResponse, http_res + ), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_runs_async( + self, + *, + workflow_identifier: OptionalNullable[str] = UNSET, + search: OptionalNullable[str] = UNSET, + status: OptionalNullable[ + Union[ + models.ListRunsV1WorkflowsRunsGetStatus, + models.ListRunsV1WorkflowsRunsGetStatusTypedDict, + ] + ] = UNSET, + user_id: OptionalNullable[str] = UNSET, + page_size: Optional[int] = 50, + next_page_token: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ListRunsV1WorkflowsRunsGetResponse]: + r"""List Runs + + :param workflow_identifier: Filter by workflow name or id + :param search: Search by workflow name, display name or id + :param status: Filter by workflow status + :param user_id: Filter by user id. Use 'current' to filter by the authenticated user + :param page_size: Number of items per page + :param next_page_token: Token for the next page of results + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListRunsV1WorkflowsRunsGetRequest( + workflow_identifier=workflow_identifier, + search=search, + status=status, + user_id=user_id, + page_size=page_size, + next_page_token=next_page_token, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/runs", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="list_runs_v1_workflows_runs_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> ( + Awaitable[Optional[models.ListRunsV1WorkflowsRunsGetResponse]] + ): + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + async def empty_result(): + return None + + next_cursor = JSONPath("$.next_page_token").parse(body) + + if len(next_cursor) == 0: + return empty_result() + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return empty_result() + results = JSONPath("$.executions").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return empty_result() + limit = request.page_size if isinstance(request.page_size, int) else 50 + if len(results[0]) < limit: + return empty_result() + + return self.list_runs_async( + workflow_identifier=workflow_identifier, + search=search, + status=status, + user_id=user_id, + page_size=page_size, + next_page_token=next_cursor, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.ListRunsV1WorkflowsRunsGetResponse( + result=unmarshal_json_response( + models.WorkflowExecutionListResponse, http_res + ), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_run( + self, + *, + run_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionResponse: + r"""Get Run + + :param run_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetRunV1WorkflowsRunsRunIDGetRequest( + run_id=run_id, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/runs/{run_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_run_v1_workflows_runs__run_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowExecutionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_run_async( + self, + *, + run_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowExecutionResponse: + r"""Get Run + + :param run_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetRunV1WorkflowsRunsRunIDGetRequest( + run_id=run_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/runs/{run_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_run_v1_workflows_runs__run_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowExecutionResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_run_history( + self, + *, + run_id: str, + decode_payloads: Optional[bool] = True, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Any: + r"""Get Run History + + :param run_id: + :param decode_payloads: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequest( + run_id=run_id, + decode_payloads=decode_payloads, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/runs/{run_id}/history", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_run_history_v1_workflows_runs__run_id__history_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(Any, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_run_history_async( + self, + *, + run_id: str, + decode_payloads: Optional[bool] = True, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Any: + r"""Get Run History + + :param run_id: + :param decode_payloads: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetRunHistoryV1WorkflowsRunsRunIDHistoryGetRequest( + run_id=run_id, + decode_payloads=decode_payloads, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/runs/{run_id}/history", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_run_history_v1_workflows_runs__run_id__history_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(Any, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/schedules.py b/src/mistralai/client/schedules.py new file mode 100644 index 00000000..9b013acd --- /dev/null +++ b/src/mistralai/client/schedules.py @@ -0,0 +1,1008 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d3b4fe452390 + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Mapping, Optional, Union + + +class Schedules(BaseSDK): + def get_schedules( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowScheduleListResponse: + r"""Get Schedules + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( + method="GET", + path="/v1/workflows/schedules", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_schedules_v1_workflows_schedules_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowScheduleListResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_schedules_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowScheduleListResponse: + r"""Get Schedules + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( + method="GET", + path="/v1/workflows/schedules", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_schedules_v1_workflows_schedules_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowScheduleListResponse, http_res + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def schedule_workflow( + self, + *, + schedule: Union[models.ScheduleDefinition, models.ScheduleDefinitionTypedDict], + workflow_registration_id: OptionalNullable[str] = UNSET, + workflow_version_id: OptionalNullable[str] = UNSET, + workflow_identifier: OptionalNullable[str] = UNSET, + workflow_task_queue: OptionalNullable[str] = UNSET, + schedule_id: OptionalNullable[str] = UNSET, + deployment_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowScheduleResponse: + r"""Schedule Workflow + + :param schedule: Specification of the times scheduled actions may occur. + + The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and + :py:attr:`cron_expressions` excluding anything in :py:attr:`skip`. + + Used for input where schedule_id is optional (can be provided or auto-generated). + :param workflow_registration_id: The ID of the workflow registration to schedule + :param workflow_version_id: Deprecated: use workflow_registration_id + :param workflow_identifier: The name or ID of the workflow to schedule + :param workflow_task_queue: Deprecated. Use deployment_name instead. + :param schedule_id: Allows you to specify a custom schedule ID. If not provided, a random ID will be generated. + :param deployment_name: Name of the deployment to route this schedule to + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.WorkflowScheduleRequest( + schedule=utils.get_pydantic_model(schedule, models.ScheduleDefinition), + workflow_registration_id=workflow_registration_id, + workflow_version_id=workflow_version_id, + workflow_identifier=workflow_identifier, + workflow_task_queue=workflow_task_queue, + schedule_id=schedule_id, + deployment_name=deployment_name, + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/schedules", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.WorkflowScheduleRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="schedule_workflow_v1_workflows_schedules_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.WorkflowScheduleResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def schedule_workflow_async( + self, + *, + schedule: Union[models.ScheduleDefinition, models.ScheduleDefinitionTypedDict], + workflow_registration_id: OptionalNullable[str] = UNSET, + workflow_version_id: OptionalNullable[str] = UNSET, + workflow_identifier: OptionalNullable[str] = UNSET, + workflow_task_queue: OptionalNullable[str] = UNSET, + schedule_id: OptionalNullable[str] = UNSET, + deployment_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowScheduleResponse: + r"""Schedule Workflow + + :param schedule: Specification of the times scheduled actions may occur. + + The times are the union of :py:attr:`calendars`, :py:attr:`intervals`, and + :py:attr:`cron_expressions` excluding anything in :py:attr:`skip`. + + Used for input where schedule_id is optional (can be provided or auto-generated). + :param workflow_registration_id: The ID of the workflow registration to schedule + :param workflow_version_id: Deprecated: use workflow_registration_id + :param workflow_identifier: The name or ID of the workflow to schedule + :param workflow_task_queue: Deprecated. Use deployment_name instead. + :param schedule_id: Allows you to specify a custom schedule ID. If not provided, a random ID will be generated. + :param deployment_name: Name of the deployment to route this schedule to + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.WorkflowScheduleRequest( + schedule=utils.get_pydantic_model(schedule, models.ScheduleDefinition), + workflow_registration_id=workflow_registration_id, + workflow_version_id=workflow_version_id, + workflow_identifier=workflow_identifier, + workflow_task_queue=workflow_task_queue, + schedule_id=schedule_id, + deployment_name=deployment_name, + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/schedules", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.WorkflowScheduleRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="schedule_workflow_v1_workflows_schedules_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(models.WorkflowScheduleResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def unschedule_workflow( + self, + *, + schedule_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Unschedule Workflow + + :param schedule_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequest( + schedule_id=schedule_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/workflows/schedules/{schedule_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="unschedule_workflow_v1_workflows_schedules__schedule_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def unschedule_workflow_async( + self, + *, + schedule_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Unschedule Workflow + + :param schedule_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UnscheduleWorkflowV1WorkflowsSchedulesScheduleIDDeleteRequest( + schedule_id=schedule_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/workflows/schedules/{schedule_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="unschedule_workflow_v1_workflows_schedules__schedule_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def pause_schedule( + self, + *, + schedule_id: str, + note: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Pause Schedule + + :param schedule_id: + :param note: Optional note recorded in Temporal when pausing or resuming a schedule + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest( + schedule_id=schedule_id, + workflow_schedule_pause_request=models.WorkflowSchedulePauseRequest( + note=note, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/schedules/{schedule_id}/pause", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_schedule_pause_request + if request is not None + else None, + True, + True, + "json", + OptionalNullable[models.WorkflowSchedulePauseRequest], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="pause_schedule_v1_workflows_schedules__schedule_id__pause_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def pause_schedule_async( + self, + *, + schedule_id: str, + note: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Pause Schedule + + :param schedule_id: + :param note: Optional note recorded in Temporal when pausing or resuming a schedule + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PauseScheduleV1WorkflowsSchedulesScheduleIDPausePostRequest( + schedule_id=schedule_id, + workflow_schedule_pause_request=models.WorkflowSchedulePauseRequest( + note=note, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/schedules/{schedule_id}/pause", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_schedule_pause_request + if request is not None + else None, + True, + True, + "json", + OptionalNullable[models.WorkflowSchedulePauseRequest], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="pause_schedule_v1_workflows_schedules__schedule_id__pause_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def resume_schedule( + self, + *, + schedule_id: str, + note: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Resume Schedule + + :param schedule_id: + :param note: Optional note recorded in Temporal when pausing or resuming a schedule + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequest( + schedule_id=schedule_id, + workflow_schedule_pause_request=models.WorkflowSchedulePauseRequest( + note=note, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/schedules/{schedule_id}/resume", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_schedule_pause_request + if request is not None + else None, + True, + True, + "json", + OptionalNullable[models.WorkflowSchedulePauseRequest], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="resume_schedule_v1_workflows_schedules__schedule_id__resume_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def resume_schedule_async( + self, + *, + schedule_id: str, + note: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ): + r"""Resume Schedule + + :param schedule_id: + :param note: Optional note recorded in Temporal when pausing or resuming a schedule + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ResumeScheduleV1WorkflowsSchedulesScheduleIDResumePostRequest( + schedule_id=schedule_id, + workflow_schedule_pause_request=models.WorkflowSchedulePauseRequest( + note=note, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/schedules/{schedule_id}/resume", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_schedule_pause_request + if request is not None + else None, + True, + True, + "json", + OptionalNullable[models.WorkflowSchedulePauseRequest], + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="resume_schedule_v1_workflows_schedules__schedule_id__resume_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/sdk.py b/src/mistralai/client/sdk.py new file mode 100644 index 00000000..03338f46 --- /dev/null +++ b/src/mistralai/client/sdk.py @@ -0,0 +1,229 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 48edbcb38d7e + +from .basesdk import BaseSDK +from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients +from .sdkconfiguration import SDKConfiguration +from .utils.logger import Logger, get_default_logger +from .utils.retries import RetryConfig +import httpx +import importlib +from mistralai.client import models as models_, utils +from mistralai.client._hooks import SDKHooks +from mistralai.client.types import OptionalNullable, UNSET +import sys +from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast +import weakref + +if TYPE_CHECKING: + from mistralai.client.agents import Agents + from mistralai.client.audio import Audio + from mistralai.client.batch import Batch + from mistralai.client.beta import Beta + from mistralai.client.chat import Chat + from mistralai.client.classifiers import Classifiers + from mistralai.client.embeddings import Embeddings + from mistralai.client.events import Events + from mistralai.client.files import Files + from mistralai.client.fim import Fim + from mistralai.client.fine_tuning import FineTuning + from mistralai.client.models_ import Models + from mistralai.client.ocr import Ocr + from mistralai.client.workflows import Workflows + + +class Mistral(BaseSDK): + r"""Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.""" + + audio: "Audio" + models: "Models" + r"""Model Management API""" + beta: "Beta" + files: "Files" + r"""Files API""" + fine_tuning: "FineTuning" + batch: "Batch" + chat: "Chat" + r"""Chat Completion API.""" + fim: "Fim" + r"""Fill-in-the-middle API.""" + agents: "Agents" + r"""Agents API.""" + embeddings: "Embeddings" + r"""Embeddings API.""" + classifiers: "Classifiers" + r"""Classifiers API.""" + ocr: "Ocr" + r"""OCR API""" + workflows: "Workflows" + events: "Events" + _sub_sdk_map = { + "audio": ("mistralai.client.audio", "Audio"), + "models": ("mistralai.client.models_", "Models"), + "beta": ("mistralai.client.beta", "Beta"), + "files": ("mistralai.client.files", "Files"), + "fine_tuning": ("mistralai.client.fine_tuning", "FineTuning"), + "batch": ("mistralai.client.batch", "Batch"), + "chat": ("mistralai.client.chat", "Chat"), + "fim": ("mistralai.client.fim", "Fim"), + "agents": ("mistralai.client.agents", "Agents"), + "embeddings": ("mistralai.client.embeddings", "Embeddings"), + "classifiers": ("mistralai.client.classifiers", "Classifiers"), + "ocr": ("mistralai.client.ocr", "Ocr"), + "workflows": ("mistralai.client.workflows", "Workflows"), + "events": ("mistralai.client.events", "Events"), + } + + def __init__( + self, + api_key: Optional[Union[Optional[str], Callable[[], Optional[str]]]] = None, + server: Optional[str] = None, + url_params: Optional[Dict[str, str]] = None, + server_url: Optional[str] = None, + client: Optional[HttpClient] = None, + async_client: Optional[AsyncHttpClient] = None, + retry_config: OptionalNullable[RetryConfig] = UNSET, + timeout_ms: Optional[int] = None, + debug_logger: Optional[Logger] = None, + ) -> None: + r"""Instantiates the SDK configuring it with the provided parameters. + + :param api_key: The api_key required for authentication + :param server: The server by name to use for all methods + :param server_url: The server URL to use for all methods + :param url_params: Parameters to optionally template the server URL with + :param client: The HTTP client to use for all synchronous methods + :param async_client: The Async HTTP client to use for all asynchronous methods + :param retry_config: The retry configuration to use for all supported methods + :param timeout_ms: Optional request timeout applied to each operation in milliseconds + """ + client_supplied = True + if client is None: + client = httpx.Client(follow_redirects=True) + client_supplied = False + + assert issubclass( + type(client), HttpClient + ), "The provided client must implement the HttpClient protocol." + + async_client_supplied = True + if async_client is None: + async_client = httpx.AsyncClient(follow_redirects=True) + async_client_supplied = False + + if debug_logger is None: + debug_logger = get_default_logger() + + assert issubclass( + type(async_client), AsyncHttpClient + ), "The provided async_client must implement the AsyncHttpClient protocol." + + security: Any = None + if callable(api_key): + # pylint: disable=unnecessary-lambda-assignment + security = lambda: models_.Security(api_key=api_key()) + else: + security = models_.Security(api_key=api_key) + + if server_url is not None: + if url_params is not None: + server_url = utils.template_url(server_url, url_params) + + BaseSDK.__init__( + self, + SDKConfiguration( + client=client, + client_supplied=client_supplied, + async_client=async_client, + async_client_supplied=async_client_supplied, + security=security, + server_url=server_url, + server=server, + retry_config=retry_config, + timeout_ms=timeout_ms, + debug_logger=debug_logger, + ), + parent_ref=self, + ) + + hooks = SDKHooks() + + # pylint: disable=protected-access + self.sdk_configuration.__dict__["_hooks"] = hooks + + current_server_url, *_ = self.sdk_configuration.get_server_details() + server_url, self.sdk_configuration.client = hooks.sdk_init( + current_server_url, client + ) + if current_server_url != server_url: + self.sdk_configuration.server_url = server_url + + weakref.finalize( + self, + close_clients, + cast(ClientOwner, self.sdk_configuration), + self.sdk_configuration.client, + self.sdk_configuration.client_supplied, + self.sdk_configuration.async_client, + self.sdk_configuration.async_client_supplied, + ) + + def dynamic_import(self, modname, retries=3): + for attempt in range(retries): + try: + return importlib.import_module(modname) + except KeyError: + # Clear any half-initialized module and retry + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + def __getattr__(self, name: str): + if name in self._sub_sdk_map: + module_path, class_name = self._sub_sdk_map[name] + try: + module = self.dynamic_import(module_path) + klass = getattr(module, class_name) + instance = klass(self.sdk_configuration, parent_ref=self) + setattr(self, name, instance) + return instance + except ImportError as e: + raise AttributeError( + f"Failed to import module {module_path} for attribute {name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}" + ) from e + + raise AttributeError( + f"'{type(self).__name__}' object has no attribute '{name}'" + ) + + def __dir__(self): + default_attrs = list(super().__dir__()) + lazy_attrs = list(self._sub_sdk_map.keys()) + return sorted(list(set(default_attrs + lazy_attrs))) + + def __enter__(self): + return self + + async def __aenter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if ( + self.sdk_configuration.client is not None + and not self.sdk_configuration.client_supplied + ): + self.sdk_configuration.client.close() + self.sdk_configuration.client = None + + async def __aexit__(self, exc_type, exc_val, exc_tb): + if ( + self.sdk_configuration.async_client is not None + and not self.sdk_configuration.async_client_supplied + ): + await self.sdk_configuration.async_client.aclose() + self.sdk_configuration.async_client = None diff --git a/src/mistralai/client/sdkconfiguration.py b/src/mistralai/client/sdkconfiguration.py new file mode 100644 index 00000000..712e92e0 --- /dev/null +++ b/src/mistralai/client/sdkconfiguration.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b7dd68a0235e + +from ._version import ( + __gen_version__, + __openapi_doc_version__, + __user_agent__, + __version__, +) +from .httpclient import AsyncHttpClient, HttpClient +from .utils import Logger, RetryConfig, remove_suffix +from dataclasses import dataclass +from mistralai.client import models +from mistralai.client.types import OptionalNullable, UNSET +from pydantic import Field +from typing import Callable, Dict, Optional, Tuple, Union + + +SERVER_EU = "eu" +r"""EU Production server""" +SERVERS = { + SERVER_EU: "https://api.mistral.ai", +} +"""Contains the list of servers available to the SDK""" + + +@dataclass +class SDKConfiguration: + client: Union[HttpClient, None] + client_supplied: bool + async_client: Union[AsyncHttpClient, None] + async_client_supplied: bool + debug_logger: Logger + security: Optional[Union[models.Security, Callable[[], models.Security]]] = None + server_url: Optional[str] = "" + server: Optional[str] = "" + language: str = "python" + openapi_doc_version: str = __openapi_doc_version__ + sdk_version: str = __version__ + gen_version: str = __gen_version__ + user_agent: str = __user_agent__ + retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) + timeout_ms: Optional[int] = None + + def get_server_details(self) -> Tuple[str, Dict[str, str]]: + if self.server_url is not None and self.server_url: + return remove_suffix(self.server_url, "/"), {} + if not self.server: + self.server = SERVER_EU + + if self.server not in SERVERS: + raise ValueError(f'Invalid server "{self.server}"') + + return SERVERS[self.server], {} diff --git a/src/mistralai/client/speech.py b/src/mistralai/client/speech.py new file mode 100644 index 00000000..4893684b --- /dev/null +++ b/src/mistralai/client/speech.py @@ -0,0 +1,410 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5c1f1109aa5e + +from .basesdk import BaseSDK +from enum import Enum +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, Literal, Mapping, Optional, Union, overload + + +class CompleteAcceptEnum(str, Enum): + APPLICATION_JSON = "application/json" + TEXT_EVENT_STREAM = "text/event-stream" + + +class Speech(BaseSDK): + @overload + def complete( + self, + *, + input: str, + model: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + stream: Union[Literal[False], None] = None, + voice_id: OptionalNullable[str] = UNSET, + ref_audio: OptionalNullable[str] = UNSET, + response_format: Optional[models.SpeechOutputFormat] = None, + additional_properties: Optional[Dict[str, Any]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SpeechResponse: + r"""Speech + + :param input: Text to generate a speech from + :param model: + :param metadata: + :param stream: + :param voice_id: The preset or custom voice to use for generating the speech. + :param ref_audio: The audio reference for generating the speech. + :param response_format: + :param additional_properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + + @overload + def complete( + self, + *, + input: str, + model: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + stream: Literal[True], + voice_id: OptionalNullable[str] = UNSET, + ref_audio: OptionalNullable[str] = UNSET, + response_format: Optional[models.SpeechOutputFormat] = None, + additional_properties: Optional[Dict[str, Any]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[models.SpeechStreamEvents]: + r"""Speech + + :param input: Text to generate a speech from + :param model: + :param metadata: + :param stream: + :param voice_id: The preset or custom voice to use for generating the speech. + :param ref_audio: The audio reference for generating the speech. + :param response_format: + :param additional_properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + + def complete( + self, + *, + input: str, + model: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + stream: Optional[bool] = False, + voice_id: OptionalNullable[str] = UNSET, + ref_audio: OptionalNullable[str] = UNSET, + response_format: Optional[models.SpeechOutputFormat] = None, + additional_properties: Optional[Dict[str, Any]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SpeechV1AudioSpeechPostResponse: + r"""Speech + + :param input: Text to generate a speech from + :param model: + :param metadata: + :param stream: + :param voice_id: The preset or custom voice to use for generating the speech. + :param ref_audio: The audio reference for generating the speech. + :param response_format: + :param additional_properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.SpeechRequest( + model=model, + metadata=metadata, + stream=stream, + voice_id=voice_id, + ref_audio=ref_audio, + input=input, + response_format=response_format, + **(additional_properties or {}), + ) + + req = self._build_request( + method="POST", + path="/v1/audio/speech", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream" if stream else "application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.SpeechRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="speech_v1_audio_speech_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + http_res_text = utils.stream_to_text(http_res) + return unmarshal_json_response( + models.SpeechResponse, http_res, http_res_text + ) + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json(raw, models.SpeechStreamEvents), + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + @overload + async def complete_async( + self, + *, + input: str, + model: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + stream: Union[Literal[False], None] = None, + voice_id: OptionalNullable[str] = UNSET, + ref_audio: OptionalNullable[str] = UNSET, + response_format: Optional[models.SpeechOutputFormat] = None, + additional_properties: Optional[Dict[str, Any]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SpeechResponse: + r"""Speech + + :param input: Text to generate a speech from + :param model: + :param metadata: + :param stream: + :param voice_id: The preset or custom voice to use for generating the speech. + :param ref_audio: The audio reference for generating the speech. + :param response_format: + :param additional_properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + + @overload + async def complete_async( + self, + *, + input: str, + model: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + stream: Literal[True], + voice_id: OptionalNullable[str] = UNSET, + ref_audio: OptionalNullable[str] = UNSET, + response_format: Optional[models.SpeechOutputFormat] = None, + additional_properties: Optional[Dict[str, Any]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[models.SpeechStreamEvents]: + r"""Speech + + :param input: Text to generate a speech from + :param model: + :param metadata: + :param stream: + :param voice_id: The preset or custom voice to use for generating the speech. + :param ref_audio: The audio reference for generating the speech. + :param response_format: + :param additional_properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + + async def complete_async( + self, + *, + input: str, + model: OptionalNullable[str] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + stream: Optional[bool] = False, + voice_id: OptionalNullable[str] = UNSET, + ref_audio: OptionalNullable[str] = UNSET, + response_format: Optional[models.SpeechOutputFormat] = None, + additional_properties: Optional[Dict[str, Any]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.SpeechV1AudioSpeechPostResponse: + r"""Speech + + :param input: Text to generate a speech from + :param model: + :param metadata: + :param stream: + :param voice_id: The preset or custom voice to use for generating the speech. + :param ref_audio: The audio reference for generating the speech. + :param response_format: + :param additional_properties: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.SpeechRequest( + model=model, + metadata=metadata, + stream=stream, + voice_id=voice_id, + ref_audio=ref_audio, + input=input, + response_format=response_format, + **(additional_properties or {}), + ) + + req = self._build_request_async( + method="POST", + path="/v1/audio/speech", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream" if stream else "application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.SpeechRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="speech_v1_audio_speech_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + return unmarshal_json_response( + models.SpeechResponse, http_res, http_res_text + ) + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json(raw, models.SpeechStreamEvents), + client_ref=self, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/transcriptions.py b/src/mistralai/client/transcriptions.py similarity index 86% rename from src/mistralai/transcriptions.py rename to src/mistralai/client/transcriptions.py index 3e2de6f5..d84b59f8 100644 --- a/src/mistralai/transcriptions.py +++ b/src/mistralai/client/transcriptions.py @@ -1,11 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 75b45780c978 from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import eventstreaming, get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response from typing import List, Mapping, Optional, Union @@ -21,6 +22,8 @@ def complete( file_id: OptionalNullable[str] = UNSET, language: OptionalNullable[str] = UNSET, temperature: OptionalNullable[float] = UNSET, + diarize: Optional[bool] = False, + context_bias: Optional[List[str]] = None, timestamp_granularities: Optional[List[models.TimestampGranularity]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -29,12 +32,14 @@ def complete( ) -> models.TranscriptionResponse: r"""Create Transcription - :param model: + :param model: ID of the model to be used. :param file: :param file_url: Url of a file to be transcribed :param file_id: ID of a file uploaded to /v1/files :param language: Language of the audio, e.g. 'en'. Providing the language can boost accuracy. :param temperature: + :param diarize: + :param context_bias: :param timestamp_granularities: Granularities of timestamps to include in the response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -46,6 +51,9 @@ def complete( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -58,6 +66,8 @@ def complete( file_id=file_id, language=language, temperature=temperature, + diarize=diarize, + context_bias=context_bias, timestamp_granularities=timestamp_granularities, ) @@ -77,6 +87,7 @@ def complete( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", models.AudioTranscriptionRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -93,7 +104,7 @@ def complete( config=self.sdk_configuration, base_url=base_url or "", operation_id="audio_api_v1_transcriptions_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -107,12 +118,12 @@ def complete( return unmarshal_json_response(models.TranscriptionResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) async def complete_async( self, @@ -123,6 +134,8 @@ async def complete_async( file_id: OptionalNullable[str] = UNSET, language: OptionalNullable[str] = UNSET, temperature: OptionalNullable[float] = UNSET, + diarize: Optional[bool] = False, + context_bias: Optional[List[str]] = None, timestamp_granularities: Optional[List[models.TimestampGranularity]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -131,12 +144,14 @@ async def complete_async( ) -> models.TranscriptionResponse: r"""Create Transcription - :param model: + :param model: ID of the model to be used. :param file: :param file_url: Url of a file to be transcribed :param file_id: ID of a file uploaded to /v1/files :param language: Language of the audio, e.g. 'en'. Providing the language can boost accuracy. :param temperature: + :param diarize: + :param context_bias: :param timestamp_granularities: Granularities of timestamps to include in the response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -148,6 +163,9 @@ async def complete_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -160,6 +178,8 @@ async def complete_async( file_id=file_id, language=language, temperature=temperature, + diarize=diarize, + context_bias=context_bias, timestamp_granularities=timestamp_granularities, ) @@ -179,6 +199,7 @@ async def complete_async( get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", models.AudioTranscriptionRequest ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -195,7 +216,7 @@ async def complete_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="audio_api_v1_transcriptions_post", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -209,12 +230,12 @@ async def complete_async( return unmarshal_json_response(models.TranscriptionResponse, http_res) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) - raise models.SDKError("Unexpected response received", http_res) + raise errors.SDKError("Unexpected response received", http_res) def stream( self, @@ -225,13 +246,15 @@ def stream( file_id: OptionalNullable[str] = UNSET, language: OptionalNullable[str] = UNSET, temperature: OptionalNullable[float] = UNSET, + diarize: Optional[bool] = False, + context_bias: Optional[List[str]] = None, timestamp_granularities: Optional[List[models.TimestampGranularity]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> eventstreaming.EventStream[models.TranscriptionStreamEvents]: - r"""Create streaming transcription (SSE) + r"""Create Streaming Transcription (SSE) :param model: :param file: @@ -239,6 +262,8 @@ def stream( :param file_id: ID of a file uploaded to /v1/files :param language: Language of the audio, e.g. 'en'. Providing the language can boost accuracy. :param temperature: + :param diarize: + :param context_bias: :param timestamp_granularities: Granularities of timestamps to include in the response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -250,6 +275,9 @@ def stream( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -262,6 +290,8 @@ def stream( file_id=file_id, language=language, temperature=temperature, + diarize=diarize, + context_bias=context_bias, timestamp_granularities=timestamp_granularities, ) @@ -285,6 +315,7 @@ def stream( "multipart", models.AudioTranscriptionRequestStream, ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -301,7 +332,7 @@ def stream( config=self.sdk_configuration, base_url=base_url or "", operation_id="audio_api_v1_transcriptions_post_stream", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -320,13 +351,13 @@ def stream( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) async def stream_async( self, @@ -337,13 +368,15 @@ async def stream_async( file_id: OptionalNullable[str] = UNSET, language: OptionalNullable[str] = UNSET, temperature: OptionalNullable[float] = UNSET, + diarize: Optional[bool] = False, + context_bias: Optional[List[str]] = None, timestamp_granularities: Optional[List[models.TimestampGranularity]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> eventstreaming.EventStreamAsync[models.TranscriptionStreamEvents]: - r"""Create streaming transcription (SSE) + r"""Create Streaming Transcription (SSE) :param model: :param file: @@ -351,6 +384,8 @@ async def stream_async( :param file_id: ID of a file uploaded to /v1/files :param language: Language of the audio, e.g. 'en'. Providing the language can boost accuracy. :param temperature: + :param diarize: + :param context_bias: :param timestamp_granularities: Granularities of timestamps to include in the response. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -362,6 +397,9 @@ async def stream_async( if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if timeout_ms is None: + timeout_ms = 60000 + if server_url is not None: base_url = server_url else: @@ -374,6 +412,8 @@ async def stream_async( file_id=file_id, language=language, temperature=temperature, + diarize=diarize, + context_bias=context_bias, timestamp_granularities=timestamp_granularities, ) @@ -397,6 +437,7 @@ async def stream_async( "multipart", models.AudioTranscriptionRequestStream, ), + allow_empty_value=None, timeout_ms=timeout_ms, ) @@ -413,7 +454,7 @@ async def stream_async( config=self.sdk_configuration, base_url=base_url or "", operation_id="audio_api_v1_transcriptions_post_stream", - oauth2_scopes=[], + oauth2_scopes=None, security_source=get_security_from_env( self.sdk_configuration.security, models.Security ), @@ -432,10 +473,10 @@ async def stream_async( ) if utils.match_response(http_res, "4XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) if utils.match_response(http_res, "5XX", "*"): http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) + raise errors.SDKError("API error occurred", http_res, http_res_text) http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/client/types/__init__.py b/src/mistralai/client/types/__init__.py new file mode 100644 index 00000000..cf838643 --- /dev/null +++ b/src/mistralai/client/types/__init__.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 000b943f821c + +from .basemodel import ( + BaseModel, + Nullable, + OptionalNullable, + UnrecognizedInt, + UnrecognizedStr, + UNSET, + UNSET_SENTINEL, +) + +__all__ = [ + "BaseModel", + "Nullable", + "OptionalNullable", + "UnrecognizedInt", + "UnrecognizedStr", + "UNSET", + "UNSET_SENTINEL", +] diff --git a/src/mistralai/client/types/basemodel.py b/src/mistralai/client/types/basemodel.py new file mode 100644 index 00000000..4e889aa0 --- /dev/null +++ b/src/mistralai/client/types/basemodel.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 7ec465a1d3ff + +from pydantic import ConfigDict, model_serializer +from pydantic import BaseModel as PydanticBaseModel +from pydantic_core import core_schema +from typing import TYPE_CHECKING, Any, Literal, Optional, TypeVar, Union +from typing_extensions import TypeAliasType, TypeAlias + + +class BaseModel(PydanticBaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() + ) + + +class Unset(BaseModel): + @model_serializer(mode="plain") + def serialize_model(self): + return UNSET_SENTINEL + + def __bool__(self) -> Literal[False]: + return False + + +UNSET = Unset() +UNSET_SENTINEL = "~?~unset~?~sentinel~?~" + + +T = TypeVar("T") +if TYPE_CHECKING: + Nullable: TypeAlias = Union[T, None] + OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] +else: + Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) + OptionalNullable = TypeAliasType( + "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) + ) + + +class UnrecognizedStr(str): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema: + # Make UnrecognizedStr only work in lax mode, not strict mode + # This makes it a "fallback" option when more specific types (like Literals) don't match + def validate_lax(v: Any) -> 'UnrecognizedStr': + if isinstance(v, cls): + return v + return cls(str(v)) + + # Use lax_or_strict_schema where strict always fails + # This forces Pydantic to prefer other union members in strict mode + # and only fall back to UnrecognizedStr in lax mode + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema([ + core_schema.str_schema(), + core_schema.no_info_plain_validator_function(validate_lax) + ]), + strict_schema=core_schema.none_schema(), # Always fails in strict mode + ) + + +class UnrecognizedInt(int): + @classmethod + def __get_pydantic_core_schema__(cls, _source_type: Any, _handler: Any) -> core_schema.CoreSchema: + # Make UnrecognizedInt only work in lax mode, not strict mode + # This makes it a "fallback" option when more specific types (like Literals) don't match + def validate_lax(v: Any) -> 'UnrecognizedInt': + if isinstance(v, cls): + return v + return cls(int(v)) + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema([ + core_schema.int_schema(), + core_schema.no_info_plain_validator_function(validate_lax) + ]), + strict_schema=core_schema.none_schema(), # Always fails in strict mode + ) diff --git a/src/mistralai/client/utils/__init__.py b/src/mistralai/client/utils/__init__.py new file mode 100644 index 00000000..4bde281a --- /dev/null +++ b/src/mistralai/client/utils/__init__.py @@ -0,0 +1,182 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b69505f4b269 + +from typing import Any, TYPE_CHECKING, Callable, TypeVar +import asyncio + +from .dynamic_imports import lazy_getattr, lazy_dir + +_T = TypeVar("_T") + + +async def run_sync_in_thread(func: Callable[..., _T], *args) -> _T: + """Run a synchronous function in a thread pool to avoid blocking the event loop.""" + return await asyncio.to_thread(func, *args) + + +if TYPE_CHECKING: + from .annotations import get_discriminator + from .datetimes import parse_datetime + from .enums import OpenEnumMeta + from .unions import parse_open_union + from .headers import get_headers, get_response_headers + from .metadata import ( + FieldMetadata, + find_metadata, + FormMetadata, + HeaderMetadata, + MultipartFormMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, + SecurityMetadata, + ) + from .queryparams import get_query_params + from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig + from .requestbodies import serialize_request_body, SerializedRequestBody + from .security import get_security, get_security_from_env + + from .serializers import ( + get_pydantic_model, + marshal_json, + unmarshal, + unmarshal_json, + serialize_decimal, + serialize_float, + serialize_int, + stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, + validate_decimal, + validate_float, + validate_int, + ) + from .url import generate_url, template_url, remove_suffix + from .values import ( + get_global_from_env, + match_content_type, + match_status_codes, + match_response, + cast_partial, + ) + from .logger import Logger, get_body_content, get_default_logger + +__all__ = [ + "BackoffStrategy", + "FieldMetadata", + "find_metadata", + "FormMetadata", + "generate_url", + "get_body_content", + "get_default_logger", + "get_discriminator", + "parse_datetime", + "get_global_from_env", + "get_headers", + "get_pydantic_model", + "get_query_params", + "get_response_headers", + "get_security", + "get_security_from_env", + "HeaderMetadata", + "Logger", + "marshal_json", + "match_content_type", + "match_status_codes", + "match_response", + "MultipartFormMetadata", + "OpenEnumMeta", + "parse_open_union", + "PathParamMetadata", + "QueryParamMetadata", + "remove_suffix", + "Retries", + "retry", + "retry_async", + "RetryConfig", + "RequestMetadata", + "SecurityMetadata", + "serialize_decimal", + "serialize_float", + "serialize_int", + "serialize_request_body", + "SerializedRequestBody", + "stream_to_text", + "stream_to_text_async", + "stream_to_bytes", + "stream_to_bytes_async", + "template_url", + "unmarshal", + "unmarshal_json", + "validate_decimal", + "validate_const", + "validate_float", + "validate_int", + "cast_partial", +] + +_dynamic_imports: dict[str, str] = { + "BackoffStrategy": ".retries", + "FieldMetadata": ".metadata", + "find_metadata": ".metadata", + "FormMetadata": ".metadata", + "generate_url": ".url", + "get_body_content": ".logger", + "get_default_logger": ".logger", + "get_discriminator": ".annotations", + "parse_datetime": ".datetimes", + "get_global_from_env": ".values", + "get_headers": ".headers", + "get_pydantic_model": ".serializers", + "get_query_params": ".queryparams", + "get_response_headers": ".headers", + "get_security": ".security", + "get_security_from_env": ".security", + "HeaderMetadata": ".metadata", + "Logger": ".logger", + "marshal_json": ".serializers", + "match_content_type": ".values", + "match_status_codes": ".values", + "match_response": ".values", + "MultipartFormMetadata": ".metadata", + "OpenEnumMeta": ".enums", + "parse_open_union": ".unions", + "PathParamMetadata": ".metadata", + "QueryParamMetadata": ".metadata", + "remove_suffix": ".url", + "Retries": ".retries", + "retry": ".retries", + "retry_async": ".retries", + "RetryConfig": ".retries", + "RequestMetadata": ".metadata", + "SecurityMetadata": ".metadata", + "serialize_decimal": ".serializers", + "serialize_float": ".serializers", + "serialize_int": ".serializers", + "serialize_request_body": ".requestbodies", + "SerializedRequestBody": ".requestbodies", + "stream_to_text": ".serializers", + "stream_to_text_async": ".serializers", + "stream_to_bytes": ".serializers", + "stream_to_bytes_async": ".serializers", + "template_url": ".url", + "unmarshal": ".serializers", + "unmarshal_json": ".serializers", + "validate_decimal": ".serializers", + "validate_const": ".serializers", + "validate_float": ".serializers", + "validate_int": ".serializers", + "cast_partial": ".values", +} + + +def __getattr__(attr_name: str) -> Any: + return lazy_getattr( + attr_name, package=__package__, dynamic_imports=_dynamic_imports + ) + + +def __dir__(): + return lazy_dir(dynamic_imports=_dynamic_imports) diff --git a/src/mistralai/client/utils/annotations.py b/src/mistralai/client/utils/annotations.py new file mode 100644 index 00000000..4b60ab8e --- /dev/null +++ b/src/mistralai/client/utils/annotations.py @@ -0,0 +1,80 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1ffdedfc66a2 + +from enum import Enum +from typing import Any, Optional + + +def get_discriminator(model: Any, fieldname: str, key: str) -> str: + """ + Recursively search for the discriminator attribute in a model. + + Args: + model (Any): The model to search within. + fieldname (str): The name of the field to search for. + key (str): The key to search for in dictionaries. + + Returns: + str: The name of the discriminator attribute. + + Raises: + ValueError: If the discriminator attribute is not found. + """ + upper_fieldname = fieldname.upper() + + def get_field_discriminator(field: Any) -> Optional[str]: + """Search for the discriminator attribute in a given field.""" + + if isinstance(field, dict): + if key in field: + return f"{field[key]}" + + if hasattr(field, fieldname): + attr = getattr(field, fieldname) + if isinstance(attr, Enum): + return f"{attr.value}" + return f"{attr}" + + if hasattr(field, upper_fieldname): + attr = getattr(field, upper_fieldname) + if isinstance(attr, Enum): + return f"{attr.value}" + return f"{attr}" + + return None + + def search_nested_discriminator(obj: Any) -> Optional[str]: + """Recursively search for discriminator in nested structures.""" + # First try direct field lookup + discriminator = get_field_discriminator(obj) + if discriminator is not None: + return discriminator + + # If it's a dict, search in nested values + if isinstance(obj, dict): + for value in obj.values(): + if isinstance(value, list): + # Search in list items + for item in value: + nested_discriminator = search_nested_discriminator(item) + if nested_discriminator is not None: + return nested_discriminator + elif isinstance(value, dict): + # Search in nested dict + nested_discriminator = search_nested_discriminator(value) + if nested_discriminator is not None: + return nested_discriminator + + return None + + if isinstance(model, list): + for field in model: + discriminator = search_nested_discriminator(field) + if discriminator is not None: + return discriminator + + discriminator = search_nested_discriminator(model) + if discriminator is not None: + return discriminator + + raise ValueError(f"Could not find discriminator field {fieldname} in {model}") diff --git a/src/mistralai/client/utils/datetimes.py b/src/mistralai/client/utils/datetimes.py new file mode 100644 index 00000000..a2c94fac --- /dev/null +++ b/src/mistralai/client/utils/datetimes.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: c40066d868c9 + +from datetime import datetime +import sys + + +def parse_datetime(datetime_string: str) -> datetime: + """ + Convert a RFC 3339 / ISO 8601 formatted string into a datetime object. + Python versions 3.11 and later support parsing RFC 3339 directly with + datetime.fromisoformat(), but for earlier versions, this function + encapsulates the necessary extra logic. + """ + # Python 3.11 and later can parse RFC 3339 directly + if sys.version_info >= (3, 11): + return datetime.fromisoformat(datetime_string) + + # For Python 3.10 and earlier, a common ValueError is trailing 'Z' suffix, + # so fix that upfront. + if datetime_string.endswith("Z"): + datetime_string = datetime_string[:-1] + "+00:00" + + return datetime.fromisoformat(datetime_string) diff --git a/src/mistralai/client/utils/dynamic_imports.py b/src/mistralai/client/utils/dynamic_imports.py new file mode 100644 index 00000000..969f2fc7 --- /dev/null +++ b/src/mistralai/client/utils/dynamic_imports.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ac9918d925c0 + +from importlib import import_module +import builtins +import sys + + +def dynamic_import(package, modname, retries=3): + """Import a module relative to package, retrying on KeyError from half-initialized modules.""" + for attempt in range(retries): + try: + return import_module(modname, package) + except KeyError: + sys.modules.pop(modname, None) + if attempt == retries - 1: + break + raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") + + +def lazy_getattr(attr_name, *, package, dynamic_imports, sub_packages=None): + """Module-level __getattr__ that lazily loads from a dynamic_imports mapping. + + Args: + attr_name: The attribute being looked up. + package: The caller's __package__ (for relative imports). + dynamic_imports: Dict mapping attribute names to relative module paths. + sub_packages: Optional list of subpackage names to lazy-load. + """ + module_name = dynamic_imports.get(attr_name) + if module_name is not None: + try: + module = dynamic_import(package, module_name) + return getattr(module, attr_name) + except ImportError as e: + raise ImportError( + f"Failed to import {attr_name} from {module_name}: {e}" + ) from e + except AttributeError as e: + raise AttributeError( + f"Failed to get {attr_name} from {module_name}: {e}" + ) from e + + if sub_packages and attr_name in sub_packages: + return import_module(f".{attr_name}", package) + + raise AttributeError(f"module '{package}' has no attribute '{attr_name}'") + + +def lazy_dir(*, dynamic_imports, sub_packages=None): + """Module-level __dir__ that lists lazily-loadable attributes.""" + lazy_attrs = builtins.list(dynamic_imports.keys()) + if sub_packages: + lazy_attrs.extend(sub_packages) + return builtins.sorted(lazy_attrs) diff --git a/src/mistralai/client/utils/enums.py b/src/mistralai/client/utils/enums.py new file mode 100644 index 00000000..d897495f --- /dev/null +++ b/src/mistralai/client/utils/enums.py @@ -0,0 +1,135 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: a0735873b5ac + +import enum +import sys +from typing import Any + +from pydantic_core import core_schema + + +class OpenEnumMeta(enum.EnumMeta): + # The __call__ method `boundary` kwarg was added in 3.11 and must be present + # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 + # pylint: disable=unexpected-keyword-arg + # The __call__ method `values` varg must be named for pyright. + # pylint: disable=keyword-arg-before-vararg + + if sys.version_info >= (3, 11): + def __call__( + cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + except ValueError: + return value + else: + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value + + def __new__(mcs, name, bases, namespace, **kwargs): + cls = super().__new__(mcs, name, bases, namespace, **kwargs) + + # Add __get_pydantic_core_schema__ to make open enums work correctly + # in union discrimination. In strict mode (used by Pydantic for unions), + # only known enum values match. In lax mode, unknown values are accepted. + def __get_pydantic_core_schema__( + cls_inner: Any, _source_type: Any, _handler: Any + ) -> core_schema.CoreSchema: + # Create a validator that only accepts known enum values (for strict mode) + def validate_strict(v: Any) -> Any: + if isinstance(v, cls_inner): + return v + # Use the parent EnumMeta's __call__ which raises ValueError for unknown values + return enum.EnumMeta.__call__(cls_inner, v) + + # Create a lax validator that accepts unknown values + def validate_lax(v: Any) -> Any: + if isinstance(v, cls_inner): + return v + try: + return enum.EnumMeta.__call__(cls_inner, v) + except ValueError: + # Return the raw value for unknown enum values + return v + + # Determine the base type schema (str or int) + is_int_enum = False + for base in cls_inner.__mro__: + if base is int: + is_int_enum = True + break + if base is str: + break + + base_schema = ( + core_schema.int_schema() + if is_int_enum + else core_schema.str_schema() + ) + + # Use lax_or_strict_schema: + # - strict mode: only known enum values match (raises ValueError for unknown) + # - lax mode: accept any value, return enum member or raw value + return core_schema.lax_or_strict_schema( + lax_schema=core_schema.chain_schema( + [base_schema, core_schema.no_info_plain_validator_function(validate_lax)] + ), + strict_schema=core_schema.chain_schema( + [base_schema, core_schema.no_info_plain_validator_function(validate_strict)] + ), + ) + + setattr(cls, "__get_pydantic_core_schema__", classmethod(__get_pydantic_core_schema__)) + return cls diff --git a/src/mistralai/client/utils/eventstreaming.py b/src/mistralai/client/utils/eventstreaming.py new file mode 100644 index 00000000..93287ab4 --- /dev/null +++ b/src/mistralai/client/utils/eventstreaming.py @@ -0,0 +1,310 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3263d7502030 + +import re +import json +from dataclasses import dataclass, asdict +from typing import ( + Any, + Callable, + Generic, + TypeVar, + Optional, + Generator, + AsyncGenerator, + Tuple, +) +import httpx + +T = TypeVar("T") + + +class EventStream(Generic[T]): + # Holds a reference to the SDK client to avoid it being garbage collected + # and cause termination of the underlying httpx client. + client_ref: Optional[object] + response: httpx.Response + generator: Generator[T, None, None] + _closed: bool + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + client_ref: Optional[object] = None, + data_required: bool = True, + ): + self.response = response + self.generator = stream_events( + response, decoder, sentinel, data_required=data_required + ) + self.client_ref = client_ref + self._closed = False + + def __iter__(self): + return self + + def __next__(self): + if self._closed: + raise StopIteration + return next(self.generator) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self._closed = True + self.response.close() + + +class EventStreamAsync(Generic[T]): + # Holds a reference to the SDK client to avoid it being garbage collected + # and cause termination of the underlying httpx client. + client_ref: Optional[object] + response: httpx.Response + generator: AsyncGenerator[T, None] + _closed: bool + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + client_ref: Optional[object] = None, + data_required: bool = True, + ): + self.response = response + self.generator = stream_events_async( + response, decoder, sentinel, data_required=data_required + ) + self.client_ref = client_ref + self._closed = False + + def __aiter__(self): + return self + + async def __anext__(self): + if self._closed: + raise StopAsyncIteration + return await self.generator.__anext__() + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + self._closed = True + await self.response.aclose() + + +@dataclass +class ServerEvent: + id: Optional[str] = None + event: Optional[str] = None + data: Any = None + retry: Optional[int] = None + + +MESSAGE_BOUNDARIES = [ + b"\r\n\r\n", + b"\r\n\r", + b"\r\n\n", + b"\r\r\n", + b"\n\r\n", + b"\r\r", + b"\n\r", + b"\n\n", +] + +UTF8_BOM = b"\xef\xbb\xbf" + + +async def stream_events_async( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + data_required: bool = True, +) -> AsyncGenerator[T, None]: + buffer = bytearray() + position = 0 + event_id: Optional[str] = None + async for chunk in response.aiter_bytes(): + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard, event_id = _parse_event( + raw=block, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, + ) + if event is not None: + yield event + if discard: + await response.aclose() + return + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard, _ = _parse_event( + raw=buffer, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, + ) + if event is not None: + yield event + + +def stream_events( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + data_required: bool = True, +) -> Generator[T, None, None]: + buffer = bytearray() + position = 0 + event_id: Optional[str] = None + for chunk in response.iter_bytes(): + if len(buffer) == 0 and chunk.startswith(UTF8_BOM): + chunk = chunk[len(UTF8_BOM) :] + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard, event_id = _parse_event( + raw=block, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, + ) + if event is not None: + yield event + if discard: + response.close() + return + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard, _ = _parse_event( + raw=buffer, + decoder=decoder, + sentinel=sentinel, + event_id=event_id, + data_required=data_required, + ) + if event is not None: + yield event + + +def _parse_event( + *, + raw: bytearray, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + event_id: Optional[str] = None, + data_required: bool = True, +) -> Tuple[Optional[T], bool, Optional[str]]: + block = raw.decode() + lines = re.split(r"\r?\n|\r", block) + publish = False + event = ServerEvent() + data = "" + for line in lines: + if not line: + continue + + delim = line.find(":") + if delim == 0: + continue + + field = line + value = "" + if delim > 0: + field = line[0:delim] + value = line[delim + 1 :] if delim < len(line) - 1 else "" + if len(value) and value[0] == " ": + value = value[1:] + + if field == "event": + event.event = value + publish = True + elif field == "data": + data += value + "\n" + publish = True + elif field == "id": + publish = True + if "\x00" not in value: + event_id = value + elif field == "retry": + if value.isdigit(): + event.retry = int(value) + publish = True + + event.id = event_id + + if sentinel and data == f"{sentinel}\n": + return None, True, event_id + + # Skip data-less events when data is required + if not data and publish and data_required: + return None, False, event_id + + if data: + data = data[:-1] + try: + event.data = json.loads(data) + except json.JSONDecodeError: + event.data = data + + out = None + if publish: + out_dict = { + k: v + for k, v in asdict(event).items() + if v is not None or (k == "data" and data) + } + out = decoder(json.dumps(out_dict)) + + return out, False, event_id + + +def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): + if len(sequence) > (len(buffer) - position): + return None + + for i, seq in enumerate(sequence): + if buffer[position + i] != seq: + return None + + return sequence diff --git a/src/mistralai/client/utils/forms.py b/src/mistralai/client/utils/forms.py new file mode 100644 index 00000000..6facec53 --- /dev/null +++ b/src/mistralai/client/utils/forms.py @@ -0,0 +1,235 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 58842e905fce + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .serializers import marshal_json + +from .metadata import ( + FormMetadata, + MultipartFormMetadata, + find_field_metadata, +) +from .values import _is_set, _val_to_string + + +def _populate_form( + field_name: str, + explode: bool, + obj: Any, + delimiter: str, + form: Dict[str, List[str]], +): + if not _is_set(obj): + return form + + if isinstance(obj, BaseModel): + items = [] + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_field_name = obj_field.alias if obj_field.alias is not None else name + if obj_field_name == "": + continue + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + form[obj_field_name] = [_val_to_string(val)] + else: + items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, Dict): + items = [] + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + form[key] = [_val_to_string(value)] + else: + items.append(f"{key}{delimiter}{_val_to_string(value)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + if explode: + if not field_name in form: + form[field_name] = [] + form[field_name].append(_val_to_string(value)) + else: + items.append(_val_to_string(value)) + + if len(items) > 0: + form[field_name] = [delimiter.join([str(item) for item in items])] + else: + form[field_name] = [_val_to_string(obj)] + + return form + + +def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: + """Extract file name, content, and content type from a file object.""" + file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields + + file_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(file_obj, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(file_obj, file_field_name, None) + else: + file_name = getattr(file_obj, file_field_name) + + if file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + return file_name, content, content_type + + +def serialize_multipart_form( + media_type: str, request: Any +) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: + form: Dict[str, Any] = {} + files: List[Tuple[str, Any]] = [] + + if not isinstance(request, BaseModel): + raise TypeError("invalid request body type") + + request_fields: Dict[str, FieldInfo] = request.__class__.model_fields + request_field_types = get_type_hints(request.__class__) + + for name in request_fields: + field = request_fields[name] + + val = getattr(request, name) + if not _is_set(val): + continue + + field_metadata = find_field_metadata(field, MultipartFormMetadata) + if not field_metadata: + continue + + f_name = field.alias if field.alias else name + + if field_metadata.file: + if isinstance(val, List): + # Handle array of files + array_field_name = f_name + for file_obj in val: + if not _is_set(file_obj): + continue + + file_name, content, content_type = _extract_file_properties( + file_obj + ) + + if content_type is not None: + files.append( + (array_field_name, (file_name, content, content_type)) + ) + else: + files.append((array_field_name, (file_name, content))) + else: + # Handle single file + file_name, content, content_type = _extract_file_properties(val) + + if content_type is not None: + files.append((f_name, (file_name, content, content_type))) + else: + files.append((f_name, (file_name, content))) + elif field_metadata.json: + files.append( + ( + f_name, + ( + None, + marshal_json(val, request_field_types[name]), + "application/json", + ), + ) + ) + else: + if isinstance(val, List): + values = [] + + for value in val: + if not _is_set(value): + continue + values.append(_val_to_string(value)) + + array_field_name = f_name + form[array_field_name] = values + else: + form[f_name] = _val_to_string(val) + return media_type, form, files + + +def serialize_form_data(data: Any) -> Dict[str, Any]: + form: Dict[str, List[str]] = {} + + if isinstance(data, BaseModel): + data_fields: Dict[str, FieldInfo] = data.__class__.model_fields + data_field_types = get_type_hints(data.__class__) + for name in data_fields: + field = data_fields[name] + + val = getattr(data, name) + if not _is_set(val): + continue + + metadata = find_field_metadata(field, FormMetadata) + if metadata is None: + continue + + f_name = field.alias if field.alias is not None else name + + if metadata.json: + form[f_name] = [marshal_json(val, data_field_types[name])] + else: + if metadata.style == "form": + _populate_form( + f_name, + metadata.explode, + val, + ",", + form, + ) + else: + raise ValueError(f"Invalid form style for field {name}") + elif isinstance(data, Dict): + for key, value in data.items(): + if _is_set(value): + form[key] = [_val_to_string(value)] + else: + raise TypeError(f"Invalid request body type {type(data)} for form data") + + return form diff --git a/src/mistralai/utils/headers.py b/src/mistralai/client/utils/headers.py similarity index 99% rename from src/mistralai/utils/headers.py rename to src/mistralai/client/utils/headers.py index 37864cbb..64911872 100644 --- a/src/mistralai/utils/headers.py +++ b/src/mistralai/client/utils/headers.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 9066de2ead8b from typing import ( Any, diff --git a/src/mistralai/utils/logger.py b/src/mistralai/client/utils/logger.py similarity index 88% rename from src/mistralai/utils/logger.py rename to src/mistralai/client/utils/logger.py index cc089307..3edad830 100644 --- a/src/mistralai/utils/logger.py +++ b/src/mistralai/client/utils/logger.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 745023607a1f import httpx import logging @@ -23,5 +24,5 @@ def get_body_content(req: httpx.Request) -> str: def get_default_logger() -> Logger: if os.getenv("MISTRAL_DEBUG"): logging.basicConfig(level=logging.DEBUG) - return logging.getLogger("mistralai") + return logging.getLogger("mistralai.client") return NoOpLogger() diff --git a/src/mistralai/utils/metadata.py b/src/mistralai/client/utils/metadata.py similarity index 98% rename from src/mistralai/utils/metadata.py rename to src/mistralai/client/utils/metadata.py index 173b3e5c..3850a6ff 100644 --- a/src/mistralai/utils/metadata.py +++ b/src/mistralai/client/utils/metadata.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d49d535ae52c from typing import Optional, Type, TypeVar, Union from dataclasses import dataclass @@ -15,6 +16,7 @@ class SecurityMetadata: scheme_type: Optional[str] = None sub_type: Optional[str] = None field_name: Optional[str] = None + composite: bool = False def get_field_name(self, default: str) -> str: return self.field_name or default diff --git a/src/mistralai/client/utils/queryparams.py b/src/mistralai/client/utils/queryparams.py new file mode 100644 index 00000000..0b78c548 --- /dev/null +++ b/src/mistralai/client/utils/queryparams.py @@ -0,0 +1,218 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bb77d4664844 + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, +) + +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + QueryParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) +from .forms import _populate_form + + +def get_query_params( + query_params: Any, + gbls: Optional[Any] = None, + allow_empty_value: Optional[List[str]] = None, +) -> Dict[str, List[str]]: + params: Dict[str, List[str]] = {} + + globals_already_populated = _populate_query_params(query_params, gbls, params, [], allow_empty_value) + if _is_set(gbls): + _populate_query_params(gbls, None, params, globals_already_populated, allow_empty_value) + + return params + + +def _populate_query_params( + query_params: Any, + gbls: Any, + query_param_values: Dict[str, List[str]], + skip_fields: List[str], + allow_empty_value: Optional[List[str]] = None, +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(query_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields + param_field_types = get_type_hints(query_params.__class__) + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + + metadata = find_field_metadata(field, QueryParamMetadata) + if not metadata: + continue + + value = getattr(query_params, name) if _is_set(query_params) else None + + value, global_found = _populate_from_globals( + name, value, QueryParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + f_name = field.alias if field.alias is not None else name + + allow_empty_set = set(allow_empty_value or []) + should_include_empty = f_name in allow_empty_set and ( + value is None or value == [] or value == "" + ) + + if should_include_empty: + query_param_values[f_name] = [""] + continue + + serialization = metadata.serialization + if serialization is not None: + serialized_parms = _get_serialized_params( + metadata, f_name, value, param_field_types[name] + ) + for key, value in serialized_parms.items(): + if key in query_param_values: + query_param_values[key].extend(value) + else: + query_param_values[key] = [value] + else: + style = metadata.style + if style == "deepObject": + _populate_deep_object_query_params(f_name, value, query_param_values) + elif style == "form": + _populate_delimited_query_params( + metadata, f_name, value, ",", query_param_values + ) + elif style == "pipeDelimited": + _populate_delimited_query_params( + metadata, f_name, value, "|", query_param_values + ) + else: + raise NotImplementedError( + f"query param style {style} not yet supported" + ) + + return globals_already_populated + + +def _populate_deep_object_query_params( + field_name: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj): + return + + if isinstance(obj, BaseModel): + _populate_deep_object_query_params_basemodel(field_name, obj, params) + elif isinstance(obj, Dict): + _populate_deep_object_query_params_dict(field_name, obj, params) + + +def _populate_deep_object_query_params_basemodel( + prior_params_key: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj) or not isinstance(obj, BaseModel): + return + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + + f_name = obj_field.alias if obj_field.alias is not None else name + + params_key = f"{prior_params_key}[{f_name}]" + + obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) + if not _is_set(obj_param_metadata): + continue + + obj_val = getattr(obj, name) + if not _is_set(obj_val): + continue + + if isinstance(obj_val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, obj_val, params) + elif isinstance(obj_val, Dict): + _populate_deep_object_query_params_dict(params_key, obj_val, params) + elif isinstance(obj_val, List): + _populate_deep_object_query_params_list(params_key, obj_val, params) + else: + params[params_key] = [_val_to_string(obj_val)] + + +def _populate_deep_object_query_params_dict( + prior_params_key: str, + value: Dict, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for key, val in value.items(): + if not _is_set(val): + continue + + params_key = f"{prior_params_key}[{key}]" + + if isinstance(val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, val, params) + elif isinstance(val, Dict): + _populate_deep_object_query_params_dict(params_key, val, params) + elif isinstance(val, List): + _populate_deep_object_query_params_list(params_key, val, params) + else: + params[params_key] = [_val_to_string(val)] + + +def _populate_deep_object_query_params_list( + params_key: str, + value: List, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for val in value: + if not _is_set(val): + continue + + if params.get(params_key) is None: + params[params_key] = [] + + params[params_key].append(_val_to_string(val)) + + +def _populate_delimited_query_params( + metadata: QueryParamMetadata, + field_name: str, + obj: Any, + delimiter: str, + query_param_values: Dict[str, List[str]], +): + _populate_form( + field_name, + metadata.explode, + obj, + delimiter, + query_param_values, + ) diff --git a/src/mistralai/client/utils/requestbodies.py b/src/mistralai/client/utils/requestbodies.py new file mode 100644 index 00000000..3aae69c7 --- /dev/null +++ b/src/mistralai/client/utils/requestbodies.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 946cfcd26ee4 + +import io +from dataclasses import dataclass +import re +from typing import ( + Any, + Optional, +) + +from .forms import serialize_form_data, serialize_multipart_form + +from .serializers import marshal_json + +SERIALIZATION_METHOD_TO_CONTENT_TYPE = { + "json": "application/json", + "form": "application/x-www-form-urlencoded", + "multipart": "multipart/form-data", + "raw": "application/octet-stream", + "string": "text/plain", +} + + +@dataclass +class SerializedRequestBody: + media_type: Optional[str] = None + content: Optional[Any] = None + data: Optional[Any] = None + files: Optional[Any] = None + + +def serialize_request_body( + request_body: Any, + nullable: bool, + optional: bool, + serialization_method: str, + request_body_type, +) -> Optional[SerializedRequestBody]: + if request_body is None: + if not nullable and optional: + return None + + media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] + + serialized_request_body = SerializedRequestBody(media_type) + + if re.match(r"^(application|text)\/([^+]+\+)*json.*", media_type) is not None: + serialized_request_body.content = marshal_json(request_body, request_body_type) + elif re.match(r"^multipart\/.*", media_type) is not None: + ( + serialized_request_body.media_type, + serialized_request_body.data, + serialized_request_body.files, + ) = serialize_multipart_form(media_type, request_body) + elif re.match(r"^application\/x-www-form-urlencoded.*", media_type) is not None: + serialized_request_body.data = serialize_form_data(request_body) + elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): + serialized_request_body.content = request_body + elif isinstance(request_body, str): + serialized_request_body.content = request_body + else: + raise TypeError( + f"invalid request body type {type(request_body)} for mediaType {media_type}" + ) + + return serialized_request_body diff --git a/src/mistralai/client/utils/retries.py b/src/mistralai/client/utils/retries.py new file mode 100644 index 00000000..bea13041 --- /dev/null +++ b/src/mistralai/client/utils/retries.py @@ -0,0 +1,272 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 5f1a5b90423c + +import asyncio +import random +import time +from datetime import datetime +from email.utils import parsedate_to_datetime +from typing import List, Optional + +import httpx + + +class BackoffStrategy: + initial_interval: int + max_interval: int + exponent: float + max_elapsed_time: int + + def __init__( + self, + initial_interval: int, + max_interval: int, + exponent: float, + max_elapsed_time: int, + ): + self.initial_interval = initial_interval + self.max_interval = max_interval + self.exponent = exponent + self.max_elapsed_time = max_elapsed_time + + +class RetryConfig: + strategy: str + backoff: BackoffStrategy + retry_connection_errors: bool + + def __init__( + self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool + ): + self.strategy = strategy + self.backoff = backoff + self.retry_connection_errors = retry_connection_errors + + +class Retries: + config: RetryConfig + status_codes: List[str] + + def __init__(self, config: RetryConfig, status_codes: List[str]): + self.config = config + self.status_codes = status_codes + + +class TemporaryError(Exception): + response: httpx.Response + retry_after: Optional[int] + + def __init__(self, response: httpx.Response): + self.response = response + self.retry_after = _parse_retry_after_header(response) + + +class PermanentError(Exception): + inner: Exception + + def __init__(self, inner: Exception): + self.inner = inner + + +def _parse_retry_after_header(response: httpx.Response) -> Optional[int]: + """Parse Retry-After header from response. + + Returns: + Retry interval in milliseconds, or None if header is missing or invalid. + """ + retry_after_header = response.headers.get("retry-after") + if not retry_after_header: + return None + + try: + seconds = float(retry_after_header) + return round(seconds * 1000) + except ValueError: + pass + + try: + retry_date = parsedate_to_datetime(retry_after_header) + delta = (retry_date - datetime.now(retry_date.tzinfo)).total_seconds() + return round(max(0, delta) * 1000) + except (ValueError, TypeError): + pass + + return None + + +def _get_sleep_interval( + exception: Exception, + initial_interval: int, + max_interval: int, + exponent: float, + retries: int, +) -> float: + """Get sleep interval for retry with exponential backoff. + + Args: + exception: The exception that triggered the retry. + initial_interval: Initial retry interval in milliseconds. + max_interval: Maximum retry interval in milliseconds. + exponent: Base for exponential backoff calculation. + retries: Current retry attempt count. + + Returns: + Sleep interval in seconds. + """ + if ( + isinstance(exception, TemporaryError) + and exception.retry_after is not None + and exception.retry_after > 0 + ): + return exception.retry_after / 1000 + + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + return min(sleep, max_interval / 1000) + + +def retry(func, retries: Retries): + if retries.config.strategy == "backoff": + + def do_request() -> httpx.Response: + res: httpx.Response + try: + res = func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except (httpx.NetworkError, httpx.TimeoutException) as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return retry_with_backoff( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return func() + + +async def retry_async(func, retries: Retries): + if retries.config.strategy == "backoff": + + async def do_request() -> httpx.Response: + res: httpx.Response + try: + res = await func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except (httpx.NetworkError, httpx.TimeoutException) as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return await retry_with_backoff_async( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return await func() + + +def retry_with_backoff( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + + sleep = _get_sleep_interval( + exception, initial_interval, max_interval, exponent, retries + ) + time.sleep(sleep) + retries += 1 + + +async def retry_with_backoff_async( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return await func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + + sleep = _get_sleep_interval( + exception, initial_interval, max_interval, exponent, retries + ) + await asyncio.sleep(sleep) + retries += 1 diff --git a/src/mistralai/client/utils/security.py b/src/mistralai/client/utils/security.py new file mode 100644 index 00000000..77a4449d --- /dev/null +++ b/src/mistralai/client/utils/security.py @@ -0,0 +1,216 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 1acb7c006265 + +import base64 + +from typing import ( + Any, + Dict, + List, + Optional, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + SecurityMetadata, + find_field_metadata, +) +import os + + +def get_security( + security: Any, allowed_fields: Optional[List[str]] = None +) -> Tuple[Dict[str, str], Dict[str, List[str]]]: + headers: Dict[str, str] = {} + query_params: Dict[str, List[str]] = {} + + if security is None: + return headers, query_params + + if not isinstance(security, BaseModel): + raise TypeError("security must be a pydantic model") + + sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields + sec_field_names = ( + list(sec_fields.keys()) if allowed_fields is None else allowed_fields + ) + + for name in sec_field_names: + if name not in sec_fields: + continue + + sec_field = sec_fields[name] + + value = getattr(security, name) + if value is None: + continue + + metadata = find_field_metadata(sec_field, SecurityMetadata) + if metadata is None: + continue + if metadata.option: + _parse_security_option(headers, query_params, value) + return headers, query_params + if metadata.scheme: + # Special case for basic auth or custom auth which could be a flattened model + if metadata.sub_type in ["basic", "custom"] and not isinstance( + value, BaseModel + ): + _parse_security_scheme(headers, query_params, metadata, name, security) + else: + _parse_security_scheme(headers, query_params, metadata, name, value) + + if not metadata.composite: + return headers, query_params + + return headers, query_params + + +def get_security_from_env(security: Any, security_class: Any) -> Optional[BaseModel]: + if security is not None: + return security + + if not issubclass(security_class, BaseModel): + raise TypeError("security_class must be a pydantic model class") + + security_dict: Any = {} + + if os.getenv("MISTRAL_API_KEY"): + security_dict["api_key"] = os.getenv("MISTRAL_API_KEY") + + return security_class(**security_dict) if security_dict else None + + +def _parse_security_option( + headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any +): + if not isinstance(option, BaseModel): + raise TypeError("security option must be a pydantic model") + + opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields + + for name in opt_fields: + opt_field = opt_fields[name] + + metadata = find_field_metadata(opt_field, SecurityMetadata) + if metadata is None or not metadata.scheme: + continue + + value = getattr(option, name) + if ( + metadata.scheme_type == "http" + and metadata.sub_type == "basic" + and not isinstance(value, BaseModel) + ): + _parse_basic_auth_scheme(headers, option) + return + + _parse_security_scheme(headers, query_params, metadata, name, value) + + +def _parse_security_scheme( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + field_name: str, + scheme: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + if isinstance(scheme, BaseModel): + if scheme_type == "http": + if sub_type == "basic": + _parse_basic_auth_scheme(headers, scheme) + return + if sub_type == "custom": + return + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + value = getattr(scheme, name) + + _parse_security_scheme_value( + headers, query_params, scheme_metadata, metadata, name, value + ) + else: + _parse_security_scheme_value( + headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme + ) + + +def _parse_security_scheme_value( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + security_metadata: SecurityMetadata, + field_name: str, + value: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + header_name = security_metadata.get_field_name(field_name) + + if scheme_type == "apiKey": + if sub_type == "header": + headers[header_name] = value + elif sub_type == "query": + query_params[header_name] = [value] + else: + raise ValueError("sub type {sub_type} not supported") + elif scheme_type == "openIdConnect": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "oauth2": + if sub_type != "client_credentials": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "http": + if sub_type == "bearer": + headers[header_name] = _apply_bearer(value) + elif sub_type == "basic": + headers[header_name] = value + elif sub_type == "custom": + return + else: + raise ValueError("sub type {sub_type} not supported") + else: + raise ValueError("scheme type {scheme_type} not supported") + + +def _apply_bearer(token: str) -> str: + return token.lower().startswith("bearer ") and token or f"Bearer {token}" + + +def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): + username = "" + password = "" + + if not isinstance(scheme, BaseModel): + raise TypeError("basic auth scheme must be a pydantic model") + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + field_name = metadata.field_name + value = getattr(scheme, name) + + if field_name == "username": + username = value + if field_name == "password": + password = value + + data = f"{username}:{password}".encode() + headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/src/mistralai/client/utils/serializers.py b/src/mistralai/client/utils/serializers.py new file mode 100644 index 00000000..691957f4 --- /dev/null +++ b/src/mistralai/client/utils/serializers.py @@ -0,0 +1,226 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 53c57c7f29a8 + +from decimal import Decimal +import functools +import json +import typing +from typing import Any, Dict, List, Tuple, Union, get_args +import typing_extensions +from typing_extensions import get_origin + +import httpx +from pydantic import ConfigDict, create_model +from pydantic_core import from_json + +from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset + + +def serialize_decimal(as_str: bool): + def serialize(d): + if d is None: + return None + if isinstance(d, Unset): + return d + + if not isinstance(d, Decimal): + raise ValueError("Expected Decimal object") + + return str(d) if as_str else float(d) + + return serialize + + +def validate_decimal(d): + if d is None: + return None + + if isinstance(d, (Decimal, Unset)): + return d + + if not isinstance(d, (str, int, float)): + raise ValueError("Expected string, int or float") + + return Decimal(str(d)) + + +def serialize_float(as_str: bool): + def serialize(f): + if f is None: + return None + if isinstance(f, Unset): + return f + + if not isinstance(f, float): + raise ValueError("Expected float") + + return str(f) if as_str else f + + return serialize + + +def validate_float(f): + if f is None: + return None + + if isinstance(f, (float, Unset)): + return f + + if not isinstance(f, str): + raise ValueError("Expected string") + + return float(f) + + +def serialize_int(as_str: bool): + def serialize(i): + if i is None: + return None + if isinstance(i, Unset): + return i + + if not isinstance(i, int): + raise ValueError("Expected int") + + return str(i) if as_str else i + + return serialize + + +def validate_int(b): + if b is None: + return None + + if isinstance(b, (int, Unset)): + return b + + if not isinstance(b, str): + raise ValueError("Expected string") + + return int(b) + + +def validate_const(v): + def validate(c): + if c is None: + return None + + if v != c: + raise ValueError(f"Expected {v}") + + return c + + return validate + + +def unmarshal_json(raw, typ: Any) -> Any: + return unmarshal(from_json(raw), typ) + + +def unmarshal(val, typ: Any) -> Any: + unmarshaller = create_model( + "Unmarshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = unmarshaller(body=val) + + # pyright: ignore[reportAttributeAccessIssue] + return m.body # type: ignore + + +def marshal_json(val, typ): + if is_nullable(typ) and val is None: + return "null" + + marshaller = create_model( + "Marshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = marshaller(body=val) + + d = m.model_dump(by_alias=True, mode="json", exclude_none=True) + + if len(d) == 0: + return "" + + return json.dumps(d[next(iter(d))], separators=(",", ":")) + + +def is_nullable(field): + origin = get_origin(field) + if origin is Nullable or origin is OptionalNullable: + return True + + if not origin is Union or type(None) not in get_args(field): + return False + + for arg in get_args(field): + if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: + return True + + return False + + +def is_union(obj: object) -> bool: + """ + Returns True if the given object is a typing.Union or typing_extensions.Union. + """ + return any( + obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union") + ) + + +def stream_to_text(stream: httpx.Response) -> str: + return "".join(stream.iter_text()) + + +async def stream_to_text_async(stream: httpx.Response) -> str: + return "".join([chunk async for chunk in stream.aiter_text()]) + + +def stream_to_bytes(stream: httpx.Response) -> bytes: + return stream.content + + +async def stream_to_bytes_async(stream: httpx.Response) -> bytes: + return await stream.aread() + + +def get_pydantic_model(data: Any, typ: Any) -> Any: + if not _contains_pydantic_model(data): + return unmarshal(data, typ) + + return data + + +def _contains_pydantic_model(data: Any) -> bool: + if isinstance(data, BaseModel): + return True + if isinstance(data, List): + return any(_contains_pydantic_model(item) for item in data) + if isinstance(data, Dict): + return any(_contains_pydantic_model(value) for value in data.values()) + + return False + + +@functools.cache +def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: + """ + Get typing objects by name from typing and typing_extensions. + Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types + """ + result = tuple( + getattr(module, name) + for module in (typing, typing_extensions) + if hasattr(module, name) + ) + if not result: + raise ValueError( + f"Neither typing nor typing_extensions has an object called {name!r}" + ) + return result diff --git a/src/mistralai/client/utils/unions.py b/src/mistralai/client/utils/unions.py new file mode 100644 index 00000000..14ef1bd5 --- /dev/null +++ b/src/mistralai/client/utils/unions.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: d23713342634 + +from typing import Any + +from pydantic import BaseModel, TypeAdapter + + +def parse_open_union( + v: Any, + *, + disc_key: str, + variants: dict[str, Any], + unknown_cls: type, + union_name: str, +) -> Any: + """Parse an open discriminated union value with forward-compatibility. + + Known discriminator values are dispatched to their variant types. + Unknown discriminator values produce an instance of the fallback class, + preserving the raw payload for inspection. + """ + if isinstance(v, BaseModel): + return v + if not isinstance(v, dict) or disc_key not in v: + raise ValueError(f"{union_name}: expected object with '{disc_key}' field") + disc = v[disc_key] + variant_cls = variants.get(disc) + if variant_cls is not None: + if isinstance(variant_cls, type) and issubclass(variant_cls, BaseModel): + return variant_cls.model_validate(v) + return TypeAdapter(variant_cls).validate_python(v) + return unknown_cls(raw=v) diff --git a/src/mistralai/client/utils/unmarshal_json_response.py b/src/mistralai/client/utils/unmarshal_json_response.py new file mode 100644 index 00000000..624433c4 --- /dev/null +++ b/src/mistralai/client/utils/unmarshal_json_response.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: b13585fc5626 + +from typing import Any, Optional, Type, TypeVar, overload + +import httpx + +from .serializers import unmarshal_json +from mistralai.client import errors + +T = TypeVar("T") + + +@overload +def unmarshal_json_response( + typ: Type[T], http_res: httpx.Response, body: Optional[str] = None +) -> T: ... + + +@overload +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: ... + + +def unmarshal_json_response( + typ: Any, http_res: httpx.Response, body: Optional[str] = None +) -> Any: + if body is None: + body = http_res.text + try: + return unmarshal_json(body, typ) + except Exception as e: + raise errors.ResponseValidationError( + "Response validation failed", + http_res, + e, + body, + ) from e diff --git a/src/mistralai/utils/url.py b/src/mistralai/client/utils/url.py similarity index 99% rename from src/mistralai/utils/url.py rename to src/mistralai/client/utils/url.py index c78ccbae..27a6a3a0 100644 --- a/src/mistralai/utils/url.py +++ b/src/mistralai/client/utils/url.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 3c6496c17510 from decimal import Decimal from typing import ( diff --git a/src/mistralai/utils/values.py b/src/mistralai/client/utils/values.py similarity index 99% rename from src/mistralai/utils/values.py rename to src/mistralai/client/utils/values.py index dae01a44..2469a9f3 100644 --- a/src/mistralai/utils/values.py +++ b/src/mistralai/client/utils/values.py @@ -1,4 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: bb6ade7a7f82 from datetime import datetime from enum import Enum diff --git a/src/mistralai/client/voices.py b/src/mistralai/client/voices.py new file mode 100644 index 00000000..e19d5d5a --- /dev/null +++ b/src/mistralai/client/voices.py @@ -0,0 +1,1255 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: ab76b1377d79 + +from .basesdk import BaseSDK +import httpx +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, List, Mapping, Optional + + +class Voices(BaseSDK): + def list( + self, + *, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + type_: Optional[models.ListVoicesV1AudioVoicesGetType] = "all", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceListResponse: + r"""List all voices + + List all voices (excluding sample data) + + :param limit: Maximum number of voices to return + :param offset: Offset for pagination + :param type: Filter the voices between customs and presets + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListVoicesV1AudioVoicesGetRequest( + limit=limit, + offset=offset, + type=type_, + ) + + req = self._build_request( + method="GET", + path="/v1/audio/voices", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="list_voices_v1_audio_voices_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceListResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def list_async( + self, + *, + limit: Optional[int] = 10, + offset: Optional[int] = 0, + type_: Optional[models.ListVoicesV1AudioVoicesGetType] = "all", + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceListResponse: + r"""List all voices + + List all voices (excluding sample data) + + :param limit: Maximum number of voices to return + :param offset: Offset for pagination + :param type: Filter the voices between customs and presets + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ListVoicesV1AudioVoicesGetRequest( + limit=limit, + offset=offset, + type=type_, + ) + + req = self._build_request_async( + method="GET", + path="/v1/audio/voices", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="list_voices_v1_audio_voices_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceListResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def create( + self, + *, + name: str, + sample_audio: str, + slug: OptionalNullable[str] = UNSET, + languages: Optional[List[str]] = None, + gender: OptionalNullable[str] = UNSET, + age: OptionalNullable[int] = UNSET, + tags: OptionalNullable[List[str]] = UNSET, + color: OptionalNullable[str] = UNSET, + retention_notice: Optional[int] = 30, + sample_filename: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceResponse: + r"""Create a new voice + + Create a new voice with a base64-encoded audio sample + + :param name: + :param sample_audio: Base64-encoded audio file + :param slug: + :param languages: + :param gender: + :param age: + :param tags: + :param color: + :param retention_notice: + :param sample_filename: Original filename for extension detection + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.VoiceCreateRequest( + name=name, + slug=slug, + languages=languages, + gender=gender, + age=age, + tags=tags, + color=color, + retention_notice=retention_notice, + sample_audio=sample_audio, + sample_filename=sample_filename, + ) + + req = self._build_request( + method="POST", + path="/v1/audio/voices", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.VoiceCreateRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_voice_v1_audio_voices_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def create_async( + self, + *, + name: str, + sample_audio: str, + slug: OptionalNullable[str] = UNSET, + languages: Optional[List[str]] = None, + gender: OptionalNullable[str] = UNSET, + age: OptionalNullable[int] = UNSET, + tags: OptionalNullable[List[str]] = UNSET, + color: OptionalNullable[str] = UNSET, + retention_notice: Optional[int] = 30, + sample_filename: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceResponse: + r"""Create a new voice + + Create a new voice with a base64-encoded audio sample + + :param name: + :param sample_audio: Base64-encoded audio file + :param slug: + :param languages: + :param gender: + :param age: + :param tags: + :param color: + :param retention_notice: + :param sample_filename: Original filename for extension detection + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.VoiceCreateRequest( + name=name, + slug=slug, + languages=languages, + gender=gender, + age=age, + tags=tags, + color=color, + retention_notice=retention_notice, + sample_audio=sample_audio, + sample_filename=sample_filename, + ) + + req = self._build_request_async( + method="POST", + path="/v1/audio/voices", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", models.VoiceCreateRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="create_voice_v1_audio_voices_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def delete( + self, + *, + voice_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceResponse: + r"""Delete a custom voice + + Delete a custom voice + + :param voice_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteVoiceV1AudioVoicesVoiceIDDeleteRequest( + voice_id=voice_id, + ) + + req = self._build_request( + method="DELETE", + path="/v1/audio/voices/{voice_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_voice_v1_audio_voices__voice_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + voice_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceResponse: + r"""Delete a custom voice + + Delete a custom voice + + :param voice_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.DeleteVoiceV1AudioVoicesVoiceIDDeleteRequest( + voice_id=voice_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/v1/audio/voices/{voice_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="delete_voice_v1_audio_voices__voice_id__delete", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update( + self, + *, + voice_id: str, + name: OptionalNullable[str] = UNSET, + languages: OptionalNullable[List[str]] = UNSET, + gender: OptionalNullable[str] = UNSET, + age: OptionalNullable[int] = UNSET, + tags: OptionalNullable[List[str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceResponse: + r"""Update voice metadata + + Update voice metadata (name, gender, languages, age, tags). + + :param voice_id: + :param name: + :param languages: + :param gender: + :param age: + :param tags: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateVoiceV1AudioVoicesVoiceIDPatchRequest( + voice_id=voice_id, + voice_update_request=models.VoiceUpdateRequest( + name=name, + languages=languages, + gender=gender, + age=age, + tags=tags, + ), + ) + + req = self._build_request( + method="PATCH", + path="/v1/audio/voices/{voice_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.voice_update_request, + False, + False, + "json", + models.VoiceUpdateRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_voice_v1_audio_voices__voice_id__patch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_async( + self, + *, + voice_id: str, + name: OptionalNullable[str] = UNSET, + languages: OptionalNullable[List[str]] = UNSET, + gender: OptionalNullable[str] = UNSET, + age: OptionalNullable[int] = UNSET, + tags: OptionalNullable[List[str]] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceResponse: + r"""Update voice metadata + + Update voice metadata (name, gender, languages, age, tags). + + :param voice_id: + :param name: + :param languages: + :param gender: + :param age: + :param tags: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateVoiceV1AudioVoicesVoiceIDPatchRequest( + voice_id=voice_id, + voice_update_request=models.VoiceUpdateRequest( + name=name, + languages=languages, + gender=gender, + age=age, + tags=tags, + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/v1/audio/voices/{voice_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.voice_update_request, + False, + False, + "json", + models.VoiceUpdateRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_voice_v1_audio_voices__voice_id__patch", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get( + self, + *, + voice_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceResponse: + r"""Get voice details + + Get voice details (excluding sample) + + :param voice_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetVoiceV1AudioVoicesVoiceIDGetRequest( + voice_id=voice_id, + ) + + req = self._build_request( + method="GET", + path="/v1/audio/voices/{voice_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_voice_v1_audio_voices__voice_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_async( + self, + *, + voice_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.VoiceResponse: + r"""Get voice details + + Get voice details (excluding sample) + + :param voice_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetVoiceV1AudioVoicesVoiceIDGetRequest( + voice_id=voice_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/audio/voices/{voice_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_voice_v1_audio_voices__voice_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.VoiceResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_sample_audio( + self, + *, + voice_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> httpx.Response: + r"""Get voice sample audio + + Get the audio sample for a voice + + :param voice_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequest( + voice_id=voice_id, + ) + + req = self._build_request( + method="GET", + path="/v1/audio/voices/{voice_id}/sample", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="audio/wav", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_voice_sample_audio_v1_audio_voices__voice_id__sample_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "audio/wav"): + return http_res + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def get_sample_audio_async( + self, + *, + voice_id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> httpx.Response: + r"""Get voice sample audio + + Get the audio sample for a voice + + :param voice_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetVoiceSampleAudioV1AudioVoicesVoiceIDSampleGetRequest( + voice_id=voice_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/audio/voices/{voice_id}/sample", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="audio/wav", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_voice_sample_audio_v1_audio_voices__voice_id__sample_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "audio/wav"): + return http_res + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/client/workflows.py b/src/mistralai/client/workflows.py new file mode 100644 index 00000000..2693b05b --- /dev/null +++ b/src/mistralai/client/workflows.py @@ -0,0 +1,2298 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: e2a0381191f6 + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from jsonpath import JSONPath +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.deployments import Deployments +from mistralai.client.executions import Executions +from mistralai.client.metrics import Metrics +from mistralai.client.runs import Runs +from mistralai.client.schedules import Schedules +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from mistralai.client.workflows_events import WorkflowsEvents +from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union +from typing_extensions import deprecated + +# region imports +import asyncio +from pydantic import BaseModel +import time +# endregion imports + + +class Workflows(BaseSDK): + executions: Executions + metrics: Metrics + runs: Runs + schedules: Schedules + events: WorkflowsEvents + deployments: Deployments + + def __init__( + self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None + ) -> None: + BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.executions = Executions(self.sdk_configuration, parent_ref=self.parent_ref) + self.metrics = Metrics(self.sdk_configuration, parent_ref=self.parent_ref) + self.runs = Runs(self.sdk_configuration, parent_ref=self.parent_ref) + self.schedules = Schedules(self.sdk_configuration, parent_ref=self.parent_ref) + self.events = WorkflowsEvents( + self.sdk_configuration, parent_ref=self.parent_ref + ) + self.deployments = Deployments( + self.sdk_configuration, parent_ref=self.parent_ref + ) + + # region sdk-class-body + def execute_workflow_and_wait( + self, + workflow_identifier: str, + input: OptionalNullable[Dict[str, Any] | BaseModel] = UNSET, + execution_id: OptionalNullable[str] = UNSET, + deployment_name: OptionalNullable[str] = UNSET, + custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET, + task_queue: OptionalNullable[str] = UNSET, + polling_interval: int = 5, + max_attempts: Optional[int] = None, + use_api_sync: bool = False, + timeout_seconds: OptionalNullable[float] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Any: + """Execute a workflow and wait for its completion. + + Args: + workflow_identifier: The workflow name or ID. + input: The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. + execution_id: Optional custom execution ID + deployment_name: Name of the deployment to route this execution to + custom_tracing_attributes: Custom tracing attributes + task_queue: Deprecated. Use deployment_name instead. + polling_interval: Seconds between status checks when polling + max_attempts: Maximum number of polling attempts when polling (None for unlimited) + use_api_sync: Whether to use the API's built-in sync execution capability + timeout_seconds: Maximum time to wait in seconds when using API sync + retries: Override the default retry configuration for this method + server_url: Override the default server URL for this method + timeout_ms: Override the default request timeout configuration for this method in milliseconds + http_headers: Additional headers to set or replace on requests. + + Returns: + The workflow result directly + + Raises: + TimeoutError: If max_attempts is reached and workflow is still running + RuntimeError: If workflow fails or terminates abnormally + """ + if use_api_sync: + # Use the API's built-in synchronous execution + response = self.execute_workflow( + workflow_identifier=workflow_identifier, + input=input, + execution_id=execution_id, + wait_for_result=True, + timeout_seconds=timeout_seconds, + custom_tracing_attributes=custom_tracing_attributes, + task_queue=task_queue, + deployment_name=deployment_name, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + return response.result + # Use polling method + execution = self.execute_workflow( + workflow_identifier=workflow_identifier, + input=input, + execution_id=execution_id, + custom_tracing_attributes=custom_tracing_attributes, + task_queue=task_queue, + deployment_name=deployment_name, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + # Wait for completion + final_execution = self.wait_for_workflow_completion( + execution.execution_id, polling_interval, max_attempts + ) + + return final_execution.result + + def wait_for_workflow_completion( + self, + execution_id: str, + polling_interval: int = 5, + max_attempts: Optional[int] = None, + ) -> models.WorkflowExecutionResponse: + """Wait for a workflow to complete by polling its status. + + Args: + execution_id: Execution ID of the workflow + polling_interval: Seconds between status checks + max_attempts: Maximum number of polling attempts (None for unlimited) + + Returns: + WorkflowExecutionResponse with the final execution details + + Raises: + TimeoutError: If max_attempts is reached and workflow is still running + RuntimeError: If workflow fails or terminates abnormally + """ + attempts = 0 + while True: + response = self.executions.get_workflow_execution(execution_id=execution_id) + + if response.status != "RUNNING": + if response.status == "COMPLETED": + return response + raise RuntimeError(f"Workflow failed with status: {response.status}") + + attempts += 1 + if max_attempts is not None and attempts >= max_attempts: + raise TimeoutError( + f"Workflow is still running after {max_attempts} polling attempts" + ) + + time.sleep(polling_interval) + + async def execute_workflow_and_wait_async( + self, + workflow_identifier: str, + input: OptionalNullable[Dict[str, Any] | BaseModel] = UNSET, + execution_id: OptionalNullable[str] = UNSET, + deployment_name: OptionalNullable[str] = UNSET, + custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET, + task_queue: OptionalNullable[str] = UNSET, + polling_interval: int = 5, + max_attempts: Optional[int] = None, + use_api_sync: bool = False, + timeout_seconds: OptionalNullable[float] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Any: + """Execute a workflow and wait for its completion (async version). + + Args: + workflow_identifier: The workflow name or ID. + input: The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. + execution_id: Optional custom execution ID + deployment_name: Name of the deployment to route this execution to + custom_tracing_attributes: Custom tracing attributes + task_queue: Deprecated. Use deployment_name instead. + polling_interval: Seconds between status checks when polling + max_attempts: Maximum number of polling attempts when polling (None for unlimited) + use_api_sync: Whether to use the API's built-in sync execution capability + timeout_seconds: Maximum time to wait in seconds when using API sync + retries: Override the default retry configuration for this method + server_url: Override the default server URL for this method + timeout_ms: Override the default request timeout configuration for this method in milliseconds + http_headers: Additional headers to set or replace on requests. + + Returns: + The workflow result directly + + Raises: + TimeoutError: If max_attempts is reached and workflow is still running + RuntimeError: If workflow fails or terminates abnormally + """ + if use_api_sync: + # Use the API's built-in synchronous execution + response = await self.execute_workflow_async( + workflow_identifier=workflow_identifier, + input=input, + execution_id=execution_id, + wait_for_result=True, + timeout_seconds=timeout_seconds, + custom_tracing_attributes=custom_tracing_attributes, + task_queue=task_queue, + deployment_name=deployment_name, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + return response.result + + # Use polling method + execution = await self.execute_workflow_async( + workflow_identifier=workflow_identifier, + input=input, + execution_id=execution_id, + custom_tracing_attributes=custom_tracing_attributes, + task_queue=task_queue, + deployment_name=deployment_name, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + # Wait for completion + final_execution = await self.wait_for_workflow_completion_async( + execution.execution_id, polling_interval, max_attempts + ) + + return final_execution.result + + async def wait_for_workflow_completion_async( + self, + execution_id: str, + polling_interval: int = 5, + max_attempts: Optional[int] = None, + ) -> models.WorkflowExecutionResponse: + """Wait for a workflow to complete by polling its status (async version). + + Args: + execution_id: Execution ID of the workflow + polling_interval: Seconds between status checks + max_attempts: Maximum number of polling attempts (None for unlimited) + + Returns: + WorkflowExecutionResponse with the final execution details + + Raises: + TimeoutError: If max_attempts is reached and workflow is still running + RuntimeError: If workflow fails or terminates abnormally + """ + attempts = 0 + while True: + response = await self.executions.get_workflow_execution_async( + execution_id=execution_id + ) + + if response.status != "RUNNING": + if response.status == "COMPLETED": + return response + raise RuntimeError(f"Workflow failed with status: {response.status}") + + attempts += 1 + if max_attempts is not None and attempts >= max_attempts: + raise TimeoutError( + f"Workflow is still running after {max_attempts} polling attempts" + ) + + await asyncio.sleep(polling_interval) + + # endregion sdk-class-body + + def get_workflows( + self, + *, + active_only: Optional[bool] = False, + include_shared: Optional[bool] = True, + available_in_chat_assistant: OptionalNullable[bool] = UNSET, + archived: OptionalNullable[bool] = UNSET, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 50, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.GetWorkflowsV1WorkflowsGetResponse]: + r"""Get Workflows + + :param active_only: Whether to only return active workflows + :param include_shared: Whether to include shared workflows + :param available_in_chat_assistant: Whether to only return workflows available in chat assistant + :param archived: Filter by archived state. False=exclude archived, True=only archived, None=include all + :param cursor: The cursor for pagination + :param limit: The maximum number of workflows to return + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowsV1WorkflowsGetRequest( + active_only=active_only, + include_shared=include_shared, + available_in_chat_assistant=available_in_chat_assistant, + archived=archived, + cursor=cursor, + limit=limit, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflows_v1_workflows_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> Optional[models.GetWorkflowsV1WorkflowsGetResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + next_cursor = JSONPath("$.next_cursor").parse(body) + + if len(next_cursor) == 0: + return None + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return None + results = JSONPath("$.workflows").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return None + limit = request.limit if isinstance(request.limit, int) else 50 + if len(results[0]) < limit: + return None + + return self.get_workflows( + active_only=active_only, + include_shared=include_shared, + available_in_chat_assistant=available_in_chat_assistant, + archived=archived, + cursor=next_cursor, + limit=limit, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.GetWorkflowsV1WorkflowsGetResponse( + result=unmarshal_json_response(models.WorkflowListResponse, http_res), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflows_async( + self, + *, + active_only: Optional[bool] = False, + include_shared: Optional[bool] = True, + available_in_chat_assistant: OptionalNullable[bool] = UNSET, + archived: OptionalNullable[bool] = UNSET, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 50, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.GetWorkflowsV1WorkflowsGetResponse]: + r"""Get Workflows + + :param active_only: Whether to only return active workflows + :param include_shared: Whether to include shared workflows + :param available_in_chat_assistant: Whether to only return workflows available in chat assistant + :param archived: Filter by archived state. False=exclude archived, True=only archived, None=include all + :param cursor: The cursor for pagination + :param limit: The maximum number of workflows to return + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowsV1WorkflowsGetRequest( + active_only=active_only, + include_shared=include_shared, + available_in_chat_assistant=available_in_chat_assistant, + archived=archived, + cursor=cursor, + limit=limit, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflows_v1_workflows_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + def next_func() -> ( + Awaitable[Optional[models.GetWorkflowsV1WorkflowsGetResponse]] + ): + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + + async def empty_result(): + return None + + next_cursor = JSONPath("$.next_cursor").parse(body) + + if len(next_cursor) == 0: + return empty_result() + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return empty_result() + results = JSONPath("$.workflows").parse(body) + if len(results) == 0 or len(results[0]) == 0: + return empty_result() + limit = request.limit if isinstance(request.limit, int) else 50 + if len(results[0]) < limit: + return empty_result() + + return self.get_workflows_async( + active_only=active_only, + include_shared=include_shared, + available_in_chat_assistant=available_in_chat_assistant, + archived=archived, + cursor=next_cursor, + limit=limit, + retries=retries, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.GetWorkflowsV1WorkflowsGetResponse( + result=unmarshal_json_response(models.WorkflowListResponse, http_res), + next=next_func, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_workflow_registrations( + self, + *, + workflow_id: OptionalNullable[str] = UNSET, + task_queue: OptionalNullable[str] = UNSET, + active_only: Optional[bool] = False, + include_shared: Optional[bool] = True, + workflow_search: OptionalNullable[str] = UNSET, + archived: OptionalNullable[bool] = UNSET, + with_workflow: Optional[bool] = False, + available_in_chat_assistant: OptionalNullable[bool] = UNSET, + limit: Optional[int] = 50, + cursor: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowRegistrationListResponse: + r"""Get Workflow Registrations + + :param workflow_id: The workflow ID to filter by + :param task_queue: The task queue to filter by + :param active_only: Whether to only return active workflows versions + :param include_shared: Whether to include shared workflow versions + :param workflow_search: The workflow name to filter by + :param archived: Filter by archived state. False=exclude archived, True=only archived, None=include all + :param with_workflow: Whether to include the workflow definition + :param available_in_chat_assistant: Whether to only return workflows available in chat assistant + :param limit: The maximum number of workflows versions to return + :param cursor: The cursor for pagination + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequest( + workflow_id=workflow_id, + task_queue=task_queue, + active_only=active_only, + include_shared=include_shared, + workflow_search=workflow_search, + archived=archived, + with_workflow=with_workflow, + available_in_chat_assistant=available_in_chat_assistant, + limit=limit, + cursor=cursor, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/registrations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_registrations_v1_workflows_registrations_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowRegistrationListResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_registrations_async( + self, + *, + workflow_id: OptionalNullable[str] = UNSET, + task_queue: OptionalNullable[str] = UNSET, + active_only: Optional[bool] = False, + include_shared: Optional[bool] = True, + workflow_search: OptionalNullable[str] = UNSET, + archived: OptionalNullable[bool] = UNSET, + with_workflow: Optional[bool] = False, + available_in_chat_assistant: OptionalNullable[bool] = UNSET, + limit: Optional[int] = 50, + cursor: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowRegistrationListResponse: + r"""Get Workflow Registrations + + :param workflow_id: The workflow ID to filter by + :param task_queue: The task queue to filter by + :param active_only: Whether to only return active workflows versions + :param include_shared: Whether to include shared workflow versions + :param workflow_search: The workflow name to filter by + :param archived: Filter by archived state. False=exclude archived, True=only archived, None=include all + :param with_workflow: Whether to include the workflow definition + :param available_in_chat_assistant: Whether to only return workflows available in chat assistant + :param limit: The maximum number of workflows versions to return + :param cursor: The cursor for pagination + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowRegistrationsV1WorkflowsRegistrationsGetRequest( + workflow_id=workflow_id, + task_queue=task_queue, + active_only=active_only, + include_shared=include_shared, + workflow_search=workflow_search, + archived=archived, + with_workflow=with_workflow, + available_in_chat_assistant=available_in_chat_assistant, + limit=limit, + cursor=cursor, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/registrations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_registrations_v1_workflows_registrations_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowRegistrationListResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def execute_workflow( + self, + *, + workflow_identifier: str, + execution_id: OptionalNullable[str] = UNSET, + input: OptionalNullable[Any] = UNSET, + wait_for_result: Optional[bool] = False, + timeout_seconds: OptionalNullable[float] = UNSET, + custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET, + extensions: OptionalNullable[Dict[str, Any]] = UNSET, + task_queue: OptionalNullable[str] = UNSET, + deployment_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost: + r"""Execute Workflow + + :param workflow_identifier: + :param execution_id: Allows you to specify a custom execution ID. If not provided, a random ID will be generated. + :param input: The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. + :param wait_for_result: If true, wait for the workflow to complete and return the result directly. + :param timeout_seconds: Maximum time to wait for completion when wait_for_result is true. + :param custom_tracing_attributes: + :param extensions: Plugin-specific data to propagate into WorkflowContext.extensions at execution time. + :param task_queue: Deprecated. Use deployment_name instead. + :param deployment_name: Name of the deployment to route this execution to + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequest( + workflow_identifier=workflow_identifier, + workflow_execution_request=models.WorkflowExecutionRequest( + execution_id=execution_id, + input=input, + wait_for_result=wait_for_result, + timeout_seconds=timeout_seconds, + custom_tracing_attributes=custom_tracing_attributes, + extensions=extensions, + task_queue=task_queue, + deployment_name=deployment_name, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/{workflow_identifier}/execute", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_execution_request, + False, + False, + "json", + models.WorkflowExecutionRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="execute_workflow_v1_workflows__workflow_identifier__execute_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost, + http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def execute_workflow_async( + self, + *, + workflow_identifier: str, + execution_id: OptionalNullable[str] = UNSET, + input: OptionalNullable[Any] = UNSET, + wait_for_result: Optional[bool] = False, + timeout_seconds: OptionalNullable[float] = UNSET, + custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET, + extensions: OptionalNullable[Dict[str, Any]] = UNSET, + task_queue: OptionalNullable[str] = UNSET, + deployment_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost: + r"""Execute Workflow + + :param workflow_identifier: + :param execution_id: Allows you to specify a custom execution ID. If not provided, a random ID will be generated. + :param input: The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. + :param wait_for_result: If true, wait for the workflow to complete and return the result directly. + :param timeout_seconds: Maximum time to wait for completion when wait_for_result is true. + :param custom_tracing_attributes: + :param extensions: Plugin-specific data to propagate into WorkflowContext.extensions at execution time. + :param task_queue: Deprecated. Use deployment_name instead. + :param deployment_name: Name of the deployment to route this execution to + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePostRequest( + workflow_identifier=workflow_identifier, + workflow_execution_request=models.WorkflowExecutionRequest( + execution_id=execution_id, + input=input, + wait_for_result=wait_for_result, + timeout_seconds=timeout_seconds, + custom_tracing_attributes=custom_tracing_attributes, + extensions=extensions, + task_queue=task_queue, + deployment_name=deployment_name, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/{workflow_identifier}/execute", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_execution_request, + False, + False, + "json", + models.WorkflowExecutionRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="execute_workflow_v1_workflows__workflow_identifier__execute_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ResponseExecuteWorkflowV1WorkflowsWorkflowIdentifierExecutePost, + http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) + def execute_workflow_registration( + self, + *, + workflow_registration_id: str, + execution_id: OptionalNullable[str] = UNSET, + input: OptionalNullable[Any] = UNSET, + wait_for_result: Optional[bool] = False, + timeout_seconds: OptionalNullable[float] = UNSET, + custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET, + extensions: OptionalNullable[Dict[str, Any]] = UNSET, + task_queue: OptionalNullable[str] = UNSET, + deployment_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost: + r"""Execute Workflow Registration + + :param workflow_registration_id: + :param execution_id: Allows you to specify a custom execution ID. If not provided, a random ID will be generated. + :param input: The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. + :param wait_for_result: If true, wait for the workflow to complete and return the result directly. + :param timeout_seconds: Maximum time to wait for completion when wait_for_result is true. + :param custom_tracing_attributes: + :param extensions: Plugin-specific data to propagate into WorkflowContext.extensions at execution time. + :param task_queue: Deprecated. Use deployment_name instead. + :param deployment_name: Name of the deployment to route this execution to + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequest( + workflow_registration_id=workflow_registration_id, + workflow_execution_request=models.WorkflowExecutionRequest( + execution_id=execution_id, + input=input, + wait_for_result=wait_for_result, + timeout_seconds=timeout_seconds, + custom_tracing_attributes=custom_tracing_attributes, + extensions=extensions, + task_queue=task_queue, + deployment_name=deployment_name, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/workflows/registrations/{workflow_registration_id}/execute", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_execution_request, + False, + False, + "json", + models.WorkflowExecutionRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="execute_workflow_registration_v1_workflows_registrations__workflow_registration_id__execute_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost, + http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) + async def execute_workflow_registration_async( + self, + *, + workflow_registration_id: str, + execution_id: OptionalNullable[str] = UNSET, + input: OptionalNullable[Any] = UNSET, + wait_for_result: Optional[bool] = False, + timeout_seconds: OptionalNullable[float] = UNSET, + custom_tracing_attributes: OptionalNullable[Dict[str, str]] = UNSET, + extensions: OptionalNullable[Dict[str, Any]] = UNSET, + task_queue: OptionalNullable[str] = UNSET, + deployment_name: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost: + r"""Execute Workflow Registration + + :param workflow_registration_id: + :param execution_id: Allows you to specify a custom execution ID. If not provided, a random ID will be generated. + :param input: The input to the workflow. This should be a dictionary or a BaseModel that matches the workflow's input schema. + :param wait_for_result: If true, wait for the workflow to complete and return the result directly. + :param timeout_seconds: Maximum time to wait for completion when wait_for_result is true. + :param custom_tracing_attributes: + :param extensions: Plugin-specific data to propagate into WorkflowContext.extensions at execution time. + :param task_queue: Deprecated. Use deployment_name instead. + :param deployment_name: Name of the deployment to route this execution to + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePostRequest( + workflow_registration_id=workflow_registration_id, + workflow_execution_request=models.WorkflowExecutionRequest( + execution_id=execution_id, + input=input, + wait_for_result=wait_for_result, + timeout_seconds=timeout_seconds, + custom_tracing_attributes=custom_tracing_attributes, + extensions=extensions, + task_queue=task_queue, + deployment_name=deployment_name, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/workflows/registrations/{workflow_registration_id}/execute", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_execution_request, + False, + False, + "json", + models.WorkflowExecutionRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="execute_workflow_registration_v1_workflows_registrations__workflow_registration_id__execute_post", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.ResponseExecuteWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDExecutePost, + http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_workflow( + self, + *, + workflow_identifier: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowGetResponse: + r"""Get Workflow + + :param workflow_identifier: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowV1WorkflowsWorkflowIdentifierGetRequest( + workflow_identifier=workflow_identifier, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/{workflow_identifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_v1_workflows__workflow_identifier__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowGetResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_async( + self, + *, + workflow_identifier: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowGetResponse: + r"""Get Workflow + + :param workflow_identifier: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowV1WorkflowsWorkflowIdentifierGetRequest( + workflow_identifier=workflow_identifier, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/{workflow_identifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_v1_workflows__workflow_identifier__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowGetResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def update_workflow( + self, + *, + workflow_identifier: str, + display_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + available_in_chat_assistant: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowUpdateResponse: + r"""Update Workflow + + :param workflow_identifier: + :param display_name: New display name value + :param description: New description value + :param available_in_chat_assistant: Whether to make the workflow available in the chat assistant + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequest( + workflow_identifier=workflow_identifier, + workflow_update_request=models.WorkflowUpdateRequest( + display_name=display_name, + description=description, + available_in_chat_assistant=available_in_chat_assistant, + ), + ) + + req = self._build_request( + method="PUT", + path="/v1/workflows/{workflow_identifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_update_request, + False, + False, + "json", + models.WorkflowUpdateRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_workflow_v1_workflows__workflow_identifier__put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowUpdateResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def update_workflow_async( + self, + *, + workflow_identifier: str, + display_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + available_in_chat_assistant: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowUpdateResponse: + r"""Update Workflow + + :param workflow_identifier: + :param display_name: New display name value + :param description: New description value + :param available_in_chat_assistant: Whether to make the workflow available in the chat assistant + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateWorkflowV1WorkflowsWorkflowIdentifierPutRequest( + workflow_identifier=workflow_identifier, + workflow_update_request=models.WorkflowUpdateRequest( + display_name=display_name, + description=description, + available_in_chat_assistant=available_in_chat_assistant, + ), + ) + + req = self._build_request_async( + method="PUT", + path="/v1/workflows/{workflow_identifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.workflow_update_request, + False, + False, + "json", + models.WorkflowUpdateRequest, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update_workflow_v1_workflows__workflow_identifier__put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowUpdateResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def get_workflow_registration( + self, + *, + workflow_registration_id: str, + with_workflow: Optional[bool] = False, + include_shared: Optional[bool] = True, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowRegistrationGetResponse: + r"""Get Workflow Registration + + :param workflow_registration_id: + :param with_workflow: Whether to include the workflow definition + :param include_shared: Whether to include shared workflow versions + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequest( + workflow_registration_id=workflow_registration_id, + with_workflow=with_workflow, + include_shared=include_shared, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/registrations/{workflow_registration_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_registration_v1_workflows_registrations__workflow_registration_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowRegistrationGetResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_registration_async( + self, + *, + workflow_registration_id: str, + with_workflow: Optional[bool] = False, + include_shared: Optional[bool] = True, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowRegistrationGetResponse: + r"""Get Workflow Registration + + :param workflow_registration_id: + :param with_workflow: Whether to include the workflow definition + :param include_shared: Whether to include shared workflow versions + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowRegistrationV1WorkflowsRegistrationsWorkflowRegistrationIDGetRequest( + workflow_registration_id=workflow_registration_id, + with_workflow=with_workflow, + include_shared=include_shared, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/registrations/{workflow_registration_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_registration_v1_workflows_registrations__workflow_registration_id__get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + models.WorkflowRegistrationGetResponse, http_res + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def archive_workflow( + self, + *, + workflow_identifier: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowArchiveResponse: + r"""Archive Workflow + + :param workflow_identifier: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequest( + workflow_identifier=workflow_identifier, + ) + + req = self._build_request( + method="PUT", + path="/v1/workflows/{workflow_identifier}/archive", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="archive_workflow_v1_workflows__workflow_identifier__archive_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowArchiveResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def archive_workflow_async( + self, + *, + workflow_identifier: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowArchiveResponse: + r"""Archive Workflow + + :param workflow_identifier: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.ArchiveWorkflowV1WorkflowsWorkflowIdentifierArchivePutRequest( + workflow_identifier=workflow_identifier, + ) + + req = self._build_request_async( + method="PUT", + path="/v1/workflows/{workflow_identifier}/archive", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="archive_workflow_v1_workflows__workflow_identifier__archive_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowArchiveResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + def unarchive_workflow( + self, + *, + workflow_identifier: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowUnarchiveResponse: + r"""Unarchive Workflow + + :param workflow_identifier: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest( + workflow_identifier=workflow_identifier, + ) + ) + + req = self._build_request( + method="PUT", + path="/v1/workflows/{workflow_identifier}/unarchive", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="unarchive_workflow_v1_workflows__workflow_identifier__unarchive_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowUnarchiveResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def unarchive_workflow_async( + self, + *, + workflow_identifier: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.WorkflowUnarchiveResponse: + r"""Unarchive Workflow + + :param workflow_identifier: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = ( + models.UnarchiveWorkflowV1WorkflowsWorkflowIdentifierUnarchivePutRequest( + workflow_identifier=workflow_identifier, + ) + ) + + req = self._build_request_async( + method="PUT", + path="/v1/workflows/{workflow_identifier}/unarchive", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="unarchive_workflow_v1_workflows__workflow_identifier__unarchive_put", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.WorkflowUnarchiveResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/client/workflows_events.py b/src/mistralai/client/workflows_events.py new file mode 100644 index 00000000..71e44ac7 --- /dev/null +++ b/src/mistralai/client/workflows_events.py @@ -0,0 +1,490 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +# @generated-id: 6d4f674ce8ef + +from .basesdk import BaseSDK +from mistralai.client import errors, models, utils +from mistralai.client._hooks import HookContext +from mistralai.client.types import OptionalNullable, UNSET +from mistralai.client.utils import eventstreaming, get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, Dict, List, Mapping, Optional + + +class WorkflowsEvents(BaseSDK): + def get_stream_events( + self, + *, + scope: Optional[models.Scope] = "*", + activity_name: Optional[str] = "*", + activity_id: Optional[str] = "*", + workflow_name: Optional[str] = "*", + workflow_exec_id: Optional[str] = "*", + root_workflow_exec_id: Optional[str] = "*", + parent_workflow_exec_id: Optional[str] = "*", + stream: Optional[str] = "*", + start_seq: Optional[int] = 0, + metadata_filters: OptionalNullable[Dict[str, Any]] = UNSET, + workflow_event_types: OptionalNullable[List[models.WorkflowEventType]] = UNSET, + last_event_id: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStream[ + models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + ]: + r"""Get Stream Events + + :param scope: + :param activity_name: + :param activity_id: + :param workflow_name: + :param workflow_exec_id: + :param root_workflow_exec_id: + :param parent_workflow_exec_id: + :param stream: + :param start_seq: + :param metadata_filters: + :param workflow_event_types: + :param last_event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetStreamEventsV1WorkflowsEventsStreamGetRequest( + scope=scope, + activity_name=activity_name, + activity_id=activity_id, + workflow_name=workflow_name, + workflow_exec_id=workflow_exec_id, + root_workflow_exec_id=root_workflow_exec_id, + parent_workflow_exec_id=parent_workflow_exec_id, + stream=stream, + start_seq=start_seq, + metadata_filters=metadata_filters, + workflow_event_types=workflow_event_types, + last_event_id=last_event_id, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/events/stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_stream_events_v1_workflows_events_stream_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStream( + http_res, + lambda raw: utils.unmarshal_json( + raw, models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + ), + client_ref=self, + data_required=False, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = utils.stream_to_text(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + async def get_stream_events_async( + self, + *, + scope: Optional[models.Scope] = "*", + activity_name: Optional[str] = "*", + activity_id: Optional[str] = "*", + workflow_name: Optional[str] = "*", + workflow_exec_id: Optional[str] = "*", + root_workflow_exec_id: Optional[str] = "*", + parent_workflow_exec_id: Optional[str] = "*", + stream: Optional[str] = "*", + start_seq: Optional[int] = 0, + metadata_filters: OptionalNullable[Dict[str, Any]] = UNSET, + workflow_event_types: OptionalNullable[List[models.WorkflowEventType]] = UNSET, + last_event_id: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> eventstreaming.EventStreamAsync[ + models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + ]: + r"""Get Stream Events + + :param scope: + :param activity_name: + :param activity_id: + :param workflow_name: + :param workflow_exec_id: + :param root_workflow_exec_id: + :param parent_workflow_exec_id: + :param stream: + :param start_seq: + :param metadata_filters: + :param workflow_event_types: + :param last_event_id: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetStreamEventsV1WorkflowsEventsStreamGetRequest( + scope=scope, + activity_name=activity_name, + activity_id=activity_id, + workflow_name=workflow_name, + workflow_exec_id=workflow_exec_id, + root_workflow_exec_id=root_workflow_exec_id, + parent_workflow_exec_id=parent_workflow_exec_id, + stream=stream, + start_seq=start_seq, + metadata_filters=metadata_filters, + workflow_event_types=workflow_event_types, + last_event_id=last_event_id, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/events/stream", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="text/event-stream", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_stream_events_v1_workflows_events_stream_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + stream=True, + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "text/event-stream"): + return eventstreaming.EventStreamAsync( + http_res, + lambda raw: utils.unmarshal_json( + raw, models.GetStreamEventsV1WorkflowsEventsStreamGetResponseBody + ), + client_ref=self, + data_required=False, + ) + if utils.match_response(http_res, "422", "application/json"): + http_res_text = await utils.stream_to_text_async(http_res) + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res, http_res_text + ) + raise errors.HTTPValidationError(response_data, http_res, http_res_text) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("Unexpected response received", http_res, http_res_text) + + def get_workflow_events( + self, + *, + root_workflow_exec_id: OptionalNullable[str] = UNSET, + workflow_exec_id: OptionalNullable[str] = UNSET, + workflow_run_id: OptionalNullable[str] = UNSET, + limit: Optional[int] = 100, + cursor: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListWorkflowEventResponse: + r"""Get Workflow Events + + :param root_workflow_exec_id: Execution ID of the root workflow that initiated this execution chain. + :param workflow_exec_id: Execution ID of the workflow that emitted this event. + :param workflow_run_id: Run ID of the workflow that emitted this event. + :param limit: Maximum number of events to return. + :param cursor: Cursor for pagination. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowEventsV1WorkflowsEventsListGetRequest( + root_workflow_exec_id=root_workflow_exec_id, + workflow_exec_id=workflow_exec_id, + workflow_run_id=workflow_run_id, + limit=limit, + cursor=cursor, + ) + + req = self._build_request( + method="GET", + path="/v1/workflows/events/list", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_events_v1_workflows_events_list_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListWorkflowEventResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) + + async def get_workflow_events_async( + self, + *, + root_workflow_exec_id: OptionalNullable[str] = UNSET, + workflow_exec_id: OptionalNullable[str] = UNSET, + workflow_run_id: OptionalNullable[str] = UNSET, + limit: Optional[int] = 100, + cursor: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.ListWorkflowEventResponse: + r"""Get Workflow Events + + :param root_workflow_exec_id: Execution ID of the root workflow that initiated this execution chain. + :param workflow_exec_id: Execution ID of the workflow that emitted this event. + :param workflow_run_id: Run ID of the workflow that emitted this event. + :param limit: Maximum number of events to return. + :param cursor: Cursor for pagination. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if timeout_ms is None: + timeout_ms = 60000 + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetWorkflowEventsV1WorkflowsEventsListGetRequest( + root_workflow_exec_id=root_workflow_exec_id, + workflow_exec_id=workflow_exec_id, + workflow_run_id=workflow_run_id, + limit=limit, + cursor=cursor, + ) + + req = self._build_request_async( + method="GET", + path="/v1/workflows/events/list", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="get_workflow_events_v1_workflows_events_list_get", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(models.ListWorkflowEventResponse, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + errors.HTTPValidationErrorData, http_res + ) + raise errors.HTTPValidationError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/conversations.py b/src/mistralai/conversations.py deleted file mode 100644 index 27eddedf..00000000 --- a/src/mistralai/conversations.py +++ /dev/null @@ -1,2471 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import eventstreaming, get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, List, Mapping, Optional, Union - -# region imports -import typing -from typing import AsyncGenerator -import logging -from collections import defaultdict - -from mistralai.models import ( - ResponseStartedEvent, - ConversationEventsData, - InputEntries, -) -from mistralai.extra.run.result import ( - RunResult, - RunResultEvents, - FunctionResultEvent, - reconstitue_entries, -) -from mistralai.extra.run.utils import run_requirements - -logger = logging.getLogger(__name__) - -if typing.TYPE_CHECKING: - from mistralai.extra.run.context import RunContext - -# endregion imports - - -class Conversations(BaseSDK): - r"""(beta) Conversations API""" - - # region sdk-class-body - # Custom run code allowing client side execution of code - - @run_requirements - async def run_async( - self, - run_ctx: "RunContext", - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - instructions: OptionalNullable[str] = UNSET, - tools: OptionalNullable[ - Union[List[models.Tools], List[models.ToolsTypedDict]] - ] = UNSET, - completion_args: OptionalNullable[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = UNSET, - name: OptionalNullable[str] = UNSET, - description: OptionalNullable[str] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> RunResult: - """Run a conversation with the given inputs and context. - - The execution of a run will only stop when no required local execution can be done.""" - from mistralai.beta import Beta - from mistralai.extra.run.context import _validate_run - from mistralai.extra.run.tools import get_function_calls - - req, run_result, input_entries = await _validate_run( - beta_client=Beta(self.sdk_configuration), - run_ctx=run_ctx, - inputs=inputs, - instructions=instructions, - tools=tools, - completion_args=completion_args, - ) - - while True: - if run_ctx.conversation_id is None: - res = await self.start_async( - inputs=input_entries, - http_headers=http_headers, - name=name, - description=description, - retries=retries, - server_url=server_url, - timeout_ms=timeout_ms, - **req, # type: ignore - ) - run_result.conversation_id = res.conversation_id - run_ctx.conversation_id = res.conversation_id - logger.info( - f"Started Run with conversation with id {res.conversation_id}" - ) - else: - res = await self.append_async( - conversation_id=run_ctx.conversation_id, - inputs=input_entries, - retries=retries, - server_url=server_url, - timeout_ms=timeout_ms, - ) - run_ctx.request_count += 1 - run_result.output_entries.extend(res.outputs) - fcalls = get_function_calls(res.outputs) - if not fcalls: - logger.debug("No more function calls to execute") - break - else: - fresults = await run_ctx.execute_function_calls(fcalls) - run_result.output_entries.extend(fresults) - input_entries = typing.cast(list[InputEntries], fresults) - return run_result - - @run_requirements - async def run_stream_async( - self, - run_ctx: "RunContext", - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - instructions: OptionalNullable[str] = UNSET, - tools: OptionalNullable[ - Union[List[models.Tools], List[models.ToolsTypedDict]] - ] = UNSET, - completion_args: OptionalNullable[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = UNSET, - name: OptionalNullable[str] = UNSET, - description: OptionalNullable[str] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> AsyncGenerator[Union[RunResultEvents, RunResult], None]: - """Similar to `run_async` but returns a generator which streams events. - - The last streamed object is the RunResult object which summarises what happened in the run.""" - from mistralai.beta import Beta - from mistralai.extra.run.context import _validate_run - from mistralai.extra.run.tools import get_function_calls - - req, run_result, input_entries = await _validate_run( - beta_client=Beta(self.sdk_configuration), - run_ctx=run_ctx, - inputs=inputs, - instructions=instructions, - tools=tools, - completion_args=completion_args, - ) - - async def run_generator() -> ( - AsyncGenerator[Union[RunResultEvents, RunResult], None] - ): - current_entries = input_entries - while True: - received_event_tracker: defaultdict[ - int, list[ConversationEventsData] - ] = defaultdict(list) - if run_ctx.conversation_id is None: - res = await self.start_stream_async( - inputs=current_entries, - http_headers=http_headers, - name=name, - description=description, - retries=retries, - server_url=server_url, - timeout_ms=timeout_ms, - **req, # type: ignore - ) - else: - res = await self.append_stream_async( - conversation_id=run_ctx.conversation_id, - inputs=current_entries, - retries=retries, - server_url=server_url, - timeout_ms=timeout_ms, - ) - async for event in res: - if ( - isinstance(event.data, ResponseStartedEvent) - and run_ctx.conversation_id is None - ): - run_result.conversation_id = event.data.conversation_id - run_ctx.conversation_id = event.data.conversation_id - logger.info( - f"Started Run with conversation with id {run_ctx.conversation_id}" - ) - if ( - output_index := getattr(event.data, "output_index", None) - ) is not None: - received_event_tracker[output_index].append(event.data) - yield typing.cast(RunResultEvents, event) - run_ctx.request_count += 1 - outputs = reconstitue_entries(received_event_tracker) - run_result.output_entries.extend(outputs) - fcalls = get_function_calls(outputs) - if not fcalls: - logger.debug("No more function calls to execute") - break - else: - fresults = await run_ctx.execute_function_calls(fcalls) - run_result.output_entries.extend(fresults) - for fresult in fresults: - yield RunResultEvents( - event="function.result", - data=FunctionResultEvent( - type="function.result", - result=fresult.result, - tool_call_id=fresult.tool_call_id, - ), - ) - current_entries = typing.cast(list[InputEntries], fresults) - yield run_result - - return run_generator() - - # endregion sdk-class-body - - def start( - self, - *, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - stream: Optional[bool] = False, - store: OptionalNullable[bool] = UNSET, - handoff_execution: OptionalNullable[models.HandoffExecution] = UNSET, - instructions: OptionalNullable[str] = UNSET, - tools: OptionalNullable[ - Union[List[models.Tools], List[models.ToolsTypedDict]] - ] = UNSET, - completion_args: OptionalNullable[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = UNSET, - name: OptionalNullable[str] = UNSET, - description: OptionalNullable[str] = UNSET, - agent_id: OptionalNullable[str] = UNSET, - model: OptionalNullable[str] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationResponse: - r"""Create a conversation and append entries to it. - - Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation. - - :param inputs: - :param stream: - :param store: - :param handoff_execution: - :param instructions: - :param tools: - :param completion_args: - :param name: - :param description: - :param agent_id: - :param model: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ConversationRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - instructions=instructions, - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tools]]), - completion_args=utils.get_pydantic_model( - completion_args, OptionalNullable[models.CompletionArgs] - ), - name=name, - description=description, - agent_id=agent_id, - model=model, - ) - - req = self._build_request( - method="POST", - path="/v1/conversations", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ConversationRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_start", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def start_async( - self, - *, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - stream: Optional[bool] = False, - store: OptionalNullable[bool] = UNSET, - handoff_execution: OptionalNullable[models.HandoffExecution] = UNSET, - instructions: OptionalNullable[str] = UNSET, - tools: OptionalNullable[ - Union[List[models.Tools], List[models.ToolsTypedDict]] - ] = UNSET, - completion_args: OptionalNullable[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = UNSET, - name: OptionalNullable[str] = UNSET, - description: OptionalNullable[str] = UNSET, - agent_id: OptionalNullable[str] = UNSET, - model: OptionalNullable[str] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationResponse: - r"""Create a conversation and append entries to it. - - Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation. - - :param inputs: - :param stream: - :param store: - :param handoff_execution: - :param instructions: - :param tools: - :param completion_args: - :param name: - :param description: - :param agent_id: - :param model: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ConversationRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - instructions=instructions, - tools=utils.get_pydantic_model(tools, OptionalNullable[List[models.Tools]]), - completion_args=utils.get_pydantic_model( - completion_args, OptionalNullable[models.CompletionArgs] - ), - name=name, - description=description, - agent_id=agent_id, - model=model, - ) - - req = self._build_request_async( - method="POST", - path="/v1/conversations", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ConversationRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_start", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def list( - self, - *, - page: Optional[int] = 0, - page_size: Optional[int] = 100, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> List[models.ResponseBody]: - r"""List all created conversations. - - Retrieve a list of conversation entities sorted by creation time. - - :param page: - :param page_size: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsListRequest( - page=page, - page_size=page_size, - ) - - req = self._build_request( - method="GET", - path="/v1/conversations", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_list", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(List[models.ResponseBody], http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def list_async( - self, - *, - page: Optional[int] = 0, - page_size: Optional[int] = 100, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> List[models.ResponseBody]: - r"""List all created conversations. - - Retrieve a list of conversation entities sorted by creation time. - - :param page: - :param page_size: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsListRequest( - page=page, - page_size=page_size, - ) - - req = self._build_request_async( - method="GET", - path="/v1/conversations", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_list", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(List[models.ResponseBody], http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def get( - self, - *, - conversation_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.AgentsAPIV1ConversationsGetResponseV1ConversationsGet: - r"""Retrieve a conversation information. - - Given a conversation_id retrieve a conversation entity with its attributes. - - :param conversation_id: ID of the conversation from which we are fetching metadata. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsGetRequest( - conversation_id=conversation_id, - ) - - req = self._build_request( - method="GET", - path="/v1/conversations/{conversation_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_get", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.AgentsAPIV1ConversationsGetResponseV1ConversationsGet, http_res - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def get_async( - self, - *, - conversation_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.AgentsAPIV1ConversationsGetResponseV1ConversationsGet: - r"""Retrieve a conversation information. - - Given a conversation_id retrieve a conversation entity with its attributes. - - :param conversation_id: ID of the conversation from which we are fetching metadata. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsGetRequest( - conversation_id=conversation_id, - ) - - req = self._build_request_async( - method="GET", - path="/v1/conversations/{conversation_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_get", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.AgentsAPIV1ConversationsGetResponseV1ConversationsGet, http_res - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def append( - self, - *, - conversation_id: str, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - stream: Optional[bool] = False, - store: Optional[bool] = True, - handoff_execution: Optional[ - models.ConversationAppendRequestHandoffExecution - ] = "server", - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationResponse: - r"""Append new entries to an existing conversation. - - Run completion on the history of the conversation and the user entries. Return the new created entries. - - :param conversation_id: ID of the conversation to which we append entries. - :param inputs: - :param stream: - :param store: Whether to store the results into our servers or not. - :param handoff_execution: - :param completion_args: White-listed arguments from the completion API - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsAppendRequest( - conversation_id=conversation_id, - conversation_append_request=models.ConversationAppendRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - ), - ) - - req = self._build_request( - method="POST", - path="/v1/conversations/{conversation_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.conversation_append_request, - False, - False, - "json", - models.ConversationAppendRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_append", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def append_async( - self, - *, - conversation_id: str, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - stream: Optional[bool] = False, - store: Optional[bool] = True, - handoff_execution: Optional[ - models.ConversationAppendRequestHandoffExecution - ] = "server", - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationResponse: - r"""Append new entries to an existing conversation. - - Run completion on the history of the conversation and the user entries. Return the new created entries. - - :param conversation_id: ID of the conversation to which we append entries. - :param inputs: - :param stream: - :param store: Whether to store the results into our servers or not. - :param handoff_execution: - :param completion_args: White-listed arguments from the completion API - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsAppendRequest( - conversation_id=conversation_id, - conversation_append_request=models.ConversationAppendRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - ), - ) - - req = self._build_request_async( - method="POST", - path="/v1/conversations/{conversation_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.conversation_append_request, - False, - False, - "json", - models.ConversationAppendRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_append", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def get_history( - self, - *, - conversation_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationHistory: - r"""Retrieve all entries in a conversation. - - Given a conversation_id retrieve all the entries belonging to that conversation. The entries are sorted in the order they were appended, those can be messages, connectors or function_call. - - :param conversation_id: ID of the conversation from which we are fetching entries. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsHistoryRequest( - conversation_id=conversation_id, - ) - - req = self._build_request( - method="GET", - path="/v1/conversations/{conversation_id}/history", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_history", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationHistory, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def get_history_async( - self, - *, - conversation_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationHistory: - r"""Retrieve all entries in a conversation. - - Given a conversation_id retrieve all the entries belonging to that conversation. The entries are sorted in the order they were appended, those can be messages, connectors or function_call. - - :param conversation_id: ID of the conversation from which we are fetching entries. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsHistoryRequest( - conversation_id=conversation_id, - ) - - req = self._build_request_async( - method="GET", - path="/v1/conversations/{conversation_id}/history", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_history", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationHistory, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def get_messages( - self, - *, - conversation_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationMessages: - r"""Retrieve all messages in a conversation. - - Given a conversation_id retrieve all the messages belonging to that conversation. This is similar to retrieving all entries except we filter the messages only. - - :param conversation_id: ID of the conversation from which we are fetching messages. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsMessagesRequest( - conversation_id=conversation_id, - ) - - req = self._build_request( - method="GET", - path="/v1/conversations/{conversation_id}/messages", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_messages", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationMessages, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def get_messages_async( - self, - *, - conversation_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationMessages: - r"""Retrieve all messages in a conversation. - - Given a conversation_id retrieve all the messages belonging to that conversation. This is similar to retrieving all entries except we filter the messages only. - - :param conversation_id: ID of the conversation from which we are fetching messages. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsMessagesRequest( - conversation_id=conversation_id, - ) - - req = self._build_request_async( - method="GET", - path="/v1/conversations/{conversation_id}/messages", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_messages", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationMessages, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def restart( - self, - *, - conversation_id: str, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - from_entry_id: str, - stream: Optional[bool] = False, - store: Optional[bool] = True, - handoff_execution: Optional[ - models.ConversationRestartRequestHandoffExecution - ] = "server", - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationResponse: - r"""Restart a conversation starting from a given entry. - - Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned. - - :param conversation_id: ID of the original conversation which is being restarted. - :param inputs: - :param from_entry_id: - :param stream: - :param store: Whether to store the results into our servers or not. - :param handoff_execution: - :param completion_args: White-listed arguments from the completion API - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsRestartRequest( - conversation_id=conversation_id, - conversation_restart_request=models.ConversationRestartRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - from_entry_id=from_entry_id, - ), - ) - - req = self._build_request( - method="POST", - path="/v1/conversations/{conversation_id}/restart", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.conversation_restart_request, - False, - False, - "json", - models.ConversationRestartRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_restart", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def restart_async( - self, - *, - conversation_id: str, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - from_entry_id: str, - stream: Optional[bool] = False, - store: Optional[bool] = True, - handoff_execution: Optional[ - models.ConversationRestartRequestHandoffExecution - ] = "server", - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.ConversationResponse: - r"""Restart a conversation starting from a given entry. - - Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned. - - :param conversation_id: ID of the original conversation which is being restarted. - :param inputs: - :param from_entry_id: - :param stream: - :param store: Whether to store the results into our servers or not. - :param handoff_execution: - :param completion_args: White-listed arguments from the completion API - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsRestartRequest( - conversation_id=conversation_id, - conversation_restart_request=models.ConversationRestartRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - from_entry_id=from_entry_id, - ), - ) - - req = self._build_request_async( - method="POST", - path="/v1/conversations/{conversation_id}/restart", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.conversation_restart_request, - False, - False, - "json", - models.ConversationRestartRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_restart", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.ConversationResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def start_stream( - self, - *, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - stream: Optional[bool] = True, - store: OptionalNullable[bool] = UNSET, - handoff_execution: OptionalNullable[ - models.ConversationStreamRequestHandoffExecution - ] = UNSET, - instructions: OptionalNullable[str] = UNSET, - tools: OptionalNullable[ - Union[ - List[models.ConversationStreamRequestTools], - List[models.ConversationStreamRequestToolsTypedDict], - ] - ] = UNSET, - completion_args: OptionalNullable[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = UNSET, - name: OptionalNullable[str] = UNSET, - description: OptionalNullable[str] = UNSET, - agent_id: OptionalNullable[str] = UNSET, - model: OptionalNullable[str] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStream[models.ConversationEvents]: - r"""Create a conversation and append entries to it. - - Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation. - - :param inputs: - :param stream: - :param store: - :param handoff_execution: - :param instructions: - :param tools: - :param completion_args: - :param name: - :param description: - :param agent_id: - :param model: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ConversationStreamRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - instructions=instructions, - tools=utils.get_pydantic_model( - tools, OptionalNullable[List[models.ConversationStreamRequestTools]] - ), - completion_args=utils.get_pydantic_model( - completion_args, OptionalNullable[models.CompletionArgs] - ), - name=name, - description=description, - agent_id=agent_id, - model=model, - ) - - req = self._build_request( - method="POST", - path="/v1/conversations#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ConversationStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_start_stream", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) - - async def start_stream_async( - self, - *, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - stream: Optional[bool] = True, - store: OptionalNullable[bool] = UNSET, - handoff_execution: OptionalNullable[ - models.ConversationStreamRequestHandoffExecution - ] = UNSET, - instructions: OptionalNullable[str] = UNSET, - tools: OptionalNullable[ - Union[ - List[models.ConversationStreamRequestTools], - List[models.ConversationStreamRequestToolsTypedDict], - ] - ] = UNSET, - completion_args: OptionalNullable[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = UNSET, - name: OptionalNullable[str] = UNSET, - description: OptionalNullable[str] = UNSET, - agent_id: OptionalNullable[str] = UNSET, - model: OptionalNullable[str] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStreamAsync[models.ConversationEvents]: - r"""Create a conversation and append entries to it. - - Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation. - - :param inputs: - :param stream: - :param store: - :param handoff_execution: - :param instructions: - :param tools: - :param completion_args: - :param name: - :param description: - :param agent_id: - :param model: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.ConversationStreamRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - instructions=instructions, - tools=utils.get_pydantic_model( - tools, OptionalNullable[List[models.ConversationStreamRequestTools]] - ), - completion_args=utils.get_pydantic_model( - completion_args, OptionalNullable[models.CompletionArgs] - ), - name=name, - description=description, - agent_id=agent_id, - model=model, - ) - - req = self._build_request_async( - method="POST", - path="/v1/conversations#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.ConversationStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_start_stream", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) - - def append_stream( - self, - *, - conversation_id: str, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - stream: Optional[bool] = True, - store: Optional[bool] = True, - handoff_execution: Optional[ - models.ConversationAppendStreamRequestHandoffExecution - ] = "server", - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStream[models.ConversationEvents]: - r"""Append new entries to an existing conversation. - - Run completion on the history of the conversation and the user entries. Return the new created entries. - - :param conversation_id: ID of the conversation to which we append entries. - :param inputs: - :param stream: - :param store: Whether to store the results into our servers or not. - :param handoff_execution: - :param completion_args: White-listed arguments from the completion API - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsAppendStreamRequest( - conversation_id=conversation_id, - conversation_append_stream_request=models.ConversationAppendStreamRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - ), - ) - - req = self._build_request( - method="POST", - path="/v1/conversations/{conversation_id}#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.conversation_append_stream_request, - False, - False, - "json", - models.ConversationAppendStreamRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_append_stream", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) - - async def append_stream_async( - self, - *, - conversation_id: str, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - stream: Optional[bool] = True, - store: Optional[bool] = True, - handoff_execution: Optional[ - models.ConversationAppendStreamRequestHandoffExecution - ] = "server", - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStreamAsync[models.ConversationEvents]: - r"""Append new entries to an existing conversation. - - Run completion on the history of the conversation and the user entries. Return the new created entries. - - :param conversation_id: ID of the conversation to which we append entries. - :param inputs: - :param stream: - :param store: Whether to store the results into our servers or not. - :param handoff_execution: - :param completion_args: White-listed arguments from the completion API - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsAppendStreamRequest( - conversation_id=conversation_id, - conversation_append_stream_request=models.ConversationAppendStreamRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - ), - ) - - req = self._build_request_async( - method="POST", - path="/v1/conversations/{conversation_id}#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.conversation_append_stream_request, - False, - False, - "json", - models.ConversationAppendStreamRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_append_stream", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) - - def restart_stream( - self, - *, - conversation_id: str, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - from_entry_id: str, - stream: Optional[bool] = True, - store: Optional[bool] = True, - handoff_execution: Optional[ - models.ConversationRestartStreamRequestHandoffExecution - ] = "server", - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStream[models.ConversationEvents]: - r"""Restart a conversation starting from a given entry. - - Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned. - - :param conversation_id: ID of the original conversation which is being restarted. - :param inputs: - :param from_entry_id: - :param stream: - :param store: Whether to store the results into our servers or not. - :param handoff_execution: - :param completion_args: White-listed arguments from the completion API - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsRestartStreamRequest( - conversation_id=conversation_id, - conversation_restart_stream_request=models.ConversationRestartStreamRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - from_entry_id=from_entry_id, - ), - ) - - req = self._build_request( - method="POST", - path="/v1/conversations/{conversation_id}/restart#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.conversation_restart_stream_request, - False, - False, - "json", - models.ConversationRestartStreamRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_restart_stream", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) - - async def restart_stream_async( - self, - *, - conversation_id: str, - inputs: Union[models.ConversationInputs, models.ConversationInputsTypedDict], - from_entry_id: str, - stream: Optional[bool] = True, - store: Optional[bool] = True, - handoff_execution: Optional[ - models.ConversationRestartStreamRequestHandoffExecution - ] = "server", - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStreamAsync[models.ConversationEvents]: - r"""Restart a conversation starting from a given entry. - - Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned. - - :param conversation_id: ID of the original conversation which is being restarted. - :param inputs: - :param from_entry_id: - :param stream: - :param store: Whether to store the results into our servers or not. - :param handoff_execution: - :param completion_args: White-listed arguments from the completion API - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1ConversationsRestartStreamRequest( - conversation_id=conversation_id, - conversation_restart_stream_request=models.ConversationRestartStreamRequest( - inputs=utils.get_pydantic_model(inputs, models.ConversationInputs), - stream=stream, - store=store, - handoff_execution=handoff_execution, - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - from_entry_id=from_entry_id, - ), - ) - - req = self._build_request_async( - method="POST", - path="/v1/conversations/{conversation_id}/restart#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.conversation_restart_stream_request, - False, - False, - "json", - models.ConversationRestartStreamRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_conversations_restart_stream", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.ConversationEvents), - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/extra/README.md b/src/mistralai/extra/README.md index dfce43b3..94f077f7 100644 --- a/src/mistralai/extra/README.md +++ b/src/mistralai/extra/README.md @@ -34,13 +34,13 @@ class Chat(BaseSDK): 3. Now build the SDK with the custom code: ```bash -rm -rf dist; poetry build; python3 -m pip install ~/client-python/dist/mistralai-1.4.1-py3-none-any.whl --force-reinstall +rm -rf dist; uv build; uv pip install --reinstall ~/client-python/dist/mistralai-2.0.0-py3-none-any.whl ``` 4. And now you should be able to call the custom method: ```python import os -from mistralai import Mistral +from mistralai.client import Mistral api_key = os.environ["MISTRAL_API_KEY"] client = Mistral(api_key=api_key) diff --git a/src/mistralai/extra/__init__.py b/src/mistralai/extra/__init__.py index d9a81d24..cabda728 100644 --- a/src/mistralai/extra/__init__.py +++ b/src/mistralai/extra/__init__.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING + from .struct_chat import ( ParsedChatCompletionResponse, convert_to_parsed_chat_completion_response, @@ -5,9 +7,55 @@ from .utils import response_format_from_pydantic_model from .utils.response_format import CustomPydanticModel +if TYPE_CHECKING: + from .realtime import ( + AudioEncoding, + AudioFormat, + RealtimeConnection, + RealtimeTranscriptionError, + RealtimeTranscriptionErrorDetail, + RealtimeTranscriptionSession, + RealtimeTranscriptionSessionCreated, + RealtimeTranscriptionSessionUpdated, + RealtimeTranscription, + UnknownRealtimeEvent, + ) + +_REALTIME_EXPORTS = { + "RealtimeTranscription", + "RealtimeConnection", + "AudioEncoding", + "AudioFormat", + "UnknownRealtimeEvent", + "RealtimeTranscriptionError", + "RealtimeTranscriptionErrorDetail", + "RealtimeTranscriptionSession", + "RealtimeTranscriptionSessionCreated", + "RealtimeTranscriptionSessionUpdated", +} + + +def __getattr__(name: str): + if name in _REALTIME_EXPORTS: + from . import realtime + + return getattr(realtime, name) + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + + __all__ = [ "convert_to_parsed_chat_completion_response", "response_format_from_pydantic_model", "CustomPydanticModel", "ParsedChatCompletionResponse", + "RealtimeTranscription", + "RealtimeConnection", + "AudioEncoding", + "AudioFormat", + "UnknownRealtimeEvent", + "RealtimeTranscriptionError", + "RealtimeTranscriptionErrorDetail", + "RealtimeTranscriptionSession", + "RealtimeTranscriptionSessionCreated", + "RealtimeTranscriptionSessionUpdated", ] diff --git a/src/mistralai/extra/exceptions.py b/src/mistralai/extra/exceptions.py index 7853ddc2..a6b9ff11 100644 --- a/src/mistralai/extra/exceptions.py +++ b/src/mistralai/extra/exceptions.py @@ -1,14 +1,292 @@ +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum +from typing import Any, Optional, Union, TYPE_CHECKING +import typing + +from mistralai.client.models import ( + FunctionCallEntryArguments, + FunctionResultEntry, + FunctionCallEntry, +) + +if TYPE_CHECKING: + from mistralai.client.models import RealtimeTranscriptionError + from mistralai.extra.run.result import RunOutputEntries + + class MistralClientException(Exception): - """Base exception for all the client errors.""" + """Base exception for client errors.""" + + +class WorkflowPayloadOffloadingException(MistralClientException): + """Workflow payload offloading exception""" + + +class WorkflowPayloadEncryptionException(MistralClientException): + """Workflow payload encryption exception""" class RunException(MistralClientException): - """Exception raised for errors during a conversation run.""" + """Conversation run errors.""" class MCPException(MistralClientException): - """Exception raised for errors related to MCP operations.""" + """MCP operation errors.""" class MCPAuthException(MCPException): - """Exception raised for authentication errors with an MCP server.""" + """MCP authentication errors.""" + + +class DeferralReason(str, Enum): + """Reason why a tool call was deferred.""" + + CONFIRMATION_REQUIRED = "confirmation_required" + SERVER_SIDE_CONFIRMATION_REQUIRED = "server_side_confirmation_required" + + +@dataclass +class DeferredToolCallConfirmation: + """Response indicating the tool call is approved for execution.""" + + tool_call_id: str + tool_name: str + function_call: FunctionCallEntry + override_args: Optional[dict[str, Any]] = None + deferral_reason: Optional[DeferralReason] = None + + +@dataclass +class DeferredToolCallRejection: + """Response indicating tool should not be executed.""" + + tool_call_id: str + message: str = "Rejected by user" + deferral_reason: Optional[DeferralReason] = None + + +DeferredToolCallResponse = Union[ + DeferredToolCallConfirmation, DeferredToolCallRejection +] + + +class FunctionCallSchema(typing.TypedDict): + id: str | None + tool_call_id: str + name: str + arguments: FunctionCallEntryArguments + + +class DeferredToolCallEntrySchema(typing.TypedDict): + tool_call_id: str + tool_name: str + arguments: FunctionCallEntryArguments + reason: str + metadata: dict[str, Any] + function_call: FunctionCallSchema + + +class DeferredToolCallEntry: + """Represents a tool call that requires confirmation.""" + + def __init__( + self, + function_call: FunctionCallEntry, + reason: DeferralReason = DeferralReason.CONFIRMATION_REQUIRED, + metadata: Optional[dict[str, Any]] = None, + ): + self.function_call = function_call + self.tool_call_id = function_call.tool_call_id + self.tool_name = function_call.name + self.arguments = function_call.arguments + self.reason = reason + self.metadata = metadata or {} + + def to_function_result(self, result: str) -> dict[str, str]: + """Convert to function result dict for use as input.""" + return { + "tool_call_id": self.tool_call_id, + "result": result, + } + + def confirm( + self, override_args: Optional[dict[str, str]] = None + ) -> DeferredToolCallConfirmation: + """Create a confirmation response for this tool call.""" + return DeferredToolCallConfirmation( + tool_call_id=self.tool_call_id, + tool_name=self.tool_name, + function_call=self.function_call, + override_args=override_args, + deferral_reason=self.reason, + ) + + def reject(self, message: str = "Rejected by user") -> DeferredToolCallRejection: + """Create a rejection response for this tool call.""" + return DeferredToolCallRejection( + tool_call_id=self.tool_call_id, + message=message, + deferral_reason=self.reason, + ) + + def to_dict(self) -> DeferredToolCallEntrySchema: + """Serialize to a JSON-serializable dictionary for stateless scenarios.""" + return { + "tool_call_id": self.tool_call_id, + "tool_name": self.tool_name, + "arguments": self.arguments, + "reason": self.reason.value, + "metadata": self.metadata, + "function_call": { + "id": self.function_call.id, + "tool_call_id": self.function_call.tool_call_id, + "name": self.function_call.name, + "arguments": self.function_call.arguments, + }, + } + + @classmethod + def from_dict(cls, data: DeferredToolCallEntrySchema) -> DeferredToolCallEntry: + """Deserialize from a dictionary.""" + function_call = FunctionCallEntry( + id=data["function_call"].get("id"), + tool_call_id=data["function_call"]["tool_call_id"], + name=data["function_call"]["name"], + arguments=data["function_call"]["arguments"], + ) + return cls( + function_call=function_call, + reason=DeferralReason( + data.get("reason", DeferralReason.CONFIRMATION_REQUIRED.value) + ), + metadata=data.get("metadata", {}), + ) + + +class DeferredToolCallsExceptionSchema(typing.TypedDict): + conversation_id: str | None + deferred_calls: list[DeferredToolCallEntrySchema] + outputs: list[dict[str, Any]] + executed_results: list[dict[str, Any]] + + +class DeferredToolCallsException(RunException): + """Exception raised when tool calls require human confirmation.""" + + def __init__( + self, + conversation_id: str | None, + deferred_calls: list[DeferredToolCallEntry], + outputs: list[RunOutputEntries] | None = None, + executed_results: list[FunctionResultEntry] | None = None, + ): + self.conversation_id = conversation_id + self.deferred_calls = deferred_calls + self.outputs = outputs or [] + self.executed_results = executed_results or [] + super().__init__( + f"Deferred tool calls requiring confirmation: {[dc.tool_name for dc in deferred_calls]}" + ) + + def to_dict(self) -> DeferredToolCallsExceptionSchema: + """Serialize to a JSON-serializable dictionary for stateless scenarios.""" + return { + "conversation_id": self.conversation_id, + "deferred_calls": [dc.to_dict() for dc in self.deferred_calls], + "outputs": [entry.model_dump(mode="json") for entry in self.outputs], + "executed_results": [ + entry.model_dump(mode="json") for entry in self.executed_results + ], + } + + @classmethod + def from_dict( + cls, data: DeferredToolCallsExceptionSchema + ) -> DeferredToolCallsException: + """Deserialize from a dictionary.""" + from pydantic import BaseModel + from mistralai.client.models import ( + MessageOutputEntry, + FunctionCallEntry, + FunctionResultEntry, + AgentHandoffEntry, + ToolExecutionEntry, + ) + + output_entry_types: dict[str, type[BaseModel]] = { + "message.output": MessageOutputEntry, + "function.call": FunctionCallEntry, + "function.result": FunctionResultEntry, + "agent.handoff": AgentHandoffEntry, + "tool.execution": ToolExecutionEntry, + } + + deferred_calls = [ + DeferredToolCallEntry.from_dict(dc_data) + for dc_data in data["deferred_calls"] + ] + + outputs: list[RunOutputEntries] = [] + for entry_data in data.get("outputs", []): + entry_type = entry_data.get("type") + if isinstance(entry_type, str): + model_cls = output_entry_types.get(entry_type) + if model_cls is not None: + outputs.append( + typing.cast( + "RunOutputEntries", model_cls.model_validate(entry_data) + ) + ) + + executed_results = [ + FunctionResultEntry.model_validate(r) + for r in data.get("executed_results", []) + ] + + return cls( + conversation_id=data["conversation_id"], + deferred_calls=deferred_calls, + outputs=outputs, + executed_results=executed_results, + ) + + +class RealtimeTranscriptionException(MistralClientException): + """Base realtime transcription exception.""" + + def __init__( + self, + message: str, + *, + code: Optional[int] = None, + payload: Optional[object] = None, + ) -> None: + super().__init__(message) + self.code = code + self.payload = payload + + +class RealtimeTranscriptionWSError(RealtimeTranscriptionException): + def __init__( + self, + message: str, + *, + payload: Optional["RealtimeTranscriptionError"] = None, + raw: Optional[object] = None, + ) -> None: + code: Optional[int] = None + if payload is not None: + try: + maybe_code = getattr(payload.error, "code", None) + if isinstance(maybe_code, int): + code = maybe_code + except Exception: + code = None + + super().__init__( + message, code=code, payload=payload if payload is not None else raw + ) + self.payload_typed = payload + self.payload_raw = raw diff --git a/src/mistralai/extra/mcp/auth.py b/src/mistralai/extra/mcp/auth.py index 909f5d4a..8a61ddab 100644 --- a/src/mistralai/extra/mcp/auth.py +++ b/src/mistralai/extra/mcp/auth.py @@ -1,11 +1,10 @@ -from typing import Optional +import logging -from authlib.oauth2.rfc8414 import AuthorizationServerMetadata -from authlib.integrations.httpx_client import AsyncOAuth2Client as AsyncOAuth2ClientBase import httpx -import logging +from authlib.integrations.httpx_client import AsyncOAuth2Client as AsyncOAuth2ClientBase +from authlib.oauth2.rfc8414 import AuthorizationServerMetadata -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel logger = logging.getLogger(__name__) @@ -16,8 +15,8 @@ class Oauth2AuthorizationScheme(BaseModel): authorization_url: str token_url: str scope: list[str] - description: Optional[str] = None - refresh_url: Optional[str] = None + description: str | None = None + refresh_url: str | None = None class OAuthParams(BaseModel): @@ -42,7 +41,7 @@ def from_oauth_params(cls, oauth_params: OAuthParams) -> "AsyncOAuth2Client": async def get_well_known_authorization_server_metadata( server_url: str, -) -> Optional[AuthorizationServerMetadata]: +) -> AuthorizationServerMetadata | None: """Fetch the metadata from the well-known location. This should be available on MCP servers as described by the specification: @@ -123,10 +122,10 @@ async def dynamic_client_registration( async def build_oauth_params( server_url: str, redirect_url: str, - client_id: Optional[str] = None, - client_secret: Optional[str] = None, - scope: Optional[list[str]] = None, - async_client: Optional[httpx.AsyncClient] = None, + client_id: str | None = None, + client_secret: str | None = None, + scope: list[str] | None = None, + async_client: httpx.AsyncClient | None = None, ) -> OAuthParams: """Get issuer metadata and build the oauth required params.""" metadata = await get_oauth_server_metadata(server_url=server_url) diff --git a/src/mistralai/extra/mcp/base.py b/src/mistralai/extra/mcp/base.py index 8be5585c..115eff61 100644 --- a/src/mistralai/extra/mcp/base.py +++ b/src/mistralai/extra/mcp/base.py @@ -1,14 +1,17 @@ -from typing import Optional, Union import logging import typing +from collections.abc import Sequence from contextlib import AsyncExitStack -from typing import Protocol, Any +from typing import Any, Protocol -from mcp import ClientSession -from mcp.types import ListPromptsResult, EmbeddedResource, ImageContent, TextContent +from mcp import ClientSession # pyright: ignore[reportMissingImports] +from mcp.types import ( # pyright: ignore[reportMissingImports] + ContentBlock, + ListPromptsResult, +) from mistralai.extra.exceptions import MCPException -from mistralai.models import ( +from mistralai.client.models import ( FunctionTool, Function, SystemMessageTypedDict, @@ -20,8 +23,8 @@ class MCPSystemPrompt(typing.TypedDict): - description: Optional[str] - messages: list[Union[SystemMessageTypedDict, AssistantMessageTypedDict]] + description: str | None + messages: list[SystemMessageTypedDict | AssistantMessageTypedDict] class MCPClientProtocol(Protocol): @@ -29,7 +32,7 @@ class MCPClientProtocol(Protocol): _name: str - async def initialize(self, exit_stack: Optional[AsyncExitStack]) -> None: + async def initialize(self, exit_stack: AsyncExitStack | None) -> None: ... async def aclose(self) -> None: @@ -39,7 +42,7 @@ async def get_tools(self) -> list[FunctionTool]: ... async def execute_tool( - self, name: str, arguments: dict + self, name: str, arguments: dict[str, Any] ) -> list[TextChunkTypedDict]: ... @@ -57,20 +60,18 @@ class MCPClientBase(MCPClientProtocol): _session: ClientSession - def __init__(self, name: Optional[str] = None): + def __init__(self, name: str | None = None): self._name = name or self.__class__.__name__ - self._exit_stack: Optional[AsyncExitStack] = None + self._exit_stack: AsyncExitStack | None = None self._is_initialized = False - def _convert_content( - self, mcp_content: Union[TextContent, ImageContent, EmbeddedResource] - ) -> TextChunkTypedDict: + def _convert_content(self, mcp_content: ContentBlock) -> TextChunkTypedDict: if not mcp_content.type == "text": raise MCPException("Only supporting text tool responses for now.") return {"type": "text", "text": mcp_content.text} def _convert_content_list( - self, mcp_contents: list[Union[TextContent, ImageContent, EmbeddedResource]] + self, mcp_contents: Sequence[ContentBlock] ) -> list[TextChunkTypedDict]: content_chunks = [] for mcp_content in mcp_contents: @@ -83,7 +84,6 @@ async def get_tools(self) -> list[FunctionTool]: for mcp_tool in mcp_tools.tools: tools.append( FunctionTool( - type="function", function=Function( name=mcp_tool.name, description=mcp_tool.description, @@ -108,7 +108,7 @@ async def get_system_prompt( "description": prompt_result.description, "messages": [ typing.cast( - Union[SystemMessageTypedDict, AssistantMessageTypedDict], + SystemMessageTypedDict | AssistantMessageTypedDict, { "role": message.role, "content": self._convert_content(mcp_content=message.content), @@ -121,7 +121,7 @@ async def get_system_prompt( async def list_system_prompts(self) -> ListPromptsResult: return await self._session.list_prompts() - async def initialize(self, exit_stack: Optional[AsyncExitStack] = None) -> None: + async def initialize(self, exit_stack: AsyncExitStack | None = None) -> None: """Initialize the MCP session.""" # client is already initialized so return if self._is_initialized: diff --git a/src/mistralai/extra/mcp/sse.py b/src/mistralai/extra/mcp/sse.py index 2dfe7a2d..b4929c54 100644 --- a/src/mistralai/extra/mcp/sse.py +++ b/src/mistralai/extra/mcp/sse.py @@ -1,24 +1,22 @@ import http import logging -import typing -from typing import Any, Optional from contextlib import AsyncExitStack from functools import cached_property +from typing import Any import httpx +from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream +from authlib.oauth2.rfc6749 import OAuth2Token +from mcp.client.sse import sse_client # pyright: ignore[reportMissingImports] +from mcp.shared.message import SessionMessage # pyright: ignore[reportMissingImports] from mistralai.extra.exceptions import MCPAuthException from mistralai.extra.mcp.base import ( MCPClientBase, ) from mistralai.extra.mcp.auth import OAuthParams, AsyncOAuth2Client -from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream - -from mcp.client.sse import sse_client -from mcp.shared.message import SessionMessage -from authlib.oauth2.rfc6749 import OAuth2Token -from mistralai.types import BaseModel +from mistralai.client.types import BaseModel logger = logging.getLogger(__name__) @@ -27,7 +25,7 @@ class SSEServerParams(BaseModel): """Parameters required for a MCPClient with SSE transport""" url: str - headers: Optional[dict[str, Any]] = None + headers: dict[str, Any] | None = None timeout: float = 5 sse_read_timeout: float = 60 * 5 @@ -41,20 +39,20 @@ class MCPClientSSE(MCPClientBase): This is possibly going to change in the future since the protocol has ongoing discussions. """ - _oauth_params: Optional[OAuthParams] + _oauth_params: OAuthParams | None _sse_params: SSEServerParams def __init__( self, sse_params: SSEServerParams, - name: Optional[str] = None, - oauth_params: Optional[OAuthParams] = None, - auth_token: Optional[OAuth2Token] = None, + name: str | None = None, + oauth_params: OAuthParams | None = None, + auth_token: OAuth2Token | None = None, ): super().__init__(name=name) self._sse_params = sse_params - self._oauth_params: Optional[OAuthParams] = oauth_params - self._auth_token: Optional[OAuth2Token] = auth_token + self._oauth_params: OAuthParams | None = oauth_params + self._auth_token: OAuth2Token | None = auth_token @cached_property def base_url(self) -> str: @@ -142,7 +140,7 @@ async def requires_auth(self) -> bool: async def _get_transport( self, exit_stack: AsyncExitStack ) -> tuple[ - MemoryObjectReceiveStream[typing.Union[SessionMessage, Exception]], + MemoryObjectReceiveStream[SessionMessage | Exception], MemoryObjectSendStream[SessionMessage], ]: try: diff --git a/src/mistralai/extra/mcp/stdio.py b/src/mistralai/extra/mcp/stdio.py index 28c3b8c5..a548066c 100644 --- a/src/mistralai/extra/mcp/stdio.py +++ b/src/mistralai/extra/mcp/stdio.py @@ -1,12 +1,9 @@ -from typing import Optional import logging from contextlib import AsyncExitStack -from mistralai.extra.mcp.base import ( - MCPClientBase, -) +from mcp import StdioServerParameters, stdio_client # pyright: ignore[reportMissingImports] -from mcp import stdio_client, StdioServerParameters +from mistralai.extra.mcp.base import MCPClientBase logger = logging.getLogger(__name__) @@ -14,7 +11,9 @@ class MCPClientSTDIO(MCPClientBase): """MCP client that uses stdio for communication.""" - def __init__(self, stdio_params: StdioServerParameters, name: Optional[str] = None): + def __init__( + self, stdio_params: StdioServerParameters, name: str | None = None + ): super().__init__(name=name) self._stdio_params = stdio_params diff --git a/src/mistralai/extra/observability/__init__.py b/src/mistralai/extra/observability/__init__.py new file mode 100644 index 00000000..d3ae6cd9 --- /dev/null +++ b/src/mistralai/extra/observability/__init__.py @@ -0,0 +1,55 @@ +from contextlib import contextmanager +from typing import TYPE_CHECKING + +from opentelemetry import trace as otel_trace + +from .otel import MISTRAL_SDK_OTEL_TRACER_NAME + +if TYPE_CHECKING: + from mistralai.client.sdk import Mistral + + +@contextmanager +def trace(name: str, **kwargs): + tracer = otel_trace.get_tracer(MISTRAL_SDK_OTEL_TRACER_NAME) + with tracer.start_as_current_span(name, **kwargs) as span: + yield span + + +def set_tracer_provider( + client: "Mistral", + provider: otel_trace.TracerProvider, +) -> None: + """Attach a per-instance OpenTelemetry TracerProvider to a Mistral client. + + When set, all SDK spans produced by *client* will be emitted through + *provider* instead of the global TracerProvider. + + Usage:: + + from opentelemetry.sdk.trace import TracerProvider + from mistralai.client import Mistral + from mistralai.extra.observability import set_tracer_provider + + client = Mistral(api_key="...") + set_tracer_provider(client, TracerProvider()) + """ + from mistralai.client._hooks.tracing import TracingHook + + hooks = getattr(client.sdk_configuration, "_hooks", None) + if hooks is None: + raise ValueError( + "Cannot set tracer_provider: SDK hooks not initialised on this client." + ) + + for hook in hooks.before_request_hooks: + if isinstance(hook, TracingHook): + hook.tracer_provider = provider + return + + raise ValueError( + "Cannot set tracer_provider: TracingHook not found in the client's hooks." + ) + + +__all__ = ["trace", "set_tracer_provider"] diff --git a/src/mistralai/extra/observability/formatting.py b/src/mistralai/extra/observability/formatting.py new file mode 100644 index 00000000..34dc9aed --- /dev/null +++ b/src/mistralai/extra/observability/formatting.py @@ -0,0 +1,155 @@ +"""Formatting helpers for converting Mistral API payloads to OTEL GenAI convention formats. + +These are pure functions with no OTEL dependencies — they transform dicts to dicts +matching the GenAI semantic convention schemas for input/output messages and tool definitions. +The caller is responsible for the final JSON serialization (single json.dumps on the whole +collection) before setting span attributes. + +Schemas: +- Input messages: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-input-messages.json +- Output messages: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-output-messages.json +- Tool definitions: https://github.com/Cirilla-zmh/semantic-conventions/blob/cc4d07e7e56b80e9aa5904a3d524c134699da37f/docs/gen-ai/gen-ai-tool-definitions.json +""" + +from typing import Any + + +def _content_to_parts(content) -> list[dict]: + """Convert Mistral message content to OTEL parts array. + + Mistral content is either a string or an array of content chunks. + """ + if content is None: + return [] + if isinstance(content, str): + return [{"type": "text", "content": content}] + # Content chunks array — map known Mistral types to OTEL part types + parts = [] + for chunk in content: + if isinstance(chunk, str): + parts.append({"type": "text", "content": chunk}) + elif isinstance(chunk, dict): + chunk_type = chunk.get("type", "") + if chunk_type == "text": + parts.append({"type": "text", "content": chunk.get("text", "")}) + elif chunk_type == "thinking": + thinking = chunk.get("thinking", "") + if isinstance(thinking, list): + text_parts = [ + sub.get("text", "") + for sub in thinking + if isinstance(sub, dict) and sub.get("type") == "text" + ] + content_str = "\n".join(text_parts) + else: # Fallback + content_str = str(thinking) + parts.append({"type": "reasoning", "content": content_str}) + elif chunk_type == "image_url": + url = chunk.get("image_url", {}) + uri = url.get("url", "") if isinstance(url, dict) else str(url) + parts.append({"type": "uri", "modality": "image", "uri": uri}) + else: + # Catch-all for other content chunk types + parts.append({"type": chunk_type}) + return parts + + +def _tool_calls_to_parts(tool_calls: list[dict] | None) -> list[dict]: + """Convert Mistral tool_calls to OTEL ToolCallRequestPart entries.""" + if not tool_calls: + return [] + parts = [] + for tc in tool_calls: + func = tc.get("function", {}) or {} + part: dict = { + "type": "tool_call", + "name": func.get("name", ""), + } + if (tc_id := tc.get("id")) is not None: + part["id"] = tc_id + if (arguments := func.get("arguments")) is not None: + part["arguments"] = arguments + parts.append(part) + return parts + + +def format_input_message(message: dict[str, Any]) -> dict[str, Any]: + """Format a single input message per the OTEL GenAI convention. + + Schema: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-input-messages.json + ChatMessage: {role (required), parts (required), name?} + + Conversation entry objects (e.g. function.result) don't carry a "role" + field — they are detected via their "type" and mapped to the closest + OTEL role. + """ + entry_type = message.get("type") + + # Conversation entry: function.result → OTEL tool role + if entry_type == "function.result": + part: dict = {"type": "tool_call_response", "response": message.get("result")} + if (tool_call_id := message.get("tool_call_id")) is not None: + part["id"] = tool_call_id + return {"role": "tool", "parts": [part]} + + # TODO: may need to handle other types for conversations (e.g. agent handoff) + + role = message.get("role", "unknown") + parts: list[dict] = [] + + if role == "tool": + # Tool messages are responses to tool calls + tool_part: dict = { + "type": "tool_call_response", + "response": message.get("content"), + } + if (tool_call_id := message.get("tool_call_id")) is not None: + tool_part["id"] = tool_call_id + parts.append(tool_part) + else: + parts.extend(_content_to_parts(message.get("content"))) + parts.extend(_tool_calls_to_parts(message.get("tool_calls"))) + + return {"role": role, "parts": parts} + + +def format_output_message(choice: dict[str, Any]) -> dict[str, Any]: + """Format a single output choice/message per the OTEL GenAI convention. + + Schema: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-output-messages.json + OutputMessage: {role (required), parts (required), finish_reason (required), name?} + """ + message = choice.get("message", {}) or {} + parts: list[dict] = [] + parts.extend(_content_to_parts(message.get("content"))) + parts.extend(_tool_calls_to_parts(message.get("tool_calls"))) + + return { + "role": message.get("role", "assistant"), + "parts": parts, + "finish_reason": choice.get("finish_reason", ""), + } + + +def format_tool_definition(tool: dict[str, Any]) -> dict[str, Any] | None: + """Flatten a Mistral tool definition to the OTEL GenAI convention schema. + + Mistral format: {"type": "function", "function": {"name": ..., "description": ..., "parameters": ...}} + OTEL format: {"type": "function", "name": ..., "description": ..., "parameters": ...} + + Schema, still under review: https://github.com/Cirilla-zmh/semantic-conventions/blob/cc4d07e7e56b80e9aa5904a3d524c134699da37f/docs/gen-ai/gen-ai-tool-definitions.json + """ + # Early exit conditions: only functions supported for now, and name is required + type = tool.get("type", "function") + func = tool.get("function") + if not func: + return None + name = func.get("name") + if not name: + return None + formatted: dict = {"type": type, "name": name} + if (description := func.get("description")) is not None: + formatted["description"] = description + if (parameters := func.get("parameters")) is not None: + formatted["parameters"] = parameters + return formatted diff --git a/src/mistralai/extra/observability/otel.py b/src/mistralai/extra/observability/otel.py new file mode 100644 index 00000000..f71fb301 --- /dev/null +++ b/src/mistralai/extra/observability/otel.py @@ -0,0 +1,662 @@ +"""OTEL conventions for gen AI may be found at: + +https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/ +https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-agent-spans/ +""" + +import copy +import json +import logging +import os +import traceback +from datetime import datetime, timezone +from enum import Enum +from typing import Any + +import httpx +import opentelemetry.semconv._incubating.attributes.gen_ai_attributes as gen_ai_attributes +import opentelemetry.semconv._incubating.attributes.http_attributes as http_attributes +import opentelemetry.semconv.attributes.error_attributes as error_attributes +import opentelemetry.semconv.attributes.server_attributes as server_attributes +from opentelemetry import context as context_api +from opentelemetry import propagate, trace +from opentelemetry.baggage import get_baggage +from opentelemetry.trace import Span, Status, StatusCode, Tracer, set_span_in_context + +from .formatting import ( + format_input_message, + format_output_message, + format_tool_definition, +) +from .streaming import accumulate_chunks_to_response_dict, parse_sse_chunks + +logger = logging.getLogger(__name__) + + +OTEL_SERVICE_NAME: str = "mistralai_sdk" +MISTRAL_SDK_OTEL_TRACER_NAME: str = OTEL_SERVICE_NAME + "_tracer" + +MISTRAL_SDK_DEBUG_TRACING: bool = ( + os.getenv("MISTRAL_SDK_DEBUG_TRACING", "false").lower() == "true" +) +DEBUG_HINT: str = "To see detailed tracing logs, set MISTRAL_SDK_DEBUG_TRACING=true." + + +class MistralAIAttributes: + MISTRAL_AI_OCR_USAGE_PAGES_PROCESSED = "mistral_ai.ocr.usage.pages_processed" + MISTRAL_AI_OCR_USAGE_DOC_SIZE_BYTES = "mistral_ai.ocr.usage.doc_size_bytes" + MISTRAL_AI_ERROR_CODE = "mistral_ai.error.code" + + +class MistralAINameValues(Enum): + OCR = "ocr" + + +class TracingErrors(Exception, Enum): + FAILED_TO_CREATE_SPAN_FOR_REQUEST = "Failed to create span for request." + FAILED_TO_ENRICH_SPAN_WITH_RESPONSE = "Failed to enrich span with response." + FAILED_TO_HANDLE_ERROR_IN_SPAN = "Failed to handle error in span." + FAILED_TO_END_SPAN = "Failed to end span." + + def __str__(self): + return str(self.value) + + +class GenAISpanEnum(str, Enum): + CONVERSATION = "conversation" + VALIDATE_RUN = "validate_run" + + +def parse_time_to_nanos(ts: str) -> int: + dt = datetime.fromisoformat(ts.replace("Z", "+00:00")).astimezone(timezone.utc) + return int(dt.timestamp() * 1e9) + + +def _infer_gen_ai_operation_name( + operation_id: str, +) -> gen_ai_attributes.GenAiOperationNameValues | None: + """Infer the GenAI operation name from the operation_id using rule-based matching.""" + if "chat_completion" in operation_id or operation_id == "stream_chat": + return gen_ai_attributes.GenAiOperationNameValues.CHAT + if ( + "agents_create" in operation_id or "agents_update" in operation_id + ) and "alias" not in operation_id: + return gen_ai_attributes.GenAiOperationNameValues.CREATE_AGENT + if "agents_completion" in operation_id or operation_id == "stream_agents": + return gen_ai_attributes.GenAiOperationNameValues.INVOKE_AGENT + if "conversations" in operation_id and any( + action in operation_id for action in ("start", "append", "restart") + ): + return gen_ai_attributes.GenAiOperationNameValues.INVOKE_AGENT + if "fim" in operation_id: + return gen_ai_attributes.GenAiOperationNameValues.TEXT_COMPLETION + if "embeddings" in operation_id: + return gen_ai_attributes.GenAiOperationNameValues.EMBEDDINGS + if "ocr_post" in operation_id: + return gen_ai_attributes.GenAiOperationNameValues.GENERATE_CONTENT + # TODO: Handle transcriptions (audio_api_v1_transcriptions_post[_stream]) + return None + + +def _build_genai_span_name( + gen_ai_op: gen_ai_attributes.GenAiOperationNameValues, body: dict[str, Any] +) -> str: + """Build span name per GenAI semantic conventions. + + - Chat/text_completion/embeddings: "{operation_name} {model}" + - create_agent/invoke_agent: "{operation_name} {agent_name}" + - execute_tool: "execute_tool {gen_ai.tool.name}" + """ + op_name = gen_ai_op.value + if gen_ai_op in { + gen_ai_attributes.GenAiOperationNameValues.CREATE_AGENT, + gen_ai_attributes.GenAiOperationNameValues.INVOKE_AGENT, + }: + agent_name = body.get("name", "") + return f"{op_name} {agent_name}" if agent_name else op_name + if gen_ai_op is gen_ai_attributes.GenAiOperationNameValues.EXECUTE_TOOL: + tool_name = body.get("name", "") + return f"{op_name} {tool_name}" if tool_name else op_name + model = body.get("model", "") + return f"{op_name} {model}" if model else op_name + + +def set_available_attributes(span: Span, attributes: dict[str, Any]) -> None: + for attribute, value in attributes.items(): + if value: + span.set_attribute(attribute, value) + + +def _set_http_attributes(span: Span, operation_id: str, request: httpx.Request) -> None: + """Set HTTP and server attributes on the span.""" + if not request.url.port: + # From httpx doc: + # Note that the URL class performs port normalization as per the WHATWG spec. + # Default ports for "http", "https", "ws", "wss", and "ftp" schemes are always treated as None. + # Handling default ports since most of the time we are using https + if request.url.scheme == "https": + port = 443 + elif request.url.scheme == "http": + port = 80 + else: + port = -1 + else: + port = request.url.port + + span.set_attributes( + { + http_attributes.HTTP_REQUEST_METHOD: request.method, + http_attributes.HTTP_URL: str(request.url), + server_attributes.SERVER_ADDRESS: request.headers.get("host", ""), + server_attributes.SERVER_PORT: port, + } + ) + + +def _enrich_request_genai_attrs( + span: Span, + gen_ai_op: gen_ai_attributes.GenAiOperationNameValues, + request_body: dict[str, Any], +) -> None: + """Set GenAI request attributes: model params, input messages, tool definitions.""" + # Update span name per GenAI semantic conventions, now that we have the parsed request body. + span.update_name(_build_genai_span_name(gen_ai_op, request_body)) + + attributes = { + gen_ai_attributes.GEN_AI_REQUEST_CHOICE_COUNT: request_body.get("n"), + gen_ai_attributes.GEN_AI_REQUEST_ENCODING_FORMATS: request_body.get( + "encoding_formats" + ), + gen_ai_attributes.GEN_AI_REQUEST_FREQUENCY_PENALTY: request_body.get( + "frequency_penalty" + ), + gen_ai_attributes.GEN_AI_REQUEST_MAX_TOKENS: request_body.get("max_tokens"), + gen_ai_attributes.GEN_AI_REQUEST_MODEL: request_body.get("model"), + gen_ai_attributes.GEN_AI_REQUEST_PRESENCE_PENALTY: request_body.get( + "presence_penalty" + ), + gen_ai_attributes.GEN_AI_REQUEST_SEED: request_body.get("random_seed"), + gen_ai_attributes.GEN_AI_REQUEST_STOP_SEQUENCES: request_body.get("stop"), + gen_ai_attributes.GEN_AI_REQUEST_TEMPERATURE: request_body.get("temperature"), + gen_ai_attributes.GEN_AI_REQUEST_TOP_P: request_body.get("top_p"), + gen_ai_attributes.GEN_AI_REQUEST_TOP_K: request_body.get("top_k"), + } + + # Chat/agent completion API uses messages in request body; conversation API uses inputs + input_messages = request_body.get("messages") or request_body.get("inputs") + if isinstance(input_messages, str): + attributes[gen_ai_attributes.GEN_AI_INPUT_MESSAGES] = json.dumps( + [format_input_message({"role": "user", "content": input_messages})] + ) + elif isinstance(input_messages, list): + attributes[gen_ai_attributes.GEN_AI_INPUT_MESSAGES] = json.dumps( + list(map(format_input_message, input_messages)) + ) + # Tool definitions + if tools := request_body.get("tools"): + formatted_tools = list(filter(None, map(format_tool_definition, tools))) + if formatted_tools: + attributes[gen_ai_attributes.GEN_AI_TOOL_DEFINITIONS] = json.dumps( + formatted_tools + ) + # TODO: For agent start conversation, add agent id and version attributes here ? + + set_available_attributes(span, attributes) + + +def enrich_span_from_request( + span: Span, operation_id: str, request: httpx.Request +) -> Span: + _set_http_attributes(span, operation_id, request) + + gen_ai_op = _infer_gen_ai_operation_name(operation_id) + if gen_ai_op is None: + return span + + span.set_attributes( + { + gen_ai_attributes.GEN_AI_OPERATION_NAME: gen_ai_op.value, + gen_ai_attributes.GEN_AI_PROVIDER_NAME: gen_ai_attributes.GenAiProviderNameValues.MISTRAL_AI.value, + } + ) + + if request.content: + request_body = json.loads(request.content) + _enrich_request_genai_attrs(span, gen_ai_op, request_body) + + return span + + +def _enrich_response_genai_attrs( + span: Span, + gen_ai_op: gen_ai_attributes.GenAiOperationNameValues, + response_data: dict[str, Any], +) -> None: + """Set common GenAI response attributes: response ID, model, choices, usage.""" + attributes: dict[str, Any] = {} + + if gen_ai_op is not gen_ai_attributes.GenAiOperationNameValues.CREATE_AGENT: + # id has another meaning for create agent operation (id of the agent) + attributes[gen_ai_attributes.GEN_AI_RESPONSE_ID] = response_data.get("id") + attributes[gen_ai_attributes.GEN_AI_RESPONSE_MODEL] = response_data.get("model") + + # Finish reasons and output messages from choices + choices = response_data.get("choices", []) + finish_reasons = [c.get("finish_reason") for c in choices if c.get("finish_reason")] + if finish_reasons: + attributes[gen_ai_attributes.GEN_AI_RESPONSE_FINISH_REASONS] = finish_reasons + if choices: + attributes[gen_ai_attributes.GEN_AI_OUTPUT_MESSAGES] = json.dumps( + list(map(format_output_message, choices)) + ) + + # Usage + usage = response_data.get("usage", {}) + if usage: + attributes.update( + { + gen_ai_attributes.GEN_AI_USAGE_INPUT_TOKENS: usage.get( + "prompt_tokens", 0 + ), + gen_ai_attributes.GEN_AI_USAGE_OUTPUT_TOKENS: usage.get( + "completion_tokens", 0 + ), + } + ) + + set_available_attributes(span, attributes) + + +def _enrich_create_agent(span: Span, response_data: dict[str, Any]) -> None: + """Set agent-specific attributes from create_agent response. + + Semantics: https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-agent-spans/#create-agent-span + """ + agent_attributes = { + gen_ai_attributes.GEN_AI_AGENT_DESCRIPTION: response_data.get("description"), + gen_ai_attributes.GEN_AI_AGENT_ID: response_data.get("id"), + gen_ai_attributes.GEN_AI_AGENT_NAME: response_data.get("name"), + # As of 2026-03-02: in convention, but not yet in opentelemetry-semantic-conventions + "gen_ai.agent.version": str(response_data.get("version")), + gen_ai_attributes.GEN_AI_REQUEST_MODEL: response_data.get("model"), + gen_ai_attributes.GEN_AI_SYSTEM_INSTRUCTIONS: response_data.get("instructions"), + } + set_available_attributes(span, agent_attributes) + + +def _create_tool_execution_child_span( + tracer: trace.Tracer, parent_context: context_api.Context, output: dict[str, Any] +) -> None: + """Create a child span for a tool.execution conversation output.""" + start_ns = parse_time_to_nanos(output["created_at"]) + end_ns = parse_time_to_nanos(output["completed_at"]) + op_name = gen_ai_attributes.GenAiOperationNameValues.EXECUTE_TOOL + span_name = _build_genai_span_name(op_name, output) + child_span = tracer.start_span( + span_name, start_time=start_ns, context=parent_context + ) + child_span.set_attributes({"agent.trace.public": ""}) + tool_arguments = output.get("arguments") + # The tool call result is in the "info" field, if provided + tool_result = output.get("info") + tool_attributes = { + gen_ai_attributes.GEN_AI_OPERATION_NAME: op_name.value, + gen_ai_attributes.GEN_AI_PROVIDER_NAME: gen_ai_attributes.GenAiProviderNameValues.MISTRAL_AI.value, + gen_ai_attributes.GEN_AI_TOOL_CALL_ID: output.get("id"), + gen_ai_attributes.GEN_AI_TOOL_CALL_ARGUMENTS: tool_arguments + if isinstance(tool_arguments, str) + else (json.dumps(tool_arguments) if tool_arguments else None), + gen_ai_attributes.GEN_AI_TOOL_CALL_RESULT: tool_result + if isinstance(tool_result, str) + else (json.dumps(tool_result) if tool_result else None), + gen_ai_attributes.GEN_AI_TOOL_NAME: output.get("name"), + gen_ai_attributes.GEN_AI_TOOL_TYPE: "extension", + } + set_available_attributes(child_span, tool_attributes) + child_span.end(end_time=end_ns) + + +def _create_message_output_child_span( + tracer: trace.Tracer, parent_context: context_api.Context, output: dict[str, Any] +) -> None: + """Create a child span for a message.output conversation output.""" + start_ns = parse_time_to_nanos(output["created_at"]) + end_ns = parse_time_to_nanos(output["completed_at"]) + op_name = gen_ai_attributes.GenAiOperationNameValues.CHAT + span_name = _build_genai_span_name(op_name, output) + child_span = tracer.start_span( + span_name, start_time=start_ns, context=parent_context + ) + child_span.set_attributes({"agent.trace.public": ""}) + # Wrap the flat conversation output as a choice dict so we + # can reuse serialize_output_message (which also handles + # tool_calls, not just content). + choice_wrapper: dict = { + "message": output, + "finish_reason": output.get("finish_reason", ""), + } + message_attributes = { + gen_ai_attributes.GEN_AI_OPERATION_NAME: op_name.value, + gen_ai_attributes.GEN_AI_PROVIDER_NAME: gen_ai_attributes.GenAiProviderNameValues.MISTRAL_AI.value, + gen_ai_attributes.GEN_AI_RESPONSE_ID: output.get("id"), + gen_ai_attributes.GEN_AI_AGENT_ID: output.get("agent_id"), + gen_ai_attributes.GEN_AI_RESPONSE_MODEL: output.get("model"), + gen_ai_attributes.GEN_AI_OUTPUT_MESSAGES: json.dumps( + [format_output_message(choice_wrapper)] + ), + } + set_available_attributes(child_span, message_attributes) + child_span.end(end_time=end_ns) + + +def _enrich_invoke_agent( + tracer: trace.Tracer, span: Span, response_data: dict[str, Any] +) -> None: + """Set invoke_agent attributes and create child spans for conversation outputs.""" + conversation_attributes = { + gen_ai_attributes.GEN_AI_CONVERSATION_ID: response_data.get("conversation_id"), + # We don't have more agent attributes available in the response data + # (agent id, name, version, description). For start conversation operation, + # we could get it from the request; see associated TODO + } + set_available_attributes(span, conversation_attributes) + + outputs = response_data.get("outputs", []) + parent_context = set_span_in_context(span) + for output in outputs: + output_type = output.get("type") + if not output_type: + continue # Safety net + if output_type == "function.call": + # handled in the extra.run.tools.create_function_result function + continue + elif output_type == "tool.execution": + _create_tool_execution_child_span(tracer, parent_context, output) + elif output_type == "message.output": + _create_message_output_child_span(tracer, parent_context, output) + # TODO: do type agent.handoff + + +def _enrich_ocr(span: Span, response_data: dict[str, Any]) -> None: + """Set OCR-specific usage attributes.""" + usage_info = response_data.get("usage_info", {}) + ocr_attributes = { + MistralAIAttributes.MISTRAL_AI_OCR_USAGE_PAGES_PROCESSED: usage_info.get( + "pages_processed" + ), + MistralAIAttributes.MISTRAL_AI_OCR_USAGE_DOC_SIZE_BYTES: usage_info.get( + "doc_size_bytes" + ), + } + set_available_attributes(span, ocr_attributes) + + +def _enrich_span_from_response( + tracer: Tracer, + span: Span, + operation_id: str, + response_data: dict[str, Any], +) -> None: + """Enrich span with GenAI response attributes and operation-specific data. + + Used by both the non-streaming and streaming paths so that the same + attributes are set regardless of response type. + """ + gen_ai_op = _infer_gen_ai_operation_name(operation_id) + if gen_ai_op is None: + return + + _enrich_response_genai_attrs(span, gen_ai_op, response_data) + + if gen_ai_op is gen_ai_attributes.GenAiOperationNameValues.CREATE_AGENT: + _enrich_create_agent(span, response_data) + elif gen_ai_op is gen_ai_attributes.GenAiOperationNameValues.INVOKE_AGENT: + _enrich_invoke_agent(tracer, span, response_data) + + if operation_id == "ocr_v1_ocr_post": + _enrich_ocr(span, response_data) + + +def get_or_create_otel_tracer( + provider: trace.TracerProvider | None = None, +) -> tuple[bool, Tracer]: + """ + Get a tracer from the given or global TracerProvider. + + When *provider* is supplied (per-instance tracer provider), the tracer is + obtained from it directly. Otherwise the global provider is used, following + the standard OTEL library convention. + + If no TracerProvider is configured (neither custom nor global), the + ProxyTracerProvider (default) will return a NoOp tracer, effectively + disabling tracing. + + Returns: + Tuple[bool, Tracer]: (tracing_enabled, tracer) + - tracing_enabled is True if a real TracerProvider is configured + - tracer is always valid (may be NoOp if no provider configured) + """ + if provider is not None: + tracer_provider = provider + else: + tracer_provider = trace.get_tracer_provider() + + tracer = tracer_provider.get_tracer(MISTRAL_SDK_OTEL_TRACER_NAME) + + # Tracing is considered enabled if we have a real TracerProvider (not the default proxy) + tracing_enabled = not isinstance(tracer_provider, trace.ProxyTracerProvider) + + return tracing_enabled, tracer + + +def get_traced_request_and_span( + tracing_enabled: bool, + tracer: Tracer, + span: Span | None, + operation_id: str, + request: httpx.Request, +) -> tuple[httpx.Request, Span | None]: + if not tracing_enabled: + return request, span + + try: + span = tracer.start_span(name=operation_id) + span.set_attributes({"agent.trace.public": ""}) + # Propagate gen_ai.conversation.id from OTEL baggage if present + conversation_id = get_baggage(gen_ai_attributes.GEN_AI_CONVERSATION_ID) + if conversation_id: + span.set_attribute( + gen_ai_attributes.GEN_AI_CONVERSATION_ID, str(conversation_id) + ) + # Inject the span context into the request headers to be used by the backend service to continue the trace + propagate.inject(request.headers, context=set_span_in_context(span)) + span = enrich_span_from_request(span, operation_id, request) + except Exception: + logger.warning( + "%s %s", + TracingErrors.FAILED_TO_CREATE_SPAN_FOR_REQUEST, + traceback.format_exc() if MISTRAL_SDK_DEBUG_TRACING else DEBUG_HINT, + ) + if span: + end_span(span=span) + span = None + + return request, span + + +def get_traced_response( + tracing_enabled: bool, + tracer: Tracer, + span: Span | None, + operation_id: str, + response: httpx.Response, +) -> httpx.Response: + if not tracing_enabled or not span: + return response + try: + span.set_status(Status(StatusCode.OK)) + span.set_attribute( + http_attributes.HTTP_RESPONSE_STATUS_CODE, response.status_code + ) + is_stream_response = not response.is_closed and not response.is_stream_consumed + if is_stream_response: + return TracedResponse.from_response( + resp=response, span=span, tracer=tracer, operation_id=operation_id + ) + if response.content: + response_data = json.loads(response.content) + _enrich_span_from_response(tracer, span, operation_id, response_data) + except Exception: + logger.warning( + "%s %s", + TracingErrors.FAILED_TO_ENRICH_SPAN_WITH_RESPONSE, + traceback.format_exc() if MISTRAL_SDK_DEBUG_TRACING else DEBUG_HINT, + ) + if span: + end_span(span=span) + return response + + +def get_response_and_error( + tracing_enabled: bool, + tracer: Tracer, + span: Span | None, + operation_id: str, + response: httpx.Response, + error: Exception | None, +) -> tuple[httpx.Response, Exception | None]: + if not tracing_enabled or not span: + return response, error + try: + if error: + span.record_exception(error) + span.set_status(Status(StatusCode.ERROR, str(error))) + if response.content: + response_body = json.loads(response.content) + if response_body.get("object", "") == "error": + if error_msg := response_body.get("message", ""): + error_type = response_body.get("type", "") + span.set_status(Status(StatusCode.ERROR, error_msg)) + span.add_event( + "exception", + { + "exception.type": error_type or "api_error", + "exception.message": error_msg, + }, + ) + attributes = { + http_attributes.HTTP_RESPONSE_STATUS_CODE: response.status_code, + error_attributes.ERROR_TYPE: error_type, + MistralAIAttributes.MISTRAL_AI_ERROR_CODE: response_body.get( + "code", "" + ), + } + for attribute, value in attributes.items(): + if value: + span.set_attribute(attribute, value) + span.end() + span = None + except Exception: + logger.warning( + "%s %s", + TracingErrors.FAILED_TO_HANDLE_ERROR_IN_SPAN, + traceback.format_exc() if MISTRAL_SDK_DEBUG_TRACING else DEBUG_HINT, + ) + + if span: + span.end() + span = None + return response, error + + +def end_span(span: Span) -> None: + try: + span.end() + except Exception: + logger.warning( + "%s %s", + TracingErrors.FAILED_TO_END_SPAN, + traceback.format_exc() if MISTRAL_SDK_DEBUG_TRACING else DEBUG_HINT, + ) + + +class TracedResponse(httpx.Response): + """Subclass of httpx.Response that accumulates streamed SSE bytes and + enriches the OTEL span with response attributes when the stream is closed. + """ + + span: Span | None + tracer: Tracer + operation_id: str + _accumulated_sse: bytearray + + def __init__( + self, + *args, + span: Span | None, + tracer: Tracer, + operation_id: str = "", + **kwargs, + ) -> None: + super().__init__(*args, **kwargs) + self.span = span + self.tracer = tracer + self.operation_id = operation_id + self._accumulated_sse = bytearray() + + def iter_bytes(self, *args, **kwargs): + for chunk in super().iter_bytes(*args, **kwargs): + self._accumulated_sse.extend(chunk) + yield chunk + + async def aiter_bytes(self, *args, **kwargs): + async for chunk in super().aiter_bytes(*args, **kwargs): + self._accumulated_sse.extend(chunk) + yield chunk + + def close(self) -> None: + self._finalize_span() + super().close() + + async def aclose(self) -> None: + self._finalize_span() + await super().aclose() + + def _finalize_span(self) -> None: + """Enrich and end the span after the stream has been fully consumed.""" + if not self.span: + return + try: + chunks = parse_sse_chunks(bytes(self._accumulated_sse)) + if chunks: + response_data = accumulate_chunks_to_response_dict(chunks) + _enrich_span_from_response( + self.tracer, self.span, self.operation_id, response_data + ) + except Exception: + logger.warning( + "%s %s", + TracingErrors.FAILED_TO_ENRICH_SPAN_WITH_RESPONSE, + traceback.format_exc() if MISTRAL_SDK_DEBUG_TRACING else DEBUG_HINT, + ) + end_span(span=self.span) + self.span = None + + @classmethod + def from_response( + cls, + resp: httpx.Response, + span: Span | None, + tracer: Tracer, + operation_id: str = "", + ) -> "TracedResponse": + # Bypass __init__ to steal the live httpx stream/connection via __dict__ copy. + # Keep tracing field assignments in sync with __init__. + traced_resp = cls.__new__(cls) + traced_resp.__dict__ = copy.copy(resp.__dict__) + traced_resp.span = span + traced_resp.tracer = tracer + traced_resp.operation_id = operation_id + traced_resp._accumulated_sse = bytearray() + + return traced_resp diff --git a/src/mistralai/extra/observability/streaming.py b/src/mistralai/extra/observability/streaming.py new file mode 100644 index 00000000..3eb9423a --- /dev/null +++ b/src/mistralai/extra/observability/streaming.py @@ -0,0 +1,98 @@ +"""Streaming response helpers for OTEL tracing. + +Pure functions that parse SSE byte streams and accumulate CompletionChunk +deltas into a ChatCompletionResponse-shaped dict suitable for span enrichment. + +TODO: supports chat and agent completion streaming endpoints. Evolutions will +be necessary to support other streaming endpoints (e.g. conversations). + +NOTE: The SSE bytes are re-parsed here even though EventStream already +parsed them during iteration. +TracedResponse sits below EventStream and can only accumulate raw bytes; it +has no access to the decoded events. Hooking into EventStream could eliminate +this double-parse, but EventStream is Speakeasy-generated code. +""" + +from typing import Any + +from mistralai.client.models import CompletionChunk, UsageInfo + + +def parse_sse_chunks(raw_sse_bytes: bytes) -> list[CompletionChunk]: + """Parse raw SSE bytes into a list of typed CompletionChunk models. + + Only CompletionChunk is handled. If new SSE-streamed response types + are added, parsing and typing here will need updating. + """ + chunks: list[CompletionChunk] = [] + text = raw_sse_bytes.decode("utf-8", errors="replace") + for line in text.split("\n"): + line = line.strip() + if not line.startswith("data: "): + continue + payload = line[6:] + if payload == "[DONE]": + continue + try: + chunks.append(CompletionChunk.model_validate_json(payload)) + except Exception: + continue + return chunks + + +def accumulate_chunks_to_response_dict( + chunks: list[CompletionChunk], +) -> dict[str, Any]: + """Accumulate streaming CompletionChunk deltas into a ChatCompletionResponse-shaped dict.""" + response_id: str | None = None + model: str | None = None + usage: UsageInfo | None = None + choices: dict[int, dict[str, Any]] = {} + + for chunk in chunks: + response_id = response_id or chunk.id + model = model or chunk.model + usage = usage or chunk.usage + + for choice in chunk.choices: + accumulated = choices.setdefault( + choice.index, + { + "message": {"role": "assistant", "content": ""}, + "finish_reason": "", + }, + ) + msg = accumulated["message"] + delta = choice.delta + if isinstance(delta.role, str): + msg["role"] = delta.role + if isinstance(delta.content, str) and delta.content: + msg["content"] += delta.content + if isinstance(choice.finish_reason, str): + accumulated["finish_reason"] = choice.finish_reason + if isinstance(delta.tool_calls, list): + tc_list = msg.setdefault("tool_calls", []) + for tc in delta.tool_calls: + tc_idx = tc.index if tc.index is not None else len(tc_list) + while len(tc_list) <= tc_idx: + tc_list.append( + {"id": None, "function": {"name": "", "arguments": ""}} + ) + # ToolCall.id defaults to the string "null" (Speakeasy codegen quirk) + if tc.id is not None and tc.id != "null": + tc_list[tc_idx]["id"] = tc.id + if tc.function.name: + tc_list[tc_idx]["function"]["name"] += tc.function.name + if isinstance(tc.function.arguments, str) and tc.function.arguments: + tc_list[tc_idx]["function"]["arguments"] += ( + tc.function.arguments + ) + + result: dict[str, Any] = { + "id": response_id, + "model": model, + "choices": [choices[idx] for idx in sorted(choices)], + } + if usage is not None: + result["usage"] = usage.model_dump(mode="json", by_alias=True) + return result diff --git a/src/mistralai/extra/py.typed b/src/mistralai/extra/py.typed new file mode 100644 index 00000000..9df62a6e --- /dev/null +++ b/src/mistralai/extra/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. The package enables type hints. \ No newline at end of file diff --git a/src/mistralai/extra/realtime/__init__.py b/src/mistralai/extra/realtime/__init__.py new file mode 100644 index 00000000..7b80e045 --- /dev/null +++ b/src/mistralai/extra/realtime/__init__.py @@ -0,0 +1,25 @@ +from mistralai.client.models import ( + AudioEncoding, + AudioFormat, + RealtimeTranscriptionError, + RealtimeTranscriptionErrorDetail, + RealtimeTranscriptionSession, + RealtimeTranscriptionSessionCreated, + RealtimeTranscriptionSessionUpdated, +) + +from .connection import UnknownRealtimeEvent, RealtimeConnection +from .transcription import RealtimeTranscription + +__all__ = [ + "AudioEncoding", + "AudioFormat", + "RealtimeTranscriptionError", + "RealtimeTranscriptionErrorDetail", + "RealtimeTranscriptionSession", + "RealtimeTranscriptionSessionCreated", + "RealtimeTranscriptionSessionUpdated", + "RealtimeConnection", + "RealtimeTranscription", + "UnknownRealtimeEvent", +] diff --git a/src/mistralai/extra/realtime/connection.py b/src/mistralai/extra/realtime/connection.py new file mode 100644 index 00000000..6547052b --- /dev/null +++ b/src/mistralai/extra/realtime/connection.py @@ -0,0 +1,232 @@ +from __future__ import annotations + +import base64 +import json +from asyncio import CancelledError +from collections import deque +from typing import Any, AsyncIterator, Deque, Optional, Union + +from pydantic import ValidationError, BaseModel + +try: + from websockets.asyncio.client import ClientConnection # websockets >= 13.0 +except ImportError as exc: + raise ImportError( + "The `websockets` package (>=13.0) is required for real-time transcription. " + "Install with: pip install 'mistralai[realtime]'" + ) from exc + +from mistralai.client.models import ( + AudioFormat, + RealtimeTranscriptionInputAudioAppend, + RealtimeTranscriptionInputAudioEnd, + RealtimeTranscriptionInputAudioFlush, + RealtimeTranscriptionError, + RealtimeTranscriptionSession, + RealtimeTranscriptionSessionCreated, + RealtimeTranscriptionSessionUpdated, + RealtimeTranscriptionSessionUpdateMessage, + RealtimeTranscriptionSessionUpdatePayload, + TranscriptionStreamDone, + TranscriptionStreamLanguage, + TranscriptionStreamSegmentDelta, + TranscriptionStreamTextDelta, +) +from mistralai.client.types import UNSET + + +class UnknownRealtimeEvent(BaseModel): + """ + Forward-compat fallback event: + - unknown message type + - invalid JSON payload + - schema validation failure + """ + + type: Optional[str] + content: Any + error: Optional[str] = None + + +RealtimeEvent = Union[ + # session lifecycle + RealtimeTranscriptionSessionCreated, + RealtimeTranscriptionSessionUpdated, + # server errors + RealtimeTranscriptionError, + # transcription events + TranscriptionStreamLanguage, + TranscriptionStreamSegmentDelta, + TranscriptionStreamTextDelta, + TranscriptionStreamDone, + # forward-compat fallback + UnknownRealtimeEvent, +] + +_MESSAGE_MODELS: dict[str, Any] = { + "session.created": RealtimeTranscriptionSessionCreated, + "session.updated": RealtimeTranscriptionSessionUpdated, + "error": RealtimeTranscriptionError, + "transcription.language": TranscriptionStreamLanguage, + "transcription.segment": TranscriptionStreamSegmentDelta, + "transcription.text.delta": TranscriptionStreamTextDelta, + "transcription.done": TranscriptionStreamDone, +} + + +def parse_realtime_event(payload: Any) -> RealtimeEvent: + """ + Tolerant parser: + - unknown event type -> UnknownRealtimeEvent + - validation failures -> UnknownRealtimeEvent (includes error string) + - invalid payload -> UnknownRealtimeEvent + """ + if not isinstance(payload, dict): + return UnknownRealtimeEvent( + type=None, content=payload, error="expected JSON object" + ) + + msg_type = payload.get("type") + if not isinstance(msg_type, str): + return UnknownRealtimeEvent( + type=None, content=payload, error="missing/invalid 'type'" + ) + + model_cls = _MESSAGE_MODELS.get(msg_type) + if model_cls is None: + return UnknownRealtimeEvent( + type=msg_type, content=payload, error="unknown event type" + ) + try: + parsed = model_cls.model_validate(payload) + return parsed + except ValidationError as exc: + return UnknownRealtimeEvent(type=msg_type, content=payload, error=str(exc)) + + +class RealtimeConnection: + def __init__( + self, + websocket: ClientConnection, + session: RealtimeTranscriptionSession, + *, + initial_events: Optional[list[RealtimeEvent]] = None, + ) -> None: + self._websocket = websocket + self._session = session + self._closed = False + self._initial_events: Deque[RealtimeEvent] = deque(initial_events or []) + + @property + def request_id(self) -> str: + return self._session.request_id + + @property + def session(self) -> RealtimeTranscriptionSession: + return self._session + + @property + def audio_format(self) -> AudioFormat: + return self._session.audio_format + + @property + def is_closed(self) -> bool: + return self._closed + + async def send_audio( + self, audio_bytes: Union[bytes, bytearray, memoryview] + ) -> None: + if self._closed: + raise RuntimeError("Connection is closed") + + message = RealtimeTranscriptionInputAudioAppend( + audio=base64.b64encode(bytes(audio_bytes)).decode("ascii") + ) + await self._websocket.send(message.model_dump_json()) + + async def flush_audio(self) -> None: + if self._closed: + raise RuntimeError("Connection is closed") + await self._websocket.send( + RealtimeTranscriptionInputAudioFlush().model_dump_json() + ) + + async def update_session( + self, + audio_format: Optional[AudioFormat] = None, + *, + target_streaming_delay_ms: Optional[int] = None, + ) -> None: + if self._closed: + raise RuntimeError("Connection is closed") + + if audio_format is None and target_streaming_delay_ms is None: + raise ValueError("At least one session field must be provided") + + message = RealtimeTranscriptionSessionUpdateMessage( + session=RealtimeTranscriptionSessionUpdatePayload( + audio_format=audio_format if audio_format is not None else UNSET, + target_streaming_delay_ms=target_streaming_delay_ms + if target_streaming_delay_ms is not None + else UNSET, + ) + ) + await self._websocket.send(message.model_dump_json()) + + async def end_audio(self) -> None: + if self._closed: + return + await self._websocket.send( + RealtimeTranscriptionInputAudioEnd().model_dump_json() + ) + + async def close(self, *, code: int = 1000, reason: str = "") -> None: + if self._closed: + return + self._closed = True + await self._websocket.close(code=code, reason=reason) + + async def __aenter__(self) -> "RealtimeConnection": + return self + + async def __aexit__(self, exc_type, exc, tb) -> None: + await self.close() + + def __aiter__(self) -> AsyncIterator[RealtimeEvent]: + return self.events() + + async def events(self) -> AsyncIterator[RealtimeEvent]: + # replay any handshake/prelude events (including session.created) + while self._initial_events: + ev = self._initial_events.popleft() + self._apply_session_updates(ev) + yield ev + + try: + async for msg in self._websocket: + text = ( + msg.decode("utf-8", errors="replace") + if isinstance(msg, (bytes, bytearray)) + else msg + ) + try: + data = json.loads(text) + except Exception as exc: + yield UnknownRealtimeEvent( + type=None, content=text, error=f"invalid JSON: {exc}" + ) + continue + + ev = parse_realtime_event(data) + self._apply_session_updates(ev) + yield ev + except CancelledError: + pass + finally: + await self.close() + + def _apply_session_updates(self, ev: RealtimeEvent) -> None: + if isinstance(ev, RealtimeTranscriptionSessionCreated) or isinstance( + ev, RealtimeTranscriptionSessionUpdated + ): + self._session = ev.session diff --git a/src/mistralai/extra/realtime/transcription.py b/src/mistralai/extra/realtime/transcription.py new file mode 100644 index 00000000..b216e676 --- /dev/null +++ b/src/mistralai/extra/realtime/transcription.py @@ -0,0 +1,278 @@ +from __future__ import annotations + +import asyncio +import json +import time +from typing import AsyncIterator, Mapping, Optional +from urllib.parse import parse_qsl, urlencode, urlparse, urlunparse + +try: + from websockets.asyncio.client import ( + ClientConnection, + connect, + ) # websockets >= 13.0 +except ImportError as exc: + raise ImportError( + "The `websockets` package (>=13.0) is required for real-time transcription. " + "Install with: pip install 'mistralai[realtime]'" + ) from exc + +from mistralai.client import models, utils +from mistralai.client.models import ( + AudioFormat, + RealtimeTranscriptionError, + RealtimeTranscriptionSession, + RealtimeTranscriptionSessionCreated, +) +from mistralai.client.sdkconfiguration import SDKConfiguration +from mistralai.client.utils import generate_url, get_security, get_security_from_env + +from ..exceptions import RealtimeTranscriptionException, RealtimeTranscriptionWSError +from .connection import ( + RealtimeConnection, + RealtimeEvent, + UnknownRealtimeEvent, + parse_realtime_event, +) + + +class RealtimeTranscription: + """Client for realtime transcription over WebSocket (websockets >= 13.0).""" + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self._sdk_config = sdk_config + + def _build_url( + self, + model: str, + *, + server_url: Optional[str], + query_params: Mapping[str, str], + ) -> str: + if server_url is not None: + base_url = utils.remove_suffix(server_url, "/") + else: + base_url, _ = self._sdk_config.get_server_details() + + url = generate_url(base_url, "/v1/audio/transcriptions/realtime", None) + + parsed = urlparse(url) + merged = dict(parse_qsl(parsed.query, keep_blank_values=True)) + merged["model"] = model + merged.update(dict(query_params)) + + return urlunparse(parsed._replace(query=urlencode(merged))) + + async def connect( + self, + model: str, + audio_format: Optional[AudioFormat] = None, + target_streaming_delay_ms: Optional[int] = None, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> RealtimeConnection: + if timeout_ms is None: + timeout_ms = self._sdk_config.timeout_ms + + security = self._sdk_config.security + if security is not None and callable(security): + security = security() + + resolved_security = get_security_from_env(security, models.Security) + + headers: dict[str, str] = {} + query_params: dict[str, str] = {} + + if resolved_security is not None: + security_headers, security_query = get_security(resolved_security) + headers |= security_headers + for key, values in security_query.items(): + if values: + query_params[key] = values[-1] + + if http_headers is not None: + headers |= dict(http_headers) + + url = self._build_url(model, server_url=server_url, query_params=query_params) + + parsed = urlparse(url) + if parsed.scheme == "https": + parsed = parsed._replace(scheme="wss") + elif parsed.scheme == "http": + parsed = parsed._replace(scheme="ws") + ws_url = urlunparse(parsed) + open_timeout = None if timeout_ms is None else timeout_ms / 1000.0 + user_agent = self._sdk_config.user_agent + + websocket: Optional[ClientConnection] = None + try: + websocket = await connect( + ws_url, + additional_headers=dict(headers), + open_timeout=open_timeout, + user_agent_header=user_agent, + ) + + session, initial_events = await _recv_handshake( + websocket, timeout_ms=timeout_ms + ) + connection = RealtimeConnection( + websocket=websocket, + session=session, + initial_events=initial_events, + ) + + if audio_format is not None or target_streaming_delay_ms is not None: + await connection.update_session( + audio_format, + target_streaming_delay_ms=target_streaming_delay_ms, + ) + + return connection + + except RealtimeTranscriptionException: + if websocket is not None: + await websocket.close() + raise + except Exception as exc: + if websocket is not None: + await websocket.close() + raise RealtimeTranscriptionException(f"Failed to connect: {exc}") from exc + + async def transcribe_stream( + self, + audio_stream: AsyncIterator[bytes], + model: str, + audio_format: Optional[AudioFormat] = None, + target_streaming_delay_ms: Optional[int] = None, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> AsyncIterator[RealtimeEvent]: + """ + Flow + - opens connection + - streams audio in background + - yields events from the connection + """ + async with await self.connect( + model=model, + audio_format=audio_format, + target_streaming_delay_ms=target_streaming_delay_ms, + server_url=server_url, + timeout_ms=timeout_ms, + http_headers=http_headers, + ) as connection: + + async def _send() -> None: + async for chunk in audio_stream: + if connection.is_closed: + break + await connection.send_audio(chunk) + await connection.flush_audio() + await connection.end_audio() + + send_task = asyncio.create_task(_send()) + + try: + async for event in connection: + yield event + + # stop early (caller still sees the terminating event) + if isinstance(event, RealtimeTranscriptionError): + break + if getattr(event, "type", None) == "transcription.done": + break + finally: + send_task.cancel() + try: + await send_task + except asyncio.CancelledError: + pass + await connection.close() + + +def _extract_error_message(payload: dict) -> str: + err = payload.get("error") + if isinstance(err, dict): + msg = err.get("message") + if isinstance(msg, str): + return msg + if isinstance(msg, dict): + detail = msg.get("detail") + if isinstance(detail, str): + return detail + return "Realtime transcription error" + + +async def _recv_handshake( + websocket: ClientConnection, + *, + timeout_ms: Optional[int], +) -> tuple[RealtimeTranscriptionSession, list[RealtimeEvent]]: + """ + Read messages until session.created or error. + Replay all messages read during handshake as initial events (lossless). + """ + timeout_s = None if timeout_ms is None else timeout_ms / 1000.0 + deadline = None if timeout_s is None else (time.monotonic() + timeout_s) + + initial_events: list[RealtimeEvent] = [] + + def remaining() -> Optional[float]: + if deadline is None: + return None + return max(0.0, deadline - time.monotonic()) + + try: + while True: + raw = await asyncio.wait_for(websocket.recv(), timeout=remaining()) + text = ( + raw.decode("utf-8", errors="replace") + if isinstance(raw, (bytes, bytearray)) + else raw + ) + + try: + payload = json.loads(text) + except Exception as exc: + initial_events.append( + UnknownRealtimeEvent( + type=None, content=text, error=f"invalid JSON: {exc}" + ) + ) + continue + + msg_type = payload.get("type") if isinstance(payload, dict) else None + if msg_type == "error" and isinstance(payload, dict): + parsed = parse_realtime_event(payload) + initial_events.append(parsed) + if isinstance(parsed, RealtimeTranscriptionError): + raise RealtimeTranscriptionWSError( + _extract_error_message(payload), + payload=parsed, + raw=payload, + ) + raise RealtimeTranscriptionWSError( + _extract_error_message(payload), + payload=None, + raw=payload, + ) + + event = parse_realtime_event(payload) + initial_events.append(event) + + if isinstance(event, RealtimeTranscriptionSessionCreated): + return event.session, initial_events + + except asyncio.TimeoutError as exc: + raise RealtimeTranscriptionException( + "Timeout waiting for session creation." + ) from exc + except RealtimeTranscriptionException: + raise + except Exception as exc: + raise RealtimeTranscriptionException( + f"Unexpected websocket handshake failure: {exc}" + ) from exc diff --git a/src/mistralai/extra/run/context.py b/src/mistralai/extra/run/context.py index 08350a84..f33b393d 100644 --- a/src/mistralai/extra/run/context.py +++ b/src/mistralai/extra/run/context.py @@ -1,50 +1,46 @@ import asyncio import inspect import typing -from contextlib import AsyncExitStack -from functools import wraps from collections.abc import Callable - +from contextlib import AsyncExitStack from dataclasses import dataclass, field -from typing import Union, Optional +from functools import wraps +from logging import getLogger import pydantic -from mistralai.extra import ( - response_format_from_pydantic_model, -) +from mistralai.extra import response_format_from_pydantic_model from mistralai.extra.exceptions import RunException from mistralai.extra.mcp.base import MCPClientProtocol from mistralai.extra.run.result import RunResult -from mistralai.types.basemodel import OptionalNullable, BaseModel, UNSET -from mistralai.models import ( - ResponseFormat, - FunctionCallEntry, - Tools, - ToolsTypedDict, +from mistralai.extra.run.tools import ( + RunCoroutine, + RunFunction, + RunMCPTool, + RunTool, + create_function_result, + create_tool_call, +) +from mistralai.client.models import ( CompletionArgs, CompletionArgsTypedDict, - FunctionResultEntry, ConversationInputs, ConversationInputsTypedDict, + ConversationRequestTool, + ConversationRequestToolTypedDict, + FunctionCallEntry, + FunctionResultEntry, FunctionTool, - MessageInputEntry, InputEntries, + MessageInputEntry, + ResponseFormat, + UnknownAgentTool, + UpdateAgentRequestTool, ) - -from logging import getLogger - -from mistralai.extra.run.tools import ( - create_function_result, - RunFunction, - create_tool_call, - RunTool, - RunMCPTool, - RunCoroutine, -) +from mistralai.client.types.basemodel import BaseModel, OptionalNullable, UNSET if typing.TYPE_CHECKING: - from mistralai import Beta, OptionalNullable + from mistralai.client import Beta, OptionalNullable logger = getLogger(__name__) @@ -56,8 +52,10 @@ class AgentRequestKwargs(typing.TypedDict): class ModelRequestKwargs(typing.TypedDict): model: str instructions: OptionalNullable[str] - tools: OptionalNullable[Union[list[Tools], list[ToolsTypedDict]]] - completion_args: OptionalNullable[Union[CompletionArgs, CompletionArgsTypedDict]] + tools: OptionalNullable[ + list[ConversationRequestTool] | list[ConversationRequestToolTypedDict] + ] + completion_args: OptionalNullable[CompletionArgs | CompletionArgsTypedDict] @dataclass @@ -72,7 +70,7 @@ class RunContext: passed if the user wants to continue an existing conversation. model (Options[str]): The model name to be used for the conversation. Can't be used along with 'agent_id'. agent_id (Options[str]): The agent id to be used for the conversation. Can't be used along with 'model'. - output_format (Optional[type[BaseModel]]): The output format expected from the conversation. It represents + output_format (type[BaseModel] | None): The output format expected from the conversation. It represents the `response_format` which is part of the `CompletionArgs`. request_count (int): The number of requests made in the current `RunContext`. continue_on_fn_error (bool): Flag to determine if the conversation should continue when function execution @@ -82,11 +80,14 @@ class RunContext: _exit_stack: AsyncExitStack = field(init=False) _callable_tools: dict[str, RunTool] = field(init=False, default_factory=dict) _mcp_clients: list[MCPClientProtocol] = field(init=False, default_factory=list) + _tool_configurations: dict[str, dict[str, bool]] = field( + init=False, default_factory=dict + ) - conversation_id: Optional[str] = field(default=None) - model: Optional[str] = field(default=None) - agent_id: Optional[str] = field(default=None) - output_format: Optional[type[BaseModel]] = field(default=None) + conversation_id: str | None = field(default=None) + model: str | None = field(default=None) + agent_id: str | None = field(default=None) + output_format: type[BaseModel] | None = field(default=None) request_count: int = field(default=0) continue_on_fn_error: bool = field(default=False) @@ -103,7 +104,14 @@ async def __aexit__(self, exc_type, exc_val, exc_tb): for mcp_client in self._mcp_clients: await mcp_client.aclose() - def register_func(self, func: Callable): + def requires_confirmation(self, tool_name: str) -> bool: + """Check if tool requires confirmation. Default: False.""" + config = self._tool_configurations.get(tool_name) + if config is None: + return False + return config.get("requires_confirmation", False) + + def register_func(self, func: Callable, requires_confirmation: bool = False): """Add a function to the context.""" if not inspect.isfunction(func): raise RunException( @@ -123,6 +131,10 @@ def register_func(self, func: Callable): tool=create_tool_call(func), ) + self._tool_configurations[func.__name__] = { + "requires_confirmation": requires_confirmation, + } + @wraps(func) def wrapper(*args, **kwargs): logger.info(f"Executing {func.__name__}") @@ -130,24 +142,63 @@ def wrapper(*args, **kwargs): return wrapper - async def register_mcp_clients(self, mcp_clients: list[MCPClientProtocol]) -> None: + async def register_mcp_clients( + self, + mcp_clients: list[MCPClientProtocol], + tool_configurations: list[dict[str, list[str]] | None] | None = None, + ) -> None: """Registering multiple MCP clients at the same time in the same asyncio.Task.""" - for mcp_client in mcp_clients: - await self.register_mcp_client(mcp_client) + for i, mcp_client in enumerate(mcp_clients): + tool_configuration = tool_configurations[i] if tool_configurations else None + await self.register_mcp_client( + mcp_client, tool_configuration=tool_configuration + ) - async def register_mcp_client(self, mcp_client: MCPClientProtocol) -> None: + async def register_mcp_client( + self, + mcp_client: MCPClientProtocol, + tool_configuration: dict[str, list[str]] | None = None, + ) -> None: """Add a MCP client to the context.""" await mcp_client.initialize(exit_stack=self._exit_stack) tools = await mcp_client.get_tools() + + include = ( + set(tool_configuration.get("include", [])) if tool_configuration else set() + ) + exclude = ( + set(tool_configuration.get("exclude", [])) if tool_configuration else set() + ) + requires_confirmation_list = ( + set(tool_configuration.get("requires_confirmation", [])) + if tool_configuration + else set() + ) + for tool in tools: + tool_name = tool.function.name + + if include: + if tool_name not in include: + continue + elif exclude: + if tool_name in exclude: + continue + logger.info( - f"Adding tool {tool.function.name} from {mcp_client._name or 'mcp client'}" + f"Adding tool {tool_name} from {mcp_client._name or 'mcp client'}" ) - self._callable_tools[tool.function.name] = RunMCPTool( - name=tool.function.name, + self._callable_tools[tool_name] = RunMCPTool( + name=tool_name, tool=tool, mcp_client=mcp_client, ) + + if tool_configuration is not None: + self._tool_configurations[tool_name] = { + "requires_confirmation": tool_name in requires_confirmation_list, + } + self._mcp_clients.append(mcp_client) async def execute_function_calls( @@ -192,10 +243,12 @@ async def prepare_agent_request(self, beta_client: "Beta") -> AgentRequestKwargs ) agent = await beta_client.agents.get_async(agent_id=self.agent_id) agent_tools = agent.tools or [] - updated_tools = [] - for i in range(len(agent_tools)): - tool = agent_tools[i] - if tool.type != "function": + updated_tools: list[UpdateAgentRequestTool] = [] + for tool in agent_tools: + if isinstance(tool, UnknownAgentTool): + # Skip unknown tools - can't include them in update request + continue + if not isinstance(tool, FunctionTool): updated_tools.append(tool) elif tool.function.name in self._callable_tools: # function already exists in the agent, don't add it again @@ -215,9 +268,11 @@ async def prepare_agent_request(self, beta_client: "Beta") -> AgentRequestKwargs async def prepare_model_request( self, - tools: OptionalNullable[Union[list[Tools], list[ToolsTypedDict]]] = UNSET, + tools: OptionalNullable[ + list[ConversationRequestTool] | list[ConversationRequestToolTypedDict] + ] = UNSET, completion_args: OptionalNullable[ - Union[CompletionArgs, CompletionArgsTypedDict] + CompletionArgs | CompletionArgsTypedDict ] = UNSET, instructions: OptionalNullable[str] = None, ) -> ModelRequestKwargs: @@ -233,7 +288,7 @@ async def prepare_model_request( request_tools = [] if isinstance(tools, list): for tool in tools: - request_tools.append(typing.cast(Tools, tool)) + request_tools.append(typing.cast(ConversationRequestTool, tool)) for tool in self.get_tools(): request_tools.append(tool) return ModelRequestKwargs( @@ -247,22 +302,22 @@ async def prepare_model_request( def response_format(self) -> ResponseFormat: if not self.output_format: raise RunException("No response format exist for the current RunContext.") - return response_format_from_pydantic_model(self.output_format) + return ResponseFormat.model_validate( + response_format_from_pydantic_model(self.output_format) + ) async def _validate_run( *, beta_client: "Beta", run_ctx: RunContext, - inputs: Union[ConversationInputs, ConversationInputsTypedDict], + inputs: ConversationInputs | ConversationInputsTypedDict, instructions: OptionalNullable[str] = UNSET, - tools: OptionalNullable[Union[list[Tools], list[ToolsTypedDict]]] = UNSET, - completion_args: OptionalNullable[ - Union[CompletionArgs, CompletionArgsTypedDict] + tools: OptionalNullable[ + list[ConversationRequestTool] | list[ConversationRequestToolTypedDict] ] = UNSET, -) -> tuple[ - Union[AgentRequestKwargs, ModelRequestKwargs], RunResult, list[InputEntries] -]: + completion_args: OptionalNullable[CompletionArgs | CompletionArgsTypedDict] = UNSET, +) -> tuple[AgentRequestKwargs | ModelRequestKwargs, RunResult, list[InputEntries]]: input_entries: list[InputEntries] = [] if isinstance(inputs, str): input_entries.append(MessageInputEntry(role="user", content=inputs)) @@ -272,12 +327,14 @@ async def _validate_run( input_entries.append( pydantic.TypeAdapter(InputEntries).validate_python(input) ) + elif isinstance(input, FunctionResultEntry): + input_entries.append(input) run_result = RunResult( input_entries=input_entries, output_model=run_ctx.output_format, conversation_id=run_ctx.conversation_id, ) - req: Union[AgentRequestKwargs, ModelRequestKwargs] + req: AgentRequestKwargs | ModelRequestKwargs if run_ctx.agent_id: if tools or completion_args: raise RunException("Can't set tools or completion_args when using an agent") diff --git a/src/mistralai/extra/run/deferred.py b/src/mistralai/extra/run/deferred.py new file mode 100644 index 00000000..5aa463b2 --- /dev/null +++ b/src/mistralai/extra/run/deferred.py @@ -0,0 +1,121 @@ +"""Helper functions for processing deferred tool call responses. + +Moved out of conversations.py to avoid conflicts with speakeasy code generation, +which overwrites everything outside custom regions. +""" + +from __future__ import annotations + +import asyncio +import json +from typing import TYPE_CHECKING + +from mistralai.client import models +from mistralai.extra.exceptions import ( + DeferralReason, + DeferredToolCallConfirmation, + DeferredToolCallRejection, + DeferredToolCallResponse, + RunException, +) + +if TYPE_CHECKING: + from mistralai.extra.run.context import RunContext + + +def _is_deferred_response(obj) -> bool: + """Check if object is a DeferredToolResponse.""" + return isinstance(obj, (DeferredToolCallConfirmation, DeferredToolCallRejection)) + + +def _is_server_deferred(fc: models.FunctionCallEntry) -> bool: + """Check if a function call was deferred server-side (pending confirmation).""" + return getattr(fc, "confirmation_status", None) == "pending" + + +async def _process_deferred_responses( + run_ctx: "RunContext", + responses: list[DeferredToolCallResponse], +) -> tuple[list[models.InputEntries], list[models.ToolCallConfirmation]]: + """Process deferred tool responses and return function results and server-side confirmations. + + For client-side deferrals (CONFIRMATION_REQUIRED): + - Confirmations: executes the tool using run_ctx -> FunctionResultEntry + - Rejections: creates a result with the rejection message -> FunctionResultEntry + For server-side deferrals (SERVER_SIDE_CONFIRMATION_REQUIRED): + - Confirmations: returns ToolCallConfirmation(confirmation="allow") + - Rejections: returns ToolCallConfirmation(confirmation="deny") + """ + results: list[models.InputEntries] = [] + tool_confirmations: list[models.ToolCallConfirmation] = [] + confirmation_tasks: list[tuple[str, str, asyncio.Task]] = [] + + for response in responses: + if isinstance(response, DeferredToolCallConfirmation): + reason = getattr( + response, "deferral_reason", DeferralReason.CONFIRMATION_REQUIRED + ) + + if reason == DeferralReason.SERVER_SIDE_CONFIRMATION_REQUIRED: + tool_confirmations.append( + models.ToolCallConfirmation( + tool_call_id=response.tool_call_id, + confirmation="allow", + ) + ) + else: + if response.override_args is not None: + original_args = ( + json.loads(response.function_call.arguments) + if isinstance(response.function_call.arguments, str) + else response.function_call.arguments + ) + merged_args = {**original_args, **response.override_args} + function_call = models.FunctionCallEntry( + id=response.function_call.id, + tool_call_id=response.tool_call_id, + name=response.tool_name, + arguments=json.dumps(merged_args), + ) + else: + function_call = response.function_call + + task = asyncio.create_task( + run_ctx.execute_function_calls([function_call]) + ) + confirmation_tasks.append( + (response.tool_call_id, response.tool_name, task) + ) + + elif isinstance(response, DeferredToolCallRejection): + reason = getattr( + response, "deferral_reason", DeferralReason.CONFIRMATION_REQUIRED + ) + + if reason == DeferralReason.SERVER_SIDE_CONFIRMATION_REQUIRED: + tool_confirmations.append( + models.ToolCallConfirmation( + tool_call_id=response.tool_call_id, + confirmation="deny", + ) + ) + else: + results.append( + models.FunctionResultEntry( + tool_call_id=response.tool_call_id, + result=response.message, + ) + ) + + if confirmation_tasks: + await asyncio.gather(*[task for _, _, task in confirmation_tasks]) + for tool_call_id, tool_name, task in confirmation_tasks: + task_results = task.result() + if task_results: + results.append(task_results[0]) + else: + raise RunException( + f"Tool '{tool_name}' is not registered in the RunContext" + ) + + return results, tool_confirmations diff --git a/src/mistralai/extra/run/result.py b/src/mistralai/extra/run/result.py index 9592dccf..6e2bcc8a 100644 --- a/src/mistralai/extra/run/result.py +++ b/src/mistralai/extra/run/result.py @@ -1,12 +1,13 @@ import datetime import json import typing -from typing import Union, Annotated, Optional, Literal from dataclasses import dataclass, field -from pydantic import Discriminator, Tag, BaseModel +from typing import Annotated, Literal + +from pydantic import BaseModel, Discriminator, Tag from mistralai.extra.utils.response_format import pydantic_model_from_json -from mistralai.models import ( +from mistralai.client.models import ( FunctionResultEntry, FunctionCallEntry, MessageOutputEntry, @@ -33,17 +34,17 @@ ToolReferenceChunk, FunctionCallEntryArguments, ) -from mistralai.utils import get_discriminator - -RunOutputEntries = typing.Union[ - MessageOutputEntry, - FunctionCallEntry, - FunctionResultEntry, - AgentHandoffEntry, - ToolExecutionEntry, -] +from mistralai.client.utils import get_discriminator + +RunOutputEntries = ( + MessageOutputEntry + | FunctionCallEntry + | FunctionResultEntry + | AgentHandoffEntry + | ToolExecutionEntry +) -RunEntries = typing.Union[RunOutputEntries, MessageInputEntry] +RunEntries = RunOutputEntries | MessageInputEntry def as_text(entry: RunOutputEntries) -> str: @@ -140,12 +141,12 @@ class RunFiles: @dataclass class RunResult: input_entries: list[InputEntries] - conversation_id: Optional[str] = field(default=None) + conversation_id: str | None = field(default=None) output_entries: list[RunOutputEntries] = field(default_factory=list) files: dict[str, RunFiles] = field(default_factory=dict) - output_model: Optional[type[BaseModel]] = field(default=None) + output_model: type[BaseModel] | None = field(default=None) - def get_file(self, file_id: str) -> Optional[RunFiles]: + def get_file(self, file_id: str) -> RunFiles | None: return self.files.get(file_id) @property @@ -172,36 +173,34 @@ def output_as_model(self) -> BaseModel: class FunctionResultEvent(BaseModel): - id: Optional[str] = None + id: str | None = None - type: Optional[Literal["function.result"]] = "function.result" + type: Literal["function.result"] | None = "function.result" result: str tool_call_id: str - created_at: Optional[datetime.datetime] = datetime.datetime.now( + created_at: datetime.datetime | None = datetime.datetime.now( tz=datetime.timezone.utc ) - output_index: Optional[int] = 0 + output_index: int | None = 0 -RunResultEventsType = typing.Union[SSETypes, Literal["function.result"]] +RunResultEventsType = SSETypes | Literal["function.result"] RunResultEventsData = typing.Annotated[ - Union[ - Annotated[AgentHandoffDoneEvent, Tag("agent.handoff.done")], - Annotated[AgentHandoffStartedEvent, Tag("agent.handoff.started")], - Annotated[ResponseDoneEvent, Tag("conversation.response.done")], - Annotated[ResponseErrorEvent, Tag("conversation.response.error")], - Annotated[ResponseStartedEvent, Tag("conversation.response.started")], - Annotated[FunctionCallEvent, Tag("function.call.delta")], - Annotated[MessageOutputEvent, Tag("message.output.delta")], - Annotated[ToolExecutionDoneEvent, Tag("tool.execution.done")], - Annotated[ToolExecutionStartedEvent, Tag("tool.execution.started")], - Annotated[FunctionResultEvent, Tag("function.result")], - ], + Annotated[AgentHandoffDoneEvent, Tag("agent.handoff.done")] + | Annotated[AgentHandoffStartedEvent, Tag("agent.handoff.started")] + | Annotated[ResponseDoneEvent, Tag("conversation.response.done")] + | Annotated[ResponseErrorEvent, Tag("conversation.response.error")] + | Annotated[ResponseStartedEvent, Tag("conversation.response.started")] + | Annotated[FunctionCallEvent, Tag("function.call.delta")] + | Annotated[MessageOutputEvent, Tag("message.output.delta")] + | Annotated[ToolExecutionDoneEvent, Tag("tool.execution.done")] + | Annotated[ToolExecutionStartedEvent, Tag("tool.execution.started")] + | Annotated[FunctionResultEvent, Tag("function.result")], Discriminator(lambda m: get_discriminator(m, "type", "type")), ] diff --git a/src/mistralai/extra/run/tools.py b/src/mistralai/extra/run/tools.py index 81fec665..7ba7ff70 100644 --- a/src/mistralai/extra/run/tools.py +++ b/src/mistralai/extra/run/tools.py @@ -1,31 +1,36 @@ +import inspect import itertools +import json import logging from dataclasses import dataclass -import inspect - -from pydantic import Field, create_model -from pydantic.fields import FieldInfo -import json -from typing import cast, Callable, Sequence, Any, ForwardRef, get_type_hints, Union +from typing import Annotated, Any, Callable, ForwardRef, Sequence, cast, get_type_hints +import opentelemetry.semconv._incubating.attributes.gen_ai_attributes as gen_ai_attributes from griffe import ( Docstring, - DocstringSectionKind, - DocstringSectionText, DocstringParameter, DocstringSection, + DocstringSectionKind, + DocstringSectionText, ) +from opentelemetry import trace +from opentelemetry.trace import Status, StatusCode +from pydantic import Field, create_model +from pydantic.fields import FieldInfo +from pydantic_core import PydanticUndefined as _PYDANTIC_UNDEFINED -from mistralai.extra.exceptions import RunException -from mistralai.extra.mcp.base import MCPClientProtocol -from mistralai.extra.run.result import RunOutputEntries -from mistralai.models import ( - FunctionResultEntry, - FunctionTool, +from mistralai.client.models import ( Function, FunctionCallEntry, + FunctionResultEntry, + FunctionTool, ) - +from mistralai.extra.exceptions import RunException +from mistralai.extra.mcp.base import MCPClientProtocol +from mistralai.extra.observability.otel import ( + set_available_attributes, +) +from mistralai.extra.run.result import RunOutputEntries logger = logging.getLogger(__name__) @@ -51,7 +56,7 @@ class RunMCPTool: mcp_client: MCPClientProtocol -RunTool = Union[RunFunction, RunCoroutine, RunMCPTool] +RunTool = RunFunction | RunCoroutine | RunMCPTool def _get_function_description(docstring_sections: list[DocstringSection]) -> str: @@ -91,7 +96,7 @@ def _get_function_parameters( param_annotations[param.name] = type_hints.get(param.name) # resolve all params into Field and create the parameters schema - fields: dict[str, tuple[type, FieldInfo]] = {} + fields: dict[str, Any] = {} for p in params_from_sig: default = p.default if p.default is not inspect.Parameter.empty else ... annotation = ( @@ -123,15 +128,25 @@ def _get_function_parameters( if isinstance(annotation, ForwardRef): annotation = param_annotations[p.name] - # no Field + description = param_descriptions[p.name] or None + if field_info is None: if default is ...: - field_info = Field() + field_info = Field(description=description) else: - field_info = Field(default=default) - - field_info.description = param_descriptions[p.name] - fields[p.name] = (cast(type, annotation), field_info) + field_info = Field(default=default, description=description) + fields[p.name] = (cast(type, annotation), field_info) + elif description: + typed = Annotated[ # type: ignore[valid-type] + cast(type, annotation), field_info, Field(description=description) + ] + raw_default = field_info.default + if raw_default is not _PYDANTIC_UNDEFINED: + fields[p.name] = (typed, raw_default) + else: + fields[p.name] = (typed, ...) + else: + fields[p.name] = (cast(type, annotation), field_info) schema = create_model("_", **fields).model_json_schema() # type: ignore[call-overload] schema.pop("title", None) @@ -166,7 +181,6 @@ def create_tool_call(func: Callable) -> FunctionTool: type_hints = get_type_hints(func, include_extras=True, localns=None, globalns=None) return FunctionTool( - type="function", function=Function( name=name, description=_get_function_description(docstring_sections), @@ -191,26 +205,47 @@ async def create_function_result( if isinstance(function_call.arguments, str) else function_call.arguments ) - try: - if isinstance(run_tool, RunFunction): - res = run_tool.callable(**arguments) - elif isinstance(run_tool, RunCoroutine): - res = await run_tool.awaitable(**arguments) - elif isinstance(run_tool, RunMCPTool): - res = await run_tool.mcp_client.execute_tool(function_call.name, arguments) - except Exception as e: - if continue_on_fn_error is True: - return FunctionResultEntry( - tool_call_id=function_call.tool_call_id, - result=f"Error while executing {function_call.name}: {str(e)}", - ) - raise RunException( - f"Failed to execute tool {function_call.name} with arguments '{function_call.arguments}'" - ) from e + tracer = trace.get_tracer(__name__) + with tracer.start_as_current_span( + f"{gen_ai_attributes.GenAiOperationNameValues.EXECUTE_TOOL.value} {function_call.name}" + ) as span: + # Always record identity attributes so the span is useful even on error + function_call_attributes = { + gen_ai_attributes.GEN_AI_OPERATION_NAME: gen_ai_attributes.GenAiOperationNameValues.EXECUTE_TOOL.value, + gen_ai_attributes.GEN_AI_PROVIDER_NAME: gen_ai_attributes.GenAiProviderNameValues.MISTRAL_AI.value, + gen_ai_attributes.GEN_AI_TOOL_CALL_ID: function_call.id, + gen_ai_attributes.GEN_AI_TOOL_CALL_ARGUMENTS: function_call.arguments + if isinstance(function_call.arguments, str) + else json.dumps(function_call.arguments), + gen_ai_attributes.GEN_AI_TOOL_NAME: function_call.name, + gen_ai_attributes.GEN_AI_TOOL_TYPE: "function", + } + set_available_attributes(span, function_call_attributes) + try: + if isinstance(run_tool, RunFunction): + res = run_tool.callable(**arguments) + elif isinstance(run_tool, RunCoroutine): + res = await run_tool.awaitable(**arguments) + elif isinstance(run_tool, RunMCPTool): + res = await run_tool.mcp_client.execute_tool( + function_call.name, arguments + ) + result_str = res if isinstance(res, str) else json.dumps(res) + span.set_attribute(gen_ai_attributes.GEN_AI_TOOL_CALL_RESULT, result_str) + except Exception as e: + span.record_exception(e) + span.set_status(Status(StatusCode.ERROR, str(e))) + if continue_on_fn_error is True: + return FunctionResultEntry( + tool_call_id=function_call.tool_call_id, + result=f"Error while executing {function_call.name}: {str(e)}", + ) + raise RunException( + f"Failed to execute tool {function_call.name} with arguments '{function_call.arguments}'" + ) from e return FunctionResultEntry( - tool_call_id=function_call.tool_call_id, - result=res if isinstance(res, str) else json.dumps(res), + tool_call_id=function_call.tool_call_id, result=result_str ) diff --git a/src/mistralai/extra/struct_chat.py b/src/mistralai/extra/struct_chat.py index 364b450f..d3fd3f5a 100644 --- a/src/mistralai/extra/struct_chat.py +++ b/src/mistralai/extra/struct_chat.py @@ -1,19 +1,26 @@ -from ..models import ChatCompletionResponse, ChatCompletionChoice, AssistantMessage -from .utils.response_format import CustomPydanticModel, pydantic_model_from_json -from typing import List, Optional, Type, Generic -from pydantic import BaseModel import json +from typing import Generic + +from mistralai.client.models import AssistantMessage, ChatCompletionChoice, ChatCompletionResponse +from .utils.response_format import CustomPydanticModel, pydantic_model_from_json + class ParsedAssistantMessage(AssistantMessage, Generic[CustomPydanticModel]): - parsed: Optional[CustomPydanticModel] + parsed: CustomPydanticModel | None + class ParsedChatCompletionChoice(ChatCompletionChoice, Generic[CustomPydanticModel]): - message: Optional[ParsedAssistantMessage[CustomPydanticModel]] # type: ignore + message: ParsedAssistantMessage[CustomPydanticModel] | None # type: ignore + class ParsedChatCompletionResponse(ChatCompletionResponse, Generic[CustomPydanticModel]): - choices: Optional[List[ParsedChatCompletionChoice[CustomPydanticModel]]] # type: ignore + choices: list[ParsedChatCompletionChoice[CustomPydanticModel]] | None # type: ignore + -def convert_to_parsed_chat_completion_response(response: ChatCompletionResponse, response_format: Type[BaseModel]) -> ParsedChatCompletionResponse: +def convert_to_parsed_chat_completion_response( + response: ChatCompletionResponse, + response_format: type[CustomPydanticModel], +) -> ParsedChatCompletionResponse[CustomPydanticModel]: parsed_choices = [] if response.choices: diff --git a/src/mistralai/extra/tests/test_formatting.py b/src/mistralai/extra/tests/test_formatting.py new file mode 100644 index 00000000..3dd1dee4 --- /dev/null +++ b/src/mistralai/extra/tests/test_formatting.py @@ -0,0 +1,439 @@ +"""Unit tests for the OTEL formatting helpers. + +Each test covers a single function with both happy-path and edge-case inputs. +The functions are pure (dict -> dict/list), so no OTEL setup is needed. +""" + +import unittest + +from mistralai.extra.observability.formatting import ( + _content_to_parts, + _tool_calls_to_parts, + format_input_message, + format_output_message, + format_tool_definition, +) + + +class TestContentToParts(unittest.TestCase): + def test_none(self): + self.assertEqual(_content_to_parts(None), []) + + def test_string(self): + self.assertEqual( + _content_to_parts("hello"), + [{"type": "text", "content": "hello"}], + ) + + def test_empty_string(self): + self.assertEqual( + _content_to_parts(""), + [{"type": "text", "content": ""}], + ) + + def test_empty_list(self): + self.assertEqual(_content_to_parts([]), []) + + def test_list_of_strings(self): + self.assertEqual( + _content_to_parts(["a", "b"]), + [ + {"type": "text", "content": "a"}, + {"type": "text", "content": "b"}, + ], + ) + + def test_text_chunk(self): + self.assertEqual( + _content_to_parts([{"type": "text", "text": "hello"}]), + [{"type": "text", "content": "hello"}], + ) + + def test_text_chunk_missing_text_field(self): + self.assertEqual( + _content_to_parts([{"type": "text"}]), + [{"type": "text", "content": ""}], + ) + + # -- thinking chunks ------------------------------------------------------- + + def test_thinking_chunk_with_sub_chunks(self): + chunk = { + "type": "thinking", + "thinking": [ + {"type": "text", "text": "step 1"}, + {"type": "text", "text": "step 2"}, + ], + } + self.assertEqual( + _content_to_parts([chunk]), + [{"type": "reasoning", "content": "step 1\nstep 2"}], + ) + + def test_thinking_chunk_filters_non_text_sub_chunks(self): + chunk = { + "type": "thinking", + "thinking": [ + {"type": "text", "text": "kept"}, + {"type": "other", "text": "ignored"}, + "also ignored", + ], + } + self.assertEqual( + _content_to_parts([chunk]), + [{"type": "reasoning", "content": "kept"}], + ) + + def test_thinking_chunk_fallback_plain_string(self): + chunk = {"type": "thinking", "thinking": "raw thought"} + self.assertEqual( + _content_to_parts([chunk]), + [{"type": "reasoning", "content": "raw thought"}], + ) + + def test_thinking_chunk_missing_thinking_field(self): + """Empty string default -> str("") fallback.""" + chunk = {"type": "thinking"} + self.assertEqual( + _content_to_parts([chunk]), + [{"type": "reasoning", "content": ""}], + ) + + # -- image_url chunks ------------------------------------------------------ + + def test_image_url_chunk_dict(self): + chunk = {"type": "image_url", "image_url": {"url": "https://img.png"}} + self.assertEqual( + _content_to_parts([chunk]), + [{"type": "uri", "modality": "image", "uri": "https://img.png"}], + ) + + def test_image_url_chunk_string_fallback(self): + chunk = {"type": "image_url", "image_url": "https://img.png"} + self.assertEqual( + _content_to_parts([chunk]), + [{"type": "uri", "modality": "image", "uri": "https://img.png"}], + ) + + def test_image_url_chunk_missing_url(self): + chunk = {"type": "image_url", "image_url": {}} + self.assertEqual( + _content_to_parts([chunk]), + [{"type": "uri", "modality": "image", "uri": ""}], + ) + + # -- unknown / catch-all --------------------------------------------------- + + def test_unknown_chunk_type(self): + chunk = {"type": "audio", "data": "..."} + self.assertEqual( + _content_to_parts([chunk]), + [{"type": "audio"}], + ) + + def test_mixed_chunk_types(self): + """Multiple chunk types in one content array.""" + parts = _content_to_parts( + [ + {"type": "text", "text": "look at this"}, + {"type": "image_url", "image_url": {"url": "https://img.png"}}, + "plain string", + ] + ) + self.assertListEqual( + parts, + [ + {"type": "text", "content": "look at this"}, + {"type": "uri", "modality": "image", "uri": "https://img.png"}, + {"type": "text", "content": "plain string"}, + ], + ) + + +class TestToolCallsToParts(unittest.TestCase): + def test_none(self): + self.assertEqual(_tool_calls_to_parts(None), []) + + def test_empty_list(self): + self.assertEqual(_tool_calls_to_parts([]), []) + + def test_full_tool_call(self): + tc = { + "id": "call_123", + "function": {"name": "get_weather", "arguments": '{"city": "Paris"}'}, + } + self.assertEqual( + _tool_calls_to_parts([tc]), + [ + { + "type": "tool_call", + "name": "get_weather", + "id": "call_123", + "arguments": '{"city": "Paris"}', + }, + ], + ) + + def test_missing_id(self): + tc = {"function": {"name": "f"}} + self.assertListEqual( + _tool_calls_to_parts([tc]), + [{"type": "tool_call", "name": "f"}], + ) + + def test_missing_arguments(self): + tc = {"id": "1", "function": {"name": "f"}} + self.assertListEqual( + _tool_calls_to_parts([tc]), + [{"type": "tool_call", "name": "f", "id": "1"}], + ) + + def test_missing_function(self): + """No function key -> empty name.""" + tc = {"id": "1"} + self.assertListEqual( + _tool_calls_to_parts([tc]), + [{"type": "tool_call", "name": "", "id": "1"}], + ) + + def test_function_is_none(self): + tc = {"id": "1", "function": None} + self.assertListEqual( + _tool_calls_to_parts([tc]), + [{"type": "tool_call", "name": "", "id": "1"}], + ) + + +class TestFormatInputMessage(unittest.TestCase): + # -- Happy paths (role-based messages) ------------------------------------ + + def test_user_message(self): + result = format_input_message({"role": "user", "content": "hi"}) + self.assertDictEqual( + result, + { + "role": "user", + "parts": [{"type": "text", "content": "hi"}], + }, + ) + + def test_system_message(self): + result = format_input_message({"role": "system", "content": "be helpful"}) + self.assertDictEqual( + result, + { + "role": "system", + "parts": [{"type": "text", "content": "be helpful"}], + }, + ) + + def test_assistant_message_with_tool_calls(self): + msg = { + "role": "assistant", + "content": "", + "tool_calls": [{"id": "tc1", "function": {"name": "f", "arguments": "{}"}}], + } + result = format_input_message(msg) + self.assertEqual(result["role"], "assistant") + # text part from content + tool_call part + self.assertListEqual( + [p["type"] for p in result["parts"]], + ["text", "tool_call"], + ) + + def test_tool_message(self): + msg = {"role": "tool", "content": "22C sunny", "tool_call_id": "tc1"} + result = format_input_message(msg) + self.assertDictEqual( + result, + { + "role": "tool", + "parts": [ + {"type": "tool_call_response", "response": "22C sunny", "id": "tc1"} + ], + }, + ) + + def test_tool_message_without_tool_call_id(self): + msg = {"role": "tool", "content": "result"} + result = format_input_message(msg) + self.assertNotIn("id", result["parts"][0]) + + # -- Conversation entry: function.result ---------------------------------- + + def test_function_result_entry(self): + msg = { + "type": "function.result", + "result": '{"status": "ok"}', + "tool_call_id": "tc1", + } + result = format_input_message(msg) + self.assertDictEqual( + result, + { + "role": "tool", + "parts": [ + { + "type": "tool_call_response", + "response": '{"status": "ok"}', + "id": "tc1", + } + ], + }, + ) + + def test_function_result_entry_without_tool_call_id(self): + msg = {"type": "function.result", "result": "data"} + result = format_input_message(msg) + self.assertNotIn("id", result["parts"][0]) + + # -- Edge cases ----------------------------------------------------------- + + def test_missing_role_defaults_to_unknown(self): + result = format_input_message({"content": "orphan"}) + self.assertDictEqual( + result, + { + "role": "unknown", + "parts": [{"type": "text", "content": "orphan"}], + }, + ) + + def test_no_content_no_tool_calls(self): + result = format_input_message({"role": "user"}) + self.assertDictEqual(result, {"role": "user", "parts": []}) + + +class TestFormatOutputMessage(unittest.TestCase): + def test_simple_assistant_response(self): + choice = { + "message": {"role": "assistant", "content": "hello"}, + "finish_reason": "stop", + } + result = format_output_message(choice) + self.assertDictEqual( + result, + { + "role": "assistant", + "parts": [{"type": "text", "content": "hello"}], + "finish_reason": "stop", + }, + ) + + def test_tool_calls_response(self): + choice = { + "message": { + "role": "assistant", + "content": None, + "tool_calls": [ + {"id": "tc1", "function": {"name": "f", "arguments": "{}"}}, + ], + }, + "finish_reason": "tool_calls", + } + result = format_output_message(choice) + self.assertEqual(result["finish_reason"], "tool_calls") + self.assertListEqual( + [p["type"] for p in result["parts"]], + ["tool_call"], + ) + + def test_missing_message(self): + result = format_output_message({}) + self.assertDictEqual( + result, + { + "role": "assistant", + "parts": [], + "finish_reason": "", + }, + ) + + def test_message_is_none(self): + result = format_output_message({"message": None}) + self.assertDictEqual( + result, + { + "role": "assistant", + "parts": [], + "finish_reason": "", + }, + ) + + def test_defaults_role_to_assistant(self): + choice = {"message": {"content": "hi"}, "finish_reason": "stop"} + result = format_output_message(choice) + self.assertDictEqual( + result, + { + "role": "assistant", + "parts": [{"type": "text", "content": "hi"}], + "finish_reason": "stop", + }, + ) + + +class TestFormatToolDefinition(unittest.TestCase): + def test_full_definition(self): + tool = { + "type": "function", + "function": { + "name": "get_weather", + "description": "Get weather", + "parameters": {"type": "object", "properties": {}}, + }, + } + result = format_tool_definition(tool) + self.assertIsNotNone(result) + assert result is not None + self.assertDictEqual( + result, + { + "type": "function", + "name": "get_weather", + "description": "Get weather", + "parameters": {"type": "object", "properties": {}}, + }, + ) + + def test_minimal_definition(self): + """Only name, no description or parameters.""" + tool = {"function": {"name": "f"}} + result = format_tool_definition(tool) + self.assertIsNotNone(result) + assert result is not None + self.assertDictEqual( + result, + { + "type": "function", + "name": "f", + }, + ) + + def test_missing_function_returns_none(self): + self.assertIsNone(format_tool_definition({"type": "function"})) + + def test_empty_function_returns_none(self): + self.assertIsNone(format_tool_definition({"function": {}})) + + def test_missing_name_returns_none(self): + self.assertIsNone( + format_tool_definition({"function": {"description": "no name"}}) + ) + + def test_custom_type_preserved(self): + tool = {"type": "custom_tool", "function": {"name": "f"}} + result = format_tool_definition(tool) + self.assertIsNotNone(result) + assert result is not None + self.assertDictEqual( + result, + { + "type": "custom_tool", + "name": "f", + }, + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/mistralai/extra/tests/test_otel_tracing.py b/src/mistralai/extra/tests/test_otel_tracing.py new file mode 100644 index 00000000..82b78ec1 --- /dev/null +++ b/src/mistralai/extra/tests/test_otel_tracing.py @@ -0,0 +1,1839 @@ +"""Tests for OTEL tracing instrumentation. + +Each test drives the real TracingHook lifecycle (before_request → after_success) +with realistic Mistral API payloads and verifies the resulting OTEL span attributes +match GenAI semantic conventions. + +Fixtures are defined inline using SDK model classes so each test is self-contained. +""" + +# pyright: reportOptionalSubscript=false +# pyright: reportOptionalMemberAccess=false +# pyright: reportArgumentType=false + +import asyncio +import json +import unittest +from datetime import datetime, timezone +from unittest.mock import MagicMock + +import httpx +from opentelemetry import context as context_api +from opentelemetry import trace +from opentelemetry.baggage import set_baggage +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import SimpleSpanProcessor +from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter +from opentelemetry.trace import StatusCode + +from mistralai.client._hooks.tracing import TracingHook +from mistralai.client._hooks.types import ( + AfterErrorContext, + AfterSuccessContext, + BeforeRequestContext, + HookContext, +) +from mistralai.client.models import ( + Agent, + AgentsCompletionRequest, + AssistantMessage, + ChatCompletionChoice, + ChatCompletionRequest, + ChatCompletionResponse, + CompletionChunk, + CompletionEvent, + CompletionResponseStreamChoice, + ConversationAppendRequest, + ConversationRequest, + ConversationResponse, + ConversationUsageInfo, + CreateAgentRequest, + DeltaMessage, + EmbeddingRequest, + EmbeddingResponse, + EmbeddingResponseData, + Function, + FunctionCall, + FunctionCallEntry, + FunctionResultEntry, + FunctionTool, + ImageURL, + ImageURLChunk, + MessageOutputEntry, + SystemMessage, + TextChunk, + ThinkChunk, + Tool, + ToolCall, + ToolExecutionEntry, + ToolMessage, + UsageInfo, + UserMessage, +) +from mistralai.client.sdk import Mistral +from mistralai.extra.observability.otel import TracedResponse +from mistralai.extra.run.tools import ( + RunFunction, + create_function_result, +) + +# Set up a single TracerProvider for the entire test module. +# trace.set_tracer_provider() can only be called once per process. +_EXPORTER = InMemorySpanExporter() +_PROVIDER = TracerProvider() +_PROVIDER.add_span_processor(SimpleSpanProcessor(_EXPORTER)) +trace.set_tracer_provider(_PROVIDER) + + +# -- Helpers ------------------------------------------------------------------- + + +def _make_httpx_request( + body: dict, + method: str = "POST", + url: str = "https://api.mistral.ai/v1/chat/completions", +) -> httpx.Request: + return httpx.Request( + method=method, + url=url, + content=json.dumps(body).encode(), + headers={"host": "api.mistral.ai", "content-type": "application/json"}, + ) + + +def _make_httpx_response(body: dict, status_code: int = 200) -> httpx.Response: + resp = httpx.Response( + status_code=status_code, + content=json.dumps(body).encode(), + ) + # Mark the response as closed/consumed so it's treated as non-streaming + resp.stream = httpx.ByteStream(resp.content) + resp.stream.close() + return resp + + +def _make_hook_context(operation_id: str) -> HookContext: + return HookContext( + config=MagicMock(), + base_url="https://api.mistral.ai", + operation_id=operation_id, + oauth2_scopes=None, + security_source=None, + ) + + +def _dump(model) -> dict: + """Serialize an SDK model to a JSON-compatible dict, matching wire format.""" + return model.model_dump(mode="json", by_alias=True) + + +def _build_sse_body(events: list[CompletionEvent]) -> bytes: + """Serialize a list of CompletionEvent models into an SSE byte payload.""" + lines = [f"data: {json.dumps(_dump(e.data))}" for e in events] + lines.append("data: [DONE]") + return ("\n\n".join(lines) + "\n\n").encode() + + +def _make_streaming_httpx_response(sse_body: bytes) -> httpx.Response: + """Create an *open* httpx.Response that simulates a streaming SSE response.""" + return httpx.Response( + status_code=200, + stream=httpx.ByteStream(sse_body), + ) + + +def _parse_json_list(span_attr): + """Parse a span attribute containing a JSON-encoded array string.""" + return json.loads(span_attr) + + +# -- Tests --------------------------------------------------------------------- + + +class TestOtelTracing(unittest.TestCase): + def setUp(self): + _EXPORTER.clear() + + # -- Test helpers ---------------------------------------------------------- + + def _run_hook_lifecycle( + self, + operation_id: str, + request_body, + response_body, + streaming: bool = False, + ): + """Drive the real TracingHook: before_request → after_success. + + ``request_body`` and ``response_body`` can be SDK model instances or + plain dicts. Models are serialised via ``_dump()`` automatically. + + When ``streaming=True``, ``response_body`` must be a + ``list[CompletionEvent]``. The helper builds an SSE byte payload, + creates an open streaming response, and consumes + closes the stream + so the span is finalised before returning. + """ + hook = TracingHook() + hook_ctx = _make_hook_context(operation_id) + + req_dict = ( + _dump(request_body) if hasattr(request_body, "model_dump") else request_body + ) + + request = _make_httpx_request(req_dict) + + if streaming: + sse_body = _build_sse_body(response_body) + response = _make_streaming_httpx_response(sse_body) + else: + resp_dict = ( + _dump(response_body) + if hasattr(response_body, "model_dump") + else response_body + ) + response = _make_httpx_response(resp_dict) + + hooked_request = hook.before_request(BeforeRequestContext(hook_ctx), request) + self.assertNotIsInstance(hooked_request, Exception) + assert isinstance(hooked_request, httpx.Request) + + # Link response to request, as httpx.Client.send() does in real usage. + response.request = hooked_request + + result = hook.after_success(AfterSuccessContext(hook_ctx), response) + self.assertNotIsInstance(result, Exception) + + if streaming: + self.assertIsInstance(result, TracedResponse) + assert isinstance(result, TracedResponse) + for _chunk in result.iter_bytes(): + pass + result.close() + + def _run_hook_error_lifecycle( + self, + operation_id: str, + request_body, + response_body: dict, + status_code: int = 400, + error: Exception | None = None, + ): + """Drive the real TracingHook: before_request → after_error.""" + hook = TracingHook() + hook_ctx = _make_hook_context(operation_id) + + req_dict = ( + _dump(request_body) if hasattr(request_body, "model_dump") else request_body + ) + request = _make_httpx_request(req_dict) + response = _make_httpx_response(response_body, status_code=status_code) + + hooked_request = hook.before_request(BeforeRequestContext(hook_ctx), request) + self.assertNotIsInstance(hooked_request, Exception) + assert isinstance(hooked_request, httpx.Request) + + # Link response to request, as httpx.Client.send() does in real usage. + response.request = hooked_request + + result = hook.after_error(AfterErrorContext(hook_ctx), response, error) + self.assertNotIsInstance(result, Exception) + + def _get_finished_spans(self): + return _EXPORTER.get_finished_spans() + + def _get_single_span(self): + spans = self._get_finished_spans() + self.assertEqual(len(spans), 1, f"Expected 1 span, got {len(spans)}") + return spans[0] + + def assertSpanAttributes(self, span, expected: dict): + """Assert that *expected* is a subset of *span.attributes*.""" + actual = {k: span.attributes[k] for k in expected} + self.assertEqual(expected, actual) + + # -- Simple chat completion ------------------------------------------------ + + def test_simple_chat_completion(self): + request = ChatCompletionRequest( + model="mistral-large-latest", + temperature=0.7, + top_p=1, + max_tokens=512, + messages=[ + SystemMessage(content="You are a helpful assistant."), + UserMessage(content="What is the best French cheese?"), + ], + ) + response = ChatCompletionResponse( + id="cmpl-a1b2c3d4e5f6", + object="chat.completion", + model="mistral-large-latest", + created=1700000000, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage( + content="There are many great French cheeses! Camembert, Roquefort, and Brie are among the most celebrated.", + tool_calls=None, + ), + finish_reason="stop", + ), + ], + usage=UsageInfo(prompt_tokens=20, completion_tokens=25, total_tokens=45), + ) + + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response, + ) + span = self._get_single_span() + + self.assertEqual(span.name, "chat mistral-large-latest") + self.assertSpanAttributes( + span, + { + "gen_ai.operation.name": "chat", + "gen_ai.provider.name": "mistral_ai", + "gen_ai.request.model": "mistral-large-latest", + "gen_ai.request.temperature": 0.7, + "gen_ai.request.top_p": 1, + "gen_ai.request.max_tokens": 512, + "http.request.method": "POST", + "server.address": "api.mistral.ai", + "server.port": 443, + "http.response.status_code": 200, + "gen_ai.response.id": "cmpl-a1b2c3d4e5f6", + "gen_ai.response.model": "mistral-large-latest", + "gen_ai.response.finish_reasons": ("stop",), + "gen_ai.usage.input_tokens": 20, + "gen_ai.usage.output_tokens": 25, + }, + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.input.messages"]), + [ + { + "role": "system", + "parts": [ + {"type": "text", "content": "You are a helpful assistant."} + ], + }, + { + "role": "user", + "parts": [ + {"type": "text", "content": "What is the best French cheese?"} + ], + }, + ], + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "There are many great French cheeses! Camembert, Roquefort, and Brie are among the most celebrated.", + } + ], + "finish_reason": "stop", + }, + ], + ) + + # -- Chat completion with tool calls --------------------------------------- + + def test_chat_completion_with_tool_calls(self): + request = ChatCompletionRequest( + model="mistral-large-latest", + messages=[ + UserMessage(content="What's the weather in Paris?"), + ], + tools=[ + Tool( + type="function", + function=Function( + name="get_weather", + description="Get the current weather in a given location", + parameters={ + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "City name", + }, + }, + "required": ["location"], + }, + ), + ), + ], + tool_choice="auto", + ) + response = ChatCompletionResponse( + id="cmpl-tool-001", + object="chat.completion", + model="mistral-large-latest", + created=1700000001, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage( + content="", + tool_calls=[ + ToolCall( + id="call_abc123", + function=FunctionCall( + name="get_weather", + arguments='{"location": "Paris"}', + ), + ), + ], + ), + finish_reason="tool_calls", + ), + ], + usage=UsageInfo(prompt_tokens=30, completion_tokens=15, total_tokens=45), + ) + + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response, + ) + span = self._get_single_span() + + self.assertEqual(span.name, "chat mistral-large-latest") + self.assertSpanAttributes( + span, + { + "gen_ai.operation.name": "chat", + "gen_ai.response.finish_reasons": ("tool_calls",), + "gen_ai.usage.input_tokens": 30, + "gen_ai.usage.output_tokens": 15, + }, + ) + + # Tool definitions in request + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.tool.definitions"]), + [ + { + "type": "function", + "name": "get_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": {"type": "string", "description": "City name"} + }, + "required": ["location"], + }, + }, + ], + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.input.messages"]), + [ + { + "role": "user", + "parts": [ + {"type": "text", "content": "What's the weather in Paris?"} + ], + }, + ], + ) + + # Output messages — assistant with tool call and empty text content + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + {"type": "text", "content": ""}, + { + "type": "tool_call", + "name": "get_weather", + "id": "call_abc123", + "arguments": '{"location": "Paris"}', + }, + ], + "finish_reason": "tool_calls", + }, + ], + ) + + # -- Embeddings ------------------------------------------------------------ + + def test_embeddings(self): + request = EmbeddingRequest( + model="mistral-embed", + inputs=["What is the best French cheese?"], + ) + response = EmbeddingResponse( + id="emb-a1b2c3", + object="list", + model="mistral-embed", + data=[ + EmbeddingResponseData( + object="embedding", embedding=[0.1, 0.2, 0.3], index=0 + ) + ], + usage=UsageInfo(prompt_tokens=10, completion_tokens=0, total_tokens=10), + ) + + self._run_hook_lifecycle( + "embeddings_v1_embeddings_post", + request, + response, + ) + span = self._get_single_span() + + self.assertEqual(span.name, "embeddings mistral-embed") + self.assertSpanAttributes( + span, + { + "gen_ai.operation.name": "embeddings", + "gen_ai.provider.name": "mistral_ai", + "gen_ai.request.model": "mistral-embed", + "gen_ai.response.id": "emb-a1b2c3", + "gen_ai.response.model": "mistral-embed", + "gen_ai.usage.input_tokens": 10, + }, + ) + + # Embeddings have no messages or choices + self.assertNotIn("gen_ai.input.messages", span.attributes) + self.assertNotIn("gen_ai.output.messages", span.attributes) + self.assertNotIn("gen_ai.response.finish_reasons", span.attributes) + + # -- Create agent ---------------------------------------------------------- + + def test_create_agent(self): + request = CreateAgentRequest( + model="mistral-large-latest", + name="my-test-agent", + description="A helpful test agent", + instructions="You are a helpful test assistant. Be concise.", + tools=[ + FunctionTool( + function=Function( + name="get_weather", + description="Get weather", + parameters={ + "type": "object", + "properties": {"location": {"type": "string"}}, + }, + ), + ), + ], + ) + response = Agent( + id="agent-xyz-789", + object="agent", + model="mistral-large-latest", + name="my-test-agent", + version=0, + versions=[], + description="A helpful test agent", + instructions="You are a helpful test assistant. Be concise.", + tools=[], + created_at=datetime(2024, 6, 1, 12, 0, 0, tzinfo=timezone.utc), + updated_at=datetime(2024, 6, 1, 12, 0, 0, tzinfo=timezone.utc), + deployment_chat=False, + source="api", + ) + + self._run_hook_lifecycle( + "agents_api_v1_agents_create", + request, + response, + ) + span = self._get_single_span() + + self.assertEqual(span.name, "create_agent my-test-agent") + self.assertSpanAttributes( + span, + { + "gen_ai.operation.name": "create_agent", + "gen_ai.provider.name": "mistral_ai", + "gen_ai.agent.id": "agent-xyz-789", + "gen_ai.agent.name": "my-test-agent", + "gen_ai.agent.description": "A helpful test agent", + "gen_ai.system_instructions": "You are a helpful test assistant. Be concise.", + "gen_ai.agent.version": "0", + "gen_ai.request.model": "mistral-large-latest", + }, + ) + + # response.id should NOT be set (id means agent id for create_agent) + self.assertNotIn("gen_ai.response.id", span.attributes) + + # -- Agent completion (via /v1/agents/completions) ------------------------- + + def test_agent_completion(self): + request = AgentsCompletionRequest( + agent_id="agent-xyz-789", + messages=[ + UserMessage(content="What's the weather in Paris?"), + ], + max_tokens=1024, + ) + response = ChatCompletionResponse( + id="cmpl-agent-001", + object="chat.completion", + model="mistral-large-latest", + created=1700000002, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage( + content="It's sunny and 22C in Paris today.", + tool_calls=None, + ), + finish_reason="stop", + ), + ], + usage=UsageInfo(prompt_tokens=40, completion_tokens=12, total_tokens=52), + ) + + self._run_hook_lifecycle( + "agents_completion_v1_agents_completions_post", + request, + response, + ) + span = self._get_single_span() + + # Span name — no agent name in request body, falls back to op name + self.assertEqual(span.name, "invoke_agent") + self.assertSpanAttributes( + span, + { + "gen_ai.operation.name": "invoke_agent", + "gen_ai.provider.name": "mistral_ai", + "gen_ai.response.id": "cmpl-agent-001", + "gen_ai.response.model": "mistral-large-latest", + "gen_ai.response.finish_reasons": ("stop",), + "gen_ai.usage.input_tokens": 40, + "gen_ai.usage.output_tokens": 12, + }, + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.input.messages"]), + [ + { + "role": "user", + "parts": [ + {"type": "text", "content": "What's the weather in Paris?"} + ], + }, + ], + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "It's sunny and 22C in Paris today.", + } + ], + "finish_reason": "stop", + }, + ], + ) + + # -- Conversation start (via /v1/conversations) ---------------------------- + + def test_conversation_start(self): + request = ConversationRequest( + agent_id="agent-xyz-789", + inputs="What's the weather in Paris?", + ) + response = ConversationResponse( + conversation_id="conv-001", + object="conversation.response", + usage=ConversationUsageInfo( + prompt_tokens=15, completion_tokens=10, total_tokens=25 + ), + outputs=[ + ToolExecutionEntry( + name="get_weather", + arguments='{"location": "Paris"}', + id="tool-exec-001", + info={"temperature": "22C", "condition": "sunny"}, + created_at=datetime(2024, 6, 1, 12, 0, 0, tzinfo=timezone.utc), + completed_at=datetime(2024, 6, 1, 12, 0, 1, tzinfo=timezone.utc), + ), + MessageOutputEntry( + id="msg-out-001", + role="assistant", + content="It's sunny and 22C in Paris today.", + model="mistral-large-latest", + agent_id="agent-xyz-789", + created_at=datetime(2024, 6, 1, 12, 0, 1, tzinfo=timezone.utc), + completed_at=datetime(2024, 6, 1, 12, 0, 2, tzinfo=timezone.utc), + ), + ], + ) + + self._run_hook_lifecycle( + "agents_api_v1_conversations_start", + request, + response, + ) + spans = self._get_finished_spans() + + # Parent span + 2 child spans (tool execution + message output) + self.assertEqual(len(spans), 3, f"Expected 3 spans, got {len(spans)}") + + # Identify spans by operation name + parent = None + tool_span = None + message_span = None + for s in spans: + op = s.attributes.get("gen_ai.operation.name") + if op == "invoke_agent": + parent = s + elif op == "execute_tool": + tool_span = s + elif op == "chat": + message_span = s + + self.assertIsNotNone(parent, "Missing invoke_agent parent span") + self.assertIsNotNone(tool_span, "Missing execute_tool child span") + self.assertIsNotNone(message_span, "Missing chat child span") + + # Parent span + self.assertSpanAttributes( + parent, + { + "gen_ai.operation.name": "invoke_agent", + "gen_ai.provider.name": "mistral_ai", + "gen_ai.conversation.id": "conv-001", + "gen_ai.usage.input_tokens": 15, + "gen_ai.usage.output_tokens": 10, + }, + ) + + self.assertListEqual( + _parse_json_list(parent.attributes["gen_ai.input.messages"]), + [ + { + "role": "user", + "parts": [ + {"type": "text", "content": "What's the weather in Paris?"} + ], + }, + ], + ) + + # Parent span should NOT have output messages (they belong on child spans) + self.assertNotIn("gen_ai.output.messages", parent.attributes) + + # Tool execution child span + self.assertEqual(tool_span.name, "execute_tool get_weather") + self.assertSpanAttributes( + tool_span, + { + "gen_ai.operation.name": "execute_tool", + "gen_ai.provider.name": "mistral_ai", + "gen_ai.tool.name": "get_weather", + "gen_ai.tool.call.id": "tool-exec-001", + "gen_ai.tool.call.arguments": '{"location": "Paris"}', + "gen_ai.tool.type": "extension", + }, + ) + self.assertEqual( + json.loads(tool_span.attributes["gen_ai.tool.call.result"]), + {"temperature": "22C", "condition": "sunny"}, + ) + self.assertEqual(tool_span.parent.span_id, parent.context.span_id) + + # Message output child span + self.assertEqual(message_span.name, "chat mistral-large-latest") + self.assertSpanAttributes( + message_span, + { + "gen_ai.operation.name": "chat", + "gen_ai.response.id": "msg-out-001", + "gen_ai.agent.id": "agent-xyz-789", + "gen_ai.response.model": "mistral-large-latest", + }, + ) + self.assertEqual(message_span.parent.span_id, parent.context.span_id) + + self.assertListEqual( + _parse_json_list(message_span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "It's sunny and 22C in Paris today.", + } + ], + "finish_reason": "", + }, + ], + ) + + # -- Conversation append --------------------------------------------------- + + def test_conversation_append_with_function_results(self): + """Conversation append with FunctionResultEntry inputs must serialize them as tool messages.""" + request = ConversationAppendRequest( + inputs=[ + FunctionResultEntry( + tool_call_id="tc-001", + result='{"status": "Completed"}', + ), + FunctionResultEntry( + tool_call_id="tc-002", + result='{"date": "2021-10-05"}', + ), + ], + ) + response = ConversationResponse( + conversation_id="conv-001", + object="conversation.response", + usage=ConversationUsageInfo( + prompt_tokens=20, completion_tokens=15, total_tokens=35 + ), + outputs=[ + MessageOutputEntry( + id="msg-out-002", + role="assistant", + content="Transaction T1001 was completed on 2021-10-05.", + model="mistral-large-latest", + agent_id="agent-xyz-789", + created_at=datetime(2024, 6, 1, 12, 1, 0, tzinfo=timezone.utc), + completed_at=datetime(2024, 6, 1, 12, 1, 1, tzinfo=timezone.utc), + ), + ], + ) + + self._run_hook_lifecycle( + "agents_api_v1_conversations_append", + _dump(request), + _dump(response), + ) + spans = self._get_finished_spans() + + # Parent span + 1 child span (message output) + self.assertEqual(len(spans), 2, f"Expected 2 spans, got {len(spans)}") + + parent = None + message_span = None + for s in spans: + op = s.attributes.get("gen_ai.operation.name") + if op == "invoke_agent" and s.parent is None: + parent = s + elif op == "chat": + message_span = s + + self.assertIsNotNone(parent, "Missing invoke_agent parent span") + self.assertIsNotNone(message_span, "Missing chat child span") + + # Parent span — input messages must contain the function results + self.assertListEqual( + _parse_json_list(parent.attributes["gen_ai.input.messages"]), + [ + { + "role": "tool", + "parts": [ + { + "type": "tool_call_response", + "response": '{"status": "Completed"}', + "id": "tc-001", + }, + ], + }, + { + "role": "tool", + "parts": [ + { + "type": "tool_call_response", + "response": '{"date": "2021-10-05"}', + "id": "tc-002", + }, + ], + }, + ], + ) + + # -- Non-GenAI operation --------------------------------------------------- + + def test_non_genai_operation(self): + self._run_hook_lifecycle( + "files_api_routes_upload_file", + {"file": "data"}, + {"id": "file-123", "object": "file"}, + ) + span = self._get_single_span() + self.assertNotIn("gen_ai.operation.name", span.attributes) + self.assertNotIn("gen_ai.provider.name", span.attributes) + self.assertEqual(span.attributes["http.request.method"], "POST") + + # -- Multi-turn tool use --------------------------------------------------- + + def test_multi_turn_tool_use(self): + """Full tool-use loop: user → assistant(tool_calls) → tool(result) → assistant(final). + + Tests that all message roles are serialised correctly in + gen_ai.input.messages, including the tool_call_response part for + role="tool" and the tool_call parts for role="assistant". + """ + request = ChatCompletionRequest( + model="mistral-small-latest", + max_tokens=64, + messages=[ + UserMessage(content="What is the weather in Paris?"), + AssistantMessage( + content="", + tool_calls=[ + ToolCall( + id="7SXIeh1Ie", + function=FunctionCall( + name="get_weather", + arguments='{"location": "Paris"}', + ), + ), + ], + ), + ToolMessage( + name="get_weather", + content="22C, sunny", + tool_call_id="7SXIeh1Ie", + ), + ], + tools=[ + Tool( + type="function", + function=Function( + name="get_weather", + description="Get the current weather in a given location", + parameters={ + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "City name", + }, + }, + "required": ["location"], + }, + ), + ), + ], + ) + response = ChatCompletionResponse( + id="cmpl-multiturn-001", + object="chat.completion", + model="mistral-small-latest", + created=1700000003, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage( + content="The weather in Paris is currently 22°C and sunny.", + tool_calls=None, + ), + finish_reason="stop", + ), + ], + usage=UsageInfo(prompt_tokens=115, completion_tokens=14, total_tokens=129), + ) + + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response, + ) + span = self._get_single_span() + + self.assertEqual(span.name, "chat mistral-small-latest") + self.assertSpanAttributes( + span, + { + "gen_ai.usage.input_tokens": 115, + "gen_ai.usage.output_tokens": 14, + }, + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.input.messages"]), + [ + { + "role": "user", + "parts": [ + {"type": "text", "content": "What is the weather in Paris?"} + ], + }, + { + "role": "assistant", + "parts": [ + {"type": "text", "content": ""}, + { + "type": "tool_call", + "name": "get_weather", + "id": "7SXIeh1Ie", + "arguments": '{"location": "Paris"}', + }, + ], + }, + { + "role": "tool", + "parts": [ + { + "type": "tool_call_response", + "response": "22C, sunny", + "id": "7SXIeh1Ie", + }, + ], + }, + ], + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "The weather in Paris is currently 22°C and sunny.", + } + ], + "finish_reason": "stop", + }, + ], + ) + + # Tool definitions + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.tool.definitions"]), + [ + { + "type": "function", + "name": "get_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": {"type": "string", "description": "City name"} + }, + "required": ["location"], + }, + }, + ], + ) + + # -- Content chunks (multimodal) ------------------------------------------- + + def test_content_chunks_text_and_image(self): + """Request with content as array of chunks (text + image_url).""" + request = ChatCompletionRequest( + model="mistral-small-latest", + max_tokens=64, + messages=[ + UserMessage( + content=[ + TextChunk(text="Describe this image briefly"), + ImageURLChunk( + image_url=ImageURL( + url="https://example.com/image.jpg", + ), + ), + ], + ), + ], + ) + response = ChatCompletionResponse( + id="cmpl-vision-001", + object="chat.completion", + model="mistral-small-latest", + created=1700000004, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage( + content="The image shows a landscape.", + tool_calls=None, + ), + finish_reason="stop", + ), + ], + usage=UsageInfo(prompt_tokens=96, completion_tokens=8, total_tokens=104), + ) + + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response, + ) + span = self._get_single_span() + + self.assertEqual(span.name, "chat mistral-small-latest") + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.input.messages"]), + [ + { + "role": "user", + "parts": [ + {"type": "text", "content": "Describe this image briefly"}, + { + "type": "uri", + "modality": "image", + "uri": "https://example.com/image.jpg", + }, + ], + }, + ], + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + {"type": "text", "content": "The image shows a landscape."} + ], + "finish_reason": "stop", + }, + ], + ) + + def test_content_chunks_thinking(self): + """Response with thinking content chunk. + + Tests the "thinking" → "reasoning" mapping in _content_to_parts. + """ + request = ChatCompletionRequest( + model="magistral-small-latest", + messages=[ + UserMessage(content="What is 15 * 37?"), + ], + ) + response = ChatCompletionResponse( + id="cmpl-think-001", + object="chat.completion", + model="magistral-small-latest", + created=1700000006, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage( + content=[ + ThinkChunk( + thinking=[ + TextChunk( + text="Let me calculate: 15 * 37 = 15 * 30 + 15 * 7 = 450 + 105 = 555" + ), + ], + ), + TextChunk(text="15 * 37 = 555"), + ], + ), + finish_reason="stop", + ), + ], + usage=UsageInfo(prompt_tokens=10, completion_tokens=30, total_tokens=40), + ) + + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response, + ) + span = self._get_single_span() + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.input.messages"]), + [ + { + "role": "user", + "parts": [{"type": "text", "content": "What is 15 * 37?"}], + }, + ], + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + { + "type": "reasoning", + "content": "Let me calculate: 15 * 37 = 15 * 30 + 15 * 7 = 450 + 105 = 555", + }, + {"type": "text", "content": "15 * 37 = 555"}, + ], + "finish_reason": "stop", + }, + ], + ) + + # -- Multiple choices (n > 1) ---------------------------------------------- + + def test_multiple_choices(self): + """Response with multiple choices (n=2).""" + request = ChatCompletionRequest( + model="mistral-small-latest", + n=2, + max_tokens=32, + messages=[ + UserMessage(content="Tell me a joke"), + ], + ) + response = ChatCompletionResponse( + id="cmpl-multi-001", + object="chat.completion", + model="mistral-small-latest", + created=1700000005, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage( + content="Why did the chicken cross the road?", + tool_calls=None, + ), + finish_reason="stop", + ), + ChatCompletionChoice( + index=1, + message=AssistantMessage( + content="A programmer walks into a bar...", + tool_calls=None, + ), + finish_reason="stop", + ), + ], + usage=UsageInfo(prompt_tokens=10, completion_tokens=20, total_tokens=30), + ) + + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response, + ) + span = self._get_single_span() + + self.assertEqual( + span.attributes["gen_ai.response.finish_reasons"], ("stop", "stop") + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.input.messages"]), + [ + { + "role": "user", + "parts": [{"type": "text", "content": "Tell me a joke"}], + }, + ], + ) + + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "Why did the chicken cross the road?", + } + ], + "finish_reason": "stop", + }, + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "A programmer walks into a bar...", + } + ], + "finish_reason": "stop", + }, + ], + ) + + # -- Error response -------------------------------------------------------- + + def test_error_response(self): + """API error response (object="error") via after_error hook.""" + + request = ChatCompletionRequest( + model="mistral-large-latest", + temperature=0.7, + top_p=1, + max_tokens=512, + messages=[ + SystemMessage(content="You are a helpful assistant."), + UserMessage(content="What is the best French cheese?"), + ], + ) + error_body = { + "object": "error", + "message": "Invalid model: nonexistent-model", + "type": "invalid_model", + "param": None, + "code": "1500", + } + + self._run_hook_error_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + error_body, + status_code=400, + error=Exception("Bad Request"), + ) + span = self._get_single_span() + + self.assertEqual(span.status.status_code, StatusCode.ERROR) + self.assertEqual(span.status.description, "Invalid model: nonexistent-model") + self.assertSpanAttributes( + span, + { + "error.type": "invalid_model", + "mistral_ai.error.code": "1500", + "http.response.status_code": 400, + }, + ) + + # Exception event per OTEL exception semantic conventions + exc_events = [e for e in span.events if e.name == "exception"] + self.assertEqual( + len(exc_events), 2 + ) # one from record_exception, one from API error body + api_error_event = exc_events[1] + self.assertEqual(api_error_event.attributes["exception.type"], "invalid_model") + self.assertEqual( + api_error_event.attributes["exception.message"], + "Invalid model: nonexistent-model", + ) + + # -- Streaming response ---------------------------------------------------- + + def test_streaming_chat_completion_enriches_span(self): + """Streaming responses must set the same response attributes as non-streaming. + + Simulates a realistic SSE stream with multiple CompletionEvent chunks: + - chunk 1: role + first content delta + - chunk 2: more content + - chunk 3: finish_reason + usage + - sentinel: [DONE] + + After consuming the stream and closing, the span must contain + gen_ai.response.id, gen_ai.response.model, gen_ai.usage.*, + gen_ai.response.finish_reasons, and gen_ai.output.messages. + """ + request = ChatCompletionRequest( + model="mistral-large-latest", + temperature=0.7, + max_tokens=512, + messages=[ + SystemMessage(content="You are a helpful assistant."), + UserMessage(content="What is the best French cheese?"), + ], + ) + response_events = [ + CompletionEvent( + data=CompletionChunk( + id="cmpl-stream-001", + model="mistral-large-latest", + object="chat.completion.chunk", + created=1700000000, + choices=[ + CompletionResponseStreamChoice( + index=0, + delta=DeltaMessage(role="assistant", content="Camembert"), + finish_reason=None, + ), + ], + ), + ), + CompletionEvent( + data=CompletionChunk( + id="cmpl-stream-001", + model="mistral-large-latest", + object="chat.completion.chunk", + created=1700000000, + choices=[ + CompletionResponseStreamChoice( + index=0, + delta=DeltaMessage(content=" is a classic choice."), + finish_reason=None, + ), + ], + ), + ), + CompletionEvent( + data=CompletionChunk( + id="cmpl-stream-001", + model="mistral-large-latest", + object="chat.completion.chunk", + created=1700000000, + choices=[ + CompletionResponseStreamChoice( + index=0, + delta=DeltaMessage(content=""), + finish_reason="stop", + ), + ], + usage=UsageInfo( + prompt_tokens=20, completion_tokens=8, total_tokens=28 + ), + ), + ), + ] + + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response_events, + streaming=True, + ) + span = self._get_single_span() + + # Request-side attributes + self.assertEqual(span.name, "chat mistral-large-latest") + self.assertSpanAttributes( + span, + { + "gen_ai.operation.name": "chat", + "gen_ai.provider.name": "mistral_ai", + "gen_ai.request.model": "mistral-large-latest", + "gen_ai.request.temperature": 0.7, + "gen_ai.request.max_tokens": 512, + "gen_ai.response.id": "cmpl-stream-001", + "gen_ai.response.model": "mistral-large-latest", + "gen_ai.usage.input_tokens": 20, + "gen_ai.usage.output_tokens": 8, + "gen_ai.response.finish_reasons": ("stop",), + }, + ) + + # Output messages — accumulated from deltas + self.assertListEqual( + _parse_json_list(span.attributes["gen_ai.output.messages"]), + [ + { + "role": "assistant", + "parts": [ + { + "type": "text", + "content": "Camembert is a classic choice.", + } + ], + "finish_reason": "stop", + }, + ], + ) + + # -- create_function_result (client-side tool execution) ------------------- + + def test_create_function_result_span_attributes(self): + """create_function_result must emit an execute_tool span with all GenAI attributes.""" + + def get_weather(location: str) -> dict: + return {"temperature": "22C", "condition": "sunny"} + + function_call = FunctionCallEntry( + tool_call_id="tc-001", + name="get_weather", + arguments='{"location": "Paris"}', + id="fc-001", + ) + run_tool = RunFunction( + name="get_weather", + callable=get_weather, + tool=FunctionTool(function=Function(name="get_weather", parameters={})), + ) + + result = asyncio.run( + create_function_result(function_call, run_tool) + ) + self.assertEqual(result.tool_call_id, "tc-001") + + span = self._get_single_span() + + self.assertEqual(span.name, "execute_tool get_weather") + self.assertSpanAttributes( + span, + { + "gen_ai.operation.name": "execute_tool", + "gen_ai.provider.name": "mistral_ai", + "gen_ai.tool.name": "get_weather", + "gen_ai.tool.call.id": "fc-001", + "gen_ai.tool.call.arguments": '{"location": "Paris"}', + "gen_ai.tool.type": "function", + }, + ) + self.assertEqual( + json.loads(span.attributes["gen_ai.tool.call.result"]), + {"temperature": "22C", "condition": "sunny"}, + ) + + def test_create_function_result_error_span(self): + """When the tool raises, the span must record the error and retain identity attributes.""" + + def failing_tool(x: int) -> str: + raise ValueError("boom") + + function_call = FunctionCallEntry( + tool_call_id="tc-err", + name="failing_tool", + arguments='{"x": 1}', + id="fc-err", + ) + run_tool = RunFunction( + name="failing_tool", + callable=failing_tool, + tool=FunctionTool(function=Function(name="failing_tool", parameters={})), + ) + + asyncio.run( + create_function_result(function_call, run_tool, continue_on_fn_error=True) + ) + + span = self._get_single_span() + + self.assertSpanAttributes( + span, + { + "gen_ai.operation.name": "execute_tool", + "gen_ai.tool.name": "failing_tool", + "gen_ai.tool.call.id": "fc-err", + }, + ) + # Result should NOT be present (tool didn't succeed) + self.assertNotIn("gen_ai.tool.call.result", span.attributes) + # Error status must be recorded + self.assertEqual(span.status.status_code, StatusCode.ERROR) + # Exception event must be recorded + self.assertTrue( + any(e.name == "exception" for e in span.events), + "Expected an exception event on the span", + ) + + # -- Baggage propagation: gen_ai.conversation.id --------------------------- + + def test_conversation_id_from_baggage(self): + """When gen_ai.conversation.id is set in OTEL baggage, it must appear as a span attribute.""" + request = ChatCompletionRequest( + model="mistral-small-latest", + messages=[UserMessage(content="Hello")], + ) + response = ChatCompletionResponse( + id="cmpl-baggage-001", + object="chat.completion", + model="mistral-small-latest", + created=1700000010, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage(content="Hi!", tool_calls=None), + finish_reason="stop", + ), + ], + usage=UsageInfo(prompt_tokens=5, completion_tokens=2, total_tokens=7), + ) + + # Attach baggage to the current context + ctx = set_baggage("gen_ai.conversation.id", "conv-from-baggage-123") + token = context_api.attach(ctx) + try: + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response, + ) + finally: + context_api.detach(token) + + span = self._get_single_span() + self.assertEqual( + span.attributes["gen_ai.conversation.id"], "conv-from-baggage-123" + ) + + def test_no_conversation_id_without_baggage(self): + """When no baggage is set, gen_ai.conversation.id must NOT appear on a chat span.""" + request = ChatCompletionRequest( + model="mistral-small-latest", + messages=[UserMessage(content="Hello")], + ) + response = ChatCompletionResponse( + id="cmpl-nobag-001", + object="chat.completion", + model="mistral-small-latest", + created=1700000011, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage(content="Hi!", tool_calls=None), + finish_reason="stop", + ), + ], + usage=UsageInfo(prompt_tokens=5, completion_tokens=2, total_tokens=7), + ) + + self._run_hook_lifecycle( + "chat_completion_v1_chat_completions_post", + request, + response, + ) + + span = self._get_single_span() + self.assertNotIn("gen_ai.conversation.id", span.attributes) + + # -- Concurrency: interleaved requests on shared hook ---------------------- + + def test_concurrent_async_requests_get_correct_spans(self): + """Two concurrent async chat completions through a real Mistral client. + + Uses asyncio.gather to fire two requests simultaneously through the + SDK. A mock transport with an asyncio.Event gate guarantees both + before_request hooks run before either after_success, reproducing + the interleaving that corrupts self.request_span. + + Expected: each span carries its own request model AND response id. + """ + + # Gate ensures both requests have entered the transport (i.e. both + # before_request hooks have already run) before either returns. + gate = asyncio.Event() + arrived = 0 + + async def _mock_handler(request: httpx.Request) -> httpx.Response: + nonlocal arrived + arrived += 1 + if arrived < 2: + # First request: wait for the second to arrive. + await gate.wait() + else: + # Second request: both hooks have fired, unblock the first. + gate.set() + + body = json.loads(request.content) + model = body["model"] + resp = _dump( + ChatCompletionResponse( + id=f"cmpl-{model}", + object="chat.completion", + model=model, + created=1700000000, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage(content=f"Reply from {model}"), + finish_reason="stop", + ) + ], + usage=UsageInfo( + prompt_tokens=10, + completion_tokens=5, + total_tokens=15, + ), + ) + ) + return httpx.Response(200, json=resp) + + transport = httpx.MockTransport(_mock_handler) + async_client = httpx.AsyncClient(transport=transport) + + client = Mistral( + api_key="test-key", + async_client=async_client, + ) + + async def _run(): + return await asyncio.gather( + client.chat.complete_async( + model="mistral-large-latest", + messages=[{"role": "user", "content": "A"}], + ), + client.chat.complete_async( + model="mistral-small-latest", + messages=[{"role": "user", "content": "B"}], + ), + ) + + results = asyncio.get_event_loop().run_until_complete(_run()) + + # Both calls must succeed + self.assertEqual(len(results), 2) + + # --- Verify spans --- + spans = self._get_finished_spans() + spans_by_resp = {s.attributes.get("gen_ai.response.id"): s for s in spans} + + # Both spans must have a response.id + self.assertIn( + "cmpl-mistral-large-latest", + spans_by_resp, + "Span for large model must exist", + ) + self.assertIn( + "cmpl-mistral-small-latest", + spans_by_resp, + "Span for small model must exist", + ) + + # Each span's request model must match its response + self.assertEqual( + spans_by_resp["cmpl-mistral-large-latest"].attributes.get( + "gen_ai.request.model" + ), + "mistral-large-latest", + ) + self.assertEqual( + spans_by_resp["cmpl-mistral-small-latest"].attributes.get( + "gen_ai.request.model" + ), + "mistral-small-latest", + ) + + +class TestPerInstanceTracerProvider(unittest.TestCase): + """Tests for per-instance tracer_provider support via set_tracer_provider.""" + + def test_custom_provider_captures_spans(self): + """Spans go to the instance-specific exporter, not the global provider.""" + # Create a standalone provider with its own exporter + custom_exporter = InMemorySpanExporter() + custom_provider = TracerProvider() + custom_provider.add_span_processor(SimpleSpanProcessor(custom_exporter)) + + # Clear the global exporter to ensure spans don't land there + _EXPORTER.clear() + + # Set the custom provider on the hook directly (as set_tracer_provider does) + hook = TracingHook() + hook.tracer_provider = custom_provider + + hook_ctx = _make_hook_context("chat_completion") + + request_body = _dump( + ChatCompletionRequest( + model="mistral-small-latest", + messages=[UserMessage(content="hello")], + ) + ) + request = _make_httpx_request(request_body) + + result = hook.before_request(BeforeRequestContext(hook_ctx), request) + assert isinstance(result, httpx.Request) + + response_body = _dump( + ChatCompletionResponse( + id="custom-prov-1", + object="chat.completion", + model="mistral-small-latest", + created=1234567890, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage(content="hi"), + finish_reason="stop", + ) + ], + usage=UsageInfo(prompt_tokens=5, completion_tokens=3, total_tokens=8), + ) + ) + response = _make_httpx_response(response_body) + response.request = result + hook.after_success(AfterSuccessContext(hook_ctx), response) + + # Spans should be in the custom exporter + custom_spans = custom_exporter.get_finished_spans() + self.assertEqual(len(custom_spans), 1) + self.assertEqual(custom_spans[0].attributes.get("gen_ai.request.model"), "mistral-small-latest") + + # Global exporter should NOT have received the span + global_spans = [ + s for s in _EXPORTER.get_finished_spans() + if s.attributes.get("gen_ai.response.id") == "custom-prov-1" + ] + self.assertEqual(len(global_spans), 0) + + def test_fallback_to_global_provider(self): + """When tracer_provider is None (default), spans go to the global provider.""" + _EXPORTER.clear() + + hook = TracingHook() + # tracer_provider defaults to None — should use global provider + self.assertIsNone(hook.tracer_provider) + + hook_ctx = _make_hook_context("chat_completion") + + request_body = _dump( + ChatCompletionRequest( + model="mistral-small-latest", + messages=[UserMessage(content="fallback test")], + ) + ) + request = _make_httpx_request(request_body) + result = hook.before_request(BeforeRequestContext(hook_ctx), request) + assert isinstance(result, httpx.Request) + + response_body = _dump( + ChatCompletionResponse( + id="fallback-1", + object="chat.completion", + model="mistral-small-latest", + created=1234567890, + choices=[ + ChatCompletionChoice( + index=0, + message=AssistantMessage(content="response"), + finish_reason="stop", + ) + ], + usage=UsageInfo(prompt_tokens=5, completion_tokens=3, total_tokens=8), + ) + ) + response = _make_httpx_response(response_body) + response.request = result + hook.after_success(AfterSuccessContext(hook_ctx), response) + + # Spans should be in the global exporter + global_spans = [ + s for s in _EXPORTER.get_finished_spans() + if s.attributes.get("gen_ai.response.id") == "fallback-1" + ] + self.assertEqual(len(global_spans), 1) + + def test_set_tracer_provider_helper(self): + """set_tracer_provider(client, provider) sets the provider on the TracingHook.""" + from mistralai.extra.observability import set_tracer_provider + + custom_provider = TracerProvider() + client = Mistral(api_key="test-key") + set_tracer_provider(client, custom_provider) + + # Verify the TracingHook now has the custom provider + hooks = client.sdk_configuration.__dict__["_hooks"] + tracing_hooks = [h for h in hooks.before_request_hooks if isinstance(h, TracingHook)] + self.assertEqual(len(tracing_hooks), 1) + self.assertIs(tracing_hooks[0].tracer_provider, custom_provider) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/mistralai/extra/tests/test_streaming.py b/src/mistralai/extra/tests/test_streaming.py new file mode 100644 index 00000000..9f2ec557 --- /dev/null +++ b/src/mistralai/extra/tests/test_streaming.py @@ -0,0 +1,372 @@ +"""Tests for streaming SSE parsing and chunk accumulation. + +Unit tests for the pure functions in ``observability.streaming``, independent +of OTEL span management. +""" + +import json +import unittest + +from mistralai.client.models import ( + CompletionChunk, + CompletionResponseStreamChoice, + CompletionResponseStreamChoiceFinishReason, + DeltaMessage, + FunctionCall, + ToolCall, + UsageInfo, +) +from mistralai.extra.observability.streaming import ( + accumulate_chunks_to_response_dict, + parse_sse_chunks, +) + +_DEFAULT_ID = "id-1" +_DEFAULT_MODEL = "m" + + +def _single_choice_chunk( + id: str = _DEFAULT_ID, + model: str = _DEFAULT_MODEL, + role: str | None = None, + content: str | None = None, + tool_calls: list[ToolCall] | None = None, + finish_reason: CompletionResponseStreamChoiceFinishReason | None = None, + object: str | None = None, + created: int | None = None, + usage: UsageInfo | None = None, +) -> CompletionChunk: + return CompletionChunk( + id=id, + model=model, + choices=[ + CompletionResponseStreamChoice( + index=0, + delta=DeltaMessage(role=role, content=content, tool_calls=tool_calls), + finish_reason=finish_reason, + ) + ], + object=object, + created=created, + usage=usage, + ) + + +def _dump(model) -> dict: + return model.model_dump(mode="json", by_alias=True) + + +def _to_sse(chunks: list[CompletionChunk], done: bool = True) -> bytes: + """Build SSE bytes from CompletionChunk models.""" + lines = [f"data: {json.dumps(_dump(c))}" for c in chunks] + if done: + lines.append("data: [DONE]") + return ("\n\n".join(lines) + "\n\n").encode() + + +class TestParseSseChunks(unittest.TestCase): + def test_parses_valid_chunks(self): + chunks = [ + _single_choice_chunk(content="hello"), + _single_choice_chunk(content=" world", finish_reason="stop"), + ] + result = parse_sse_chunks(_to_sse(chunks)) + self.assertEqual(result, chunks) + + def test_skips_done_sentinel(self): + chunk = _single_choice_chunk(content="hi", finish_reason="stop") + result = parse_sse_chunks(_to_sse([chunk], done=True)) + self.assertEqual(result, [chunk]) + + def test_skips_invalid_json(self): + sse = b"data: {not valid json}\n\ndata: [DONE]\n\n" + result = parse_sse_chunks(sse) + self.assertEqual(result, []) + + def test_skips_non_data_lines(self): + chunk = _single_choice_chunk(content="hi", finish_reason="stop") + sse = b"event: message\n\n" + _to_sse([chunk]) + result = parse_sse_chunks(sse) + self.assertEqual(result, [chunk]) + + def test_empty_bytes(self): + self.assertEqual(parse_sse_chunks(b""), []) + + +class TestAccumulateChunks(unittest.TestCase): + def test_simple_content_concatenation(self): + chunks = [ + _single_choice_chunk(role="assistant", content="Hello"), + _single_choice_chunk(content=" world"), + _single_choice_chunk( + content="", + finish_reason="stop", + usage=UsageInfo(prompt_tokens=10, completion_tokens=5, total_tokens=15), + ), + ] + result = accumulate_chunks_to_response_dict(chunks) + + self.assertDictEqual( + result, + { + "id": _DEFAULT_ID, + "model": _DEFAULT_MODEL, + "choices": [ + { + "message": {"role": "assistant", "content": "Hello world"}, + "finish_reason": "stop", + } + ], + "usage": { + "prompt_tokens": 10, + "completion_tokens": 5, + "total_tokens": 15, + }, + }, + ) + + def test_tool_call_argument_accumulation(self): + """Tool call arguments fragmented across multiple chunks.""" + chunks = [ + _single_choice_chunk( + role="assistant", + content="", + tool_calls=[ + ToolCall( + id="tc-1", + index=0, + function=FunctionCall(name="get_weather", arguments=""), + ) + ], + ), + _single_choice_chunk( + tool_calls=[ + ToolCall( + index=0, function=FunctionCall(name="", arguments='{"location"') + ) + ], + ), + _single_choice_chunk( + tool_calls=[ + ToolCall( + index=0, function=FunctionCall(name="", arguments=': "Paris"}') + ) + ], + finish_reason="tool_calls", + ), + ] + result = accumulate_chunks_to_response_dict(chunks) + + self.assertDictEqual( + result, + { + "id": _DEFAULT_ID, + "model": _DEFAULT_MODEL, + "choices": [ + { + "message": { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "id": "tc-1", + "function": { + "name": "get_weather", + "arguments": '{"location": "Paris"}', + }, + } + ], + }, + "finish_reason": "tool_calls", + } + ], + }, + ) + + def test_multiple_tool_calls_on_same_choice(self): + """Two tool calls on the same choice, different indexes.""" + chunks = [ + _single_choice_chunk( + role="assistant", + tool_calls=[ + ToolCall( + id="tc-1", + index=0, + function=FunctionCall( + name="get_weather", arguments='{"location": "Paris"}' + ), + ), + ToolCall( + id="tc-2", + index=1, + function=FunctionCall( + name="get_time", arguments='{"timezone": "CET"}' + ), + ), + ], + finish_reason="tool_calls", + ), + ] + result = accumulate_chunks_to_response_dict(chunks) + + self.assertDictEqual( + result, + { + "id": _DEFAULT_ID, + "model": _DEFAULT_MODEL, + "choices": [ + { + "message": { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "id": "tc-1", + "function": { + "name": "get_weather", + "arguments": '{"location": "Paris"}', + }, + }, + { + "id": "tc-2", + "function": { + "name": "get_time", + "arguments": '{"timezone": "CET"}', + }, + }, + ], + }, + "finish_reason": "tool_calls", + } + ], + }, + ) + + def test_multiple_choices(self): + """n > 1: parallel choice accumulation.""" + chunks = [ + CompletionChunk( + id=_DEFAULT_ID, + model=_DEFAULT_MODEL, + choices=[ + CompletionResponseStreamChoice( + index=0, + delta=DeltaMessage(role="assistant", content="Answer A"), + finish_reason=None, + ), + CompletionResponseStreamChoice( + index=1, + delta=DeltaMessage(role="assistant", content="Answer B"), + finish_reason=None, + ), + ], + ), + CompletionChunk( + id=_DEFAULT_ID, + model=_DEFAULT_MODEL, + choices=[ + CompletionResponseStreamChoice( + index=0, delta=DeltaMessage(content=""), finish_reason="stop" + ), + CompletionResponseStreamChoice( + index=1, delta=DeltaMessage(content=""), finish_reason="stop" + ), + ], + ), + ] + result = accumulate_chunks_to_response_dict(chunks) + + self.assertDictEqual( + result, + { + "id": _DEFAULT_ID, + "model": _DEFAULT_MODEL, + "choices": [ + { + "message": {"role": "assistant", "content": "Answer A"}, + "finish_reason": "stop", + }, + { + "message": {"role": "assistant", "content": "Answer B"}, + "finish_reason": "stop", + }, + ], + }, + ) + + def test_missing_usage(self): + """Interrupted stream — no usage in any chunk.""" + chunks = [ + _single_choice_chunk(role="assistant", content="partial"), + ] + result = accumulate_chunks_to_response_dict(chunks) + + self.assertDictEqual( + result, + { + "id": _DEFAULT_ID, + "model": _DEFAULT_MODEL, + "choices": [ + { + "message": {"role": "assistant", "content": "partial"}, + "finish_reason": "", + } + ], + }, + ) + + def test_function_name_accumulation(self): + """Function name split across chunks.""" + chunks = [ + _single_choice_chunk( + tool_calls=[ + ToolCall( + id="tc-1", + index=0, + function=FunctionCall(name="get_", arguments=""), + ) + ], + ), + _single_choice_chunk( + tool_calls=[ + ToolCall( + index=0, + function=FunctionCall( + name="weather", arguments='{"loc": "Paris"}' + ), + ) + ], + finish_reason="tool_calls", + ), + ] + result = accumulate_chunks_to_response_dict(chunks) + + self.assertDictEqual( + result, + { + "id": _DEFAULT_ID, + "model": _DEFAULT_MODEL, + "choices": [ + { + "message": { + "role": "assistant", + "content": "", + "tool_calls": [ + { + "id": "tc-1", + "function": { + "name": "get_weather", + "arguments": '{"loc": "Paris"}', + }, + } + ], + }, + "finish_reason": "tool_calls", + } + ], + }, + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/src/mistralai/extra/tests/test_struct_chat.py b/src/mistralai/extra/tests/test_struct_chat.py index dd529ba5..7b79bf77 100644 --- a/src/mistralai/extra/tests/test_struct_chat.py +++ b/src/mistralai/extra/tests/test_struct_chat.py @@ -5,7 +5,7 @@ ParsedChatCompletionChoice, ParsedAssistantMessage, ) -from ...models import ( +from mistralai.client.models import ( ChatCompletionResponse, UsageInfo, ChatCompletionChoice, diff --git a/src/mistralai/extra/tests/test_tools.py b/src/mistralai/extra/tests/test_tools.py new file mode 100644 index 00000000..46d81ea0 --- /dev/null +++ b/src/mistralai/extra/tests/test_tools.py @@ -0,0 +1,288 @@ +"""Unit tests for create_tool_call parameter description propagation. + +Validates that parameter descriptions from docstrings and Annotated[T, Field(...)] +annotations correctly appear in the JSON schema produced by create_tool_call(). + +This is a regression test for a Pydantic v2 bug where post-construction mutation +of FieldInfo.description is silently ignored by model_json_schema(). + +Fixtures are defined inline so each test is self-contained. +""" + +import unittest +from typing import Annotated, Optional + +from pydantic import Field + +from ..run.tools import create_tool_call + + +def _props(func): + """Shorthand: create a tool call and return its parameter properties.""" + return create_tool_call(func).function.parameters["properties"] + + +class TestCreateToolCallDescriptions(unittest.TestCase): + """Descriptions from docstrings must appear in the generated JSON schema.""" + + # -- Docstring descriptions (Path 3: no existing FieldInfo) ---------------- + + def test_required_param_gets_docstring_description(self): + def search(query: str) -> str: + """Search the web. + + Args: + query: The search query to execute. + """ + return "" + + props = _props(search) + self.assertEqual(props["query"]["description"], "The search query to execute.") + + def test_optional_param_with_default_gets_docstring_description(self): + def search(query: str, limit: int = 10) -> str: + """Search the web. + + Args: + query: The search query. + limit: Maximum number of results. + """ + return "" + + props = _props(search) + self.assertEqual(props["limit"]["description"], "Maximum number of results.") + self.assertEqual(props["limit"]["default"], 10) + + def test_multiple_params_all_get_descriptions(self): + def fetch(url: str, timeout: int = 30, verbose: bool = False) -> str: + """Fetch a URL. + + Args: + url: The URL to fetch. + timeout: Request timeout in seconds. + verbose: Enable verbose logging. + """ + return "" + + props = _props(fetch) + self.assertEqual(props["url"]["description"], "The URL to fetch.") + self.assertEqual(props["timeout"]["description"], "Request timeout in seconds.") + self.assertEqual(props["verbose"]["description"], "Enable verbose logging.") + + # -- Annotated + docstring (Path 2: existing FieldInfo) -------------------- + + def test_annotated_field_description_overridden_by_docstring(self): + def search(query: Annotated[str, Field(description="original")]) -> str: + """Search. + + Args: + query: From docstring. + """ + return "" + + props = _props(search) + self.assertEqual(props["query"]["description"], "From docstring.") + + def test_annotated_field_description_preserved_when_no_docstring_entry(self): + """When the docstring has no Args entry for a param, the Field(description=...) + from Annotated must be preserved, not clobbered with empty string.""" + + def search(query: Annotated[str, Field(description="keep me")]) -> str: + """Search the web.""" + return "" + + props = _props(search) + self.assertEqual(props["query"]["description"], "keep me") + + def test_annotated_field_constraints_preserved_with_docstring(self): + def count(n: Annotated[int, Field(ge=0, le=100)]) -> str: + """Count items. + + Args: + n: Number of items. + """ + return "" + + props = _props(count) + self.assertEqual(props["n"]["description"], "Number of items.") + self.assertEqual(props["n"]["minimum"], 0) + self.assertEqual(props["n"]["maximum"], 100) + + def test_annotated_field_constraints_preserved_without_docstring_entry(self): + def count( + n: Annotated[int, Field(ge=0, le=100, description="original")], + ) -> str: + """Count items.""" + return "" + + props = _props(count) + self.assertEqual(props["n"]["description"], "original") + self.assertEqual(props["n"]["minimum"], 0) + self.assertEqual(props["n"]["maximum"], 100) + + # -- Field as default value (Path 1: isinstance(default, FieldInfo)) ------- + + def test_field_default_value_with_docstring(self): + def search(query: str, limit: int = Field(default=10, ge=1)) -> str: + """Search. + + Args: + query: The query. + limit: Max results. + """ + return "" + + props = _props(search) + self.assertEqual(props["limit"]["description"], "Max results.") + self.assertEqual(props["limit"]["default"], 10) + self.assertEqual(props["limit"]["minimum"], 1) + + def test_field_default_value_without_docstring_entry(self): + """Field(default=..., ge=...) without a docstring entry should preserve + constraints and not inject a spurious empty description.""" + + def search(query: str, limit: int = Field(default=10, ge=1)) -> str: + """Search. + + Args: + query: The query. + """ + return "" + + props = _props(search) + self.assertEqual(props["limit"]["default"], 10) + self.assertEqual(props["limit"]["minimum"], 1) + + # -- Edge cases ------------------------------------------------------------ + + def test_undocumented_param_has_no_description_key(self): + """Params without any docstring entry or Field description should not + have a description key in the schema (not even an empty string).""" + + def search(query: str) -> str: + """Search the web.""" + return "" + + props = _props(search) + self.assertIn("query", props) + self.assertNotIn("description", props["query"]) + + def test_required_params_in_required_list(self): + def search(query: str, limit: int = 10) -> str: + """Search. + + Args: + query: The query. + limit: Max results. + """ + return "" + + tool = create_tool_call(search) + required = tool.function.parameters.get("required", []) + self.assertIn("query", required) + self.assertNotIn("limit", required) + + def test_optional_type_annotation(self): + def search(query: str, tag: Optional[str] = None) -> str: + """Search. + + Args: + query: The query. + tag: Optional tag filter. + """ + return "" + + props = _props(search) + self.assertEqual(props["tag"]["description"], "Optional tag filter.") + + def test_list_type_annotation(self): + def search(queries: list[str]) -> str: + """Batch search. + + Args: + queries: List of search queries. + """ + return "" + + props = _props(search) + self.assertEqual(props["queries"]["description"], "List of search queries.") + + def test_function_level_description(self): + def search(query: str) -> str: + """Search the web for information. + + Args: + query: The search query. + """ + return "" + + tool = create_tool_call(search) + self.assertEqual(tool.function.description, "Search the web for information.") + + def test_no_docstring_at_all(self): + def search(query: str) -> str: + return "" + + tool = create_tool_call(search) + self.assertIsNotNone(tool.function.parameters) + self.assertIn("query", tool.function.parameters["properties"]) + + def test_shared_field_info_no_cross_contamination(self): + """Two functions sharing the same FieldInfo instance via Annotated must + not cross-contaminate descriptions.""" + + shared_field = Field(ge=0) + + def func_a(n: Annotated[int, shared_field]) -> str: + """A. + + Args: + n: Description A. + """ + return "" + + def func_b(n: Annotated[int, shared_field]) -> str: + """B. + + Args: + n: Description B. + """ + return "" + + props_a = _props(func_a) + props_b = _props(func_b) + self.assertEqual(props_a["n"]["description"], "Description A.") + self.assertEqual(props_b["n"]["description"], "Description B.") + # Calling func_a again after func_b must still produce "Description A." + props_a_again = _props(func_a) + self.assertEqual(props_a_again["n"]["description"], "Description A.") + # Original shared instance must be unmodified + self.assertIsNone(shared_field.description) + + +class TestCreateToolCallRegressionPydanticV2(unittest.TestCase): + """Regression: post-construction FieldInfo.description mutation is broken in Pydantic v2.""" + + def test_description_appears_in_schema_not_silently_dropped(self): + """The original bug: docstring descriptions were silently dropped from the + JSON schema because FieldInfo.description was mutated after construction, + which Pydantic v2 ignores in model_json_schema().""" + + def get_weather(city: str, units: str = "celsius") -> str: + """Get weather for a city. + + Args: + city: The city name. + units: Temperature units. + """ + return "" + + tool = create_tool_call(get_weather) + props = tool.function.parameters["properties"] + self.assertEqual(props["city"]["description"], "The city name.") + self.assertEqual(props["units"]["description"], "Temperature units.") + self.assertEqual(props["units"]["default"], "celsius") + + +if __name__ == "__main__": + unittest.main() diff --git a/src/mistralai/extra/tests/test_traceparent_hook.py b/src/mistralai/extra/tests/test_traceparent_hook.py new file mode 100644 index 00000000..8202f3d6 --- /dev/null +++ b/src/mistralai/extra/tests/test_traceparent_hook.py @@ -0,0 +1,112 @@ +import re +import unittest +from unittest.mock import MagicMock + +import httpx +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import SimpleSpanProcessor +from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter +from opentelemetry.sdk.trace.sampling import ALWAYS_OFF + +from mistralai.client._hooks.traceparent import TraceparentInjectionHook +from mistralai.client._hooks.types import BeforeRequestContext, HookContext + + +TRACEPARENT_RE = re.compile(r"^00-[0-9a-f]{32}-[0-9a-f]{16}-01$") + +_EXECUTE_OP_ID = "execute_workflow_v1_workflows__workflow_identifier__execute_post" +_EXECUTE_REG_OP_ID = "execute_workflow_registration_v1_workflows_registrations__workflow_registration_id__execute_post" +_OTHER_OP_ID = "list_executions_v1_workflows__workflow_identifier__executions_get" + + +def _make_hook_ctx(operation_id: str = _EXECUTE_OP_ID) -> BeforeRequestContext: + ctx = HookContext( + config=MagicMock(), + base_url="https://api.mistral.ai", + operation_id=operation_id, + oauth2_scopes=None, + security_source=None, + ) + return BeforeRequestContext(ctx) + + +def _make_request(path: str, traceparent: str | None = None) -> httpx.Request: + headers = {} + if traceparent is not None: + headers["traceparent"] = traceparent + return httpx.Request("POST", f"https://api.mistral.ai{path}", headers=headers) + + +class TestTraceparentInjectionHook(unittest.TestCase): + def setUp(self): + self.hook = TraceparentInjectionHook() + + # --- non-execute operations must NOT be touched --- + + def test_other_operation_is_unchanged(self): + req = _make_request("/v1/workflows/my-wf/executions") + result = self.hook.before_request(_make_hook_ctx(_OTHER_OP_ID), req) + assert isinstance(result, httpx.Request) + self.assertNotIn("traceparent", result.headers) + + # --- execute operations: header injected --- + + def test_execute_gets_sampled_traceparent(self): + req = _make_request("/v1/workflows/my-wf/execute") + result = self.hook.before_request(_make_hook_ctx(_EXECUTE_OP_ID), req) + assert isinstance(result, httpx.Request) + self.assertIn("traceparent", result.headers) + self.assertRegex(result.headers["traceparent"], TRACEPARENT_RE) + + def test_execute_registration_gets_sampled_traceparent(self): + req = _make_request("/v1/workflows/registrations/reg-id/execute") + result = self.hook.before_request(_make_hook_ctx(_EXECUTE_REG_OP_ID), req) + assert isinstance(result, httpx.Request) + self.assertIn("traceparent", result.headers) + self.assertRegex(result.headers["traceparent"], TRACEPARENT_RE) + + def test_explicit_traceparent_is_not_overwritten(self): + explicit = "00-aabbccddeeff00112233445566778899-0102030405060708-01" + req = _make_request("/v1/workflows/my-wf/execute", traceparent=explicit) + result = self.hook.before_request(_make_hook_ctx(_EXECUTE_OP_ID), req) + assert isinstance(result, httpx.Request) + self.assertEqual(result.headers["traceparent"], explicit) + + # --- OTEL context propagation --- + + def test_propagates_sampled_active_span(self): + exporter = InMemorySpanExporter() + provider = TracerProvider() + provider.add_span_processor(SimpleSpanProcessor(exporter)) + tracer = provider.get_tracer("test") + + with tracer.start_as_current_span("parent") as span: + req = _make_request("/v1/workflows/my-wf/execute") + result = self.hook.before_request(_make_hook_ctx(_EXECUTE_OP_ID), req) + + assert isinstance(result, httpx.Request) + injected = result.headers["traceparent"] + self.assertTrue(injected.endswith("-01")) + trace_id_hex = f"{span.get_span_context().trace_id:032x}" + self.assertIn(trace_id_hex, injected) + + def test_generates_fresh_traceparent_when_no_active_span(self): + req = _make_request("/v1/workflows/my-wf/execute") + result = self.hook.before_request(_make_hook_ctx(_EXECUTE_OP_ID), req) + assert isinstance(result, httpx.Request) + self.assertRegex(result.headers["traceparent"], TRACEPARENT_RE) + + def test_generates_fresh_traceparent_when_span_is_unsampled(self): + provider = TracerProvider(sampler=ALWAYS_OFF) + tracer = provider.get_tracer("test") + + with tracer.start_as_current_span("unsampled-parent"): + req = _make_request("/v1/workflows/my-wf/execute") + result = self.hook.before_request(_make_hook_ctx(_EXECUTE_OP_ID), req) + + assert isinstance(result, httpx.Request) + injected = result.headers["traceparent"] + self.assertTrue(injected.endswith("-01"), f"Expected sampled, got: {injected}") + +if __name__ == "__main__": + unittest.main() diff --git a/src/mistralai/extra/tests/test_utils.py b/src/mistralai/extra/tests/test_utils.py index 41fa53e3..a071b3ab 100644 --- a/src/mistralai/extra/tests/test_utils.py +++ b/src/mistralai/extra/tests/test_utils.py @@ -3,10 +3,7 @@ response_format_from_pydantic_model, rec_strict_json_schema, ) -from pydantic import BaseModel, ValidationError - -from ...models import ResponseFormat, JSONSchema -from ...types.basemodel import Unset +from pydantic import BaseModel, Field, ValidationError import unittest @@ -55,15 +52,14 @@ class MathDemonstration(BaseModel): mathdemo_strict_schema["$defs"]["Explanation"]["additionalProperties"] = False # type: ignore mathdemo_strict_schema["additionalProperties"] = False -mathdemo_response_format = ResponseFormat( - type="json_schema", - json_schema=JSONSchema( - name="MathDemonstration", - schema_definition=mathdemo_strict_schema, - description=Unset(), - strict=True, - ), -) +mathdemo_response_format = { + "type": "json_schema", + "json_schema": { + "name": "MathDemonstration", + "schema": mathdemo_strict_schema, + "strict": True, + }, +} class TestResponseFormat(unittest.TestCase): @@ -149,11 +145,90 @@ def test_response_format_from_pydantic_model(self): ) def test_rec_strict_json_schema(self): - invalid_schema = mathdemo_schema | {"wrong_value": 1} self.assertEqual( rec_strict_json_schema(mathdemo_schema), mathdemo_strict_schema ) + def test_rec_strict_json_schema_with_numeric_constraints(self): + """ + Test that rec_strict_json_schema handles JSON Schema constraint keywords + that have numeric values (e.g., minLength, maxLength, minItems, maxItems). + + This is a regression test for issue #300 where Pydantic models with + constraint keywords like min_length would cause a ValueError. + """ + # Schema with numeric constraint values (minItems, maxItems, minimum, etc.) + schema_with_constraints = { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": {"type": "integer"}, + "minItems": 1, + "maxItems": 10, + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100, + }, + "count": { + "type": "number", + "minimum": 0, + "maximum": 1000, + "multipleOf": 0.5, # float value + }, + }, + "required": ["items", "name"], + } + + # Should not raise ValueError - integers and floats are valid terminal values + result = rec_strict_json_schema(schema_with_constraints) + + # Check that additionalProperties was added + self.assertEqual(result["additionalProperties"], False) + # Check that numeric constraints are preserved + self.assertEqual(result["properties"]["items"]["minItems"], 1) + self.assertEqual(result["properties"]["items"]["maxItems"], 10) + self.assertEqual(result["properties"]["name"]["minLength"], 1) + self.assertEqual(result["properties"]["count"]["multipleOf"], 0.5) + + def test_response_format_with_constrained_pydantic_model(self): + """ + Test that response_format_from_pydantic_model works with Pydantic models + that use constraint keywords like min_length. + + This is a regression test for issue #300. + """ + + class ModelWithConstraints(BaseModel): + some_list: list[int] = Field( + default_factory=list, + description="A list of integers", + min_length=1, + ) + name: str = Field( + description="A name", + min_length=1, + max_length=100, + ) + + # Should not raise ValueError + result = response_format_from_pydantic_model(ModelWithConstraints) + + # Verify it returns a valid response format dict + self.assertIsInstance(result, dict) + self.assertEqual(result.get("type"), "json_schema") + self.assertIsNotNone(result.get("json_schema")) + + def test_rec_strict_json_schema_with_invalid_type(self): + """Test that rec_strict_json_schema raises ValueError for truly invalid types.""" + # A custom object that is not a valid JSON schema node type + class CustomObject: + pass + + invalid_schema = {"invalid": CustomObject()} + with self.assertRaises(ValueError): rec_strict_json_schema(invalid_schema) diff --git a/src/mistralai/extra/tests/test_workflow_encoding.py b/src/mistralai/extra/tests/test_workflow_encoding.py new file mode 100644 index 00000000..3703012b --- /dev/null +++ b/src/mistralai/extra/tests/test_workflow_encoding.py @@ -0,0 +1,134 @@ +"""Tests for workflow encoding configuration lifecycle.""" + +import gc + +import pytest +from pydantic import SecretStr + +from mistralai.client import Mistral +from mistralai.client._hooks.workflow_encoding_hook import ( + _workflow_configs, + _ENCODING_CONFIG_ID_ATTR, + configure_workflow_encoding, +) +from mistralai.extra.workflows import ( + WorkflowEncodingConfig, + PayloadEncryptionConfig, + PayloadEncryptionMode, +) + + +@pytest.fixture +def encryption_config() -> WorkflowEncodingConfig: + """Create a test encryption config.""" + return WorkflowEncodingConfig( + payload_encryption=PayloadEncryptionConfig( + mode=PayloadEncryptionMode.FULL, + main_key=SecretStr("0" * 64), # 256-bit key in hex + ) + ) + + +def test_payload_encoder_cleanup_on_client_gc(encryption_config: WorkflowEncodingConfig): + """Test that PayloadEncoder is cleaned up when client is garbage collected.""" + initial_config_count = len(_workflow_configs) + + # Create client and configure encoding + client = Mistral(api_key="test-key") + configure_workflow_encoding( + encryption_config, + namespace="test-namespace", + sdk_config=client.sdk_configuration, + ) + + # Verify config was added + config_id = getattr(client.sdk_configuration, _ENCODING_CONFIG_ID_ATTR) + assert config_id is not None + assert config_id in _workflow_configs + assert len(_workflow_configs) == initial_config_count + 1 + + # Delete client and force garbage collection + del client + gc.collect() + + # Verify config was cleaned up + assert config_id not in _workflow_configs + assert len(_workflow_configs) == initial_config_count + + +def test_multiple_clients_independent_configs(encryption_config: WorkflowEncodingConfig): + """Test that multiple clients have independent configs.""" + initial_config_count = len(_workflow_configs) + + # Create two clients with different namespaces + client1 = Mistral(api_key="test-key-1") + client2 = Mistral(api_key="test-key-2") + + configure_workflow_encoding( + encryption_config, + namespace="namespace-1", + sdk_config=client1.sdk_configuration, + ) + configure_workflow_encoding( + encryption_config, + namespace="namespace-2", + sdk_config=client2.sdk_configuration, + ) + + # Verify both configs exist + config_id1 = getattr(client1.sdk_configuration, _ENCODING_CONFIG_ID_ATTR) + config_id2 = getattr(client2.sdk_configuration, _ENCODING_CONFIG_ID_ATTR) + assert config_id1 != config_id2 + assert len(_workflow_configs) == initial_config_count + 2 + + # Verify namespaces are independent + assert _workflow_configs[config_id1].namespace == "namespace-1" + assert _workflow_configs[config_id2].namespace == "namespace-2" + + # Delete first client + del client1 + gc.collect() + + # First config should be cleaned up, second should remain + assert config_id1 not in _workflow_configs + assert config_id2 in _workflow_configs + assert len(_workflow_configs) == initial_config_count + 1 + + # Delete second client + del client2 + gc.collect() + + # Both configs should be cleaned up + assert config_id2 not in _workflow_configs + assert len(_workflow_configs) == initial_config_count + + +def test_reconfigure_same_client(encryption_config: WorkflowEncodingConfig): + """Test that reconfiguring the same client updates the config.""" + client = Mistral(api_key="test-key") + + # Initial configuration + configure_workflow_encoding( + encryption_config, + namespace="namespace-v1", + sdk_config=client.sdk_configuration, + ) + + config_id = getattr(client.sdk_configuration, _ENCODING_CONFIG_ID_ATTR) + assert _workflow_configs[config_id].namespace == "namespace-v1" + + # Reconfigure with different namespace + configure_workflow_encoding( + encryption_config, + namespace="namespace-v2", + sdk_config=client.sdk_configuration, + ) + + # Should use same config_id but updated namespace + assert getattr(client.sdk_configuration, _ENCODING_CONFIG_ID_ATTR) == config_id + assert _workflow_configs[config_id].namespace == "namespace-v2" + + # Cleanup + del client + gc.collect() + assert config_id not in _workflow_configs diff --git a/src/mistralai/extra/utils/_pydantic_helper.py b/src/mistralai/extra/utils/_pydantic_helper.py index f042c394..7273af12 100644 --- a/src/mistralai/extra/utils/_pydantic_helper.py +++ b/src/mistralai/extra/utils/_pydantic_helper.py @@ -6,7 +6,9 @@ def rec_strict_json_schema(schema_node: Any) -> Any: Recursively set the additionalProperties property to False for all objects in the JSON Schema. This makes the JSON Schema strict (i.e. no additional properties are allowed). """ - if isinstance(schema_node, (str, bool)) or schema_node is None: + # Include int and float as terminal types to handle JSON Schema constraint keywords + # like minLength, maxLength, minItems, maxItems, minimum, maximum, etc. + if isinstance(schema_node, (str, bool, int, float)) or schema_node is None: return schema_node if isinstance(schema_node, dict): if "type" in schema_node and schema_node["type"] == "object": diff --git a/src/mistralai/extra/utils/response_format.py b/src/mistralai/extra/utils/response_format.py index 67e15912..3600156b 100644 --- a/src/mistralai/extra/utils/response_format.py +++ b/src/mistralai/extra/utils/response_format.py @@ -1,24 +1,37 @@ +from typing import Any, TypeVar, cast + from pydantic import BaseModel -from typing import TypeVar, Any, Type, Dict -from ...models import JSONSchema, ResponseFormat +from mistralai.client.models import ResponseFormatTypedDict from ._pydantic_helper import rec_strict_json_schema CustomPydanticModel = TypeVar("CustomPydanticModel", bound=BaseModel) def response_format_from_pydantic_model( - model: Type[CustomPydanticModel], -) -> ResponseFormat: - """Generate a strict JSON schema from a pydantic model.""" + model: type[CustomPydanticModel], +) -> ResponseFormatTypedDict: + """Generate a strict JSON schema response format from a pydantic model. + + Returns a TypedDict compatible with both the main SDK's and Azure SDK's + ResponseFormat / ResponseFormatTypedDict. + """ model_schema = rec_strict_json_schema(model.model_json_schema()) - json_schema = JSONSchema.model_validate( - {"name": model.__name__, "schema": model_schema, "strict": True} + return cast( + ResponseFormatTypedDict, + { + "type": "json_schema", + "json_schema": { + "name": model.__name__, + "schema": model_schema, + "strict": True, + }, + }, ) - return ResponseFormat(type="json_schema", json_schema=json_schema) def pydantic_model_from_json( - json_data: Dict[str, Any], pydantic_model: Type[CustomPydanticModel] + json_data: dict[str, Any], + pydantic_model: type[CustomPydanticModel], ) -> CustomPydanticModel: """Parse a JSON schema into a pydantic model.""" return pydantic_model.model_validate(json_data) diff --git a/src/mistralai/extra/workflows/__init__.py b/src/mistralai/extra/workflows/__init__.py new file mode 100644 index 00000000..f26edf4e --- /dev/null +++ b/src/mistralai/extra/workflows/__init__.py @@ -0,0 +1,39 @@ +from .connector_auth import ( + ConnectorAuthTaskState, + execute_with_connector_auth_async, +) +from .connector_slot import ( + ConnectorBindings, + ConnectorExtension, + ConnectorSlot, + WorkflowExtensions, +) +from .encoding import ( + WorkflowEncodingConfig, + PayloadOffloadingConfig, + PayloadEncryptionConfig, + PayloadEncryptionMode, + BlobStorageConfig, + StorageProvider, + EncryptedStrField, + configure_workflow_encoding, + generate_two_part_id, +) + +__all__ = [ + "ConnectorAuthTaskState", + "ConnectorBindings", + "ConnectorExtension", + "ConnectorSlot", + "WorkflowExtensions", + "execute_with_connector_auth_async", + "WorkflowEncodingConfig", + "PayloadOffloadingConfig", + "PayloadEncryptionConfig", + "PayloadEncryptionMode", + "BlobStorageConfig", + "StorageProvider", + "EncryptedStrField", + "configure_workflow_encoding", + "generate_two_part_id", +] diff --git a/src/mistralai/extra/workflows/connector_auth.py b/src/mistralai/extra/workflows/connector_auth.py new file mode 100644 index 00000000..94fd40ad --- /dev/null +++ b/src/mistralai/extra/workflows/connector_auth.py @@ -0,0 +1,262 @@ +"""Helper for executing workflows that require connector OAuth authentication. + +When a workflow uses connectors that need OAuth, it emits ``connector-auth`` +custom task events. This module provides a high-level async function that +automates the handshake: + +1. Start the workflow execution. +2. Stream events, watching for ``connector-auth`` custom task events. +3. When a ``waiting_for_auth`` event arrives, invoke a user-supplied callback. +4. The interceptor polls for credentials server-side and resumes automatically. +5. Return the final execution result once the workflow completes. + +Example:: + + from mistralai import Mistral + from mistralai.extra.workflows import ( + ConnectorAuthTaskState, + ConnectorSlot, + execute_with_connector_auth_async, + ) + + async def prompt_user(state: ConnectorAuthTaskState) -> None: + print(f"Please authenticate: {state.auth_url}") + + gmail = ConnectorSlot(connector_name="gmail") + + client = Mistral(api_key="...") + result = await execute_with_connector_auth_async( + client, + workflow_identifier="my-workflow", + input_data={"query": "summarize my emails"}, + on_auth_required=prompt_user, + connectors=[gmail], + ) +""" + +from __future__ import annotations + +import asyncio +import logging +from typing import ( + TYPE_CHECKING, + Any, + Awaitable, + Callable, + Dict, + Optional, + Sequence, +) + +import httpx +from pydantic import BaseModel + +from mistralai.client.models import ( + CustomTaskStartedResponse, + WorkflowExecutionCanceledResponse, + WorkflowExecutionCompletedResponse, + WorkflowExecutionFailedResponse, + WorkflowExecutionResponse, +) + +from .connector_slot import ConnectorSlot, WorkflowExtensions + +if TYPE_CHECKING: + from mistralai.client.sdk import Mistral + +logger = logging.getLogger(__name__) + +_TERMINAL_EVENT_TYPES = ( + WorkflowExecutionCompletedResponse, + WorkflowExecutionFailedResponse, + WorkflowExecutionCanceledResponse, +) + +_MAX_RECONNECT_ATTEMPTS = 10 + + +class ConnectorAuthTaskState(BaseModel): + """State emitted by a ``connector_auth`` custom task when it needs OAuth. + + Attributes: + connector_name: Identifier of the connector requiring authentication. + connector_id: Server-side connector ID. + credentials_name: Optional named credential set used for this connector. + auth_url: URL the user should visit to complete authentication. + message: Optional human-readable context about the auth request. + """ + + connector_name: str + connector_id: str + credentials_name: Optional[str] = None + auth_url: Optional[str] = None + message: Optional[str] = None + + +async def execute_with_connector_auth_async( + client: Mistral, + workflow_identifier: str, + input_data: Any = None, + *, + on_auth_required: Optional[ + Callable[[ConnectorAuthTaskState], Awaitable[None]] + ] = None, + execution_id: Optional[str] = None, + task_queue: Optional[str] = None, + deployment_name: Optional[str] = None, + connectors: Sequence[ConnectorSlot] = (), + polling_interval: float = 2, + max_polling_attempts: Optional[int] = None, +) -> WorkflowExecutionResponse: + """Execute a workflow, automatically handling connector OAuth flows. + + Args: + client: An initialised :class:`Mistral` client. + workflow_identifier: Name or ID of the workflow to execute. + input_data: Input payload for the workflow. Pydantic models are + serialised via ``model_dump(mode="json")``. + on_auth_required: Async callback invoked when a connector needs + the user to authenticate. Receives a + :class:`ConnectorAuthTaskState` whose ``auth_url`` field + contains the OAuth URL. The workflow resumes automatically + after this callback returns. + execution_id: Optional custom execution ID. + task_queue: Optional task queue name (deprecated upstream). + deployment_name: Optional deployment target. + connectors: Typed connector slots that declare which connectors + the workflow needs. + polling_interval: Seconds between status polls after the event + stream ends. + max_polling_attempts: Maximum number of polling iterations before + raising :class:`TimeoutError`. ``None`` means poll forever. + + Returns: + The completed :class:`WorkflowExecutionResponse`. + + Raises: + RuntimeError: If the workflow finishes with a non-COMPLETED status. + TimeoutError: If *max_polling_attempts* is set and exceeded. + """ + extensions = ( + WorkflowExtensions.from_connectors(connectors).to_dict() if connectors else None + ) + + execute_kwargs: Dict[str, Any] = dict( + workflow_identifier=workflow_identifier, + input=input_data, + execution_id=execution_id, + task_queue=task_queue, + deployment_name=deployment_name, + ) + if extensions is not None: + execute_kwargs["extensions"] = extensions + + execution = await client.workflows.execute_workflow_async(**execute_kwargs) + exec_id = execution.execution_id + + await _stream_and_handle_auth(client, exec_id, on_auth_required) + + return await _poll_until_done( + client, exec_id, polling_interval, max_polling_attempts + ) + + +# --------------------------------------------------------------------------- +# Internal helpers +# --------------------------------------------------------------------------- + + +async def _stream_and_handle_auth( + client: Mistral, + exec_id: str, + on_auth_required: Optional[Callable[[ConnectorAuthTaskState], Awaitable[None]]], +) -> None: + """Stream workflow events, handling connector-auth tasks. + + Reconnects automatically with exponential back-off when the SSE + connection drops. + """ + last_seq = 0 + + for attempt in range(_MAX_RECONNECT_ATTEMPTS): + try: + event_stream = await client.workflows.events.get_stream_events_async( + root_workflow_exec_id=exec_id, + workflow_exec_id="*", + parent_workflow_exec_id="*", + start_seq=last_seq, + ) + async with event_stream: + async for sse_event in event_stream: + if sse_event.data is None: + continue + + payload = sse_event.data + last_seq = payload.broker_sequence + 1 + event = payload.data + + if isinstance(event, _TERMINAL_EVENT_TYPES): + return + + if not isinstance(event, CustomTaskStartedResponse): + continue + if event.attributes.custom_task_type != "connector_auth": + continue + + payload_value = ( + event.attributes.payload.value + if event.attributes.payload is not None + else None + ) + if not isinstance(payload_value, dict): + continue + + state = ConnectorAuthTaskState.model_validate(payload_value) + + if on_auth_required: + await on_auth_required(state) + + # The interceptor polls for credentials server-side — + # no signal or update needed from the client. + else: + # Stream exhausted without a terminal event — retry. + continue + except (ConnectionError, httpx.RemoteProtocolError): + logger.debug( + "Event stream connection lost, reconnecting " + "(execution_id=%s, attempt=%d)", + exec_id, + attempt, + ) + await asyncio.sleep(min(2**attempt, 30)) + else: + logger.warning( + "Exhausted %d reconnect attempts for event stream (execution_id=%s)", + _MAX_RECONNECT_ATTEMPTS, + exec_id, + ) + + +async def _poll_until_done( + client: Mistral, + exec_id: str, + polling_interval: float, + max_attempts: Optional[int], +) -> WorkflowExecutionResponse: + """Poll the execution status until it reaches a terminal state.""" + attempts = 0 + while True: + result = await client.workflows.executions.get_workflow_execution_async( + execution_id=exec_id, + ) + if result.status != "RUNNING": + if result.status == "COMPLETED": + return result + raise RuntimeError(f"Workflow failed with status: {result.status}") + + attempts += 1 + if max_attempts is not None and attempts >= max_attempts: + raise TimeoutError( + f"Workflow still running after {max_attempts} polling attempts" + ) + await asyncio.sleep(polling_interval) diff --git a/src/mistralai/extra/workflows/connector_slot.py b/src/mistralai/extra/workflows/connector_slot.py new file mode 100644 index 00000000..7287cf32 --- /dev/null +++ b/src/mistralai/extra/workflows/connector_slot.py @@ -0,0 +1,62 @@ +"""Typed descriptors for connector dependencies and extensions.""" + +from __future__ import annotations + +from typing import Any, Dict, List, Optional, Sequence + +from pydantic import BaseModel + + +class ConnectorSlot(BaseModel): + """A declared connector dependency for a workflow execution. + + Mirrors the server-side ``ConnectorSlot`` from the workflow SDK plugin, + providing a typed interface for specifying connector bindings instead of + raw ``Dict[str, Any]`` extension dicts. + + Example:: + + from mistralai.extra.workflows import ConnectorSlot + + gmail = ConnectorSlot(connector_name="gmail") + notion = ConnectorSlot(connector_name="notion", credentials_name="work-account") + """ + + connector_name: str + credentials_name: Optional[str] = None + + +class ConnectorBindings(BaseModel): + """Container for a list of connector bindings.""" + + bindings: List[ConnectorSlot] + + +class ConnectorExtension(BaseModel): + """Mistral-specific extension carrying connector configuration.""" + + connectors: ConnectorBindings + + +class WorkflowExtensions(BaseModel): + """Top-level extensions dict passed to the workflow execution API. + + Serialises to the shape expected by the API:: + + {"mistralai": {"connectors": {"bindings": [...]}}} + """ + + mistralai: ConnectorExtension + + @classmethod + def from_connectors(cls, connectors: Sequence[ConnectorSlot]) -> WorkflowExtensions: + """Build extensions from a sequence of connector slots.""" + return cls( + mistralai=ConnectorExtension( + connectors=ConnectorBindings(bindings=list(connectors)) + ) + ) + + def to_dict(self) -> Dict[str, Any]: + """Serialise to the ``Dict[str, Any]`` the API expects.""" + return self.model_dump(mode="json", exclude_none=True) diff --git a/src/mistralai/extra/workflows/encoding/__init__.py b/src/mistralai/extra/workflows/encoding/__init__.py new file mode 100644 index 00000000..c1881636 --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/__init__.py @@ -0,0 +1,24 @@ +from .config import ( + WorkflowEncodingConfig, + PayloadOffloadingConfig, + PayloadEncryptionConfig, + PayloadEncryptionMode, + BlobStorageConfig, + StorageProvider, +) +from .models import EncryptedStrField +from .payload_encoder import PayloadEncoder +from .helpers import configure_workflow_encoding, generate_two_part_id + +__all__ = [ + "WorkflowEncodingConfig", + "PayloadOffloadingConfig", + "PayloadEncryptionConfig", + "PayloadEncryptionMode", + "BlobStorageConfig", + "StorageProvider", + "EncryptedStrField", + "PayloadEncoder", + "configure_workflow_encoding", + "generate_two_part_id", +] diff --git a/src/mistralai/extra/workflows/encoding/config.py b/src/mistralai/extra/workflows/encoding/config.py new file mode 100644 index 00000000..ff849fd7 --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/config.py @@ -0,0 +1,52 @@ +from enum import Enum +from pydantic import SecretStr, BaseModel +from typing import Optional + + +class StorageProvider(str, Enum): + AZURE = "azure" + GCS = "gcs" + S3 = "s3" + + +class BlobStorageConfig(BaseModel): + storage_provider: StorageProvider = StorageProvider.S3 + prefix: Optional[str] = None + + # Azure settings + container_name: Optional[str] = None + azure_connection_string: Optional[SecretStr] = None + + # GCS settings + bucket_id: Optional[str] = None + + # S3 settings + bucket_name: Optional[str] = None + region_name: Optional[str] = None + endpoint_url: Optional[str] = None + aws_access_key_id: Optional[SecretStr] = None + aws_secret_access_key: Optional[SecretStr] = None + + +class PayloadOffloadingConfig(BaseModel): + storage_config: Optional[BlobStorageConfig] = None + min_size_bytes: int = 1024 * 1024 # 1MB + + +class PayloadEncryptionMode(str, Enum): + FULL = "full" + PARTIAL = "partial" + + +class PayloadEncryptionConfig(BaseModel): + mode: PayloadEncryptionMode + + # If both keys are provided, the main key will be used for encryption and both keys will be used for decryption + # to support key rotation. + main_key: Optional[SecretStr] = None + secondary_key: Optional[SecretStr] = None + + +class WorkflowEncodingConfig(BaseModel): + payload_offloading: PayloadOffloadingConfig | None = None + payload_encryption: PayloadEncryptionConfig | None = None diff --git a/src/mistralai/extra/workflows/encoding/helpers.py b/src/mistralai/extra/workflows/encoding/helpers.py new file mode 100644 index 00000000..73afb214 --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/helpers.py @@ -0,0 +1,47 @@ +import uuid +from typing import TYPE_CHECKING + +from .config import WorkflowEncodingConfig + +if TYPE_CHECKING: + from mistralai.client.sdk import Mistral + + +def generate_two_part_id( + primary_seed: str | None = None, secondary_seed: str | None = None +) -> str: + """Generates a unique ID composed of two parts derived from seeds.""" + if not primary_seed: + primary_seed = uuid.uuid4().hex + if not secondary_seed: + secondary_seed = uuid.uuid4().hex + first_part = uuid.uuid5(uuid.NAMESPACE_DNS, primary_seed).hex + second_part = uuid.uuid5(uuid.NAMESPACE_DNS, secondary_seed).hex + return f"{first_part}{second_part}".replace("-", "") + + +async def configure_workflow_encoding( + config: WorkflowEncodingConfig, + *, + client: "Mistral", + namespace: str | None = None, +) -> None: + """Configure workflow payload encoding for the SDK. + + This enables encryption and/or blob storage offloading for workflow payloads. + + Args: + config: The workflow encoding configuration. + client: The Mistral client instance. + namespace: The workflow namespace. If not provided, it will be fetched + from the scheduler using the client. + """ + from mistralai.client._hooks.workflow_encoding_hook import ( + configure_workflow_encoding as _configure_workflow_encoding, + ) + + if not namespace: + from mistralai.extra.workflows.helpers import get_scheduler_namespace + + namespace = await get_scheduler_namespace(client) + _configure_workflow_encoding(config, namespace, client.sdk_configuration) diff --git a/src/mistralai/extra/workflows/encoding/models.py b/src/mistralai/extra/workflows/encoding/models.py new file mode 100644 index 00000000..496be8b1 --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/models.py @@ -0,0 +1,90 @@ +from enum import Enum +from typing import Literal, Optional + +import base64 +from pydantic import BaseModel, Field + + +class EncodedPayloadOptions(str, Enum): + OFFLOADED = "offloaded" + ENCRYPTED = "encrypted" + PARTIALLY_ENCRYPTED = "encrypted-partial" + + +class EncryptableFieldTypes(str, Enum): + STRING = "__encrypted_str__" + + +class EncryptedStrField(BaseModel): + """Mark a string field for partial encryption in workflow payloads.""" + + field_type: Literal[EncryptableFieldTypes.STRING] = EncryptableFieldTypes.STRING + data: str + + +class WorkflowContext(BaseModel): + namespace: str + execution_id: str + parent_workflow_exec_id: Optional[str] = None + root_workflow_exec_id: Optional[str] = None + execution_token: Optional[str] = None + + +class EncodedPayload(BaseModel): + context: WorkflowContext + encoding_options: list[EncodedPayloadOptions] = Field( + description="The encoding of the payload", default=[] + ) + payload: bytes = Field(description="The encoded payload") + + +class NetworkEncodedBase(BaseModel): + b64payload: str = Field(description="The encoded payload") + encoding_options: list[EncodedPayloadOptions] = Field( + description="The encoding of the payload", default=[] + ) + + def get_payload(self) -> bytes: + return base64.b64decode(self.b64payload) + + +class NetworkEncodedInput(NetworkEncodedBase): + empty: bool = Field(description="Whether the payload is empty", default=False) + + def to_encoded_payload( + self, namespace: str, execution_id: str, execution_token: str | None = None + ) -> EncodedPayload: + return EncodedPayload( + payload=base64.b64decode(self.b64payload), + encoding_options=self.encoding_options, + context=WorkflowContext( + namespace=namespace, + execution_id=execution_id, + execution_token=execution_token, + ), + ) + + @staticmethod + def from_encoded_payload(encoded_payload: EncodedPayload) -> "NetworkEncodedInput": + return NetworkEncodedInput( + b64payload=base64.b64encode(encoded_payload.payload).decode("utf-8"), + encoding_options=encoded_payload.encoding_options, + ) + + @staticmethod + def from_data( + data: bytes, encoding_options: list[EncodedPayloadOptions] + ) -> "NetworkEncodedInput": + return NetworkEncodedInput( + b64payload=base64.b64encode(data).decode("utf-8"), + encoding_options=encoding_options, + ) + + +class NetworkEncodedResult(NetworkEncodedBase): + @staticmethod + def from_encoded_payload(encoded_payload: EncodedPayload) -> "NetworkEncodedResult": + return NetworkEncodedResult( + b64payload=base64.b64encode(encoded_payload.payload).decode("utf-8"), + encoding_options=encoded_payload.encoding_options, + ) diff --git a/src/mistralai/extra/workflows/encoding/payload_encoder.py b/src/mistralai/extra/workflows/encoding/payload_encoder.py new file mode 100644 index 00000000..611f33fa --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/payload_encoder.py @@ -0,0 +1,390 @@ +from __future__ import annotations + +import base64 +import functools +import hashlib +import json +import logging +import os +import urllib.parse +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union + +from pydantic import BaseModel + +if TYPE_CHECKING: + from cryptography.exceptions import InvalidTag + from cryptography.hazmat.primitives.ciphers.aead import AESGCM + +try: + from cryptography.exceptions import InvalidTag + from cryptography.hazmat.primitives.ciphers.aead import AESGCM + + _HAS_CRYPTO = True +except ImportError: + _HAS_CRYPTO = False +from pydantic_core import from_json, to_json + +from mistralai.extra.workflows.encoding.config import ( + PayloadEncryptionConfig, + PayloadEncryptionMode, + PayloadOffloadingConfig, + WorkflowEncodingConfig, +) +from .storage.blob_storage import get_blob_storage, BlobNotFoundError +from mistralai.extra.workflows.encoding.models import ( + EncodedPayloadOptions, + EncryptableFieldTypes, + NetworkEncodedInput, + NetworkEncodedResult, + WorkflowContext, +) +from mistralai.extra.exceptions import ( + WorkflowPayloadEncryptionException, + WorkflowPayloadOffloadingException, +) + +logger = logging.getLogger(__name__) + + +class OffloadedPayloadData(BaseModel): + key: str + + +class PayloadEncoder: + """This class is in charge of payload encoding/decoding operations such as: + - Blob storage offloading + - Encryption + """ + + BLOB_STORAGE_KEY_PREFIX = "temporal-payload" + _NONCE_SIZE = 12 + + offloading_config: Optional[PayloadOffloadingConfig] + encryption_config: Optional[PayloadEncryptionConfig] + + encryptor_main: Optional[AESGCM] = None + encryptor_secondary: Optional[AESGCM] = None + + def __init__( + self, + encoding_config: WorkflowEncodingConfig, + ) -> None: + self.offloading_config = encoding_config.payload_offloading + if ( + self.offloading_config is not None + and not self.offloading_config.storage_config + ): + raise WorkflowPayloadOffloadingException( + "Blob storage config is not set for workflow payload encoding" + ) + + self.encryption_config = encoding_config.payload_encryption + if self.encryption_config is not None: + if not _HAS_CRYPTO: + raise ImportError( + "Encryption support requires cryptography. " + "Install it with: pip install 'mistralai[workflow_payload_encryption]'" + ) + main_key = ( + self.encryption_config.main_key.get_secret_value() + if self.encryption_config.main_key + else None + ) + if not main_key: + raise WorkflowPayloadEncryptionException( + "You must configure payload encryption key" + ) + self.encryptor_main = AESGCM(bytes.fromhex(main_key)) + secondary_key_secret = self.encryption_config.secondary_key + secondary_key = ( + secondary_key_secret.get_secret_value() + if secondary_key_secret + else None + ) + if secondary_key: + self.encryptor_secondary = AESGCM(bytes.fromhex(secondary_key)) + + @staticmethod + def blob_storage_key_prefix(context: WorkflowContext) -> str: + quote = functools.partial(urllib.parse.quote, safe="") + return "/".join( + [ + PayloadEncoder.BLOB_STORAGE_KEY_PREFIX, + quote(context.namespace), + quote(context.execution_id), + ] + ) + + def _encrypt(self, data: bytes) -> bytes: + if self.encryptor_main is None: + raise WorkflowPayloadEncryptionException( + "You must configure payload encryption" + ) + nonce = os.urandom(self._NONCE_SIZE) + return nonce + self.encryptor_main.encrypt(nonce, data, None) + + def _decrypt(self, data: bytes) -> bytes: + if self.encryptor_main is None: + raise WorkflowPayloadEncryptionException( + "You must configure payload encryption" + ) + try: + return self.encryptor_main.decrypt( + data[: self._NONCE_SIZE], data[self._NONCE_SIZE :], None + ) + except InvalidTag as main_exc: + if self.encryptor_secondary: + logger.warning( + "Failed to decrypt payload with main key, trying secondary key" + ) + try: + return self.encryptor_secondary.decrypt( + data[: self._NONCE_SIZE], data[self._NONCE_SIZE :], None + ) + except InvalidTag: + pass + logger.error("Could not decrypt payload", exc_info=main_exc) + raise WorkflowPayloadEncryptionException( + "Failed to decrypt payload" + ) from main_exc + + async def _handle_offloading( + self, data: bytes, context: Optional[WorkflowContext] + ) -> tuple[bytes, bool]: + if self.offloading_config is None or self.offloading_config.storage_config is None: + raise WorkflowPayloadOffloadingException( + "You must configure payload offloading storage" + ) + + if len(data) < self.offloading_config.min_size_bytes: + return data, False + + if not context: + logger.error( + "Payload offloading required but no context was provided. Cannot proceed with offloading..." + ) + return data, False + + # Hash the content to have a uniq idempotent key for this payload + blob_key = f"sha256:{hashlib.sha256(data).hexdigest()}" + payload_key = f"{self.blob_storage_key_prefix(context)}/{blob_key}" + async with get_blob_storage( + self.offloading_config.storage_config + ) as blob_storage: + blob = None + try: + blob = await blob_storage.get_blob_properties(payload_key) + except BlobNotFoundError: + pass + + if not blob: + logger.debug("Offloading payload") + await blob_storage.upload_blob(key=payload_key, content=data) + else: + logger.debug("Offloaded payload exists already") + + data = OffloadedPayloadData(key=payload_key).model_dump_json().encode() + return data, True + + @staticmethod + def _extract_encrypted_fields(data: Any = None) -> list[dict[str, Any]]: + encrypted_fields = [] + if isinstance(data, dict): + if data.get("field_type") == EncryptableFieldTypes.STRING: + return [data] + for _, field_data in data.items(): + if isinstance(field_data, (dict, list)): + encrypted_fields.extend( + PayloadEncoder._extract_encrypted_fields(field_data) + ) + elif isinstance(data, list): + for item in data: + encrypted_fields.extend(PayloadEncoder._extract_encrypted_fields(item)) + return encrypted_fields + + async def _partially_encrypt_fields(self, data: bytes) -> tuple[bytes, bool]: + try: + obj = json.loads(data) + except json.decoder.JSONDecodeError: + return data, False + + encrypted_fields = self._extract_encrypted_fields(obj) + for encrypted_field in encrypted_fields: + encrypted_data = self._encrypt(encrypted_field["data"].encode()) + encrypted_field["data"] = base64.b64encode(encrypted_data).decode() + + return json.dumps(obj).encode(), len(encrypted_fields) > 0 + + async def _partially_decrypt_fields(self, data: bytes) -> tuple[bytes, bool]: + try: + obj = json.loads(data) + except json.decoder.JSONDecodeError: + return data, False + + encrypted_fields = self._extract_encrypted_fields(obj) + for encrypted_field in encrypted_fields: + encrypted_data = base64.b64decode(encrypted_field["data"]) + encrypted_field["data"] = self._decrypt(encrypted_data).decode() + + return json.dumps(obj).encode(), len(encrypted_fields) > 0 + + async def encode_payload_content( + self, data: Union[bytes, str], context: Optional[WorkflowContext] + ) -> tuple[bytes, list[EncodedPayloadOptions]]: + """Handle payload encoding: + - Payload offloading (if context provided) + - Encryption + """ + if isinstance(data, str): + data = data.encode() + + encoding_options = [] + + if self.offloading_config is not None: + data, offloaded = await self._handle_offloading(data, context) + if offloaded: + encoding_options.append(EncodedPayloadOptions.OFFLOADED) + + if ( + self.encryption_config is not None + and self.encryption_config.mode == PayloadEncryptionMode.FULL + ): + data = self._encrypt(data) + encoding_options.append(EncodedPayloadOptions.ENCRYPTED) + elif ( + self.encryption_config is not None + and self.encryption_config.mode == PayloadEncryptionMode.PARTIAL + and EncodedPayloadOptions.OFFLOADED not in encoding_options + ): + # Do not partially encrypt offloaded payload (fields not in the payload anymore) + data, partially_encrypted = await self._partially_encrypt_fields(data) + if partially_encrypted: + encoding_options.append(EncodedPayloadOptions.PARTIALLY_ENCRYPTED) + + return data, encoding_options + + async def encode_event_payload_content( + self, data: Union[bytes, str], force_full_encryption: bool = False + ) -> tuple[bytes, list[EncodedPayloadOptions]]: + """Encrypt event payload content. + + Unlike encode_payload_content, this only handles encryption (no offloading). + + Args: + data: The payload data to encrypt. + force_full_encryption: Force full encryption regardless of configured mode. + Use for payloads like json_patch that don't support partial encryption. + """ + if isinstance(data, str): + data = data.encode() + + if self.encryption_config is None: + return data, [] + + if force_full_encryption or self.encryption_config.mode == PayloadEncryptionMode.FULL: + encrypted_data = self._encrypt(data) + return encrypted_data, [EncodedPayloadOptions.ENCRYPTED] + + # Partial encryption mode + data, partially_encrypted = await self._partially_encrypt_fields(data) + if partially_encrypted: + return data, [EncodedPayloadOptions.PARTIALLY_ENCRYPTED] + + return data, [] + + async def decode_payload_content( + self, data: bytes, encoding_options: List[EncodedPayloadOptions] + ) -> bytes: + # Decode in the reverse order of encoding + for option in reversed(encoding_options): + if option == EncodedPayloadOptions.ENCRYPTED: + data = self._decrypt(data) + elif option == EncodedPayloadOptions.PARTIALLY_ENCRYPTED: + data, _ = await self._partially_decrypt_fields(data) + elif option == EncodedPayloadOptions.OFFLOADED: + if ( + self.offloading_config is None + or not self.offloading_config.storage_config + ): + raise WorkflowPayloadOffloadingException( + "Payload offloading is not enabled but an offloaded payload was received" + ) + async with get_blob_storage( + self.offloading_config.storage_config + ) as blob_storage: + offloaded_payload_data = OffloadedPayloadData.model_validate_json( + data + ) + data = await blob_storage.get_blob(offloaded_payload_data.key) + else: + raise WorkflowPayloadOffloadingException( + f"Unknown decoding option: {option}" + ) + + return data + + async def decode_event_payload( + self, payload_data: Dict[str, Any] + ) -> Dict[str, Any]: + """Decrypt an event payload's value if it has encoding_options. + + Args: + payload_data: Dict with 'type', 'value', and 'encoding_options' fields + + Returns: + Dict with decrypted 'value' and empty 'encoding_options' + """ + encoding_options_strs = payload_data.get("encoding_options", []) + if not encoding_options_strs: + return payload_data + + encoding_options = [EncodedPayloadOptions(opt) for opt in encoding_options_strs] + encrypted_bytes = base64.b64decode(payload_data["value"]) + decrypted_bytes = await self.decode_payload_content(encrypted_bytes, encoding_options) + decrypted_value = json.loads(decrypted_bytes) + + return { + "type": payload_data["type"], + "value": decrypted_value, + "encoding_options": [], + } + + async def encode_network_input( + self, data: Optional[Dict[str, Any]], context: WorkflowContext + ) -> NetworkEncodedInput: + """This method MUST be called to format every payload send to Mistral Workflows control plane + to ensure a proper encoding of the payload. + """ + encoded_data, encoding_options = await self.encode_payload_content( + to_json(data), context + ) + network_input = NetworkEncodedInput.from_data(encoded_data, encoding_options) + return network_input + + async def decode_network_result(self, data: Any) -> Any: + """This method MUST be called to format every response payload from the Mistral Workflows control plane + otherwise the payload will not be decoded, hence not usable. + """ + try: + network_encoded_payload = NetworkEncodedResult.model_validate(data) + except ValueError: + logger.warning("Network result is not a NetworkEncodedResult") + return data + + byte_results = await self.decode_payload_content( + network_encoded_payload.get_payload(), + network_encoded_payload.encoding_options, + ) + try: + return from_json(byte_results) + except ValueError: + logger.warning("Payload is not a valid json.") + return byte_results # Return as-is if JSON conversion fails + + def check_is_payload_encoded(self, data: Any) -> bool: + """Check if the payload is encoded (offloaded or encrypted)""" + try: + NetworkEncodedResult.model_validate(data) + return True + except ValueError: + return False diff --git a/src/mistralai/extra/workflows/encoding/storage/_azure.py b/src/mistralai/extra/workflows/encoding/storage/_azure.py new file mode 100644 index 00000000..e62d9926 --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/storage/_azure.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from typing import Any, cast + +from azure.core.exceptions import ResourceNotFoundError +from azure.storage.blob.aio import BlobServiceClient +from .blob_storage import BlobNotFoundError, BlobStorage + + +class AzureBlobStorage(BlobStorage): + def __init__( + self, + container_name: str, + azure_connection_string: str, + prefix: str | None = None, + ): + self.container_name = container_name + self.connection_string = azure_connection_string + self.prefix = prefix or "" + self._service_client: BlobServiceClient | None = None + self._container_client: Any = None + + def _get_full_key(self, key: str) -> str: + if not self.prefix: + return key + if key.startswith(self.prefix): + return key + return f"{self.prefix}/{key}" + + async def __aenter__(self) -> "AzureBlobStorage": + self._service_client = BlobServiceClient.from_connection_string( + self.connection_string + ) + assert self._service_client is not None + self._container_client = self._service_client.get_container_client( + self.container_name + ) + return self + + async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + if self._service_client: + await self._service_client.close() + + async def upload_blob(self, key: str, content: bytes) -> str: + full_key = self._get_full_key(key) + blob_client = self._container_client.get_blob_client(full_key) + await blob_client.upload_blob(content, overwrite=True) + return cast(str, blob_client.url) + + async def get_blob(self, key: str) -> bytes: + full_key = self._get_full_key(key) + blob_client = self._container_client.get_blob_client(full_key) + try: + stream = await blob_client.download_blob() + return cast(bytes, await stream.readall()) + except ResourceNotFoundError as e: + raise BlobNotFoundError(f"Blob not found: {key}") from e + + async def get_blob_properties(self, key: str) -> dict[str, Any] | None: + full_key = self._get_full_key(key) + blob_client = self._container_client.get_blob_client(full_key) + try: + props = await blob_client.get_blob_properties() + return {"size": props.size, "last_modified": props.last_modified} + except ResourceNotFoundError: + return None + + async def delete_blob(self, key: str) -> None: + full_key = self._get_full_key(key) + blob_client = self._container_client.get_blob_client(full_key) + await blob_client.delete_blob() + + async def blob_exists(self, key: str) -> bool: + full_key = self._get_full_key(key) + blob_client = self._container_client.get_blob_client(full_key) + return cast(bool, await blob_client.exists()) diff --git a/src/mistralai/extra/workflows/encoding/storage/_gcs.py b/src/mistralai/extra/workflows/encoding/storage/_gcs.py new file mode 100644 index 00000000..c5e37d60 --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/storage/_gcs.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from typing import Any, cast + +import aiohttp +from gcloud.aio.storage import Storage + +from .blob_storage import BlobNotFoundError, BlobStorage + + +class GCSBlobStorage(BlobStorage): + def __init__(self, bucket_id: str, prefix: str | None = None): + self.bucket_id = bucket_id + self.prefix = prefix or "" + self._storage: Storage | None = None + self._session: aiohttp.ClientSession | None = None + + def _get_full_key(self, key: str) -> str: + if not self.prefix: + return key + if key.startswith(self.prefix): + return key + return f"{self.prefix}/{key}" + + async def __aenter__(self) -> "GCSBlobStorage": + self._session = aiohttp.ClientSession() + self._storage = Storage(session=self._session) + return self + + async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + if self._storage: + await self._storage.close() + if self._session: + await self._session.close() + + async def upload_blob(self, key: str, content: bytes) -> str: + full_key = self._get_full_key(key) + assert self._storage is not None + response = await self._storage.upload(self.bucket_id, full_key, content) + return str(response.get("selfLink")) + + async def get_blob(self, key: str) -> bytes: + full_key = self._get_full_key(key) + assert self._storage is not None + try: + content = await self._storage.download(self.bucket_id, full_key) + return cast(bytes, content) + except Exception as e: + if "404" in str(e) or "Not Found" in str(e): + raise BlobNotFoundError(f"Blob not found: {key}") from e + raise + + async def get_blob_properties(self, key: str) -> dict[str, Any] | None: + full_key = self._get_full_key(key) + assert self._storage is not None + try: + metadata = await self._storage.download_metadata(self.bucket_id, full_key) + return { + "size": int(metadata.get("size", 0)), + "last_modified": metadata.get("updated"), + } + except Exception as e: + if "404" in str(e) or "Not Found" in str(e): + return None + raise + + async def delete_blob(self, key: str) -> None: + full_key = self._get_full_key(key) + assert self._storage is not None + await self._storage.delete(self.bucket_id, full_key) + + async def blob_exists(self, key: str) -> bool: + full_key = self._get_full_key(key) + assert self._storage is not None + try: + await self._storage.download_metadata(self.bucket_id, full_key) + return True + except Exception as e: + if "404" in str(e) or "Not Found" in str(e): + return False + raise diff --git a/src/mistralai/extra/workflows/encoding/storage/_s3.py b/src/mistralai/extra/workflows/encoding/storage/_s3.py new file mode 100644 index 00000000..4a0ce063 --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/storage/_s3.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +from typing import Any, cast + +import aioboto3 # type: ignore[import-untyped] +from botocore.exceptions import ClientError # type: ignore[import-untyped] + +from .blob_storage import BlobNotFoundError, BlobStorage + + +class S3BlobStorage(BlobStorage): + def __init__( + self, + bucket_name: str, + prefix: str | None = None, + region_name: str | None = None, + endpoint_url: str | None = None, + aws_access_key_id: str | None = None, + aws_secret_access_key: str | None = None, + ): + self.bucket_name = bucket_name + self.prefix = prefix or "" + self.region_name = region_name + self.endpoint_url = endpoint_url + self.aws_access_key_id = aws_access_key_id + self.aws_secret_access_key = aws_secret_access_key + self._session: aioboto3.Session | None = None + self._client: Any = None + + def _get_full_key(self, key: str) -> str: + if not self.prefix: + return key + if key.startswith(self.prefix): + return key + return f"{self.prefix}/{key}" + + async def __aenter__(self) -> "S3BlobStorage": + self._session = aioboto3.Session() + assert self._session is not None + kwargs: dict[str, Any] = {} + if self.region_name: + kwargs["region_name"] = self.region_name + if self.endpoint_url: + kwargs["endpoint_url"] = self.endpoint_url + if self.aws_access_key_id: + kwargs["aws_access_key_id"] = self.aws_access_key_id + if self.aws_secret_access_key: + kwargs["aws_secret_access_key"] = self.aws_secret_access_key + + self._client = self._session.client("s3", **kwargs) + self._client = await self._client.__aenter__() + return self + + async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + if self._client: + await self._client.__aexit__(exc_type, exc_val, exc_tb) + self._session = None + self._client = None + + async def upload_blob(self, key: str, content: bytes) -> str: + full_key = self._get_full_key(key) + await self._client.put_object( + Bucket=self.bucket_name, Key=full_key, Body=content + ) + endpoint = ( + self.endpoint_url + or f"https://s3.{self.region_name or 'us-east-1'}.amazonaws.com" + ) + return f"{endpoint}/{self.bucket_name}/{full_key}" + + async def get_blob(self, key: str) -> bytes: + full_key = self._get_full_key(key) + try: + response = await self._client.get_object( + Bucket=self.bucket_name, Key=full_key + ) + async with response["Body"] as stream: + return cast(bytes, await stream.read()) + except ClientError as e: + if e.response.get("Error", {}).get("Code") == "NoSuchKey": + raise BlobNotFoundError(f"Blob not found: {key}") from e + raise + + async def get_blob_properties(self, key: str) -> dict[str, Any] | None: + full_key = self._get_full_key(key) + try: + response = await self._client.head_object( + Bucket=self.bucket_name, Key=full_key + ) + return { + "size": response["ContentLength"], + "last_modified": response["LastModified"], + } + except ClientError as e: + if e.response.get("Error", {}).get("Code") in ("NoSuchKey", "404"): + return None + raise + + async def delete_blob(self, key: str) -> None: + full_key = self._get_full_key(key) + await self._client.delete_object(Bucket=self.bucket_name, Key=full_key) + + async def blob_exists(self, key: str) -> bool: + full_key = self._get_full_key(key) + try: + await self._client.head_object(Bucket=self.bucket_name, Key=full_key) + return True + except ClientError as e: + if e.response.get("Error", {}).get("Code") in ("NoSuchKey", "404"): + return False + raise diff --git a/src/mistralai/extra/workflows/encoding/storage/blob_storage.py b/src/mistralai/extra/workflows/encoding/storage/blob_storage.py new file mode 100644 index 00000000..ce488421 --- /dev/null +++ b/src/mistralai/extra/workflows/encoding/storage/blob_storage.py @@ -0,0 +1,148 @@ +from __future__ import annotations + +from abc import ABC, abstractmethod +from contextlib import asynccontextmanager +from typing import Any, AsyncGenerator + +from mistralai.extra.workflows.encoding.config import BlobStorageConfig, StorageProvider +from mistralai.extra.exceptions import WorkflowPayloadOffloadingException + + +class BlobNotFoundError(Exception): + """Raised when a blob is not found in storage.""" + + pass + + +class BlobStorage(ABC): + """Abstract base class for blob storage implementations.""" + + @abstractmethod + async def upload_blob(self, key: str, content: bytes) -> str: + """Upload a blob to storage and return its URL.""" + pass + + @abstractmethod + async def get_blob(self, key: str) -> bytes: + """Download a blob from storage.""" + pass + + @abstractmethod + async def get_blob_properties(self, key: str) -> dict[str, Any] | None: + """Get blob properties. Returns None if blob doesn't exist.""" + pass + + @abstractmethod + async def delete_blob(self, key: str) -> None: + """Delete a blob from storage.""" + pass + + @abstractmethod + async def blob_exists(self, key: str) -> bool: + """Check if a blob exists.""" + pass + + async def __aenter__(self) -> "BlobStorage": + """Async context manager entry.""" + return self + + async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: + """Async context manager exit.""" + pass + + +@asynccontextmanager +async def get_blob_storage( + blob_storage_config: BlobStorageConfig, +) -> AsyncGenerator[BlobStorage, None]: + """ Create a blob storage instance based on the configuration. + """ + storage: BlobStorage + prefix = blob_storage_config.prefix + + if blob_storage_config.storage_provider == StorageProvider.AZURE: + try: + from ._azure import AzureBlobStorage # type: ignore[import-untyped] + except ImportError as e: + raise ImportError( + "Azure Blob Storage support requires azure-storage-blob. " + "Install it with: pip install 'mistralai[workflow_payload_offloading_azure]'" + ) from e + + if not blob_storage_config.container_name: + raise WorkflowPayloadOffloadingException( + "container_name is required for Azure blob storage" + ) + azure_conn_str = ( + blob_storage_config.azure_connection_string.get_secret_value() + if blob_storage_config.azure_connection_string + else None + ) + if not azure_conn_str: + raise WorkflowPayloadOffloadingException( + "azure_connection_string is required for Azure blob storage" + ) + storage = AzureBlobStorage( + container_name=blob_storage_config.container_name, + azure_connection_string=azure_conn_str, + prefix=prefix, + ) + + elif blob_storage_config.storage_provider == StorageProvider.GCS: + try: + from ._gcs import GCSBlobStorage # type: ignore[import-untyped] + except ImportError as e: + raise ImportError( + "Google Cloud Storage support requires gcloud-aio-storage. " + "Install it with: pip install 'mistralai[workflow_payload_offloading_gcs]'" + ) from e + + if not blob_storage_config.bucket_id: + raise WorkflowPayloadOffloadingException( + "bucket_id is required for GCS blob storage" + ) + storage = GCSBlobStorage( + bucket_id=blob_storage_config.bucket_id, + prefix=prefix, + ) + + elif blob_storage_config.storage_provider == StorageProvider.S3: + try: + from ._s3 import S3BlobStorage # type: ignore[import-untyped] + except ImportError as e: + raise ImportError( + "AWS S3 support requires aioboto3. " + "Install it with: pip install 'mistralai[workflow_payload_offloading_s3]'" + ) from e + + if not blob_storage_config.bucket_name: + raise WorkflowPayloadOffloadingException( + "bucket_name is required for S3 blob storage" + ) + storage = S3BlobStorage( + bucket_name=blob_storage_config.bucket_name, + prefix=prefix, + region_name=blob_storage_config.region_name, + endpoint_url=blob_storage_config.endpoint_url, + aws_access_key_id=( + blob_storage_config.aws_access_key_id.get_secret_value() + if blob_storage_config.aws_access_key_id + else None + ), + aws_secret_access_key=( + blob_storage_config.aws_secret_access_key.get_secret_value() + if blob_storage_config.aws_secret_access_key + else None + ), + ) + + else: + raise ValueError( + f"Unsupported storage provider: {blob_storage_config.storage_provider}" + ) + + async with storage as blob_storage_instance: + yield blob_storage_instance + + +__all__ = ["BlobStorage", "BlobNotFoundError", "get_blob_storage"] diff --git a/src/mistralai/extra/workflows/helpers.py b/src/mistralai/extra/workflows/helpers.py new file mode 100644 index 00000000..508c4b97 --- /dev/null +++ b/src/mistralai/extra/workflows/helpers.py @@ -0,0 +1,86 @@ +from typing import TYPE_CHECKING, Mapping, Optional + +from pydantic import BaseModel + +from mistralai.client import errors, models, utils +from mistralai.client._hooks.types import HookContext +from mistralai.client.types.basemodel import UNSET, OptionalNullable +from mistralai.client.utils.security import get_security_from_env +from mistralai.client.utils.unmarshal_json_response import unmarshal_json_response + +if TYPE_CHECKING: + from mistralai.client.sdk import Mistral + + +class WorkerInfo(BaseModel): + scheduler_url: str + namespace: str + + +async def get_scheduler_namespace( + client: "Mistral", + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, +) -> str: + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = client.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = client._get_url(base_url, url_variables) + req = client._build_request_async( + method="GET", + path="/v1/workflows/workers/whoami", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=client.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if client.sdk_configuration.retry_config is not UNSET: + retries = client.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await client.do_request_async( + hook_ctx=HookContext( + config=client.sdk_configuration, + base_url=base_url or "", + operation_id="get_worker_info_v1_workflows_workers_whoami_get", + oauth2_scopes=None, + security_source=get_security_from_env( + client.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(WorkerInfo, http_res).namespace + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError("API error occurred", http_res, http_res_text) + + raise errors.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/fim.py b/src/mistralai/fim.py deleted file mode 100644 index fa7b15c2..00000000 --- a/src/mistralai/fim.py +++ /dev/null @@ -1,525 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import eventstreaming, get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional, Union - - -class Fim(BaseSDK): - r"""Fill-in-the-middle API.""" - - def complete( - self, - *, - model: str, - prompt: str, - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.FIMCompletionRequestStop, - models.FIMCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - suffix: OptionalNullable[str] = UNSET, - min_tokens: OptionalNullable[int] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.FIMCompletionResponse: - r"""Fim Completion - - FIM completion. - - :param model: ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` - :param prompt: The text/code to complete. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. - :param min_tokens: The minimum number of tokens to generate in the completion. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FIMCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - prompt=prompt, - suffix=suffix, - min_tokens=min_tokens, - ) - - req = self._build_request( - method="POST", - path="/v1/fim/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.FIMCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="fim_completion_v1_fim_completions_post", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.FIMCompletionResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def complete_async( - self, - *, - model: str, - prompt: str, - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = False, - stop: Optional[ - Union[ - models.FIMCompletionRequestStop, - models.FIMCompletionRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - suffix: OptionalNullable[str] = UNSET, - min_tokens: OptionalNullable[int] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.FIMCompletionResponse: - r"""Fim Completion - - FIM completion. - - :param model: ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` - :param prompt: The text/code to complete. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. - :param min_tokens: The minimum number of tokens to generate in the completion. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FIMCompletionRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - prompt=prompt, - suffix=suffix, - min_tokens=min_tokens, - ) - - req = self._build_request_async( - method="POST", - path="/v1/fim/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.FIMCompletionRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="fim_completion_v1_fim_completions_post", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.FIMCompletionResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def stream( - self, - *, - model: str, - prompt: str, - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[ - Union[ - models.FIMCompletionStreamRequestStop, - models.FIMCompletionStreamRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - suffix: OptionalNullable[str] = UNSET, - min_tokens: OptionalNullable[int] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStream[models.CompletionEvent]: - r"""Stream fim completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param model: ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` - :param prompt: The text/code to complete. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. - :param min_tokens: The minimum number of tokens to generate in the completion. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FIMCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - prompt=prompt, - suffix=suffix, - min_tokens=min_tokens, - ) - - req = self._build_request( - method="POST", - path="/v1/fim/completions#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.FIMCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="stream_fim", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStream( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) - - async def stream_async( - self, - *, - model: str, - prompt: str, - temperature: OptionalNullable[float] = UNSET, - top_p: Optional[float] = 1, - max_tokens: OptionalNullable[int] = UNSET, - stream: Optional[bool] = True, - stop: Optional[ - Union[ - models.FIMCompletionStreamRequestStop, - models.FIMCompletionStreamRequestStopTypedDict, - ] - ] = None, - random_seed: OptionalNullable[int] = UNSET, - suffix: OptionalNullable[str] = UNSET, - min_tokens: OptionalNullable[int] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> eventstreaming.EventStreamAsync[models.CompletionEvent]: - r"""Stream fim completion - - Mistral AI provides the ability to stream responses back to a client in order to allow partial results for certain requests. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. - - :param model: ID of the model to use. Only compatible for now with: - `codestral-2405` - `codestral-latest` - :param prompt: The text/code to complete. - :param temperature: What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value. - :param top_p: Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. - :param max_tokens: The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. - :param stream: - :param stop: Stop generation if this token is detected. Or if one of these tokens is detected when providing an array - :param random_seed: The seed to use for random sampling. If set, different calls will generate deterministic results. - :param suffix: Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. - :param min_tokens: The minimum number of tokens to generate in the completion. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.FIMCompletionStreamRequest( - model=model, - temperature=temperature, - top_p=top_p, - max_tokens=max_tokens, - stream=stream, - stop=stop, - random_seed=random_seed, - prompt=prompt, - suffix=suffix, - min_tokens=min_tokens, - ) - - req = self._build_request_async( - method="POST", - path="/v1/fim/completions#stream", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="text/event-stream", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.FIMCompletionStreamRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="stream_fim", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return eventstreaming.EventStreamAsync( - http_res, - lambda raw: utils.unmarshal_json(raw, models.CompletionEvent), - sentinel="[DONE]", - client_ref=self, - ) - if utils.match_response(http_res, "422", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res, http_res_text - ) - raise models.HTTPValidationError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("Unexpected response received", http_res, http_res_text) diff --git a/src/mistralai/fine_tuning.py b/src/mistralai/fine_tuning.py deleted file mode 100644 index 8ed5788a..00000000 --- a/src/mistralai/fine_tuning.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from .sdkconfiguration import SDKConfiguration -from mistralai.jobs import Jobs -from typing import Optional - - -class FineTuning(BaseSDK): - jobs: Jobs - - def __init__( - self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None - ) -> None: - BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref) - self.sdk_configuration = sdk_config - self._init_sdks() - - def _init_sdks(self): - self.jobs = Jobs(self.sdk_configuration, parent_ref=self.parent_ref) diff --git a/src/mistralai/httpclient.py b/src/mistralai/httpclient.py deleted file mode 100644 index 47b052cb..00000000 --- a/src/mistralai/httpclient.py +++ /dev/null @@ -1,126 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -# pyright: reportReturnType = false -import asyncio -from typing_extensions import Protocol, runtime_checkable -import httpx -from typing import Any, Optional, Union - - -@runtime_checkable -class HttpClient(Protocol): - def send( - self, - request: httpx.Request, - *, - stream: bool = False, - auth: Union[ - httpx._types.AuthTypes, httpx._client.UseClientDefault, None - ] = httpx.USE_CLIENT_DEFAULT, - follow_redirects: Union[ - bool, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - ) -> httpx.Response: - pass - - def build_request( - self, - method: str, - url: httpx._types.URLTypes, - *, - content: Optional[httpx._types.RequestContent] = None, - data: Optional[httpx._types.RequestData] = None, - files: Optional[httpx._types.RequestFiles] = None, - json: Optional[Any] = None, - params: Optional[httpx._types.QueryParamTypes] = None, - headers: Optional[httpx._types.HeaderTypes] = None, - cookies: Optional[httpx._types.CookieTypes] = None, - timeout: Union[ - httpx._types.TimeoutTypes, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - extensions: Optional[httpx._types.RequestExtensions] = None, - ) -> httpx.Request: - pass - - def close(self) -> None: - pass - - -@runtime_checkable -class AsyncHttpClient(Protocol): - async def send( - self, - request: httpx.Request, - *, - stream: bool = False, - auth: Union[ - httpx._types.AuthTypes, httpx._client.UseClientDefault, None - ] = httpx.USE_CLIENT_DEFAULT, - follow_redirects: Union[ - bool, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - ) -> httpx.Response: - pass - - def build_request( - self, - method: str, - url: httpx._types.URLTypes, - *, - content: Optional[httpx._types.RequestContent] = None, - data: Optional[httpx._types.RequestData] = None, - files: Optional[httpx._types.RequestFiles] = None, - json: Optional[Any] = None, - params: Optional[httpx._types.QueryParamTypes] = None, - headers: Optional[httpx._types.HeaderTypes] = None, - cookies: Optional[httpx._types.CookieTypes] = None, - timeout: Union[ - httpx._types.TimeoutTypes, httpx._client.UseClientDefault - ] = httpx.USE_CLIENT_DEFAULT, - extensions: Optional[httpx._types.RequestExtensions] = None, - ) -> httpx.Request: - pass - - async def aclose(self) -> None: - pass - - -class ClientOwner(Protocol): - client: Union[HttpClient, None] - async_client: Union[AsyncHttpClient, None] - - -def close_clients( - owner: ClientOwner, - sync_client: Union[HttpClient, None], - sync_client_supplied: bool, - async_client: Union[AsyncHttpClient, None], - async_client_supplied: bool, -) -> None: - """ - A finalizer function that is meant to be used with weakref.finalize to close - httpx clients used by an SDK so that underlying resources can be garbage - collected. - """ - - # Unset the client/async_client properties so there are no more references - # to them from the owning SDK instance and they can be reaped. - owner.client = None - owner.async_client = None - - if sync_client is not None and not sync_client_supplied: - try: - sync_client.close() - except Exception: - pass - - if async_client is not None and not async_client_supplied: - try: - loop = asyncio.get_running_loop() - asyncio.run_coroutine_threadsafe(async_client.aclose(), loop) - except RuntimeError: - try: - asyncio.run(async_client.aclose()) - except RuntimeError: - # best effort - pass diff --git a/src/mistralai/jobs.py b/src/mistralai/jobs.py deleted file mode 100644 index af6364cb..00000000 --- a/src/mistralai/jobs.py +++ /dev/null @@ -1,1028 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from datetime import datetime -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import List, Mapping, Optional, Union - - -class Jobs(BaseSDK): - def list( - self, - *, - page: Optional[int] = 0, - page_size: Optional[int] = 100, - model: OptionalNullable[str] = UNSET, - created_after: OptionalNullable[datetime] = UNSET, - created_before: OptionalNullable[datetime] = UNSET, - created_by_me: Optional[bool] = False, - status: OptionalNullable[models.QueryParamStatus] = UNSET, - wandb_project: OptionalNullable[str] = UNSET, - wandb_name: OptionalNullable[str] = UNSET, - suffix: OptionalNullable[str] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsOut: - r"""Get Fine Tuning Jobs - - Get a list of fine-tuning jobs for your organization and user. - - :param page: The page number of the results to be returned. - :param page_size: The number of items to return per page. - :param model: The model name used for fine-tuning to filter on. When set, the other results are not displayed. - :param created_after: The date/time to filter on. When set, the results for previous creation times are not displayed. - :param created_before: - :param created_by_me: When set, only return results for jobs created by the API caller. Other results are not displayed. - :param status: The current job state to filter on. When set, the other results are not displayed. - :param wandb_project: The Weights and Biases project to filter on. When set, the other results are not displayed. - :param wandb_name: The Weight and Biases run name to filter on. When set, the other results are not displayed. - :param suffix: The model suffix to filter on. When set, the other results are not displayed. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesFineTuningGetFineTuningJobsRequest( - page=page, - page_size=page_size, - model=model, - created_after=created_after, - created_before=created_before, - created_by_me=created_by_me, - status=status, - wandb_project=wandb_project, - wandb_name=wandb_name, - suffix=suffix, - ) - - req = self._build_request( - method="GET", - path="/v1/fine_tuning/jobs", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_jobs", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.JobsOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def list_async( - self, - *, - page: Optional[int] = 0, - page_size: Optional[int] = 100, - model: OptionalNullable[str] = UNSET, - created_after: OptionalNullable[datetime] = UNSET, - created_before: OptionalNullable[datetime] = UNSET, - created_by_me: Optional[bool] = False, - status: OptionalNullable[models.QueryParamStatus] = UNSET, - wandb_project: OptionalNullable[str] = UNSET, - wandb_name: OptionalNullable[str] = UNSET, - suffix: OptionalNullable[str] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsOut: - r"""Get Fine Tuning Jobs - - Get a list of fine-tuning jobs for your organization and user. - - :param page: The page number of the results to be returned. - :param page_size: The number of items to return per page. - :param model: The model name used for fine-tuning to filter on. When set, the other results are not displayed. - :param created_after: The date/time to filter on. When set, the results for previous creation times are not displayed. - :param created_before: - :param created_by_me: When set, only return results for jobs created by the API caller. Other results are not displayed. - :param status: The current job state to filter on. When set, the other results are not displayed. - :param wandb_project: The Weights and Biases project to filter on. When set, the other results are not displayed. - :param wandb_name: The Weight and Biases run name to filter on. When set, the other results are not displayed. - :param suffix: The model suffix to filter on. When set, the other results are not displayed. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesFineTuningGetFineTuningJobsRequest( - page=page, - page_size=page_size, - model=model, - created_after=created_after, - created_before=created_before, - created_by_me=created_by_me, - status=status, - wandb_project=wandb_project, - wandb_name=wandb_name, - suffix=suffix, - ) - - req = self._build_request_async( - method="GET", - path="/v1/fine_tuning/jobs", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_jobs", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.JobsOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def create( - self, - *, - model: str, - hyperparameters: Union[models.Hyperparameters, models.HyperparametersTypedDict], - training_files: Optional[ - Union[List[models.TrainingFile], List[models.TrainingFileTypedDict]] - ] = None, - validation_files: OptionalNullable[List[str]] = UNSET, - suffix: OptionalNullable[str] = UNSET, - integrations: OptionalNullable[ - Union[ - List[models.JobInIntegrations], List[models.JobInIntegrationsTypedDict] - ] - ] = UNSET, - auto_start: Optional[bool] = None, - invalid_sample_skip_percentage: Optional[float] = 0, - job_type: OptionalNullable[models.FineTuneableModelType] = UNSET, - repositories: OptionalNullable[ - Union[ - List[models.JobInRepositories], List[models.JobInRepositoriesTypedDict] - ] - ] = UNSET, - classifier_targets: OptionalNullable[ - Union[ - List[models.ClassifierTargetIn], - List[models.ClassifierTargetInTypedDict], - ] - ] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse: - r"""Create Fine Tuning Job - - Create a new fine-tuning job, it will be queued for processing. - - :param model: The name of the model to fine-tune. - :param hyperparameters: - :param training_files: - :param validation_files: A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. - :param suffix: A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` - :param integrations: A list of integrations to enable for your fine-tuning job. - :param auto_start: This field will be required in a future release. - :param invalid_sample_skip_percentage: - :param job_type: - :param repositories: - :param classifier_targets: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobIn( - model=model, - training_files=utils.get_pydantic_model( - training_files, Optional[List[models.TrainingFile]] - ), - validation_files=validation_files, - suffix=suffix, - integrations=utils.get_pydantic_model( - integrations, OptionalNullable[List[models.JobInIntegrations]] - ), - auto_start=auto_start, - invalid_sample_skip_percentage=invalid_sample_skip_percentage, - job_type=job_type, - hyperparameters=utils.get_pydantic_model( - hyperparameters, models.Hyperparameters - ), - repositories=utils.get_pydantic_model( - repositories, OptionalNullable[List[models.JobInRepositories]] - ), - classifier_targets=utils.get_pydantic_model( - classifier_targets, OptionalNullable[List[models.ClassifierTargetIn]] - ), - ) - - req = self._build_request( - method="POST", - path="/v1/fine_tuning/jobs", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.JobIn - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_create_fine_tuning_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse, http_res - ) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def create_async( - self, - *, - model: str, - hyperparameters: Union[models.Hyperparameters, models.HyperparametersTypedDict], - training_files: Optional[ - Union[List[models.TrainingFile], List[models.TrainingFileTypedDict]] - ] = None, - validation_files: OptionalNullable[List[str]] = UNSET, - suffix: OptionalNullable[str] = UNSET, - integrations: OptionalNullable[ - Union[ - List[models.JobInIntegrations], List[models.JobInIntegrationsTypedDict] - ] - ] = UNSET, - auto_start: Optional[bool] = None, - invalid_sample_skip_percentage: Optional[float] = 0, - job_type: OptionalNullable[models.FineTuneableModelType] = UNSET, - repositories: OptionalNullable[ - Union[ - List[models.JobInRepositories], List[models.JobInRepositoriesTypedDict] - ] - ] = UNSET, - classifier_targets: OptionalNullable[ - Union[ - List[models.ClassifierTargetIn], - List[models.ClassifierTargetInTypedDict], - ] - ] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse: - r"""Create Fine Tuning Job - - Create a new fine-tuning job, it will be queued for processing. - - :param model: The name of the model to fine-tune. - :param hyperparameters: - :param training_files: - :param validation_files: A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. - :param suffix: A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` - :param integrations: A list of integrations to enable for your fine-tuning job. - :param auto_start: This field will be required in a future release. - :param invalid_sample_skip_percentage: - :param job_type: - :param repositories: - :param classifier_targets: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobIn( - model=model, - training_files=utils.get_pydantic_model( - training_files, Optional[List[models.TrainingFile]] - ), - validation_files=validation_files, - suffix=suffix, - integrations=utils.get_pydantic_model( - integrations, OptionalNullable[List[models.JobInIntegrations]] - ), - auto_start=auto_start, - invalid_sample_skip_percentage=invalid_sample_skip_percentage, - job_type=job_type, - hyperparameters=utils.get_pydantic_model( - hyperparameters, models.Hyperparameters - ), - repositories=utils.get_pydantic_model( - repositories, OptionalNullable[List[models.JobInRepositories]] - ), - classifier_targets=utils.get_pydantic_model( - classifier_targets, OptionalNullable[List[models.ClassifierTargetIn]] - ), - ) - - req = self._build_request_async( - method="POST", - path="/v1/fine_tuning/jobs", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.JobIn - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_create_fine_tuning_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.JobsAPIRoutesFineTuningCreateFineTuningJobResponse, http_res - ) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def get( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsAPIRoutesFineTuningGetFineTuningJobResponse: - r"""Get Fine Tuning Job - - Get a fine-tuned job details by its UUID. - - :param job_id: The ID of the job to analyse. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesFineTuningGetFineTuningJobRequest( - job_id=job_id, - ) - - req = self._build_request( - method="GET", - path="/v1/fine_tuning/jobs/{job_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.JobsAPIRoutesFineTuningGetFineTuningJobResponse, http_res - ) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def get_async( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsAPIRoutesFineTuningGetFineTuningJobResponse: - r"""Get Fine Tuning Job - - Get a fine-tuned job details by its UUID. - - :param job_id: The ID of the job to analyse. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesFineTuningGetFineTuningJobRequest( - job_id=job_id, - ) - - req = self._build_request_async( - method="GET", - path="/v1/fine_tuning/jobs/{job_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_get_fine_tuning_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.JobsAPIRoutesFineTuningGetFineTuningJobResponse, http_res - ) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def cancel( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse: - r"""Cancel Fine Tuning Job - - Request the cancellation of a fine tuning job. - - :param job_id: The ID of the job to cancel. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesFineTuningCancelFineTuningJobRequest( - job_id=job_id, - ) - - req = self._build_request( - method="POST", - path="/v1/fine_tuning/jobs/{job_id}/cancel", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_cancel_fine_tuning_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse, http_res - ) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def cancel_async( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse: - r"""Cancel Fine Tuning Job - - Request the cancellation of a fine tuning job. - - :param job_id: The ID of the job to cancel. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesFineTuningCancelFineTuningJobRequest( - job_id=job_id, - ) - - req = self._build_request_async( - method="POST", - path="/v1/fine_tuning/jobs/{job_id}/cancel", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_cancel_fine_tuning_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.JobsAPIRoutesFineTuningCancelFineTuningJobResponse, http_res - ) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def start( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsAPIRoutesFineTuningStartFineTuningJobResponse: - r"""Start Fine Tuning Job - - Request the start of a validated fine tuning job. - - :param job_id: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesFineTuningStartFineTuningJobRequest( - job_id=job_id, - ) - - req = self._build_request( - method="POST", - path="/v1/fine_tuning/jobs/{job_id}/start", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_start_fine_tuning_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.JobsAPIRoutesFineTuningStartFineTuningJobResponse, http_res - ) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def start_async( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.JobsAPIRoutesFineTuningStartFineTuningJobResponse: - r"""Start Fine Tuning Job - - Request the start of a validated fine tuning job. - - :param job_id: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesFineTuningStartFineTuningJobRequest( - job_id=job_id, - ) - - req = self._build_request_async( - method="POST", - path="/v1/fine_tuning/jobs/{job_id}/start", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_fine_tuning_start_fine_tuning_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response( - models.JobsAPIRoutesFineTuningStartFineTuningJobResponse, http_res - ) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/mistral_agents.py b/src/mistralai/mistral_agents.py deleted file mode 100644 index 65f256d6..00000000 --- a/src/mistralai/mistral_agents.py +++ /dev/null @@ -1,1061 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, List, Mapping, Optional, Union - - -class MistralAgents(BaseSDK): - r"""(beta) Agents API""" - - def create( - self, - *, - model: str, - name: str, - instructions: OptionalNullable[str] = UNSET, - tools: Optional[ - Union[ - List[models.AgentCreationRequestTools], - List[models.AgentCreationRequestToolsTypedDict], - ] - ] = None, - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - description: OptionalNullable[str] = UNSET, - handoffs: OptionalNullable[List[str]] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.Agent: - r"""Create a agent that can be used within a conversation. - - Create a new agent giving it instructions, tools, description. The agent is then available to be used as a regular assistant in a conversation or as part of an agent pool from which it can be used. - - :param model: - :param name: - :param instructions: Instruction prompt the model will follow during the conversation. - :param tools: List of tools which are available to the model during the conversation. - :param completion_args: White-listed arguments from the completion API - :param description: - :param handoffs: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentCreationRequest( - instructions=instructions, - tools=utils.get_pydantic_model( - tools, Optional[List[models.AgentCreationRequestTools]] - ), - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - model=model, - name=name, - description=description, - handoffs=handoffs, - ) - - req = self._build_request( - method="POST", - path="/v1/agents", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.AgentCreationRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_create", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.Agent, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def create_async( - self, - *, - model: str, - name: str, - instructions: OptionalNullable[str] = UNSET, - tools: Optional[ - Union[ - List[models.AgentCreationRequestTools], - List[models.AgentCreationRequestToolsTypedDict], - ] - ] = None, - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - description: OptionalNullable[str] = UNSET, - handoffs: OptionalNullable[List[str]] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.Agent: - r"""Create a agent that can be used within a conversation. - - Create a new agent giving it instructions, tools, description. The agent is then available to be used as a regular assistant in a conversation or as part of an agent pool from which it can be used. - - :param model: - :param name: - :param instructions: Instruction prompt the model will follow during the conversation. - :param tools: List of tools which are available to the model during the conversation. - :param completion_args: White-listed arguments from the completion API - :param description: - :param handoffs: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentCreationRequest( - instructions=instructions, - tools=utils.get_pydantic_model( - tools, Optional[List[models.AgentCreationRequestTools]] - ), - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - model=model, - name=name, - description=description, - handoffs=handoffs, - ) - - req = self._build_request_async( - method="POST", - path="/v1/agents", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.AgentCreationRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_create", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.Agent, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def list( - self, - *, - page: Optional[int] = 0, - page_size: Optional[int] = 20, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> List[models.Agent]: - r"""List agent entities. - - Retrieve a list of agent entities sorted by creation time. - - :param page: - :param page_size: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1AgentsListRequest( - page=page, - page_size=page_size, - ) - - req = self._build_request( - method="GET", - path="/v1/agents", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_list", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(List[models.Agent], http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def list_async( - self, - *, - page: Optional[int] = 0, - page_size: Optional[int] = 20, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> List[models.Agent]: - r"""List agent entities. - - Retrieve a list of agent entities sorted by creation time. - - :param page: - :param page_size: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1AgentsListRequest( - page=page, - page_size=page_size, - ) - - req = self._build_request_async( - method="GET", - path="/v1/agents", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_list", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(List[models.Agent], http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def get( - self, - *, - agent_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.Agent: - r"""Retrieve an agent entity. - - Given an agent retrieve an agent entity with its attributes. - - :param agent_id: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1AgentsGetRequest( - agent_id=agent_id, - ) - - req = self._build_request( - method="GET", - path="/v1/agents/{agent_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_get", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.Agent, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def get_async( - self, - *, - agent_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.Agent: - r"""Retrieve an agent entity. - - Given an agent retrieve an agent entity with its attributes. - - :param agent_id: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1AgentsGetRequest( - agent_id=agent_id, - ) - - req = self._build_request_async( - method="GET", - path="/v1/agents/{agent_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_get", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.Agent, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def update( - self, - *, - agent_id: str, - instructions: OptionalNullable[str] = UNSET, - tools: Optional[ - Union[ - List[models.AgentUpdateRequestTools], - List[models.AgentUpdateRequestToolsTypedDict], - ] - ] = None, - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - model: OptionalNullable[str] = UNSET, - name: OptionalNullable[str] = UNSET, - description: OptionalNullable[str] = UNSET, - handoffs: OptionalNullable[List[str]] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.Agent: - r"""Update an agent entity. - - Update an agent attributes and create a new version. - - :param agent_id: - :param instructions: Instruction prompt the model will follow during the conversation. - :param tools: List of tools which are available to the model during the conversation. - :param completion_args: White-listed arguments from the completion API - :param model: - :param name: - :param description: - :param handoffs: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1AgentsUpdateRequest( - agent_id=agent_id, - agent_update_request=models.AgentUpdateRequest( - instructions=instructions, - tools=utils.get_pydantic_model( - tools, Optional[List[models.AgentUpdateRequestTools]] - ), - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - model=model, - name=name, - description=description, - handoffs=handoffs, - ), - ) - - req = self._build_request( - method="PATCH", - path="/v1/agents/{agent_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.agent_update_request, - False, - False, - "json", - models.AgentUpdateRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_update", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.Agent, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def update_async( - self, - *, - agent_id: str, - instructions: OptionalNullable[str] = UNSET, - tools: Optional[ - Union[ - List[models.AgentUpdateRequestTools], - List[models.AgentUpdateRequestToolsTypedDict], - ] - ] = None, - completion_args: Optional[ - Union[models.CompletionArgs, models.CompletionArgsTypedDict] - ] = None, - model: OptionalNullable[str] = UNSET, - name: OptionalNullable[str] = UNSET, - description: OptionalNullable[str] = UNSET, - handoffs: OptionalNullable[List[str]] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.Agent: - r"""Update an agent entity. - - Update an agent attributes and create a new version. - - :param agent_id: - :param instructions: Instruction prompt the model will follow during the conversation. - :param tools: List of tools which are available to the model during the conversation. - :param completion_args: White-listed arguments from the completion API - :param model: - :param name: - :param description: - :param handoffs: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1AgentsUpdateRequest( - agent_id=agent_id, - agent_update_request=models.AgentUpdateRequest( - instructions=instructions, - tools=utils.get_pydantic_model( - tools, Optional[List[models.AgentUpdateRequestTools]] - ), - completion_args=utils.get_pydantic_model( - completion_args, Optional[models.CompletionArgs] - ), - model=model, - name=name, - description=description, - handoffs=handoffs, - ), - ) - - req = self._build_request_async( - method="PATCH", - path="/v1/agents/{agent_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.agent_update_request, - False, - False, - "json", - models.AgentUpdateRequest, - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_update", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.Agent, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def update_version( - self, - *, - agent_id: str, - version: int, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.Agent: - r"""Update an agent version. - - Switch the version of an agent. - - :param agent_id: - :param version: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1AgentsUpdateVersionRequest( - agent_id=agent_id, - version=version, - ) - - req = self._build_request( - method="PATCH", - path="/v1/agents/{agent_id}/version", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_update_version", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.Agent, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def update_version_async( - self, - *, - agent_id: str, - version: int, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.Agent: - r"""Update an agent version. - - Switch the version of an agent. - - :param agent_id: - :param version: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.AgentsAPIV1AgentsUpdateVersionRequest( - agent_id=agent_id, - version=version, - ) - - req = self._build_request_async( - method="PATCH", - path="/v1/agents/{agent_id}/version", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="agents_api_v1_agents_update_version", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.Agent, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/mistral_jobs.py b/src/mistralai/mistral_jobs.py deleted file mode 100644 index fb0a0de7..00000000 --- a/src/mistralai/mistral_jobs.py +++ /dev/null @@ -1,754 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from datetime import datetime -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Dict, List, Mapping, Optional - - -class MistralJobs(BaseSDK): - def list( - self, - *, - page: Optional[int] = 0, - page_size: Optional[int] = 100, - model: OptionalNullable[str] = UNSET, - agent_id: OptionalNullable[str] = UNSET, - metadata: OptionalNullable[Dict[str, Any]] = UNSET, - created_after: OptionalNullable[datetime] = UNSET, - created_by_me: Optional[bool] = False, - status: OptionalNullable[List[models.BatchJobStatus]] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.BatchJobsOut: - r"""Get Batch Jobs - - Get a list of batch jobs for your organization and user. - - :param page: - :param page_size: - :param model: - :param agent_id: - :param metadata: - :param created_after: - :param created_by_me: - :param status: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesBatchGetBatchJobsRequest( - page=page, - page_size=page_size, - model=model, - agent_id=agent_id, - metadata=metadata, - created_after=created_after, - created_by_me=created_by_me, - status=status, - ) - - req = self._build_request( - method="GET", - path="/v1/batch/jobs", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_batch_get_batch_jobs", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.BatchJobsOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def list_async( - self, - *, - page: Optional[int] = 0, - page_size: Optional[int] = 100, - model: OptionalNullable[str] = UNSET, - agent_id: OptionalNullable[str] = UNSET, - metadata: OptionalNullable[Dict[str, Any]] = UNSET, - created_after: OptionalNullable[datetime] = UNSET, - created_by_me: Optional[bool] = False, - status: OptionalNullable[List[models.BatchJobStatus]] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.BatchJobsOut: - r"""Get Batch Jobs - - Get a list of batch jobs for your organization and user. - - :param page: - :param page_size: - :param model: - :param agent_id: - :param metadata: - :param created_after: - :param created_by_me: - :param status: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesBatchGetBatchJobsRequest( - page=page, - page_size=page_size, - model=model, - agent_id=agent_id, - metadata=metadata, - created_after=created_after, - created_by_me=created_by_me, - status=status, - ) - - req = self._build_request_async( - method="GET", - path="/v1/batch/jobs", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_batch_get_batch_jobs", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.BatchJobsOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def create( - self, - *, - input_files: List[str], - endpoint: models.APIEndpoint, - model: OptionalNullable[str] = UNSET, - agent_id: OptionalNullable[str] = UNSET, - metadata: OptionalNullable[Dict[str, str]] = UNSET, - timeout_hours: Optional[int] = 24, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.BatchJobOut: - r"""Create Batch Job - - Create a new batch job, it will be queued for processing. - - :param input_files: - :param endpoint: - :param model: - :param agent_id: - :param metadata: - :param timeout_hours: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.BatchJobIn( - input_files=input_files, - endpoint=endpoint, - model=model, - agent_id=agent_id, - metadata=metadata, - timeout_hours=timeout_hours, - ) - - req = self._build_request( - method="POST", - path="/v1/batch/jobs", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.BatchJobIn - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_batch_create_batch_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.BatchJobOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def create_async( - self, - *, - input_files: List[str], - endpoint: models.APIEndpoint, - model: OptionalNullable[str] = UNSET, - agent_id: OptionalNullable[str] = UNSET, - metadata: OptionalNullable[Dict[str, str]] = UNSET, - timeout_hours: Optional[int] = 24, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.BatchJobOut: - r"""Create Batch Job - - Create a new batch job, it will be queued for processing. - - :param input_files: - :param endpoint: - :param model: - :param agent_id: - :param metadata: - :param timeout_hours: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.BatchJobIn( - input_files=input_files, - endpoint=endpoint, - model=model, - agent_id=agent_id, - metadata=metadata, - timeout_hours=timeout_hours, - ) - - req = self._build_request_async( - method="POST", - path="/v1/batch/jobs", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.BatchJobIn - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_batch_create_batch_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.BatchJobOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def get( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.BatchJobOut: - r"""Get Batch Job - - Get a batch job details by its UUID. - - :param job_id: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesBatchGetBatchJobRequest( - job_id=job_id, - ) - - req = self._build_request( - method="GET", - path="/v1/batch/jobs/{job_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_batch_get_batch_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.BatchJobOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def get_async( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.BatchJobOut: - r"""Get Batch Job - - Get a batch job details by its UUID. - - :param job_id: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesBatchGetBatchJobRequest( - job_id=job_id, - ) - - req = self._build_request_async( - method="GET", - path="/v1/batch/jobs/{job_id}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_batch_get_batch_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.BatchJobOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - def cancel( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.BatchJobOut: - r"""Cancel Batch Job - - Request the cancellation of a batch job. - - :param job_id: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesBatchCancelBatchJobRequest( - job_id=job_id, - ) - - req = self._build_request( - method="POST", - path="/v1/batch/jobs/{job_id}/cancel", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_batch_cancel_batch_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.BatchJobOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def cancel_async( - self, - *, - job_id: str, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.BatchJobOut: - r"""Cancel Batch Job - - Request the cancellation of a batch job. - - :param job_id: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.JobsAPIRoutesBatchCancelBatchJobRequest( - job_id=job_id, - ) - - req = self._build_request_async( - method="POST", - path="/v1/batch/jobs/{job_id}/cancel", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="jobs_api_routes_batch_cancel_batch_job", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["4XX", "5XX"], - retry_config=retry_config, - ) - - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.BatchJobOut, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/models/__init__.py b/src/mistralai/models/__init__.py deleted file mode 100644 index 0298e73b..00000000 --- a/src/mistralai/models/__init__.py +++ /dev/null @@ -1,2316 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .mistralerror import MistralError -from typing import TYPE_CHECKING -from importlib import import_module -import builtins -import sys - -if TYPE_CHECKING: - from .agent import ( - Agent, - AgentObject, - AgentTools, - AgentToolsTypedDict, - AgentTypedDict, - ) - from .agentconversation import ( - AgentConversation, - AgentConversationObject, - AgentConversationTypedDict, - ) - from .agentcreationrequest import ( - AgentCreationRequest, - AgentCreationRequestTools, - AgentCreationRequestToolsTypedDict, - AgentCreationRequestTypedDict, - ) - from .agenthandoffdoneevent import ( - AgentHandoffDoneEvent, - AgentHandoffDoneEventType, - AgentHandoffDoneEventTypedDict, - ) - from .agenthandoffentry import ( - AgentHandoffEntry, - AgentHandoffEntryObject, - AgentHandoffEntryType, - AgentHandoffEntryTypedDict, - ) - from .agenthandoffstartedevent import ( - AgentHandoffStartedEvent, - AgentHandoffStartedEventType, - AgentHandoffStartedEventTypedDict, - ) - from .agents_api_v1_agents_getop import ( - AgentsAPIV1AgentsGetRequest, - AgentsAPIV1AgentsGetRequestTypedDict, - ) - from .agents_api_v1_agents_listop import ( - AgentsAPIV1AgentsListRequest, - AgentsAPIV1AgentsListRequestTypedDict, - ) - from .agents_api_v1_agents_update_versionop import ( - AgentsAPIV1AgentsUpdateVersionRequest, - AgentsAPIV1AgentsUpdateVersionRequestTypedDict, - ) - from .agents_api_v1_agents_updateop import ( - AgentsAPIV1AgentsUpdateRequest, - AgentsAPIV1AgentsUpdateRequestTypedDict, - ) - from .agents_api_v1_conversations_append_streamop import ( - AgentsAPIV1ConversationsAppendStreamRequest, - AgentsAPIV1ConversationsAppendStreamRequestTypedDict, - ) - from .agents_api_v1_conversations_appendop import ( - AgentsAPIV1ConversationsAppendRequest, - AgentsAPIV1ConversationsAppendRequestTypedDict, - ) - from .agents_api_v1_conversations_getop import ( - AgentsAPIV1ConversationsGetRequest, - AgentsAPIV1ConversationsGetRequestTypedDict, - AgentsAPIV1ConversationsGetResponseV1ConversationsGet, - AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict, - ) - from .agents_api_v1_conversations_historyop import ( - AgentsAPIV1ConversationsHistoryRequest, - AgentsAPIV1ConversationsHistoryRequestTypedDict, - ) - from .agents_api_v1_conversations_listop import ( - AgentsAPIV1ConversationsListRequest, - AgentsAPIV1ConversationsListRequestTypedDict, - ResponseBody, - ResponseBodyTypedDict, - ) - from .agents_api_v1_conversations_messagesop import ( - AgentsAPIV1ConversationsMessagesRequest, - AgentsAPIV1ConversationsMessagesRequestTypedDict, - ) - from .agents_api_v1_conversations_restart_streamop import ( - AgentsAPIV1ConversationsRestartStreamRequest, - AgentsAPIV1ConversationsRestartStreamRequestTypedDict, - ) - from .agents_api_v1_conversations_restartop import ( - AgentsAPIV1ConversationsRestartRequest, - AgentsAPIV1ConversationsRestartRequestTypedDict, - ) - from .agentscompletionrequest import ( - AgentsCompletionRequest, - AgentsCompletionRequestMessages, - AgentsCompletionRequestMessagesTypedDict, - AgentsCompletionRequestStop, - AgentsCompletionRequestStopTypedDict, - AgentsCompletionRequestToolChoice, - AgentsCompletionRequestToolChoiceTypedDict, - AgentsCompletionRequestTypedDict, - ) - from .agentscompletionstreamrequest import ( - AgentsCompletionStreamRequest, - AgentsCompletionStreamRequestMessages, - AgentsCompletionStreamRequestMessagesTypedDict, - AgentsCompletionStreamRequestStop, - AgentsCompletionStreamRequestStopTypedDict, - AgentsCompletionStreamRequestToolChoice, - AgentsCompletionStreamRequestToolChoiceTypedDict, - AgentsCompletionStreamRequestTypedDict, - ) - from .agentupdaterequest import ( - AgentUpdateRequest, - AgentUpdateRequestTools, - AgentUpdateRequestToolsTypedDict, - AgentUpdateRequestTypedDict, - ) - from .apiendpoint import APIEndpoint - from .archiveftmodelout import ( - ArchiveFTModelOut, - ArchiveFTModelOutObject, - ArchiveFTModelOutTypedDict, - ) - from .assistantmessage import ( - AssistantMessage, - AssistantMessageContent, - AssistantMessageContentTypedDict, - AssistantMessageRole, - AssistantMessageTypedDict, - ) - from .audiochunk import AudioChunk, AudioChunkType, AudioChunkTypedDict - from .audiotranscriptionrequest import ( - AudioTranscriptionRequest, - AudioTranscriptionRequestTypedDict, - ) - from .audiotranscriptionrequeststream import ( - AudioTranscriptionRequestStream, - AudioTranscriptionRequestStreamTypedDict, - ) - from .basemodelcard import BaseModelCard, BaseModelCardType, BaseModelCardTypedDict - from .batcherror import BatchError, BatchErrorTypedDict - from .batchjobin import BatchJobIn, BatchJobInTypedDict - from .batchjobout import BatchJobOut, BatchJobOutObject, BatchJobOutTypedDict - from .batchjobsout import BatchJobsOut, BatchJobsOutObject, BatchJobsOutTypedDict - from .batchjobstatus import BatchJobStatus - from .builtinconnectors import BuiltInConnectors - from .chatclassificationrequest import ( - ChatClassificationRequest, - ChatClassificationRequestTypedDict, - ) - from .chatcompletionchoice import ( - ChatCompletionChoice, - ChatCompletionChoiceTypedDict, - FinishReason, - ) - from .chatcompletionrequest import ( - ChatCompletionRequest, - ChatCompletionRequestToolChoice, - ChatCompletionRequestToolChoiceTypedDict, - ChatCompletionRequestTypedDict, - Messages, - MessagesTypedDict, - Stop, - StopTypedDict, - ) - from .chatcompletionresponse import ( - ChatCompletionResponse, - ChatCompletionResponseTypedDict, - ) - from .chatcompletionstreamrequest import ( - ChatCompletionStreamRequest, - ChatCompletionStreamRequestMessages, - ChatCompletionStreamRequestMessagesTypedDict, - ChatCompletionStreamRequestStop, - ChatCompletionStreamRequestStopTypedDict, - ChatCompletionStreamRequestToolChoice, - ChatCompletionStreamRequestToolChoiceTypedDict, - ChatCompletionStreamRequestTypedDict, - ) - from .chatmoderationrequest import ( - ChatModerationRequest, - ChatModerationRequestInputs, - ChatModerationRequestInputsTypedDict, - ChatModerationRequestTypedDict, - One, - OneTypedDict, - Two, - TwoTypedDict, - ) - from .checkpointout import CheckpointOut, CheckpointOutTypedDict - from .classificationrequest import ( - ClassificationRequest, - ClassificationRequestInputs, - ClassificationRequestInputsTypedDict, - ClassificationRequestTypedDict, - ) - from .classificationresponse import ( - ClassificationResponse, - ClassificationResponseTypedDict, - ) - from .classificationtargetresult import ( - ClassificationTargetResult, - ClassificationTargetResultTypedDict, - ) - from .classifierdetailedjobout import ( - ClassifierDetailedJobOut, - ClassifierDetailedJobOutIntegrations, - ClassifierDetailedJobOutIntegrationsTypedDict, - ClassifierDetailedJobOutJobType, - ClassifierDetailedJobOutObject, - ClassifierDetailedJobOutStatus, - ClassifierDetailedJobOutTypedDict, - ) - from .classifierftmodelout import ( - ClassifierFTModelOut, - ClassifierFTModelOutModelType, - ClassifierFTModelOutObject, - ClassifierFTModelOutTypedDict, - ) - from .classifierjobout import ( - ClassifierJobOut, - ClassifierJobOutIntegrations, - ClassifierJobOutIntegrationsTypedDict, - ClassifierJobOutJobType, - ClassifierJobOutObject, - ClassifierJobOutStatus, - ClassifierJobOutTypedDict, - ) - from .classifiertargetin import ClassifierTargetIn, ClassifierTargetInTypedDict - from .classifiertargetout import ClassifierTargetOut, ClassifierTargetOutTypedDict - from .classifiertrainingparameters import ( - ClassifierTrainingParameters, - ClassifierTrainingParametersTypedDict, - ) - from .classifiertrainingparametersin import ( - ClassifierTrainingParametersIn, - ClassifierTrainingParametersInTypedDict, - ) - from .codeinterpretertool import ( - CodeInterpreterTool, - CodeInterpreterToolType, - CodeInterpreterToolTypedDict, - ) - from .completionargs import CompletionArgs, CompletionArgsTypedDict - from .completionargsstop import CompletionArgsStop, CompletionArgsStopTypedDict - from .completionchunk import CompletionChunk, CompletionChunkTypedDict - from .completiondetailedjobout import ( - CompletionDetailedJobOut, - CompletionDetailedJobOutIntegrations, - CompletionDetailedJobOutIntegrationsTypedDict, - CompletionDetailedJobOutJobType, - CompletionDetailedJobOutObject, - CompletionDetailedJobOutRepositories, - CompletionDetailedJobOutRepositoriesTypedDict, - CompletionDetailedJobOutStatus, - CompletionDetailedJobOutTypedDict, - ) - from .completionevent import CompletionEvent, CompletionEventTypedDict - from .completionftmodelout import ( - CompletionFTModelOut, - CompletionFTModelOutObject, - CompletionFTModelOutTypedDict, - ModelType, - ) - from .completionjobout import ( - CompletionJobOut, - CompletionJobOutObject, - CompletionJobOutTypedDict, - Integrations, - IntegrationsTypedDict, - JobType, - Repositories, - RepositoriesTypedDict, - Status, - ) - from .completionresponsestreamchoice import ( - CompletionResponseStreamChoice, - CompletionResponseStreamChoiceFinishReason, - CompletionResponseStreamChoiceTypedDict, - ) - from .completiontrainingparameters import ( - CompletionTrainingParameters, - CompletionTrainingParametersTypedDict, - ) - from .completiontrainingparametersin import ( - CompletionTrainingParametersIn, - CompletionTrainingParametersInTypedDict, - ) - from .contentchunk import ContentChunk, ContentChunkTypedDict - from .conversationappendrequest import ( - ConversationAppendRequest, - ConversationAppendRequestHandoffExecution, - ConversationAppendRequestTypedDict, - ) - from .conversationappendstreamrequest import ( - ConversationAppendStreamRequest, - ConversationAppendStreamRequestHandoffExecution, - ConversationAppendStreamRequestTypedDict, - ) - from .conversationevents import ( - ConversationEvents, - ConversationEventsData, - ConversationEventsDataTypedDict, - ConversationEventsTypedDict, - ) - from .conversationhistory import ( - ConversationHistory, - ConversationHistoryObject, - ConversationHistoryTypedDict, - Entries, - EntriesTypedDict, - ) - from .conversationinputs import ConversationInputs, ConversationInputsTypedDict - from .conversationmessages import ( - ConversationMessages, - ConversationMessagesObject, - ConversationMessagesTypedDict, - ) - from .conversationrequest import ( - ConversationRequest, - ConversationRequestTypedDict, - HandoffExecution, - Tools, - ToolsTypedDict, - ) - from .conversationresponse import ( - ConversationResponse, - ConversationResponseObject, - ConversationResponseTypedDict, - Outputs, - OutputsTypedDict, - ) - from .conversationrestartrequest import ( - ConversationRestartRequest, - ConversationRestartRequestHandoffExecution, - ConversationRestartRequestTypedDict, - ) - from .conversationrestartstreamrequest import ( - ConversationRestartStreamRequest, - ConversationRestartStreamRequestHandoffExecution, - ConversationRestartStreamRequestTypedDict, - ) - from .conversationstreamrequest import ( - ConversationStreamRequest, - ConversationStreamRequestHandoffExecution, - ConversationStreamRequestTools, - ConversationStreamRequestToolsTypedDict, - ConversationStreamRequestTypedDict, - ) - from .conversationusageinfo import ( - ConversationUsageInfo, - ConversationUsageInfoTypedDict, - ) - from .delete_model_v1_models_model_id_deleteop import ( - DeleteModelV1ModelsModelIDDeleteRequest, - DeleteModelV1ModelsModelIDDeleteRequestTypedDict, - ) - from .deletefileout import DeleteFileOut, DeleteFileOutTypedDict - from .deletemodelout import DeleteModelOut, DeleteModelOutTypedDict - from .deltamessage import ( - Content, - ContentTypedDict, - DeltaMessage, - DeltaMessageTypedDict, - ) - from .documentlibrarytool import ( - DocumentLibraryTool, - DocumentLibraryToolType, - DocumentLibraryToolTypedDict, - ) - from .documentout import DocumentOut, DocumentOutTypedDict - from .documenttextcontent import DocumentTextContent, DocumentTextContentTypedDict - from .documentupdatein import DocumentUpdateIn, DocumentUpdateInTypedDict - from .documenturlchunk import ( - DocumentURLChunk, - DocumentURLChunkType, - DocumentURLChunkTypedDict, - ) - from .embeddingdtype import EmbeddingDtype - from .embeddingrequest import ( - EmbeddingRequest, - EmbeddingRequestInputs, - EmbeddingRequestInputsTypedDict, - EmbeddingRequestTypedDict, - ) - from .embeddingresponse import EmbeddingResponse, EmbeddingResponseTypedDict - from .embeddingresponsedata import ( - EmbeddingResponseData, - EmbeddingResponseDataTypedDict, - ) - from .encodingformat import EncodingFormat - from .entitytype import EntityType - from .eventout import EventOut, EventOutTypedDict - from .file import File, FileTypedDict - from .filechunk import FileChunk, FileChunkTypedDict - from .filepurpose import FilePurpose - from .files_api_routes_delete_fileop import ( - FilesAPIRoutesDeleteFileRequest, - FilesAPIRoutesDeleteFileRequestTypedDict, - ) - from .files_api_routes_download_fileop import ( - FilesAPIRoutesDownloadFileRequest, - FilesAPIRoutesDownloadFileRequestTypedDict, - ) - from .files_api_routes_get_signed_urlop import ( - FilesAPIRoutesGetSignedURLRequest, - FilesAPIRoutesGetSignedURLRequestTypedDict, - ) - from .files_api_routes_list_filesop import ( - FilesAPIRoutesListFilesRequest, - FilesAPIRoutesListFilesRequestTypedDict, - ) - from .files_api_routes_retrieve_fileop import ( - FilesAPIRoutesRetrieveFileRequest, - FilesAPIRoutesRetrieveFileRequestTypedDict, - ) - from .files_api_routes_upload_fileop import ( - FilesAPIRoutesUploadFileMultiPartBodyParams, - FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict, - ) - from .fileschema import FileSchema, FileSchemaTypedDict - from .filesignedurl import FileSignedURL, FileSignedURLTypedDict - from .fimcompletionrequest import ( - FIMCompletionRequest, - FIMCompletionRequestStop, - FIMCompletionRequestStopTypedDict, - FIMCompletionRequestTypedDict, - ) - from .fimcompletionresponse import ( - FIMCompletionResponse, - FIMCompletionResponseTypedDict, - ) - from .fimcompletionstreamrequest import ( - FIMCompletionStreamRequest, - FIMCompletionStreamRequestStop, - FIMCompletionStreamRequestStopTypedDict, - FIMCompletionStreamRequestTypedDict, - ) - from .finetuneablemodeltype import FineTuneableModelType - from .ftclassifierlossfunction import FTClassifierLossFunction - from .ftmodelcapabilitiesout import ( - FTModelCapabilitiesOut, - FTModelCapabilitiesOutTypedDict, - ) - from .ftmodelcard import FTModelCard, FTModelCardType, FTModelCardTypedDict - from .function import Function, FunctionTypedDict - from .functioncall import ( - Arguments, - ArgumentsTypedDict, - FunctionCall, - FunctionCallTypedDict, - ) - from .functioncallentry import ( - FunctionCallEntry, - FunctionCallEntryObject, - FunctionCallEntryType, - FunctionCallEntryTypedDict, - ) - from .functioncallentryarguments import ( - FunctionCallEntryArguments, - FunctionCallEntryArgumentsTypedDict, - ) - from .functioncallevent import ( - FunctionCallEvent, - FunctionCallEventType, - FunctionCallEventTypedDict, - ) - from .functionname import FunctionName, FunctionNameTypedDict - from .functionresultentry import ( - FunctionResultEntry, - FunctionResultEntryObject, - FunctionResultEntryType, - FunctionResultEntryTypedDict, - ) - from .functiontool import FunctionTool, FunctionToolType, FunctionToolTypedDict - from .githubrepositoryin import ( - GithubRepositoryIn, - GithubRepositoryInType, - GithubRepositoryInTypedDict, - ) - from .githubrepositoryout import ( - GithubRepositoryOut, - GithubRepositoryOutType, - GithubRepositoryOutTypedDict, - ) - from .httpvalidationerror import HTTPValidationError, HTTPValidationErrorData - from .imagegenerationtool import ( - ImageGenerationTool, - ImageGenerationToolType, - ImageGenerationToolTypedDict, - ) - from .imageurl import ImageURL, ImageURLTypedDict - from .imageurlchunk import ( - ImageURLChunk, - ImageURLChunkImageURL, - ImageURLChunkImageURLTypedDict, - ImageURLChunkType, - ImageURLChunkTypedDict, - ) - from .inputentries import InputEntries, InputEntriesTypedDict - from .inputs import ( - Inputs, - InputsTypedDict, - InstructRequestInputs, - InstructRequestInputsMessages, - InstructRequestInputsMessagesTypedDict, - InstructRequestInputsTypedDict, - ) - from .instructrequest import ( - InstructRequest, - InstructRequestMessages, - InstructRequestMessagesTypedDict, - InstructRequestTypedDict, - ) - from .jobin import ( - Hyperparameters, - HyperparametersTypedDict, - JobIn, - JobInIntegrations, - JobInIntegrationsTypedDict, - JobInRepositories, - JobInRepositoriesTypedDict, - JobInTypedDict, - ) - from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict - from .jobs_api_routes_batch_cancel_batch_jobop import ( - JobsAPIRoutesBatchCancelBatchJobRequest, - JobsAPIRoutesBatchCancelBatchJobRequestTypedDict, - ) - from .jobs_api_routes_batch_get_batch_jobop import ( - JobsAPIRoutesBatchGetBatchJobRequest, - JobsAPIRoutesBatchGetBatchJobRequestTypedDict, - ) - from .jobs_api_routes_batch_get_batch_jobsop import ( - JobsAPIRoutesBatchGetBatchJobsRequest, - JobsAPIRoutesBatchGetBatchJobsRequestTypedDict, - ) - from .jobs_api_routes_fine_tuning_archive_fine_tuned_modelop import ( - JobsAPIRoutesFineTuningArchiveFineTunedModelRequest, - JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict, - ) - from .jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop import ( - JobsAPIRoutesFineTuningCancelFineTuningJobRequest, - JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict, - JobsAPIRoutesFineTuningCancelFineTuningJobResponse, - JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict, - ) - from .jobs_api_routes_fine_tuning_create_fine_tuning_jobop import ( - JobsAPIRoutesFineTuningCreateFineTuningJobResponse, - JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict, - Response1, - Response1TypedDict, - ) - from .jobs_api_routes_fine_tuning_get_fine_tuning_jobop import ( - JobsAPIRoutesFineTuningGetFineTuningJobRequest, - JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict, - JobsAPIRoutesFineTuningGetFineTuningJobResponse, - JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict, - ) - from .jobs_api_routes_fine_tuning_get_fine_tuning_jobsop import ( - JobsAPIRoutesFineTuningGetFineTuningJobsRequest, - JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict, - QueryParamStatus, - ) - from .jobs_api_routes_fine_tuning_start_fine_tuning_jobop import ( - JobsAPIRoutesFineTuningStartFineTuningJobRequest, - JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict, - JobsAPIRoutesFineTuningStartFineTuningJobResponse, - JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict, - ) - from .jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop import ( - JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest, - JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict, - ) - from .jobs_api_routes_fine_tuning_update_fine_tuned_modelop import ( - JobsAPIRoutesFineTuningUpdateFineTunedModelRequest, - JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict, - JobsAPIRoutesFineTuningUpdateFineTunedModelResponse, - JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict, - ) - from .jobsout import ( - JobsOut, - JobsOutData, - JobsOutDataTypedDict, - JobsOutObject, - JobsOutTypedDict, - ) - from .jsonschema import JSONSchema, JSONSchemaTypedDict - from .legacyjobmetadataout import ( - LegacyJobMetadataOut, - LegacyJobMetadataOutObject, - LegacyJobMetadataOutTypedDict, - ) - from .libraries_delete_v1op import ( - LibrariesDeleteV1Request, - LibrariesDeleteV1RequestTypedDict, - ) - from .libraries_documents_delete_v1op import ( - LibrariesDocumentsDeleteV1Request, - LibrariesDocumentsDeleteV1RequestTypedDict, - ) - from .libraries_documents_get_extracted_text_signed_url_v1op import ( - LibrariesDocumentsGetExtractedTextSignedURLV1Request, - LibrariesDocumentsGetExtractedTextSignedURLV1RequestTypedDict, - ) - from .libraries_documents_get_signed_url_v1op import ( - LibrariesDocumentsGetSignedURLV1Request, - LibrariesDocumentsGetSignedURLV1RequestTypedDict, - ) - from .libraries_documents_get_status_v1op import ( - LibrariesDocumentsGetStatusV1Request, - LibrariesDocumentsGetStatusV1RequestTypedDict, - ) - from .libraries_documents_get_text_content_v1op import ( - LibrariesDocumentsGetTextContentV1Request, - LibrariesDocumentsGetTextContentV1RequestTypedDict, - ) - from .libraries_documents_get_v1op import ( - LibrariesDocumentsGetV1Request, - LibrariesDocumentsGetV1RequestTypedDict, - ) - from .libraries_documents_list_v1op import ( - LibrariesDocumentsListV1Request, - LibrariesDocumentsListV1RequestTypedDict, - ) - from .libraries_documents_reprocess_v1op import ( - LibrariesDocumentsReprocessV1Request, - LibrariesDocumentsReprocessV1RequestTypedDict, - ) - from .libraries_documents_update_v1op import ( - LibrariesDocumentsUpdateV1Request, - LibrariesDocumentsUpdateV1RequestTypedDict, - ) - from .libraries_documents_upload_v1op import ( - LibrariesDocumentsUploadV1DocumentUpload, - LibrariesDocumentsUploadV1DocumentUploadTypedDict, - LibrariesDocumentsUploadV1Request, - LibrariesDocumentsUploadV1RequestTypedDict, - ) - from .libraries_get_v1op import ( - LibrariesGetV1Request, - LibrariesGetV1RequestTypedDict, - ) - from .libraries_share_create_v1op import ( - LibrariesShareCreateV1Request, - LibrariesShareCreateV1RequestTypedDict, - ) - from .libraries_share_delete_v1op import ( - LibrariesShareDeleteV1Request, - LibrariesShareDeleteV1RequestTypedDict, - ) - from .libraries_share_list_v1op import ( - LibrariesShareListV1Request, - LibrariesShareListV1RequestTypedDict, - ) - from .libraries_update_v1op import ( - LibrariesUpdateV1Request, - LibrariesUpdateV1RequestTypedDict, - ) - from .libraryin import LibraryIn, LibraryInTypedDict - from .libraryinupdate import LibraryInUpdate, LibraryInUpdateTypedDict - from .libraryout import LibraryOut, LibraryOutTypedDict - from .listdocumentout import ListDocumentOut, ListDocumentOutTypedDict - from .listfilesout import ListFilesOut, ListFilesOutTypedDict - from .listlibraryout import ListLibraryOut, ListLibraryOutTypedDict - from .listsharingout import ListSharingOut, ListSharingOutTypedDict - from .messageentries import MessageEntries, MessageEntriesTypedDict - from .messageinputcontentchunks import ( - MessageInputContentChunks, - MessageInputContentChunksTypedDict, - ) - from .messageinputentry import ( - MessageInputEntry, - MessageInputEntryContent, - MessageInputEntryContentTypedDict, - MessageInputEntryRole, - MessageInputEntryType, - MessageInputEntryTypedDict, - Object, - ) - from .messageoutputcontentchunks import ( - MessageOutputContentChunks, - MessageOutputContentChunksTypedDict, - ) - from .messageoutputentry import ( - MessageOutputEntry, - MessageOutputEntryContent, - MessageOutputEntryContentTypedDict, - MessageOutputEntryObject, - MessageOutputEntryRole, - MessageOutputEntryType, - MessageOutputEntryTypedDict, - ) - from .messageoutputevent import ( - MessageOutputEvent, - MessageOutputEventContent, - MessageOutputEventContentTypedDict, - MessageOutputEventRole, - MessageOutputEventType, - MessageOutputEventTypedDict, - ) - from .metricout import MetricOut, MetricOutTypedDict - from .mistralpromptmode import MistralPromptMode - from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict - from .modelconversation import ( - ModelConversation, - ModelConversationObject, - ModelConversationTools, - ModelConversationToolsTypedDict, - ModelConversationTypedDict, - ) - from .modellist import Data, DataTypedDict, ModelList, ModelListTypedDict - from .moderationobject import ModerationObject, ModerationObjectTypedDict - from .moderationresponse import ModerationResponse, ModerationResponseTypedDict - from .no_response_error import NoResponseError - from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict - from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict - from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict - from .ocrrequest import Document, DocumentTypedDict, OCRRequest, OCRRequestTypedDict - from .ocrresponse import OCRResponse, OCRResponseTypedDict - from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict - from .outputcontentchunks import OutputContentChunks, OutputContentChunksTypedDict - from .paginationinfo import PaginationInfo, PaginationInfoTypedDict - from .prediction import Prediction, PredictionTypedDict - from .processingstatusout import ProcessingStatusOut, ProcessingStatusOutTypedDict - from .referencechunk import ( - ReferenceChunk, - ReferenceChunkType, - ReferenceChunkTypedDict, - ) - from .responsedoneevent import ( - ResponseDoneEvent, - ResponseDoneEventType, - ResponseDoneEventTypedDict, - ) - from .responseerrorevent import ( - ResponseErrorEvent, - ResponseErrorEventType, - ResponseErrorEventTypedDict, - ) - from .responseformat import ResponseFormat, ResponseFormatTypedDict - from .responseformats import ResponseFormats - from .responsestartedevent import ( - ResponseStartedEvent, - ResponseStartedEventType, - ResponseStartedEventTypedDict, - ) - from .responsevalidationerror import ResponseValidationError - from .retrieve_model_v1_models_model_id_getop import ( - RetrieveModelV1ModelsModelIDGetRequest, - RetrieveModelV1ModelsModelIDGetRequestTypedDict, - RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet, - RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict, - ) - from .retrievefileout import RetrieveFileOut, RetrieveFileOutTypedDict - from .sampletype import SampleType - from .sdkerror import SDKError - from .security import Security, SecurityTypedDict - from .shareenum import ShareEnum - from .sharingdelete import SharingDelete, SharingDeleteTypedDict - from .sharingin import SharingIn, SharingInTypedDict - from .sharingout import SharingOut, SharingOutTypedDict - from .source import Source - from .ssetypes import SSETypes - from .systemmessage import ( - Role, - SystemMessage, - SystemMessageContent, - SystemMessageContentTypedDict, - SystemMessageTypedDict, - ) - from .systemmessagecontentchunks import ( - SystemMessageContentChunks, - SystemMessageContentChunksTypedDict, - ) - from .textchunk import TextChunk, TextChunkType, TextChunkTypedDict - from .thinkchunk import ( - ThinkChunk, - ThinkChunkType, - ThinkChunkTypedDict, - Thinking, - ThinkingTypedDict, - ) - from .timestampgranularity import TimestampGranularity - from .tool import Tool, ToolTypedDict - from .toolcall import ToolCall, ToolCallTypedDict - from .toolchoice import ToolChoice, ToolChoiceTypedDict - from .toolchoiceenum import ToolChoiceEnum - from .toolexecutiondeltaevent import ( - ToolExecutionDeltaEvent, - ToolExecutionDeltaEventType, - ToolExecutionDeltaEventTypedDict, - ) - from .toolexecutiondoneevent import ( - ToolExecutionDoneEvent, - ToolExecutionDoneEventType, - ToolExecutionDoneEventTypedDict, - ) - from .toolexecutionentry import ( - ToolExecutionEntry, - ToolExecutionEntryObject, - ToolExecutionEntryType, - ToolExecutionEntryTypedDict, - ) - from .toolexecutionstartedevent import ( - ToolExecutionStartedEvent, - ToolExecutionStartedEventType, - ToolExecutionStartedEventTypedDict, - ) - from .toolfilechunk import ToolFileChunk, ToolFileChunkType, ToolFileChunkTypedDict - from .toolmessage import ( - ToolMessage, - ToolMessageContent, - ToolMessageContentTypedDict, - ToolMessageRole, - ToolMessageTypedDict, - ) - from .toolreferencechunk import ( - ToolReferenceChunk, - ToolReferenceChunkType, - ToolReferenceChunkTypedDict, - ) - from .tooltypes import ToolTypes - from .trainingfile import TrainingFile, TrainingFileTypedDict - from .transcriptionresponse import ( - TranscriptionResponse, - TranscriptionResponseTypedDict, - ) - from .transcriptionsegmentchunk import ( - TranscriptionSegmentChunk, - TranscriptionSegmentChunkTypedDict, - Type, - ) - from .transcriptionstreamdone import ( - TranscriptionStreamDone, - TranscriptionStreamDoneType, - TranscriptionStreamDoneTypedDict, - ) - from .transcriptionstreamevents import ( - TranscriptionStreamEvents, - TranscriptionStreamEventsData, - TranscriptionStreamEventsDataTypedDict, - TranscriptionStreamEventsTypedDict, - ) - from .transcriptionstreameventtypes import TranscriptionStreamEventTypes - from .transcriptionstreamlanguage import ( - TranscriptionStreamLanguage, - TranscriptionStreamLanguageType, - TranscriptionStreamLanguageTypedDict, - ) - from .transcriptionstreamsegmentdelta import ( - TranscriptionStreamSegmentDelta, - TranscriptionStreamSegmentDeltaType, - TranscriptionStreamSegmentDeltaTypedDict, - ) - from .transcriptionstreamtextdelta import ( - TranscriptionStreamTextDelta, - TranscriptionStreamTextDeltaType, - TranscriptionStreamTextDeltaTypedDict, - ) - from .unarchiveftmodelout import ( - UnarchiveFTModelOut, - UnarchiveFTModelOutObject, - UnarchiveFTModelOutTypedDict, - ) - from .updateftmodelin import UpdateFTModelIn, UpdateFTModelInTypedDict - from .uploadfileout import UploadFileOut, UploadFileOutTypedDict - from .usageinfo import UsageInfo, UsageInfoTypedDict - from .usermessage import ( - UserMessage, - UserMessageContent, - UserMessageContentTypedDict, - UserMessageRole, - UserMessageTypedDict, - ) - from .validationerror import ( - Loc, - LocTypedDict, - ValidationError, - ValidationErrorTypedDict, - ) - from .wandbintegration import ( - WandbIntegration, - WandbIntegrationType, - WandbIntegrationTypedDict, - ) - from .wandbintegrationout import ( - WandbIntegrationOut, - WandbIntegrationOutType, - WandbIntegrationOutTypedDict, - ) - from .websearchpremiumtool import ( - WebSearchPremiumTool, - WebSearchPremiumToolType, - WebSearchPremiumToolTypedDict, - ) - from .websearchtool import WebSearchTool, WebSearchToolType, WebSearchToolTypedDict - -__all__ = [ - "APIEndpoint", - "Agent", - "AgentConversation", - "AgentConversationObject", - "AgentConversationTypedDict", - "AgentCreationRequest", - "AgentCreationRequestTools", - "AgentCreationRequestToolsTypedDict", - "AgentCreationRequestTypedDict", - "AgentHandoffDoneEvent", - "AgentHandoffDoneEventType", - "AgentHandoffDoneEventTypedDict", - "AgentHandoffEntry", - "AgentHandoffEntryObject", - "AgentHandoffEntryType", - "AgentHandoffEntryTypedDict", - "AgentHandoffStartedEvent", - "AgentHandoffStartedEventType", - "AgentHandoffStartedEventTypedDict", - "AgentObject", - "AgentTools", - "AgentToolsTypedDict", - "AgentTypedDict", - "AgentUpdateRequest", - "AgentUpdateRequestTools", - "AgentUpdateRequestToolsTypedDict", - "AgentUpdateRequestTypedDict", - "AgentsAPIV1AgentsGetRequest", - "AgentsAPIV1AgentsGetRequestTypedDict", - "AgentsAPIV1AgentsListRequest", - "AgentsAPIV1AgentsListRequestTypedDict", - "AgentsAPIV1AgentsUpdateRequest", - "AgentsAPIV1AgentsUpdateRequestTypedDict", - "AgentsAPIV1AgentsUpdateVersionRequest", - "AgentsAPIV1AgentsUpdateVersionRequestTypedDict", - "AgentsAPIV1ConversationsAppendRequest", - "AgentsAPIV1ConversationsAppendRequestTypedDict", - "AgentsAPIV1ConversationsAppendStreamRequest", - "AgentsAPIV1ConversationsAppendStreamRequestTypedDict", - "AgentsAPIV1ConversationsGetRequest", - "AgentsAPIV1ConversationsGetRequestTypedDict", - "AgentsAPIV1ConversationsGetResponseV1ConversationsGet", - "AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict", - "AgentsAPIV1ConversationsHistoryRequest", - "AgentsAPIV1ConversationsHistoryRequestTypedDict", - "AgentsAPIV1ConversationsListRequest", - "AgentsAPIV1ConversationsListRequestTypedDict", - "AgentsAPIV1ConversationsMessagesRequest", - "AgentsAPIV1ConversationsMessagesRequestTypedDict", - "AgentsAPIV1ConversationsRestartRequest", - "AgentsAPIV1ConversationsRestartRequestTypedDict", - "AgentsAPIV1ConversationsRestartStreamRequest", - "AgentsAPIV1ConversationsRestartStreamRequestTypedDict", - "AgentsCompletionRequest", - "AgentsCompletionRequestMessages", - "AgentsCompletionRequestMessagesTypedDict", - "AgentsCompletionRequestStop", - "AgentsCompletionRequestStopTypedDict", - "AgentsCompletionRequestToolChoice", - "AgentsCompletionRequestToolChoiceTypedDict", - "AgentsCompletionRequestTypedDict", - "AgentsCompletionStreamRequest", - "AgentsCompletionStreamRequestMessages", - "AgentsCompletionStreamRequestMessagesTypedDict", - "AgentsCompletionStreamRequestStop", - "AgentsCompletionStreamRequestStopTypedDict", - "AgentsCompletionStreamRequestToolChoice", - "AgentsCompletionStreamRequestToolChoiceTypedDict", - "AgentsCompletionStreamRequestTypedDict", - "ArchiveFTModelOut", - "ArchiveFTModelOutObject", - "ArchiveFTModelOutTypedDict", - "Arguments", - "ArgumentsTypedDict", - "AssistantMessage", - "AssistantMessageContent", - "AssistantMessageContentTypedDict", - "AssistantMessageRole", - "AssistantMessageTypedDict", - "AudioChunk", - "AudioChunkType", - "AudioChunkTypedDict", - "AudioTranscriptionRequest", - "AudioTranscriptionRequestStream", - "AudioTranscriptionRequestStreamTypedDict", - "AudioTranscriptionRequestTypedDict", - "BaseModelCard", - "BaseModelCardType", - "BaseModelCardTypedDict", - "BatchError", - "BatchErrorTypedDict", - "BatchJobIn", - "BatchJobInTypedDict", - "BatchJobOut", - "BatchJobOutObject", - "BatchJobOutTypedDict", - "BatchJobStatus", - "BatchJobsOut", - "BatchJobsOutObject", - "BatchJobsOutTypedDict", - "BuiltInConnectors", - "ChatClassificationRequest", - "ChatClassificationRequestTypedDict", - "ChatCompletionChoice", - "ChatCompletionChoiceTypedDict", - "ChatCompletionRequest", - "ChatCompletionRequestToolChoice", - "ChatCompletionRequestToolChoiceTypedDict", - "ChatCompletionRequestTypedDict", - "ChatCompletionResponse", - "ChatCompletionResponseTypedDict", - "ChatCompletionStreamRequest", - "ChatCompletionStreamRequestMessages", - "ChatCompletionStreamRequestMessagesTypedDict", - "ChatCompletionStreamRequestStop", - "ChatCompletionStreamRequestStopTypedDict", - "ChatCompletionStreamRequestToolChoice", - "ChatCompletionStreamRequestToolChoiceTypedDict", - "ChatCompletionStreamRequestTypedDict", - "ChatModerationRequest", - "ChatModerationRequestInputs", - "ChatModerationRequestInputsTypedDict", - "ChatModerationRequestTypedDict", - "CheckpointOut", - "CheckpointOutTypedDict", - "ClassificationRequest", - "ClassificationRequestInputs", - "ClassificationRequestInputsTypedDict", - "ClassificationRequestTypedDict", - "ClassificationResponse", - "ClassificationResponseTypedDict", - "ClassificationTargetResult", - "ClassificationTargetResultTypedDict", - "ClassifierDetailedJobOut", - "ClassifierDetailedJobOutIntegrations", - "ClassifierDetailedJobOutIntegrationsTypedDict", - "ClassifierDetailedJobOutJobType", - "ClassifierDetailedJobOutObject", - "ClassifierDetailedJobOutStatus", - "ClassifierDetailedJobOutTypedDict", - "ClassifierFTModelOut", - "ClassifierFTModelOutModelType", - "ClassifierFTModelOutObject", - "ClassifierFTModelOutTypedDict", - "ClassifierJobOut", - "ClassifierJobOutIntegrations", - "ClassifierJobOutIntegrationsTypedDict", - "ClassifierJobOutJobType", - "ClassifierJobOutObject", - "ClassifierJobOutStatus", - "ClassifierJobOutTypedDict", - "ClassifierTargetIn", - "ClassifierTargetInTypedDict", - "ClassifierTargetOut", - "ClassifierTargetOutTypedDict", - "ClassifierTrainingParameters", - "ClassifierTrainingParametersIn", - "ClassifierTrainingParametersInTypedDict", - "ClassifierTrainingParametersTypedDict", - "CodeInterpreterTool", - "CodeInterpreterToolType", - "CodeInterpreterToolTypedDict", - "CompletionArgs", - "CompletionArgsStop", - "CompletionArgsStopTypedDict", - "CompletionArgsTypedDict", - "CompletionChunk", - "CompletionChunkTypedDict", - "CompletionDetailedJobOut", - "CompletionDetailedJobOutIntegrations", - "CompletionDetailedJobOutIntegrationsTypedDict", - "CompletionDetailedJobOutJobType", - "CompletionDetailedJobOutObject", - "CompletionDetailedJobOutRepositories", - "CompletionDetailedJobOutRepositoriesTypedDict", - "CompletionDetailedJobOutStatus", - "CompletionDetailedJobOutTypedDict", - "CompletionEvent", - "CompletionEventTypedDict", - "CompletionFTModelOut", - "CompletionFTModelOutObject", - "CompletionFTModelOutTypedDict", - "CompletionJobOut", - "CompletionJobOutObject", - "CompletionJobOutTypedDict", - "CompletionResponseStreamChoice", - "CompletionResponseStreamChoiceFinishReason", - "CompletionResponseStreamChoiceTypedDict", - "CompletionTrainingParameters", - "CompletionTrainingParametersIn", - "CompletionTrainingParametersInTypedDict", - "CompletionTrainingParametersTypedDict", - "Content", - "ContentChunk", - "ContentChunkTypedDict", - "ContentTypedDict", - "ConversationAppendRequest", - "ConversationAppendRequestHandoffExecution", - "ConversationAppendRequestTypedDict", - "ConversationAppendStreamRequest", - "ConversationAppendStreamRequestHandoffExecution", - "ConversationAppendStreamRequestTypedDict", - "ConversationEvents", - "ConversationEventsData", - "ConversationEventsDataTypedDict", - "ConversationEventsTypedDict", - "ConversationHistory", - "ConversationHistoryObject", - "ConversationHistoryTypedDict", - "ConversationInputs", - "ConversationInputsTypedDict", - "ConversationMessages", - "ConversationMessagesObject", - "ConversationMessagesTypedDict", - "ConversationRequest", - "ConversationRequestTypedDict", - "ConversationResponse", - "ConversationResponseObject", - "ConversationResponseTypedDict", - "ConversationRestartRequest", - "ConversationRestartRequestHandoffExecution", - "ConversationRestartRequestTypedDict", - "ConversationRestartStreamRequest", - "ConversationRestartStreamRequestHandoffExecution", - "ConversationRestartStreamRequestTypedDict", - "ConversationStreamRequest", - "ConversationStreamRequestHandoffExecution", - "ConversationStreamRequestTools", - "ConversationStreamRequestToolsTypedDict", - "ConversationStreamRequestTypedDict", - "ConversationUsageInfo", - "ConversationUsageInfoTypedDict", - "Data", - "DataTypedDict", - "DeleteFileOut", - "DeleteFileOutTypedDict", - "DeleteModelOut", - "DeleteModelOutTypedDict", - "DeleteModelV1ModelsModelIDDeleteRequest", - "DeleteModelV1ModelsModelIDDeleteRequestTypedDict", - "DeltaMessage", - "DeltaMessageTypedDict", - "Document", - "DocumentLibraryTool", - "DocumentLibraryToolType", - "DocumentLibraryToolTypedDict", - "DocumentOut", - "DocumentOutTypedDict", - "DocumentTextContent", - "DocumentTextContentTypedDict", - "DocumentTypedDict", - "DocumentURLChunk", - "DocumentURLChunkType", - "DocumentURLChunkTypedDict", - "DocumentUpdateIn", - "DocumentUpdateInTypedDict", - "EmbeddingDtype", - "EmbeddingRequest", - "EmbeddingRequestInputs", - "EmbeddingRequestInputsTypedDict", - "EmbeddingRequestTypedDict", - "EmbeddingResponse", - "EmbeddingResponseData", - "EmbeddingResponseDataTypedDict", - "EmbeddingResponseTypedDict", - "EncodingFormat", - "EntityType", - "Entries", - "EntriesTypedDict", - "EventOut", - "EventOutTypedDict", - "FIMCompletionRequest", - "FIMCompletionRequestStop", - "FIMCompletionRequestStopTypedDict", - "FIMCompletionRequestTypedDict", - "FIMCompletionResponse", - "FIMCompletionResponseTypedDict", - "FIMCompletionStreamRequest", - "FIMCompletionStreamRequestStop", - "FIMCompletionStreamRequestStopTypedDict", - "FIMCompletionStreamRequestTypedDict", - "FTClassifierLossFunction", - "FTModelCapabilitiesOut", - "FTModelCapabilitiesOutTypedDict", - "FTModelCard", - "FTModelCardType", - "FTModelCardTypedDict", - "File", - "FileChunk", - "FileChunkTypedDict", - "FilePurpose", - "FileSchema", - "FileSchemaTypedDict", - "FileSignedURL", - "FileSignedURLTypedDict", - "FileTypedDict", - "FilesAPIRoutesDeleteFileRequest", - "FilesAPIRoutesDeleteFileRequestTypedDict", - "FilesAPIRoutesDownloadFileRequest", - "FilesAPIRoutesDownloadFileRequestTypedDict", - "FilesAPIRoutesGetSignedURLRequest", - "FilesAPIRoutesGetSignedURLRequestTypedDict", - "FilesAPIRoutesListFilesRequest", - "FilesAPIRoutesListFilesRequestTypedDict", - "FilesAPIRoutesRetrieveFileRequest", - "FilesAPIRoutesRetrieveFileRequestTypedDict", - "FilesAPIRoutesUploadFileMultiPartBodyParams", - "FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict", - "FineTuneableModelType", - "FinishReason", - "Function", - "FunctionCall", - "FunctionCallEntry", - "FunctionCallEntryArguments", - "FunctionCallEntryArgumentsTypedDict", - "FunctionCallEntryObject", - "FunctionCallEntryType", - "FunctionCallEntryTypedDict", - "FunctionCallEvent", - "FunctionCallEventType", - "FunctionCallEventTypedDict", - "FunctionCallTypedDict", - "FunctionName", - "FunctionNameTypedDict", - "FunctionResultEntry", - "FunctionResultEntryObject", - "FunctionResultEntryType", - "FunctionResultEntryTypedDict", - "FunctionTool", - "FunctionToolType", - "FunctionToolTypedDict", - "FunctionTypedDict", - "GithubRepositoryIn", - "GithubRepositoryInType", - "GithubRepositoryInTypedDict", - "GithubRepositoryOut", - "GithubRepositoryOutType", - "GithubRepositoryOutTypedDict", - "HTTPValidationError", - "HTTPValidationErrorData", - "HandoffExecution", - "Hyperparameters", - "HyperparametersTypedDict", - "ImageGenerationTool", - "ImageGenerationToolType", - "ImageGenerationToolTypedDict", - "ImageURL", - "ImageURLChunk", - "ImageURLChunkImageURL", - "ImageURLChunkImageURLTypedDict", - "ImageURLChunkType", - "ImageURLChunkTypedDict", - "ImageURLTypedDict", - "InputEntries", - "InputEntriesTypedDict", - "Inputs", - "InputsTypedDict", - "InstructRequest", - "InstructRequestInputs", - "InstructRequestInputsMessages", - "InstructRequestInputsMessagesTypedDict", - "InstructRequestInputsTypedDict", - "InstructRequestMessages", - "InstructRequestMessagesTypedDict", - "InstructRequestTypedDict", - "Integrations", - "IntegrationsTypedDict", - "JSONSchema", - "JSONSchemaTypedDict", - "JobIn", - "JobInIntegrations", - "JobInIntegrationsTypedDict", - "JobInRepositories", - "JobInRepositoriesTypedDict", - "JobInTypedDict", - "JobMetadataOut", - "JobMetadataOutTypedDict", - "JobType", - "JobsAPIRoutesBatchCancelBatchJobRequest", - "JobsAPIRoutesBatchCancelBatchJobRequestTypedDict", - "JobsAPIRoutesBatchGetBatchJobRequest", - "JobsAPIRoutesBatchGetBatchJobRequestTypedDict", - "JobsAPIRoutesBatchGetBatchJobsRequest", - "JobsAPIRoutesBatchGetBatchJobsRequestTypedDict", - "JobsAPIRoutesFineTuningArchiveFineTunedModelRequest", - "JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict", - "JobsAPIRoutesFineTuningCancelFineTuningJobRequest", - "JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict", - "JobsAPIRoutesFineTuningCancelFineTuningJobResponse", - "JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict", - "JobsAPIRoutesFineTuningCreateFineTuningJobResponse", - "JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict", - "JobsAPIRoutesFineTuningGetFineTuningJobRequest", - "JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict", - "JobsAPIRoutesFineTuningGetFineTuningJobResponse", - "JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict", - "JobsAPIRoutesFineTuningGetFineTuningJobsRequest", - "JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict", - "JobsAPIRoutesFineTuningStartFineTuningJobRequest", - "JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict", - "JobsAPIRoutesFineTuningStartFineTuningJobResponse", - "JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict", - "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest", - "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict", - "JobsAPIRoutesFineTuningUpdateFineTunedModelRequest", - "JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict", - "JobsAPIRoutesFineTuningUpdateFineTunedModelResponse", - "JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict", - "JobsOut", - "JobsOutData", - "JobsOutDataTypedDict", - "JobsOutObject", - "JobsOutTypedDict", - "LegacyJobMetadataOut", - "LegacyJobMetadataOutObject", - "LegacyJobMetadataOutTypedDict", - "LibrariesDeleteV1Request", - "LibrariesDeleteV1RequestTypedDict", - "LibrariesDocumentsDeleteV1Request", - "LibrariesDocumentsDeleteV1RequestTypedDict", - "LibrariesDocumentsGetExtractedTextSignedURLV1Request", - "LibrariesDocumentsGetExtractedTextSignedURLV1RequestTypedDict", - "LibrariesDocumentsGetSignedURLV1Request", - "LibrariesDocumentsGetSignedURLV1RequestTypedDict", - "LibrariesDocumentsGetStatusV1Request", - "LibrariesDocumentsGetStatusV1RequestTypedDict", - "LibrariesDocumentsGetTextContentV1Request", - "LibrariesDocumentsGetTextContentV1RequestTypedDict", - "LibrariesDocumentsGetV1Request", - "LibrariesDocumentsGetV1RequestTypedDict", - "LibrariesDocumentsListV1Request", - "LibrariesDocumentsListV1RequestTypedDict", - "LibrariesDocumentsReprocessV1Request", - "LibrariesDocumentsReprocessV1RequestTypedDict", - "LibrariesDocumentsUpdateV1Request", - "LibrariesDocumentsUpdateV1RequestTypedDict", - "LibrariesDocumentsUploadV1DocumentUpload", - "LibrariesDocumentsUploadV1DocumentUploadTypedDict", - "LibrariesDocumentsUploadV1Request", - "LibrariesDocumentsUploadV1RequestTypedDict", - "LibrariesGetV1Request", - "LibrariesGetV1RequestTypedDict", - "LibrariesShareCreateV1Request", - "LibrariesShareCreateV1RequestTypedDict", - "LibrariesShareDeleteV1Request", - "LibrariesShareDeleteV1RequestTypedDict", - "LibrariesShareListV1Request", - "LibrariesShareListV1RequestTypedDict", - "LibrariesUpdateV1Request", - "LibrariesUpdateV1RequestTypedDict", - "LibraryIn", - "LibraryInTypedDict", - "LibraryInUpdate", - "LibraryInUpdateTypedDict", - "LibraryOut", - "LibraryOutTypedDict", - "ListDocumentOut", - "ListDocumentOutTypedDict", - "ListFilesOut", - "ListFilesOutTypedDict", - "ListLibraryOut", - "ListLibraryOutTypedDict", - "ListSharingOut", - "ListSharingOutTypedDict", - "Loc", - "LocTypedDict", - "MessageEntries", - "MessageEntriesTypedDict", - "MessageInputContentChunks", - "MessageInputContentChunksTypedDict", - "MessageInputEntry", - "MessageInputEntryContent", - "MessageInputEntryContentTypedDict", - "MessageInputEntryRole", - "MessageInputEntryType", - "MessageInputEntryTypedDict", - "MessageOutputContentChunks", - "MessageOutputContentChunksTypedDict", - "MessageOutputEntry", - "MessageOutputEntryContent", - "MessageOutputEntryContentTypedDict", - "MessageOutputEntryObject", - "MessageOutputEntryRole", - "MessageOutputEntryType", - "MessageOutputEntryTypedDict", - "MessageOutputEvent", - "MessageOutputEventContent", - "MessageOutputEventContentTypedDict", - "MessageOutputEventRole", - "MessageOutputEventType", - "MessageOutputEventTypedDict", - "Messages", - "MessagesTypedDict", - "MetricOut", - "MetricOutTypedDict", - "MistralError", - "MistralPromptMode", - "ModelCapabilities", - "ModelCapabilitiesTypedDict", - "ModelConversation", - "ModelConversationObject", - "ModelConversationTools", - "ModelConversationToolsTypedDict", - "ModelConversationTypedDict", - "ModelList", - "ModelListTypedDict", - "ModelType", - "ModerationObject", - "ModerationObjectTypedDict", - "ModerationResponse", - "ModerationResponseTypedDict", - "NoResponseError", - "OCRImageObject", - "OCRImageObjectTypedDict", - "OCRPageDimensions", - "OCRPageDimensionsTypedDict", - "OCRPageObject", - "OCRPageObjectTypedDict", - "OCRRequest", - "OCRRequestTypedDict", - "OCRResponse", - "OCRResponseTypedDict", - "OCRUsageInfo", - "OCRUsageInfoTypedDict", - "Object", - "One", - "OneTypedDict", - "OutputContentChunks", - "OutputContentChunksTypedDict", - "Outputs", - "OutputsTypedDict", - "PaginationInfo", - "PaginationInfoTypedDict", - "Prediction", - "PredictionTypedDict", - "ProcessingStatusOut", - "ProcessingStatusOutTypedDict", - "QueryParamStatus", - "ReferenceChunk", - "ReferenceChunkType", - "ReferenceChunkTypedDict", - "Repositories", - "RepositoriesTypedDict", - "Response1", - "Response1TypedDict", - "ResponseBody", - "ResponseBodyTypedDict", - "ResponseDoneEvent", - "ResponseDoneEventType", - "ResponseDoneEventTypedDict", - "ResponseErrorEvent", - "ResponseErrorEventType", - "ResponseErrorEventTypedDict", - "ResponseFormat", - "ResponseFormatTypedDict", - "ResponseFormats", - "ResponseStartedEvent", - "ResponseStartedEventType", - "ResponseStartedEventTypedDict", - "ResponseValidationError", - "RetrieveFileOut", - "RetrieveFileOutTypedDict", - "RetrieveModelV1ModelsModelIDGetRequest", - "RetrieveModelV1ModelsModelIDGetRequestTypedDict", - "RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet", - "RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict", - "Role", - "SDKError", - "SSETypes", - "SampleType", - "Security", - "SecurityTypedDict", - "ShareEnum", - "SharingDelete", - "SharingDeleteTypedDict", - "SharingIn", - "SharingInTypedDict", - "SharingOut", - "SharingOutTypedDict", - "Source", - "Status", - "Stop", - "StopTypedDict", - "SystemMessage", - "SystemMessageContent", - "SystemMessageContentChunks", - "SystemMessageContentChunksTypedDict", - "SystemMessageContentTypedDict", - "SystemMessageTypedDict", - "TextChunk", - "TextChunkType", - "TextChunkTypedDict", - "ThinkChunk", - "ThinkChunkType", - "ThinkChunkTypedDict", - "Thinking", - "ThinkingTypedDict", - "TimestampGranularity", - "Tool", - "ToolCall", - "ToolCallTypedDict", - "ToolChoice", - "ToolChoiceEnum", - "ToolChoiceTypedDict", - "ToolExecutionDeltaEvent", - "ToolExecutionDeltaEventType", - "ToolExecutionDeltaEventTypedDict", - "ToolExecutionDoneEvent", - "ToolExecutionDoneEventType", - "ToolExecutionDoneEventTypedDict", - "ToolExecutionEntry", - "ToolExecutionEntryObject", - "ToolExecutionEntryType", - "ToolExecutionEntryTypedDict", - "ToolExecutionStartedEvent", - "ToolExecutionStartedEventType", - "ToolExecutionStartedEventTypedDict", - "ToolFileChunk", - "ToolFileChunkType", - "ToolFileChunkTypedDict", - "ToolMessage", - "ToolMessageContent", - "ToolMessageContentTypedDict", - "ToolMessageRole", - "ToolMessageTypedDict", - "ToolReferenceChunk", - "ToolReferenceChunkType", - "ToolReferenceChunkTypedDict", - "ToolTypedDict", - "ToolTypes", - "Tools", - "ToolsTypedDict", - "TrainingFile", - "TrainingFileTypedDict", - "TranscriptionResponse", - "TranscriptionResponseTypedDict", - "TranscriptionSegmentChunk", - "TranscriptionSegmentChunkTypedDict", - "TranscriptionStreamDone", - "TranscriptionStreamDoneType", - "TranscriptionStreamDoneTypedDict", - "TranscriptionStreamEventTypes", - "TranscriptionStreamEvents", - "TranscriptionStreamEventsData", - "TranscriptionStreamEventsDataTypedDict", - "TranscriptionStreamEventsTypedDict", - "TranscriptionStreamLanguage", - "TranscriptionStreamLanguageType", - "TranscriptionStreamLanguageTypedDict", - "TranscriptionStreamSegmentDelta", - "TranscriptionStreamSegmentDeltaType", - "TranscriptionStreamSegmentDeltaTypedDict", - "TranscriptionStreamTextDelta", - "TranscriptionStreamTextDeltaType", - "TranscriptionStreamTextDeltaTypedDict", - "Two", - "TwoTypedDict", - "Type", - "UnarchiveFTModelOut", - "UnarchiveFTModelOutObject", - "UnarchiveFTModelOutTypedDict", - "UpdateFTModelIn", - "UpdateFTModelInTypedDict", - "UploadFileOut", - "UploadFileOutTypedDict", - "UsageInfo", - "UsageInfoTypedDict", - "UserMessage", - "UserMessageContent", - "UserMessageContentTypedDict", - "UserMessageRole", - "UserMessageTypedDict", - "ValidationError", - "ValidationErrorTypedDict", - "WandbIntegration", - "WandbIntegrationOut", - "WandbIntegrationOutType", - "WandbIntegrationOutTypedDict", - "WandbIntegrationType", - "WandbIntegrationTypedDict", - "WebSearchPremiumTool", - "WebSearchPremiumToolType", - "WebSearchPremiumToolTypedDict", - "WebSearchTool", - "WebSearchToolType", - "WebSearchToolTypedDict", -] - -_dynamic_imports: dict[str, str] = { - "Agent": ".agent", - "AgentObject": ".agent", - "AgentTools": ".agent", - "AgentToolsTypedDict": ".agent", - "AgentTypedDict": ".agent", - "AgentConversation": ".agentconversation", - "AgentConversationObject": ".agentconversation", - "AgentConversationTypedDict": ".agentconversation", - "AgentCreationRequest": ".agentcreationrequest", - "AgentCreationRequestTools": ".agentcreationrequest", - "AgentCreationRequestToolsTypedDict": ".agentcreationrequest", - "AgentCreationRequestTypedDict": ".agentcreationrequest", - "AgentHandoffDoneEvent": ".agenthandoffdoneevent", - "AgentHandoffDoneEventType": ".agenthandoffdoneevent", - "AgentHandoffDoneEventTypedDict": ".agenthandoffdoneevent", - "AgentHandoffEntry": ".agenthandoffentry", - "AgentHandoffEntryObject": ".agenthandoffentry", - "AgentHandoffEntryType": ".agenthandoffentry", - "AgentHandoffEntryTypedDict": ".agenthandoffentry", - "AgentHandoffStartedEvent": ".agenthandoffstartedevent", - "AgentHandoffStartedEventType": ".agenthandoffstartedevent", - "AgentHandoffStartedEventTypedDict": ".agenthandoffstartedevent", - "AgentsAPIV1AgentsGetRequest": ".agents_api_v1_agents_getop", - "AgentsAPIV1AgentsGetRequestTypedDict": ".agents_api_v1_agents_getop", - "AgentsAPIV1AgentsListRequest": ".agents_api_v1_agents_listop", - "AgentsAPIV1AgentsListRequestTypedDict": ".agents_api_v1_agents_listop", - "AgentsAPIV1AgentsUpdateVersionRequest": ".agents_api_v1_agents_update_versionop", - "AgentsAPIV1AgentsUpdateVersionRequestTypedDict": ".agents_api_v1_agents_update_versionop", - "AgentsAPIV1AgentsUpdateRequest": ".agents_api_v1_agents_updateop", - "AgentsAPIV1AgentsUpdateRequestTypedDict": ".agents_api_v1_agents_updateop", - "AgentsAPIV1ConversationsAppendStreamRequest": ".agents_api_v1_conversations_append_streamop", - "AgentsAPIV1ConversationsAppendStreamRequestTypedDict": ".agents_api_v1_conversations_append_streamop", - "AgentsAPIV1ConversationsAppendRequest": ".agents_api_v1_conversations_appendop", - "AgentsAPIV1ConversationsAppendRequestTypedDict": ".agents_api_v1_conversations_appendop", - "AgentsAPIV1ConversationsGetRequest": ".agents_api_v1_conversations_getop", - "AgentsAPIV1ConversationsGetRequestTypedDict": ".agents_api_v1_conversations_getop", - "AgentsAPIV1ConversationsGetResponseV1ConversationsGet": ".agents_api_v1_conversations_getop", - "AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict": ".agents_api_v1_conversations_getop", - "AgentsAPIV1ConversationsHistoryRequest": ".agents_api_v1_conversations_historyop", - "AgentsAPIV1ConversationsHistoryRequestTypedDict": ".agents_api_v1_conversations_historyop", - "AgentsAPIV1ConversationsListRequest": ".agents_api_v1_conversations_listop", - "AgentsAPIV1ConversationsListRequestTypedDict": ".agents_api_v1_conversations_listop", - "ResponseBody": ".agents_api_v1_conversations_listop", - "ResponseBodyTypedDict": ".agents_api_v1_conversations_listop", - "AgentsAPIV1ConversationsMessagesRequest": ".agents_api_v1_conversations_messagesop", - "AgentsAPIV1ConversationsMessagesRequestTypedDict": ".agents_api_v1_conversations_messagesop", - "AgentsAPIV1ConversationsRestartStreamRequest": ".agents_api_v1_conversations_restart_streamop", - "AgentsAPIV1ConversationsRestartStreamRequestTypedDict": ".agents_api_v1_conversations_restart_streamop", - "AgentsAPIV1ConversationsRestartRequest": ".agents_api_v1_conversations_restartop", - "AgentsAPIV1ConversationsRestartRequestTypedDict": ".agents_api_v1_conversations_restartop", - "AgentsCompletionRequest": ".agentscompletionrequest", - "AgentsCompletionRequestMessages": ".agentscompletionrequest", - "AgentsCompletionRequestMessagesTypedDict": ".agentscompletionrequest", - "AgentsCompletionRequestStop": ".agentscompletionrequest", - "AgentsCompletionRequestStopTypedDict": ".agentscompletionrequest", - "AgentsCompletionRequestToolChoice": ".agentscompletionrequest", - "AgentsCompletionRequestToolChoiceTypedDict": ".agentscompletionrequest", - "AgentsCompletionRequestTypedDict": ".agentscompletionrequest", - "AgentsCompletionStreamRequest": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestMessages": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestMessagesTypedDict": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestStop": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestStopTypedDict": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestToolChoice": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestToolChoiceTypedDict": ".agentscompletionstreamrequest", - "AgentsCompletionStreamRequestTypedDict": ".agentscompletionstreamrequest", - "AgentUpdateRequest": ".agentupdaterequest", - "AgentUpdateRequestTools": ".agentupdaterequest", - "AgentUpdateRequestToolsTypedDict": ".agentupdaterequest", - "AgentUpdateRequestTypedDict": ".agentupdaterequest", - "APIEndpoint": ".apiendpoint", - "ArchiveFTModelOut": ".archiveftmodelout", - "ArchiveFTModelOutObject": ".archiveftmodelout", - "ArchiveFTModelOutTypedDict": ".archiveftmodelout", - "AssistantMessage": ".assistantmessage", - "AssistantMessageContent": ".assistantmessage", - "AssistantMessageContentTypedDict": ".assistantmessage", - "AssistantMessageRole": ".assistantmessage", - "AssistantMessageTypedDict": ".assistantmessage", - "AudioChunk": ".audiochunk", - "AudioChunkType": ".audiochunk", - "AudioChunkTypedDict": ".audiochunk", - "AudioTranscriptionRequest": ".audiotranscriptionrequest", - "AudioTranscriptionRequestTypedDict": ".audiotranscriptionrequest", - "AudioTranscriptionRequestStream": ".audiotranscriptionrequeststream", - "AudioTranscriptionRequestStreamTypedDict": ".audiotranscriptionrequeststream", - "BaseModelCard": ".basemodelcard", - "BaseModelCardType": ".basemodelcard", - "BaseModelCardTypedDict": ".basemodelcard", - "BatchError": ".batcherror", - "BatchErrorTypedDict": ".batcherror", - "BatchJobIn": ".batchjobin", - "BatchJobInTypedDict": ".batchjobin", - "BatchJobOut": ".batchjobout", - "BatchJobOutObject": ".batchjobout", - "BatchJobOutTypedDict": ".batchjobout", - "BatchJobsOut": ".batchjobsout", - "BatchJobsOutObject": ".batchjobsout", - "BatchJobsOutTypedDict": ".batchjobsout", - "BatchJobStatus": ".batchjobstatus", - "BuiltInConnectors": ".builtinconnectors", - "ChatClassificationRequest": ".chatclassificationrequest", - "ChatClassificationRequestTypedDict": ".chatclassificationrequest", - "ChatCompletionChoice": ".chatcompletionchoice", - "ChatCompletionChoiceTypedDict": ".chatcompletionchoice", - "FinishReason": ".chatcompletionchoice", - "ChatCompletionRequest": ".chatcompletionrequest", - "ChatCompletionRequestToolChoice": ".chatcompletionrequest", - "ChatCompletionRequestToolChoiceTypedDict": ".chatcompletionrequest", - "ChatCompletionRequestTypedDict": ".chatcompletionrequest", - "Messages": ".chatcompletionrequest", - "MessagesTypedDict": ".chatcompletionrequest", - "Stop": ".chatcompletionrequest", - "StopTypedDict": ".chatcompletionrequest", - "ChatCompletionResponse": ".chatcompletionresponse", - "ChatCompletionResponseTypedDict": ".chatcompletionresponse", - "ChatCompletionStreamRequest": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestMessages": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestMessagesTypedDict": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestStop": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestStopTypedDict": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestToolChoice": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestToolChoiceTypedDict": ".chatcompletionstreamrequest", - "ChatCompletionStreamRequestTypedDict": ".chatcompletionstreamrequest", - "ChatModerationRequest": ".chatmoderationrequest", - "ChatModerationRequestInputs": ".chatmoderationrequest", - "ChatModerationRequestInputsTypedDict": ".chatmoderationrequest", - "ChatModerationRequestTypedDict": ".chatmoderationrequest", - "One": ".chatmoderationrequest", - "OneTypedDict": ".chatmoderationrequest", - "Two": ".chatmoderationrequest", - "TwoTypedDict": ".chatmoderationrequest", - "CheckpointOut": ".checkpointout", - "CheckpointOutTypedDict": ".checkpointout", - "ClassificationRequest": ".classificationrequest", - "ClassificationRequestInputs": ".classificationrequest", - "ClassificationRequestInputsTypedDict": ".classificationrequest", - "ClassificationRequestTypedDict": ".classificationrequest", - "ClassificationResponse": ".classificationresponse", - "ClassificationResponseTypedDict": ".classificationresponse", - "ClassificationTargetResult": ".classificationtargetresult", - "ClassificationTargetResultTypedDict": ".classificationtargetresult", - "ClassifierDetailedJobOut": ".classifierdetailedjobout", - "ClassifierDetailedJobOutIntegrations": ".classifierdetailedjobout", - "ClassifierDetailedJobOutIntegrationsTypedDict": ".classifierdetailedjobout", - "ClassifierDetailedJobOutJobType": ".classifierdetailedjobout", - "ClassifierDetailedJobOutObject": ".classifierdetailedjobout", - "ClassifierDetailedJobOutStatus": ".classifierdetailedjobout", - "ClassifierDetailedJobOutTypedDict": ".classifierdetailedjobout", - "ClassifierFTModelOut": ".classifierftmodelout", - "ClassifierFTModelOutModelType": ".classifierftmodelout", - "ClassifierFTModelOutObject": ".classifierftmodelout", - "ClassifierFTModelOutTypedDict": ".classifierftmodelout", - "ClassifierJobOut": ".classifierjobout", - "ClassifierJobOutIntegrations": ".classifierjobout", - "ClassifierJobOutIntegrationsTypedDict": ".classifierjobout", - "ClassifierJobOutJobType": ".classifierjobout", - "ClassifierJobOutObject": ".classifierjobout", - "ClassifierJobOutStatus": ".classifierjobout", - "ClassifierJobOutTypedDict": ".classifierjobout", - "ClassifierTargetIn": ".classifiertargetin", - "ClassifierTargetInTypedDict": ".classifiertargetin", - "ClassifierTargetOut": ".classifiertargetout", - "ClassifierTargetOutTypedDict": ".classifiertargetout", - "ClassifierTrainingParameters": ".classifiertrainingparameters", - "ClassifierTrainingParametersTypedDict": ".classifiertrainingparameters", - "ClassifierTrainingParametersIn": ".classifiertrainingparametersin", - "ClassifierTrainingParametersInTypedDict": ".classifiertrainingparametersin", - "CodeInterpreterTool": ".codeinterpretertool", - "CodeInterpreterToolType": ".codeinterpretertool", - "CodeInterpreterToolTypedDict": ".codeinterpretertool", - "CompletionArgs": ".completionargs", - "CompletionArgsTypedDict": ".completionargs", - "CompletionArgsStop": ".completionargsstop", - "CompletionArgsStopTypedDict": ".completionargsstop", - "CompletionChunk": ".completionchunk", - "CompletionChunkTypedDict": ".completionchunk", - "CompletionDetailedJobOut": ".completiondetailedjobout", - "CompletionDetailedJobOutIntegrations": ".completiondetailedjobout", - "CompletionDetailedJobOutIntegrationsTypedDict": ".completiondetailedjobout", - "CompletionDetailedJobOutJobType": ".completiondetailedjobout", - "CompletionDetailedJobOutObject": ".completiondetailedjobout", - "CompletionDetailedJobOutRepositories": ".completiondetailedjobout", - "CompletionDetailedJobOutRepositoriesTypedDict": ".completiondetailedjobout", - "CompletionDetailedJobOutStatus": ".completiondetailedjobout", - "CompletionDetailedJobOutTypedDict": ".completiondetailedjobout", - "CompletionEvent": ".completionevent", - "CompletionEventTypedDict": ".completionevent", - "CompletionFTModelOut": ".completionftmodelout", - "CompletionFTModelOutObject": ".completionftmodelout", - "CompletionFTModelOutTypedDict": ".completionftmodelout", - "ModelType": ".completionftmodelout", - "CompletionJobOut": ".completionjobout", - "CompletionJobOutObject": ".completionjobout", - "CompletionJobOutTypedDict": ".completionjobout", - "Integrations": ".completionjobout", - "IntegrationsTypedDict": ".completionjobout", - "JobType": ".completionjobout", - "Repositories": ".completionjobout", - "RepositoriesTypedDict": ".completionjobout", - "Status": ".completionjobout", - "CompletionResponseStreamChoice": ".completionresponsestreamchoice", - "CompletionResponseStreamChoiceFinishReason": ".completionresponsestreamchoice", - "CompletionResponseStreamChoiceTypedDict": ".completionresponsestreamchoice", - "CompletionTrainingParameters": ".completiontrainingparameters", - "CompletionTrainingParametersTypedDict": ".completiontrainingparameters", - "CompletionTrainingParametersIn": ".completiontrainingparametersin", - "CompletionTrainingParametersInTypedDict": ".completiontrainingparametersin", - "ContentChunk": ".contentchunk", - "ContentChunkTypedDict": ".contentchunk", - "ConversationAppendRequest": ".conversationappendrequest", - "ConversationAppendRequestHandoffExecution": ".conversationappendrequest", - "ConversationAppendRequestTypedDict": ".conversationappendrequest", - "ConversationAppendStreamRequest": ".conversationappendstreamrequest", - "ConversationAppendStreamRequestHandoffExecution": ".conversationappendstreamrequest", - "ConversationAppendStreamRequestTypedDict": ".conversationappendstreamrequest", - "ConversationEvents": ".conversationevents", - "ConversationEventsData": ".conversationevents", - "ConversationEventsDataTypedDict": ".conversationevents", - "ConversationEventsTypedDict": ".conversationevents", - "ConversationHistory": ".conversationhistory", - "ConversationHistoryObject": ".conversationhistory", - "ConversationHistoryTypedDict": ".conversationhistory", - "Entries": ".conversationhistory", - "EntriesTypedDict": ".conversationhistory", - "ConversationInputs": ".conversationinputs", - "ConversationInputsTypedDict": ".conversationinputs", - "ConversationMessages": ".conversationmessages", - "ConversationMessagesObject": ".conversationmessages", - "ConversationMessagesTypedDict": ".conversationmessages", - "ConversationRequest": ".conversationrequest", - "ConversationRequestTypedDict": ".conversationrequest", - "HandoffExecution": ".conversationrequest", - "Tools": ".conversationrequest", - "ToolsTypedDict": ".conversationrequest", - "ConversationResponse": ".conversationresponse", - "ConversationResponseObject": ".conversationresponse", - "ConversationResponseTypedDict": ".conversationresponse", - "Outputs": ".conversationresponse", - "OutputsTypedDict": ".conversationresponse", - "ConversationRestartRequest": ".conversationrestartrequest", - "ConversationRestartRequestHandoffExecution": ".conversationrestartrequest", - "ConversationRestartRequestTypedDict": ".conversationrestartrequest", - "ConversationRestartStreamRequest": ".conversationrestartstreamrequest", - "ConversationRestartStreamRequestHandoffExecution": ".conversationrestartstreamrequest", - "ConversationRestartStreamRequestTypedDict": ".conversationrestartstreamrequest", - "ConversationStreamRequest": ".conversationstreamrequest", - "ConversationStreamRequestHandoffExecution": ".conversationstreamrequest", - "ConversationStreamRequestTools": ".conversationstreamrequest", - "ConversationStreamRequestToolsTypedDict": ".conversationstreamrequest", - "ConversationStreamRequestTypedDict": ".conversationstreamrequest", - "ConversationUsageInfo": ".conversationusageinfo", - "ConversationUsageInfoTypedDict": ".conversationusageinfo", - "DeleteModelV1ModelsModelIDDeleteRequest": ".delete_model_v1_models_model_id_deleteop", - "DeleteModelV1ModelsModelIDDeleteRequestTypedDict": ".delete_model_v1_models_model_id_deleteop", - "DeleteFileOut": ".deletefileout", - "DeleteFileOutTypedDict": ".deletefileout", - "DeleteModelOut": ".deletemodelout", - "DeleteModelOutTypedDict": ".deletemodelout", - "Content": ".deltamessage", - "ContentTypedDict": ".deltamessage", - "DeltaMessage": ".deltamessage", - "DeltaMessageTypedDict": ".deltamessage", - "DocumentLibraryTool": ".documentlibrarytool", - "DocumentLibraryToolType": ".documentlibrarytool", - "DocumentLibraryToolTypedDict": ".documentlibrarytool", - "DocumentOut": ".documentout", - "DocumentOutTypedDict": ".documentout", - "DocumentTextContent": ".documenttextcontent", - "DocumentTextContentTypedDict": ".documenttextcontent", - "DocumentUpdateIn": ".documentupdatein", - "DocumentUpdateInTypedDict": ".documentupdatein", - "DocumentURLChunk": ".documenturlchunk", - "DocumentURLChunkType": ".documenturlchunk", - "DocumentURLChunkTypedDict": ".documenturlchunk", - "EmbeddingDtype": ".embeddingdtype", - "EmbeddingRequest": ".embeddingrequest", - "EmbeddingRequestInputs": ".embeddingrequest", - "EmbeddingRequestInputsTypedDict": ".embeddingrequest", - "EmbeddingRequestTypedDict": ".embeddingrequest", - "EmbeddingResponse": ".embeddingresponse", - "EmbeddingResponseTypedDict": ".embeddingresponse", - "EmbeddingResponseData": ".embeddingresponsedata", - "EmbeddingResponseDataTypedDict": ".embeddingresponsedata", - "EncodingFormat": ".encodingformat", - "EntityType": ".entitytype", - "EventOut": ".eventout", - "EventOutTypedDict": ".eventout", - "File": ".file", - "FileTypedDict": ".file", - "FileChunk": ".filechunk", - "FileChunkTypedDict": ".filechunk", - "FilePurpose": ".filepurpose", - "FilesAPIRoutesDeleteFileRequest": ".files_api_routes_delete_fileop", - "FilesAPIRoutesDeleteFileRequestTypedDict": ".files_api_routes_delete_fileop", - "FilesAPIRoutesDownloadFileRequest": ".files_api_routes_download_fileop", - "FilesAPIRoutesDownloadFileRequestTypedDict": ".files_api_routes_download_fileop", - "FilesAPIRoutesGetSignedURLRequest": ".files_api_routes_get_signed_urlop", - "FilesAPIRoutesGetSignedURLRequestTypedDict": ".files_api_routes_get_signed_urlop", - "FilesAPIRoutesListFilesRequest": ".files_api_routes_list_filesop", - "FilesAPIRoutesListFilesRequestTypedDict": ".files_api_routes_list_filesop", - "FilesAPIRoutesRetrieveFileRequest": ".files_api_routes_retrieve_fileop", - "FilesAPIRoutesRetrieveFileRequestTypedDict": ".files_api_routes_retrieve_fileop", - "FilesAPIRoutesUploadFileMultiPartBodyParams": ".files_api_routes_upload_fileop", - "FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict": ".files_api_routes_upload_fileop", - "FileSchema": ".fileschema", - "FileSchemaTypedDict": ".fileschema", - "FileSignedURL": ".filesignedurl", - "FileSignedURLTypedDict": ".filesignedurl", - "FIMCompletionRequest": ".fimcompletionrequest", - "FIMCompletionRequestStop": ".fimcompletionrequest", - "FIMCompletionRequestStopTypedDict": ".fimcompletionrequest", - "FIMCompletionRequestTypedDict": ".fimcompletionrequest", - "FIMCompletionResponse": ".fimcompletionresponse", - "FIMCompletionResponseTypedDict": ".fimcompletionresponse", - "FIMCompletionStreamRequest": ".fimcompletionstreamrequest", - "FIMCompletionStreamRequestStop": ".fimcompletionstreamrequest", - "FIMCompletionStreamRequestStopTypedDict": ".fimcompletionstreamrequest", - "FIMCompletionStreamRequestTypedDict": ".fimcompletionstreamrequest", - "FineTuneableModelType": ".finetuneablemodeltype", - "FTClassifierLossFunction": ".ftclassifierlossfunction", - "FTModelCapabilitiesOut": ".ftmodelcapabilitiesout", - "FTModelCapabilitiesOutTypedDict": ".ftmodelcapabilitiesout", - "FTModelCard": ".ftmodelcard", - "FTModelCardType": ".ftmodelcard", - "FTModelCardTypedDict": ".ftmodelcard", - "Function": ".function", - "FunctionTypedDict": ".function", - "Arguments": ".functioncall", - "ArgumentsTypedDict": ".functioncall", - "FunctionCall": ".functioncall", - "FunctionCallTypedDict": ".functioncall", - "FunctionCallEntry": ".functioncallentry", - "FunctionCallEntryObject": ".functioncallentry", - "FunctionCallEntryType": ".functioncallentry", - "FunctionCallEntryTypedDict": ".functioncallentry", - "FunctionCallEntryArguments": ".functioncallentryarguments", - "FunctionCallEntryArgumentsTypedDict": ".functioncallentryarguments", - "FunctionCallEvent": ".functioncallevent", - "FunctionCallEventType": ".functioncallevent", - "FunctionCallEventTypedDict": ".functioncallevent", - "FunctionName": ".functionname", - "FunctionNameTypedDict": ".functionname", - "FunctionResultEntry": ".functionresultentry", - "FunctionResultEntryObject": ".functionresultentry", - "FunctionResultEntryType": ".functionresultentry", - "FunctionResultEntryTypedDict": ".functionresultentry", - "FunctionTool": ".functiontool", - "FunctionToolType": ".functiontool", - "FunctionToolTypedDict": ".functiontool", - "GithubRepositoryIn": ".githubrepositoryin", - "GithubRepositoryInType": ".githubrepositoryin", - "GithubRepositoryInTypedDict": ".githubrepositoryin", - "GithubRepositoryOut": ".githubrepositoryout", - "GithubRepositoryOutType": ".githubrepositoryout", - "GithubRepositoryOutTypedDict": ".githubrepositoryout", - "HTTPValidationError": ".httpvalidationerror", - "HTTPValidationErrorData": ".httpvalidationerror", - "ImageGenerationTool": ".imagegenerationtool", - "ImageGenerationToolType": ".imagegenerationtool", - "ImageGenerationToolTypedDict": ".imagegenerationtool", - "ImageURL": ".imageurl", - "ImageURLTypedDict": ".imageurl", - "ImageURLChunk": ".imageurlchunk", - "ImageURLChunkImageURL": ".imageurlchunk", - "ImageURLChunkImageURLTypedDict": ".imageurlchunk", - "ImageURLChunkType": ".imageurlchunk", - "ImageURLChunkTypedDict": ".imageurlchunk", - "InputEntries": ".inputentries", - "InputEntriesTypedDict": ".inputentries", - "Inputs": ".inputs", - "InputsTypedDict": ".inputs", - "InstructRequestInputs": ".inputs", - "InstructRequestInputsMessages": ".inputs", - "InstructRequestInputsMessagesTypedDict": ".inputs", - "InstructRequestInputsTypedDict": ".inputs", - "InstructRequest": ".instructrequest", - "InstructRequestMessages": ".instructrequest", - "InstructRequestMessagesTypedDict": ".instructrequest", - "InstructRequestTypedDict": ".instructrequest", - "Hyperparameters": ".jobin", - "HyperparametersTypedDict": ".jobin", - "JobIn": ".jobin", - "JobInIntegrations": ".jobin", - "JobInIntegrationsTypedDict": ".jobin", - "JobInRepositories": ".jobin", - "JobInRepositoriesTypedDict": ".jobin", - "JobInTypedDict": ".jobin", - "JobMetadataOut": ".jobmetadataout", - "JobMetadataOutTypedDict": ".jobmetadataout", - "JobsAPIRoutesBatchCancelBatchJobRequest": ".jobs_api_routes_batch_cancel_batch_jobop", - "JobsAPIRoutesBatchCancelBatchJobRequestTypedDict": ".jobs_api_routes_batch_cancel_batch_jobop", - "JobsAPIRoutesBatchGetBatchJobRequest": ".jobs_api_routes_batch_get_batch_jobop", - "JobsAPIRoutesBatchGetBatchJobRequestTypedDict": ".jobs_api_routes_batch_get_batch_jobop", - "JobsAPIRoutesBatchGetBatchJobsRequest": ".jobs_api_routes_batch_get_batch_jobsop", - "JobsAPIRoutesBatchGetBatchJobsRequestTypedDict": ".jobs_api_routes_batch_get_batch_jobsop", - "JobsAPIRoutesFineTuningArchiveFineTunedModelRequest": ".jobs_api_routes_fine_tuning_archive_fine_tuned_modelop", - "JobsAPIRoutesFineTuningArchiveFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_archive_fine_tuned_modelop", - "JobsAPIRoutesFineTuningCancelFineTuningJobRequest": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", - "JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", - "JobsAPIRoutesFineTuningCancelFineTuningJobResponse": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", - "JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop", - "JobsAPIRoutesFineTuningCreateFineTuningJobResponse": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", - "JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", - "Response1": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", - "Response1TypedDict": ".jobs_api_routes_fine_tuning_create_fine_tuning_jobop", - "JobsAPIRoutesFineTuningGetFineTuningJobRequest": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", - "JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", - "JobsAPIRoutesFineTuningGetFineTuningJobResponse": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", - "JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobop", - "JobsAPIRoutesFineTuningGetFineTuningJobsRequest": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", - "JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", - "QueryParamStatus": ".jobs_api_routes_fine_tuning_get_fine_tuning_jobsop", - "JobsAPIRoutesFineTuningStartFineTuningJobRequest": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", - "JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", - "JobsAPIRoutesFineTuningStartFineTuningJobResponse": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", - "JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict": ".jobs_api_routes_fine_tuning_start_fine_tuning_jobop", - "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequest": ".jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop", - "JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop", - "JobsAPIRoutesFineTuningUpdateFineTunedModelRequest": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", - "JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", - "JobsAPIRoutesFineTuningUpdateFineTunedModelResponse": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", - "JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict": ".jobs_api_routes_fine_tuning_update_fine_tuned_modelop", - "JobsOut": ".jobsout", - "JobsOutData": ".jobsout", - "JobsOutDataTypedDict": ".jobsout", - "JobsOutObject": ".jobsout", - "JobsOutTypedDict": ".jobsout", - "JSONSchema": ".jsonschema", - "JSONSchemaTypedDict": ".jsonschema", - "LegacyJobMetadataOut": ".legacyjobmetadataout", - "LegacyJobMetadataOutObject": ".legacyjobmetadataout", - "LegacyJobMetadataOutTypedDict": ".legacyjobmetadataout", - "LibrariesDeleteV1Request": ".libraries_delete_v1op", - "LibrariesDeleteV1RequestTypedDict": ".libraries_delete_v1op", - "LibrariesDocumentsDeleteV1Request": ".libraries_documents_delete_v1op", - "LibrariesDocumentsDeleteV1RequestTypedDict": ".libraries_documents_delete_v1op", - "LibrariesDocumentsGetExtractedTextSignedURLV1Request": ".libraries_documents_get_extracted_text_signed_url_v1op", - "LibrariesDocumentsGetExtractedTextSignedURLV1RequestTypedDict": ".libraries_documents_get_extracted_text_signed_url_v1op", - "LibrariesDocumentsGetSignedURLV1Request": ".libraries_documents_get_signed_url_v1op", - "LibrariesDocumentsGetSignedURLV1RequestTypedDict": ".libraries_documents_get_signed_url_v1op", - "LibrariesDocumentsGetStatusV1Request": ".libraries_documents_get_status_v1op", - "LibrariesDocumentsGetStatusV1RequestTypedDict": ".libraries_documents_get_status_v1op", - "LibrariesDocumentsGetTextContentV1Request": ".libraries_documents_get_text_content_v1op", - "LibrariesDocumentsGetTextContentV1RequestTypedDict": ".libraries_documents_get_text_content_v1op", - "LibrariesDocumentsGetV1Request": ".libraries_documents_get_v1op", - "LibrariesDocumentsGetV1RequestTypedDict": ".libraries_documents_get_v1op", - "LibrariesDocumentsListV1Request": ".libraries_documents_list_v1op", - "LibrariesDocumentsListV1RequestTypedDict": ".libraries_documents_list_v1op", - "LibrariesDocumentsReprocessV1Request": ".libraries_documents_reprocess_v1op", - "LibrariesDocumentsReprocessV1RequestTypedDict": ".libraries_documents_reprocess_v1op", - "LibrariesDocumentsUpdateV1Request": ".libraries_documents_update_v1op", - "LibrariesDocumentsUpdateV1RequestTypedDict": ".libraries_documents_update_v1op", - "LibrariesDocumentsUploadV1DocumentUpload": ".libraries_documents_upload_v1op", - "LibrariesDocumentsUploadV1DocumentUploadTypedDict": ".libraries_documents_upload_v1op", - "LibrariesDocumentsUploadV1Request": ".libraries_documents_upload_v1op", - "LibrariesDocumentsUploadV1RequestTypedDict": ".libraries_documents_upload_v1op", - "LibrariesGetV1Request": ".libraries_get_v1op", - "LibrariesGetV1RequestTypedDict": ".libraries_get_v1op", - "LibrariesShareCreateV1Request": ".libraries_share_create_v1op", - "LibrariesShareCreateV1RequestTypedDict": ".libraries_share_create_v1op", - "LibrariesShareDeleteV1Request": ".libraries_share_delete_v1op", - "LibrariesShareDeleteV1RequestTypedDict": ".libraries_share_delete_v1op", - "LibrariesShareListV1Request": ".libraries_share_list_v1op", - "LibrariesShareListV1RequestTypedDict": ".libraries_share_list_v1op", - "LibrariesUpdateV1Request": ".libraries_update_v1op", - "LibrariesUpdateV1RequestTypedDict": ".libraries_update_v1op", - "LibraryIn": ".libraryin", - "LibraryInTypedDict": ".libraryin", - "LibraryInUpdate": ".libraryinupdate", - "LibraryInUpdateTypedDict": ".libraryinupdate", - "LibraryOut": ".libraryout", - "LibraryOutTypedDict": ".libraryout", - "ListDocumentOut": ".listdocumentout", - "ListDocumentOutTypedDict": ".listdocumentout", - "ListFilesOut": ".listfilesout", - "ListFilesOutTypedDict": ".listfilesout", - "ListLibraryOut": ".listlibraryout", - "ListLibraryOutTypedDict": ".listlibraryout", - "ListSharingOut": ".listsharingout", - "ListSharingOutTypedDict": ".listsharingout", - "MessageEntries": ".messageentries", - "MessageEntriesTypedDict": ".messageentries", - "MessageInputContentChunks": ".messageinputcontentchunks", - "MessageInputContentChunksTypedDict": ".messageinputcontentchunks", - "MessageInputEntry": ".messageinputentry", - "MessageInputEntryContent": ".messageinputentry", - "MessageInputEntryContentTypedDict": ".messageinputentry", - "MessageInputEntryRole": ".messageinputentry", - "MessageInputEntryType": ".messageinputentry", - "MessageInputEntryTypedDict": ".messageinputentry", - "Object": ".messageinputentry", - "MessageOutputContentChunks": ".messageoutputcontentchunks", - "MessageOutputContentChunksTypedDict": ".messageoutputcontentchunks", - "MessageOutputEntry": ".messageoutputentry", - "MessageOutputEntryContent": ".messageoutputentry", - "MessageOutputEntryContentTypedDict": ".messageoutputentry", - "MessageOutputEntryObject": ".messageoutputentry", - "MessageOutputEntryRole": ".messageoutputentry", - "MessageOutputEntryType": ".messageoutputentry", - "MessageOutputEntryTypedDict": ".messageoutputentry", - "MessageOutputEvent": ".messageoutputevent", - "MessageOutputEventContent": ".messageoutputevent", - "MessageOutputEventContentTypedDict": ".messageoutputevent", - "MessageOutputEventRole": ".messageoutputevent", - "MessageOutputEventType": ".messageoutputevent", - "MessageOutputEventTypedDict": ".messageoutputevent", - "MetricOut": ".metricout", - "MetricOutTypedDict": ".metricout", - "MistralPromptMode": ".mistralpromptmode", - "ModelCapabilities": ".modelcapabilities", - "ModelCapabilitiesTypedDict": ".modelcapabilities", - "ModelConversation": ".modelconversation", - "ModelConversationObject": ".modelconversation", - "ModelConversationTools": ".modelconversation", - "ModelConversationToolsTypedDict": ".modelconversation", - "ModelConversationTypedDict": ".modelconversation", - "Data": ".modellist", - "DataTypedDict": ".modellist", - "ModelList": ".modellist", - "ModelListTypedDict": ".modellist", - "ModerationObject": ".moderationobject", - "ModerationObjectTypedDict": ".moderationobject", - "ModerationResponse": ".moderationresponse", - "ModerationResponseTypedDict": ".moderationresponse", - "NoResponseError": ".no_response_error", - "OCRImageObject": ".ocrimageobject", - "OCRImageObjectTypedDict": ".ocrimageobject", - "OCRPageDimensions": ".ocrpagedimensions", - "OCRPageDimensionsTypedDict": ".ocrpagedimensions", - "OCRPageObject": ".ocrpageobject", - "OCRPageObjectTypedDict": ".ocrpageobject", - "Document": ".ocrrequest", - "DocumentTypedDict": ".ocrrequest", - "OCRRequest": ".ocrrequest", - "OCRRequestTypedDict": ".ocrrequest", - "OCRResponse": ".ocrresponse", - "OCRResponseTypedDict": ".ocrresponse", - "OCRUsageInfo": ".ocrusageinfo", - "OCRUsageInfoTypedDict": ".ocrusageinfo", - "OutputContentChunks": ".outputcontentchunks", - "OutputContentChunksTypedDict": ".outputcontentchunks", - "PaginationInfo": ".paginationinfo", - "PaginationInfoTypedDict": ".paginationinfo", - "Prediction": ".prediction", - "PredictionTypedDict": ".prediction", - "ProcessingStatusOut": ".processingstatusout", - "ProcessingStatusOutTypedDict": ".processingstatusout", - "ReferenceChunk": ".referencechunk", - "ReferenceChunkType": ".referencechunk", - "ReferenceChunkTypedDict": ".referencechunk", - "ResponseDoneEvent": ".responsedoneevent", - "ResponseDoneEventType": ".responsedoneevent", - "ResponseDoneEventTypedDict": ".responsedoneevent", - "ResponseErrorEvent": ".responseerrorevent", - "ResponseErrorEventType": ".responseerrorevent", - "ResponseErrorEventTypedDict": ".responseerrorevent", - "ResponseFormat": ".responseformat", - "ResponseFormatTypedDict": ".responseformat", - "ResponseFormats": ".responseformats", - "ResponseStartedEvent": ".responsestartedevent", - "ResponseStartedEventType": ".responsestartedevent", - "ResponseStartedEventTypedDict": ".responsestartedevent", - "ResponseValidationError": ".responsevalidationerror", - "RetrieveModelV1ModelsModelIDGetRequest": ".retrieve_model_v1_models_model_id_getop", - "RetrieveModelV1ModelsModelIDGetRequestTypedDict": ".retrieve_model_v1_models_model_id_getop", - "RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet": ".retrieve_model_v1_models_model_id_getop", - "RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict": ".retrieve_model_v1_models_model_id_getop", - "RetrieveFileOut": ".retrievefileout", - "RetrieveFileOutTypedDict": ".retrievefileout", - "SampleType": ".sampletype", - "SDKError": ".sdkerror", - "Security": ".security", - "SecurityTypedDict": ".security", - "ShareEnum": ".shareenum", - "SharingDelete": ".sharingdelete", - "SharingDeleteTypedDict": ".sharingdelete", - "SharingIn": ".sharingin", - "SharingInTypedDict": ".sharingin", - "SharingOut": ".sharingout", - "SharingOutTypedDict": ".sharingout", - "Source": ".source", - "SSETypes": ".ssetypes", - "Role": ".systemmessage", - "SystemMessage": ".systemmessage", - "SystemMessageContent": ".systemmessage", - "SystemMessageContentTypedDict": ".systemmessage", - "SystemMessageTypedDict": ".systemmessage", - "SystemMessageContentChunks": ".systemmessagecontentchunks", - "SystemMessageContentChunksTypedDict": ".systemmessagecontentchunks", - "TextChunk": ".textchunk", - "TextChunkType": ".textchunk", - "TextChunkTypedDict": ".textchunk", - "ThinkChunk": ".thinkchunk", - "ThinkChunkType": ".thinkchunk", - "ThinkChunkTypedDict": ".thinkchunk", - "Thinking": ".thinkchunk", - "ThinkingTypedDict": ".thinkchunk", - "TimestampGranularity": ".timestampgranularity", - "Tool": ".tool", - "ToolTypedDict": ".tool", - "ToolCall": ".toolcall", - "ToolCallTypedDict": ".toolcall", - "ToolChoice": ".toolchoice", - "ToolChoiceTypedDict": ".toolchoice", - "ToolChoiceEnum": ".toolchoiceenum", - "ToolExecutionDeltaEvent": ".toolexecutiondeltaevent", - "ToolExecutionDeltaEventType": ".toolexecutiondeltaevent", - "ToolExecutionDeltaEventTypedDict": ".toolexecutiondeltaevent", - "ToolExecutionDoneEvent": ".toolexecutiondoneevent", - "ToolExecutionDoneEventType": ".toolexecutiondoneevent", - "ToolExecutionDoneEventTypedDict": ".toolexecutiondoneevent", - "ToolExecutionEntry": ".toolexecutionentry", - "ToolExecutionEntryObject": ".toolexecutionentry", - "ToolExecutionEntryType": ".toolexecutionentry", - "ToolExecutionEntryTypedDict": ".toolexecutionentry", - "ToolExecutionStartedEvent": ".toolexecutionstartedevent", - "ToolExecutionStartedEventType": ".toolexecutionstartedevent", - "ToolExecutionStartedEventTypedDict": ".toolexecutionstartedevent", - "ToolFileChunk": ".toolfilechunk", - "ToolFileChunkType": ".toolfilechunk", - "ToolFileChunkTypedDict": ".toolfilechunk", - "ToolMessage": ".toolmessage", - "ToolMessageContent": ".toolmessage", - "ToolMessageContentTypedDict": ".toolmessage", - "ToolMessageRole": ".toolmessage", - "ToolMessageTypedDict": ".toolmessage", - "ToolReferenceChunk": ".toolreferencechunk", - "ToolReferenceChunkType": ".toolreferencechunk", - "ToolReferenceChunkTypedDict": ".toolreferencechunk", - "ToolTypes": ".tooltypes", - "TrainingFile": ".trainingfile", - "TrainingFileTypedDict": ".trainingfile", - "TranscriptionResponse": ".transcriptionresponse", - "TranscriptionResponseTypedDict": ".transcriptionresponse", - "TranscriptionSegmentChunk": ".transcriptionsegmentchunk", - "TranscriptionSegmentChunkTypedDict": ".transcriptionsegmentchunk", - "Type": ".transcriptionsegmentchunk", - "TranscriptionStreamDone": ".transcriptionstreamdone", - "TranscriptionStreamDoneType": ".transcriptionstreamdone", - "TranscriptionStreamDoneTypedDict": ".transcriptionstreamdone", - "TranscriptionStreamEvents": ".transcriptionstreamevents", - "TranscriptionStreamEventsData": ".transcriptionstreamevents", - "TranscriptionStreamEventsDataTypedDict": ".transcriptionstreamevents", - "TranscriptionStreamEventsTypedDict": ".transcriptionstreamevents", - "TranscriptionStreamEventTypes": ".transcriptionstreameventtypes", - "TranscriptionStreamLanguage": ".transcriptionstreamlanguage", - "TranscriptionStreamLanguageType": ".transcriptionstreamlanguage", - "TranscriptionStreamLanguageTypedDict": ".transcriptionstreamlanguage", - "TranscriptionStreamSegmentDelta": ".transcriptionstreamsegmentdelta", - "TranscriptionStreamSegmentDeltaType": ".transcriptionstreamsegmentdelta", - "TranscriptionStreamSegmentDeltaTypedDict": ".transcriptionstreamsegmentdelta", - "TranscriptionStreamTextDelta": ".transcriptionstreamtextdelta", - "TranscriptionStreamTextDeltaType": ".transcriptionstreamtextdelta", - "TranscriptionStreamTextDeltaTypedDict": ".transcriptionstreamtextdelta", - "UnarchiveFTModelOut": ".unarchiveftmodelout", - "UnarchiveFTModelOutObject": ".unarchiveftmodelout", - "UnarchiveFTModelOutTypedDict": ".unarchiveftmodelout", - "UpdateFTModelIn": ".updateftmodelin", - "UpdateFTModelInTypedDict": ".updateftmodelin", - "UploadFileOut": ".uploadfileout", - "UploadFileOutTypedDict": ".uploadfileout", - "UsageInfo": ".usageinfo", - "UsageInfoTypedDict": ".usageinfo", - "UserMessage": ".usermessage", - "UserMessageContent": ".usermessage", - "UserMessageContentTypedDict": ".usermessage", - "UserMessageRole": ".usermessage", - "UserMessageTypedDict": ".usermessage", - "Loc": ".validationerror", - "LocTypedDict": ".validationerror", - "ValidationError": ".validationerror", - "ValidationErrorTypedDict": ".validationerror", - "WandbIntegration": ".wandbintegration", - "WandbIntegrationType": ".wandbintegration", - "WandbIntegrationTypedDict": ".wandbintegration", - "WandbIntegrationOut": ".wandbintegrationout", - "WandbIntegrationOutType": ".wandbintegrationout", - "WandbIntegrationOutTypedDict": ".wandbintegrationout", - "WebSearchPremiumTool": ".websearchpremiumtool", - "WebSearchPremiumToolType": ".websearchpremiumtool", - "WebSearchPremiumToolTypedDict": ".websearchpremiumtool", - "WebSearchTool": ".websearchtool", - "WebSearchToolType": ".websearchtool", - "WebSearchToolTypedDict": ".websearchtool", -} - - -def dynamic_import(modname, retries=3): - for attempt in range(retries): - try: - return import_module(modname, __package__) - except KeyError: - # Clear any half-initialized module and retry - sys.modules.pop(modname, None) - if attempt == retries - 1: - break - raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") - - -def __getattr__(attr_name: str) -> object: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError( - f"No {attr_name} found in _dynamic_imports for module name -> {__name__} " - ) - - try: - module = dynamic_import(module_name) - result = getattr(module, attr_name) - return result - except ImportError as e: - raise ImportError( - f"Failed to import {attr_name} from {module_name}: {e}" - ) from e - except AttributeError as e: - raise AttributeError( - f"Failed to get {attr_name} from {module_name}: {e}" - ) from e - - -def __dir__(): - lazy_attrs = builtins.list(_dynamic_imports.keys()) - return builtins.sorted(lazy_attrs) diff --git a/src/mistralai/models/agent.py b/src/mistralai/models/agent.py deleted file mode 100644 index b6bf17ab..00000000 --- a/src/mistralai/models/agent.py +++ /dev/null @@ -1,129 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict -from .functiontool import FunctionTool, FunctionToolTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -AgentToolsTypedDict = TypeAliasType( - "AgentToolsTypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - FunctionToolTypedDict, - DocumentLibraryToolTypedDict, - ], -) - - -AgentTools = Annotated[ - Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -AgentObject = Literal["agent"] - - -class AgentTypedDict(TypedDict): - model: str - name: str - id: str - version: int - created_at: datetime - updated_at: datetime - instructions: NotRequired[Nullable[str]] - r"""Instruction prompt the model will follow during the conversation.""" - tools: NotRequired[List[AgentToolsTypedDict]] - r"""List of tools which are available to the model during the conversation.""" - completion_args: NotRequired[CompletionArgsTypedDict] - r"""White-listed arguments from the completion API""" - description: NotRequired[Nullable[str]] - handoffs: NotRequired[Nullable[List[str]]] - object: NotRequired[AgentObject] - - -class Agent(BaseModel): - model: str - - name: str - - id: str - - version: int - - created_at: datetime - - updated_at: datetime - - instructions: OptionalNullable[str] = UNSET - r"""Instruction prompt the model will follow during the conversation.""" - - tools: Optional[List[AgentTools]] = None - r"""List of tools which are available to the model during the conversation.""" - - completion_args: Optional[CompletionArgs] = None - r"""White-listed arguments from the completion API""" - - description: OptionalNullable[str] = UNSET - - handoffs: OptionalNullable[List[str]] = UNSET - - object: Optional[AgentObject] = "agent" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "instructions", - "tools", - "completion_args", - "description", - "handoffs", - "object", - ] - nullable_fields = ["instructions", "description", "handoffs"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/agentconversation.py b/src/mistralai/models/agentconversation.py deleted file mode 100644 index 42ab84f5..00000000 --- a/src/mistralai/models/agentconversation.py +++ /dev/null @@ -1,71 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -AgentConversationObject = Literal["conversation"] - - -class AgentConversationTypedDict(TypedDict): - id: str - created_at: datetime - updated_at: datetime - agent_id: str - name: NotRequired[Nullable[str]] - r"""Name given to the conversation.""" - description: NotRequired[Nullable[str]] - r"""Description of the what the conversation is about.""" - object: NotRequired[AgentConversationObject] - - -class AgentConversation(BaseModel): - id: str - - created_at: datetime - - updated_at: datetime - - agent_id: str - - name: OptionalNullable[str] = UNSET - r"""Name given to the conversation.""" - - description: OptionalNullable[str] = UNSET - r"""Description of the what the conversation is about.""" - - object: Optional[AgentConversationObject] = "conversation" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["name", "description", "object"] - nullable_fields = ["name", "description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/agentcreationrequest.py b/src/mistralai/models/agentcreationrequest.py deleted file mode 100644 index 83a27028..00000000 --- a/src/mistralai/models/agentcreationrequest.py +++ /dev/null @@ -1,109 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict -from .functiontool import FunctionTool, FunctionToolTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -AgentCreationRequestToolsTypedDict = TypeAliasType( - "AgentCreationRequestToolsTypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - FunctionToolTypedDict, - DocumentLibraryToolTypedDict, - ], -) - - -AgentCreationRequestTools = Annotated[ - Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -class AgentCreationRequestTypedDict(TypedDict): - model: str - name: str - instructions: NotRequired[Nullable[str]] - r"""Instruction prompt the model will follow during the conversation.""" - tools: NotRequired[List[AgentCreationRequestToolsTypedDict]] - r"""List of tools which are available to the model during the conversation.""" - completion_args: NotRequired[CompletionArgsTypedDict] - r"""White-listed arguments from the completion API""" - description: NotRequired[Nullable[str]] - handoffs: NotRequired[Nullable[List[str]]] - - -class AgentCreationRequest(BaseModel): - model: str - - name: str - - instructions: OptionalNullable[str] = UNSET - r"""Instruction prompt the model will follow during the conversation.""" - - tools: Optional[List[AgentCreationRequestTools]] = None - r"""List of tools which are available to the model during the conversation.""" - - completion_args: Optional[CompletionArgs] = None - r"""White-listed arguments from the completion API""" - - description: OptionalNullable[str] = UNSET - - handoffs: OptionalNullable[List[str]] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "instructions", - "tools", - "completion_args", - "description", - "handoffs", - ] - nullable_fields = ["instructions", "description", "handoffs"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/agenthandoffdoneevent.py b/src/mistralai/models/agenthandoffdoneevent.py deleted file mode 100644 index fa545a02..00000000 --- a/src/mistralai/models/agenthandoffdoneevent.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -AgentHandoffDoneEventType = Literal["agent.handoff.done"] - - -class AgentHandoffDoneEventTypedDict(TypedDict): - id: str - next_agent_id: str - next_agent_name: str - type: NotRequired[AgentHandoffDoneEventType] - created_at: NotRequired[datetime] - output_index: NotRequired[int] - - -class AgentHandoffDoneEvent(BaseModel): - id: str - - next_agent_id: str - - next_agent_name: str - - type: Optional[AgentHandoffDoneEventType] = "agent.handoff.done" - - created_at: Optional[datetime] = None - - output_index: Optional[int] = 0 diff --git a/src/mistralai/models/agenthandoffentry.py b/src/mistralai/models/agenthandoffentry.py deleted file mode 100644 index 44bfe0f2..00000000 --- a/src/mistralai/models/agenthandoffentry.py +++ /dev/null @@ -1,75 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -AgentHandoffEntryObject = Literal["entry"] - -AgentHandoffEntryType = Literal["agent.handoff"] - - -class AgentHandoffEntryTypedDict(TypedDict): - previous_agent_id: str - previous_agent_name: str - next_agent_id: str - next_agent_name: str - object: NotRequired[AgentHandoffEntryObject] - type: NotRequired[AgentHandoffEntryType] - created_at: NotRequired[datetime] - completed_at: NotRequired[Nullable[datetime]] - id: NotRequired[str] - - -class AgentHandoffEntry(BaseModel): - previous_agent_id: str - - previous_agent_name: str - - next_agent_id: str - - next_agent_name: str - - object: Optional[AgentHandoffEntryObject] = "entry" - - type: Optional[AgentHandoffEntryType] = "agent.handoff" - - created_at: Optional[datetime] = None - - completed_at: OptionalNullable[datetime] = UNSET - - id: Optional[str] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["object", "type", "created_at", "completed_at", "id"] - nullable_fields = ["completed_at"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/agenthandoffstartedevent.py b/src/mistralai/models/agenthandoffstartedevent.py deleted file mode 100644 index 9033a0a9..00000000 --- a/src/mistralai/models/agenthandoffstartedevent.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -AgentHandoffStartedEventType = Literal["agent.handoff.started"] - - -class AgentHandoffStartedEventTypedDict(TypedDict): - id: str - previous_agent_id: str - previous_agent_name: str - type: NotRequired[AgentHandoffStartedEventType] - created_at: NotRequired[datetime] - output_index: NotRequired[int] - - -class AgentHandoffStartedEvent(BaseModel): - id: str - - previous_agent_id: str - - previous_agent_name: str - - type: Optional[AgentHandoffStartedEventType] = "agent.handoff.started" - - created_at: Optional[datetime] = None - - output_index: Optional[int] = 0 diff --git a/src/mistralai/models/agents_api_v1_agents_getop.py b/src/mistralai/models/agents_api_v1_agents_getop.py deleted file mode 100644 index 5dbcecc1..00000000 --- a/src/mistralai/models/agents_api_v1_agents_getop.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class AgentsAPIV1AgentsGetRequestTypedDict(TypedDict): - agent_id: str - - -class AgentsAPIV1AgentsGetRequest(BaseModel): - agent_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/agents_api_v1_agents_listop.py b/src/mistralai/models/agents_api_v1_agents_listop.py deleted file mode 100644 index 25f48a62..00000000 --- a/src/mistralai/models/agents_api_v1_agents_listop.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, QueryParamMetadata -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class AgentsAPIV1AgentsListRequestTypedDict(TypedDict): - page: NotRequired[int] - page_size: NotRequired[int] - - -class AgentsAPIV1AgentsListRequest(BaseModel): - page: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 0 - - page_size: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 20 diff --git a/src/mistralai/models/agents_api_v1_agents_updateop.py b/src/mistralai/models/agents_api_v1_agents_updateop.py deleted file mode 100644 index 32696fbe..00000000 --- a/src/mistralai/models/agents_api_v1_agents_updateop.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .agentupdaterequest import AgentUpdateRequest, AgentUpdateRequestTypedDict -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata -from typing_extensions import Annotated, TypedDict - - -class AgentsAPIV1AgentsUpdateRequestTypedDict(TypedDict): - agent_id: str - agent_update_request: AgentUpdateRequestTypedDict - - -class AgentsAPIV1AgentsUpdateRequest(BaseModel): - agent_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - agent_update_request: Annotated[ - AgentUpdateRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] diff --git a/src/mistralai/models/agents_api_v1_conversations_getop.py b/src/mistralai/models/agents_api_v1_conversations_getop.py deleted file mode 100644 index a37a61ba..00000000 --- a/src/mistralai/models/agents_api_v1_conversations_getop.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .agentconversation import AgentConversation, AgentConversationTypedDict -from .modelconversation import ModelConversation, ModelConversationTypedDict -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing import Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -class AgentsAPIV1ConversationsGetRequestTypedDict(TypedDict): - conversation_id: str - r"""ID of the conversation from which we are fetching metadata.""" - - -class AgentsAPIV1ConversationsGetRequest(BaseModel): - conversation_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - r"""ID of the conversation from which we are fetching metadata.""" - - -AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict = TypeAliasType( - "AgentsAPIV1ConversationsGetResponseV1ConversationsGetTypedDict", - Union[AgentConversationTypedDict, ModelConversationTypedDict], -) -r"""Successful Response""" - - -AgentsAPIV1ConversationsGetResponseV1ConversationsGet = TypeAliasType( - "AgentsAPIV1ConversationsGetResponseV1ConversationsGet", - Union[AgentConversation, ModelConversation], -) -r"""Successful Response""" diff --git a/src/mistralai/models/agents_api_v1_conversations_listop.py b/src/mistralai/models/agents_api_v1_conversations_listop.py deleted file mode 100644 index f1d3d579..00000000 --- a/src/mistralai/models/agents_api_v1_conversations_listop.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .agentconversation import AgentConversation, AgentConversationTypedDict -from .modelconversation import ModelConversation, ModelConversationTypedDict -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, QueryParamMetadata -from typing import Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -class AgentsAPIV1ConversationsListRequestTypedDict(TypedDict): - page: NotRequired[int] - page_size: NotRequired[int] - - -class AgentsAPIV1ConversationsListRequest(BaseModel): - page: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 0 - - page_size: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 100 - - -ResponseBodyTypedDict = TypeAliasType( - "ResponseBodyTypedDict", - Union[AgentConversationTypedDict, ModelConversationTypedDict], -) - - -ResponseBody = TypeAliasType( - "ResponseBody", Union[AgentConversation, ModelConversation] -) diff --git a/src/mistralai/models/agentscompletionrequest.py b/src/mistralai/models/agentscompletionrequest.py deleted file mode 100644 index c832edfd..00000000 --- a/src/mistralai/models/agentscompletionrequest.py +++ /dev/null @@ -1,180 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .mistralpromptmode import MistralPromptMode -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .tool import Tool, ToolTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator, validate_open_enum -from pydantic import Discriminator, Tag, model_serializer -from pydantic.functional_validators import PlainValidator -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -AgentsCompletionRequestStopTypedDict = TypeAliasType( - "AgentsCompletionRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -AgentsCompletionRequestStop = TypeAliasType( - "AgentsCompletionRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -AgentsCompletionRequestMessagesTypedDict = TypeAliasType( - "AgentsCompletionRequestMessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -AgentsCompletionRequestMessages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -AgentsCompletionRequestToolChoiceTypedDict = TypeAliasType( - "AgentsCompletionRequestToolChoiceTypedDict", - Union[ToolChoiceTypedDict, ToolChoiceEnum], -) - - -AgentsCompletionRequestToolChoice = TypeAliasType( - "AgentsCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] -) - - -class AgentsCompletionRequestTypedDict(TypedDict): - messages: List[AgentsCompletionRequestMessagesTypedDict] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - agent_id: str - r"""The ID of the agent to use for this completion.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - stop: NotRequired[AgentsCompletionRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - response_format: NotRequired[ResponseFormatTypedDict] - tools: NotRequired[Nullable[List[ToolTypedDict]]] - tool_choice: NotRequired[AgentsCompletionRequestToolChoiceTypedDict] - presence_penalty: NotRequired[float] - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: NotRequired[float] - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - n: NotRequired[Nullable[int]] - r"""Number of completions to return for each request, input tokens are only billed once.""" - prediction: NotRequired[PredictionTypedDict] - parallel_tool_calls: NotRequired[bool] - prompt_mode: NotRequired[Nullable[MistralPromptMode]] - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - - -class AgentsCompletionRequest(BaseModel): - messages: List[AgentsCompletionRequestMessages] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - - agent_id: str - r"""The ID of the agent to use for this completion.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = False - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - - stop: Optional[AgentsCompletionRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - response_format: Optional[ResponseFormat] = None - - tools: OptionalNullable[List[Tool]] = UNSET - - tool_choice: Optional[AgentsCompletionRequestToolChoice] = None - - presence_penalty: Optional[float] = None - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - - frequency_penalty: Optional[float] = None - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - - n: OptionalNullable[int] = UNSET - r"""Number of completions to return for each request, input tokens are only billed once.""" - - prediction: Optional[Prediction] = None - - parallel_tool_calls: Optional[bool] = None - - prompt_mode: Annotated[ - OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False)) - ] = UNSET - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "max_tokens", - "stream", - "stop", - "random_seed", - "response_format", - "tools", - "tool_choice", - "presence_penalty", - "frequency_penalty", - "n", - "prediction", - "parallel_tool_calls", - "prompt_mode", - ] - nullable_fields = ["max_tokens", "random_seed", "tools", "n", "prompt_mode"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/agentscompletionstreamrequest.py b/src/mistralai/models/agentscompletionstreamrequest.py deleted file mode 100644 index 6e619b77..00000000 --- a/src/mistralai/models/agentscompletionstreamrequest.py +++ /dev/null @@ -1,178 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .mistralpromptmode import MistralPromptMode -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .tool import Tool, ToolTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator, validate_open_enum -from pydantic import Discriminator, Tag, model_serializer -from pydantic.functional_validators import PlainValidator -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -AgentsCompletionStreamRequestStopTypedDict = TypeAliasType( - "AgentsCompletionStreamRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -AgentsCompletionStreamRequestStop = TypeAliasType( - "AgentsCompletionStreamRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -AgentsCompletionStreamRequestMessagesTypedDict = TypeAliasType( - "AgentsCompletionStreamRequestMessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -AgentsCompletionStreamRequestMessages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -AgentsCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( - "AgentsCompletionStreamRequestToolChoiceTypedDict", - Union[ToolChoiceTypedDict, ToolChoiceEnum], -) - - -AgentsCompletionStreamRequestToolChoice = TypeAliasType( - "AgentsCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] -) - - -class AgentsCompletionStreamRequestTypedDict(TypedDict): - messages: List[AgentsCompletionStreamRequestMessagesTypedDict] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - agent_id: str - r"""The ID of the agent to use for this completion.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - stop: NotRequired[AgentsCompletionStreamRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - response_format: NotRequired[ResponseFormatTypedDict] - tools: NotRequired[Nullable[List[ToolTypedDict]]] - tool_choice: NotRequired[AgentsCompletionStreamRequestToolChoiceTypedDict] - presence_penalty: NotRequired[float] - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: NotRequired[float] - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - n: NotRequired[Nullable[int]] - r"""Number of completions to return for each request, input tokens are only billed once.""" - prediction: NotRequired[PredictionTypedDict] - parallel_tool_calls: NotRequired[bool] - prompt_mode: NotRequired[Nullable[MistralPromptMode]] - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - - -class AgentsCompletionStreamRequest(BaseModel): - messages: List[AgentsCompletionStreamRequestMessages] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - - agent_id: str - r"""The ID of the agent to use for this completion.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = True - - stop: Optional[AgentsCompletionStreamRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - response_format: Optional[ResponseFormat] = None - - tools: OptionalNullable[List[Tool]] = UNSET - - tool_choice: Optional[AgentsCompletionStreamRequestToolChoice] = None - - presence_penalty: Optional[float] = None - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - - frequency_penalty: Optional[float] = None - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - - n: OptionalNullable[int] = UNSET - r"""Number of completions to return for each request, input tokens are only billed once.""" - - prediction: Optional[Prediction] = None - - parallel_tool_calls: Optional[bool] = None - - prompt_mode: Annotated[ - OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False)) - ] = UNSET - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "max_tokens", - "stream", - "stop", - "random_seed", - "response_format", - "tools", - "tool_choice", - "presence_penalty", - "frequency_penalty", - "n", - "prediction", - "parallel_tool_calls", - "prompt_mode", - ] - nullable_fields = ["max_tokens", "random_seed", "tools", "n", "prompt_mode"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/agentupdaterequest.py b/src/mistralai/models/agentupdaterequest.py deleted file mode 100644 index f6fcb27a..00000000 --- a/src/mistralai/models/agentupdaterequest.py +++ /dev/null @@ -1,111 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict -from .functiontool import FunctionTool, FunctionToolTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -AgentUpdateRequestToolsTypedDict = TypeAliasType( - "AgentUpdateRequestToolsTypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - FunctionToolTypedDict, - DocumentLibraryToolTypedDict, - ], -) - - -AgentUpdateRequestTools = Annotated[ - Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -class AgentUpdateRequestTypedDict(TypedDict): - instructions: NotRequired[Nullable[str]] - r"""Instruction prompt the model will follow during the conversation.""" - tools: NotRequired[List[AgentUpdateRequestToolsTypedDict]] - r"""List of tools which are available to the model during the conversation.""" - completion_args: NotRequired[CompletionArgsTypedDict] - r"""White-listed arguments from the completion API""" - model: NotRequired[Nullable[str]] - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - handoffs: NotRequired[Nullable[List[str]]] - - -class AgentUpdateRequest(BaseModel): - instructions: OptionalNullable[str] = UNSET - r"""Instruction prompt the model will follow during the conversation.""" - - tools: Optional[List[AgentUpdateRequestTools]] = None - r"""List of tools which are available to the model during the conversation.""" - - completion_args: Optional[CompletionArgs] = None - r"""White-listed arguments from the completion API""" - - model: OptionalNullable[str] = UNSET - - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - handoffs: OptionalNullable[List[str]] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "instructions", - "tools", - "completion_args", - "model", - "name", - "description", - "handoffs", - ] - nullable_fields = ["instructions", "model", "name", "description", "handoffs"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/archiveftmodelout.py b/src/mistralai/models/archiveftmodelout.py deleted file mode 100644 index cff27c4e..00000000 --- a/src/mistralai/models/archiveftmodelout.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ArchiveFTModelOutObject = Literal["model"] - - -class ArchiveFTModelOutTypedDict(TypedDict): - id: str - object: NotRequired[ArchiveFTModelOutObject] - archived: NotRequired[bool] - - -class ArchiveFTModelOut(BaseModel): - id: str - - object: Optional[ArchiveFTModelOutObject] = "model" - - archived: Optional[bool] = True diff --git a/src/mistralai/models/assistantmessage.py b/src/mistralai/models/assistantmessage.py deleted file mode 100644 index 18841a72..00000000 --- a/src/mistralai/models/assistantmessage.py +++ /dev/null @@ -1,71 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from .toolcall import ToolCall, ToolCallTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -AssistantMessageContentTypedDict = TypeAliasType( - "AssistantMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -AssistantMessageContent = TypeAliasType( - "AssistantMessageContent", Union[str, List[ContentChunk]] -) - - -AssistantMessageRole = Literal["assistant"] - - -class AssistantMessageTypedDict(TypedDict): - content: NotRequired[Nullable[AssistantMessageContentTypedDict]] - tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] - prefix: NotRequired[bool] - r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - role: NotRequired[AssistantMessageRole] - - -class AssistantMessage(BaseModel): - content: OptionalNullable[AssistantMessageContent] = UNSET - - tool_calls: OptionalNullable[List[ToolCall]] = UNSET - - prefix: Optional[bool] = False - r"""Set this to `true` when adding an assistant message as prefix to condition the model response. The role of the prefix message is to force the model to start its answer by the content of the message.""" - - role: Optional[AssistantMessageRole] = "assistant" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["content", "tool_calls", "prefix", "role"] - nullable_fields = ["content", "tool_calls"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/audiochunk.py b/src/mistralai/models/audiochunk.py deleted file mode 100644 index 2780570a..00000000 --- a/src/mistralai/models/audiochunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -AudioChunkType = Literal["input_audio"] - - -class AudioChunkTypedDict(TypedDict): - input_audio: str - type: NotRequired[AudioChunkType] - - -class AudioChunk(BaseModel): - input_audio: str - - type: Optional[AudioChunkType] = "input_audio" diff --git a/src/mistralai/models/audiotranscriptionrequest.py b/src/mistralai/models/audiotranscriptionrequest.py deleted file mode 100644 index 371d3ecc..00000000 --- a/src/mistralai/models/audiotranscriptionrequest.py +++ /dev/null @@ -1,97 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .file import File, FileTypedDict -from .timestampgranularity import TimestampGranularity -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import FieldMetadata, MultipartFormMetadata, validate_const -import pydantic -from pydantic import model_serializer -from pydantic.functional_validators import AfterValidator -from typing import List, Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class AudioTranscriptionRequestTypedDict(TypedDict): - model: str - file: NotRequired[FileTypedDict] - file_url: NotRequired[Nullable[str]] - r"""Url of a file to be transcribed""" - file_id: NotRequired[Nullable[str]] - r"""ID of a file uploaded to /v1/files""" - language: NotRequired[Nullable[str]] - r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy.""" - temperature: NotRequired[Nullable[float]] - stream: Literal[False] - timestamp_granularities: NotRequired[List[TimestampGranularity]] - r"""Granularities of timestamps to include in the response.""" - - -class AudioTranscriptionRequest(BaseModel): - model: Annotated[str, FieldMetadata(multipart=True)] - - file: Annotated[ - Optional[File], FieldMetadata(multipart=MultipartFormMetadata(file=True)) - ] = None - - file_url: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET - r"""Url of a file to be transcribed""" - - file_id: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET - r"""ID of a file uploaded to /v1/files""" - - language: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET - r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy.""" - - temperature: Annotated[OptionalNullable[float], FieldMetadata(multipart=True)] = ( - UNSET - ) - - STREAM: Annotated[ - Annotated[Optional[Literal[False]], AfterValidator(validate_const(False))], - pydantic.Field(alias="stream"), - FieldMetadata(multipart=True), - ] = False - - timestamp_granularities: Annotated[ - Optional[List[TimestampGranularity]], FieldMetadata(multipart=True) - ] = None - r"""Granularities of timestamps to include in the response.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "file", - "file_url", - "file_id", - "language", - "temperature", - "stream", - "timestamp_granularities", - ] - nullable_fields = ["file_url", "file_id", "language", "temperature"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/audiotranscriptionrequeststream.py b/src/mistralai/models/audiotranscriptionrequeststream.py deleted file mode 100644 index 04374503..00000000 --- a/src/mistralai/models/audiotranscriptionrequeststream.py +++ /dev/null @@ -1,97 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .file import File, FileTypedDict -from .timestampgranularity import TimestampGranularity -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import FieldMetadata, MultipartFormMetadata, validate_const -import pydantic -from pydantic import model_serializer -from pydantic.functional_validators import AfterValidator -from typing import List, Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class AudioTranscriptionRequestStreamTypedDict(TypedDict): - model: str - file: NotRequired[FileTypedDict] - file_url: NotRequired[Nullable[str]] - r"""Url of a file to be transcribed""" - file_id: NotRequired[Nullable[str]] - r"""ID of a file uploaded to /v1/files""" - language: NotRequired[Nullable[str]] - r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy.""" - temperature: NotRequired[Nullable[float]] - stream: Literal[True] - timestamp_granularities: NotRequired[List[TimestampGranularity]] - r"""Granularities of timestamps to include in the response.""" - - -class AudioTranscriptionRequestStream(BaseModel): - model: Annotated[str, FieldMetadata(multipart=True)] - - file: Annotated[ - Optional[File], FieldMetadata(multipart=MultipartFormMetadata(file=True)) - ] = None - - file_url: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET - r"""Url of a file to be transcribed""" - - file_id: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET - r"""ID of a file uploaded to /v1/files""" - - language: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET - r"""Language of the audio, e.g. 'en'. Providing the language can boost accuracy.""" - - temperature: Annotated[OptionalNullable[float], FieldMetadata(multipart=True)] = ( - UNSET - ) - - STREAM: Annotated[ - Annotated[Optional[Literal[True]], AfterValidator(validate_const(True))], - pydantic.Field(alias="stream"), - FieldMetadata(multipart=True), - ] = True - - timestamp_granularities: Annotated[ - Optional[List[TimestampGranularity]], FieldMetadata(multipart=True) - ] = None - r"""Granularities of timestamps to include in the response.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "file", - "file_url", - "file_id", - "language", - "temperature", - "stream", - "timestamp_granularities", - ] - nullable_fields = ["file_url", "file_id", "language", "temperature"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/basemodelcard.py b/src/mistralai/models/basemodelcard.py deleted file mode 100644 index a4a061ff..00000000 --- a/src/mistralai/models/basemodelcard.py +++ /dev/null @@ -1,110 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import validate_const -import pydantic -from pydantic import model_serializer -from pydantic.functional_validators import AfterValidator -from typing import List, Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -BaseModelCardType = Literal["base"] - - -class BaseModelCardTypedDict(TypedDict): - id: str - capabilities: ModelCapabilitiesTypedDict - object: NotRequired[str] - created: NotRequired[int] - owned_by: NotRequired[str] - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - max_context_length: NotRequired[int] - aliases: NotRequired[List[str]] - deprecation: NotRequired[Nullable[datetime]] - deprecation_replacement_model: NotRequired[Nullable[str]] - default_model_temperature: NotRequired[Nullable[float]] - type: BaseModelCardType - - -class BaseModelCard(BaseModel): - id: str - - capabilities: ModelCapabilities - - object: Optional[str] = "model" - - created: Optional[int] = None - - owned_by: Optional[str] = "mistralai" - - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - max_context_length: Optional[int] = 32768 - - aliases: Optional[List[str]] = None - - deprecation: OptionalNullable[datetime] = UNSET - - deprecation_replacement_model: OptionalNullable[str] = UNSET - - default_model_temperature: OptionalNullable[float] = UNSET - - TYPE: Annotated[ - Annotated[Optional[BaseModelCardType], AfterValidator(validate_const("base"))], - pydantic.Field(alias="type"), - ] = "base" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "object", - "created", - "owned_by", - "name", - "description", - "max_context_length", - "aliases", - "deprecation", - "deprecation_replacement_model", - "default_model_temperature", - "type", - ] - nullable_fields = [ - "name", - "description", - "deprecation", - "deprecation_replacement_model", - "default_model_temperature", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/batcherror.py b/src/mistralai/models/batcherror.py deleted file mode 100644 index 4f823446..00000000 --- a/src/mistralai/models/batcherror.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class BatchErrorTypedDict(TypedDict): - message: str - count: NotRequired[int] - - -class BatchError(BaseModel): - message: str - - count: Optional[int] = 1 diff --git a/src/mistralai/models/batchjobin.py b/src/mistralai/models/batchjobin.py deleted file mode 100644 index aa0bb5be..00000000 --- a/src/mistralai/models/batchjobin.py +++ /dev/null @@ -1,63 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .apiendpoint import APIEndpoint -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import validate_open_enum -from pydantic import model_serializer -from pydantic.functional_validators import PlainValidator -from typing import Dict, List, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class BatchJobInTypedDict(TypedDict): - input_files: List[str] - endpoint: APIEndpoint - model: NotRequired[Nullable[str]] - agent_id: NotRequired[Nullable[str]] - metadata: NotRequired[Nullable[Dict[str, str]]] - timeout_hours: NotRequired[int] - - -class BatchJobIn(BaseModel): - input_files: List[str] - - endpoint: Annotated[APIEndpoint, PlainValidator(validate_open_enum(False))] - - model: OptionalNullable[str] = UNSET - - agent_id: OptionalNullable[str] = UNSET - - metadata: OptionalNullable[Dict[str, str]] = UNSET - - timeout_hours: Optional[int] = 24 - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["model", "agent_id", "metadata", "timeout_hours"] - nullable_fields = ["model", "agent_id", "metadata"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/batchjobout.py b/src/mistralai/models/batchjobout.py deleted file mode 100644 index 88304313..00000000 --- a/src/mistralai/models/batchjobout.py +++ /dev/null @@ -1,118 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .batcherror import BatchError, BatchErrorTypedDict -from .batchjobstatus import BatchJobStatus -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Any, Dict, List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -BatchJobOutObject = Literal["batch"] - - -class BatchJobOutTypedDict(TypedDict): - id: str - input_files: List[str] - endpoint: str - errors: List[BatchErrorTypedDict] - status: BatchJobStatus - created_at: int - total_requests: int - completed_requests: int - succeeded_requests: int - failed_requests: int - object: NotRequired[BatchJobOutObject] - metadata: NotRequired[Nullable[Dict[str, Any]]] - model: NotRequired[Nullable[str]] - agent_id: NotRequired[Nullable[str]] - output_file: NotRequired[Nullable[str]] - error_file: NotRequired[Nullable[str]] - started_at: NotRequired[Nullable[int]] - completed_at: NotRequired[Nullable[int]] - - -class BatchJobOut(BaseModel): - id: str - - input_files: List[str] - - endpoint: str - - errors: List[BatchError] - - status: BatchJobStatus - - created_at: int - - total_requests: int - - completed_requests: int - - succeeded_requests: int - - failed_requests: int - - object: Optional[BatchJobOutObject] = "batch" - - metadata: OptionalNullable[Dict[str, Any]] = UNSET - - model: OptionalNullable[str] = UNSET - - agent_id: OptionalNullable[str] = UNSET - - output_file: OptionalNullable[str] = UNSET - - error_file: OptionalNullable[str] = UNSET - - started_at: OptionalNullable[int] = UNSET - - completed_at: OptionalNullable[int] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "object", - "metadata", - "model", - "agent_id", - "output_file", - "error_file", - "started_at", - "completed_at", - ] - nullable_fields = [ - "metadata", - "model", - "agent_id", - "output_file", - "error_file", - "started_at", - "completed_at", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/batchjobsout.py b/src/mistralai/models/batchjobsout.py deleted file mode 100644 index 8ce26f31..00000000 --- a/src/mistralai/models/batchjobsout.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .batchjobout import BatchJobOut, BatchJobOutTypedDict -from mistralai.types import BaseModel -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -BatchJobsOutObject = Literal["list"] - - -class BatchJobsOutTypedDict(TypedDict): - total: int - data: NotRequired[List[BatchJobOutTypedDict]] - object: NotRequired[BatchJobsOutObject] - - -class BatchJobsOut(BaseModel): - total: int - - data: Optional[List[BatchJobOut]] = None - - object: Optional[BatchJobsOutObject] = "list" diff --git a/src/mistralai/models/batchjobstatus.py b/src/mistralai/models/batchjobstatus.py deleted file mode 100644 index 4b28059b..00000000 --- a/src/mistralai/models/batchjobstatus.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -BatchJobStatus = Literal[ - "QUEUED", - "RUNNING", - "SUCCESS", - "FAILED", - "TIMEOUT_EXCEEDED", - "CANCELLATION_REQUESTED", - "CANCELLED", -] diff --git a/src/mistralai/models/chatclassificationrequest.py b/src/mistralai/models/chatclassificationrequest.py deleted file mode 100644 index f06f4f34..00000000 --- a/src/mistralai/models/chatclassificationrequest.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .inputs import Inputs, InputsTypedDict -from mistralai.types import BaseModel -import pydantic -from typing_extensions import Annotated, TypedDict - - -class ChatClassificationRequestTypedDict(TypedDict): - model: str - inputs: InputsTypedDict - r"""Chat to classify""" - - -class ChatClassificationRequest(BaseModel): - model: str - - inputs: Annotated[Inputs, pydantic.Field(alias="input")] - r"""Chat to classify""" diff --git a/src/mistralai/models/chatcompletionchoice.py b/src/mistralai/models/chatcompletionchoice.py deleted file mode 100644 index f4f37fb4..00000000 --- a/src/mistralai/models/chatcompletionchoice.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from mistralai.types import BaseModel, UnrecognizedStr -from mistralai.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Literal, Union -from typing_extensions import Annotated, TypedDict - - -FinishReason = Union[ - Literal["stop", "length", "model_length", "error", "tool_calls"], UnrecognizedStr -] - - -class ChatCompletionChoiceTypedDict(TypedDict): - index: int - message: AssistantMessageTypedDict - finish_reason: FinishReason - - -class ChatCompletionChoice(BaseModel): - index: int - - message: AssistantMessage - - finish_reason: Annotated[FinishReason, PlainValidator(validate_open_enum(False))] diff --git a/src/mistralai/models/chatcompletionrequest.py b/src/mistralai/models/chatcompletionrequest.py deleted file mode 100644 index 6f195f13..00000000 --- a/src/mistralai/models/chatcompletionrequest.py +++ /dev/null @@ -1,201 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .mistralpromptmode import MistralPromptMode -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .tool import Tool, ToolTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator, validate_open_enum -from pydantic import Discriminator, Tag, model_serializer -from pydantic.functional_validators import PlainValidator -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -StopTypedDict = TypeAliasType("StopTypedDict", Union[str, List[str]]) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -Stop = TypeAliasType("Stop", Union[str, List[str]]) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -MessagesTypedDict = TypeAliasType( - "MessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -Messages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -ChatCompletionRequestToolChoiceTypedDict = TypeAliasType( - "ChatCompletionRequestToolChoiceTypedDict", - Union[ToolChoiceTypedDict, ToolChoiceEnum], -) - - -ChatCompletionRequestToolChoice = TypeAliasType( - "ChatCompletionRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] -) - - -class ChatCompletionRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - messages: List[MessagesTypedDict] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - stop: NotRequired[StopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - response_format: NotRequired[ResponseFormatTypedDict] - tools: NotRequired[Nullable[List[ToolTypedDict]]] - tool_choice: NotRequired[ChatCompletionRequestToolChoiceTypedDict] - presence_penalty: NotRequired[float] - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: NotRequired[float] - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - n: NotRequired[Nullable[int]] - r"""Number of completions to return for each request, input tokens are only billed once.""" - prediction: NotRequired[PredictionTypedDict] - parallel_tool_calls: NotRequired[bool] - prompt_mode: NotRequired[Nullable[MistralPromptMode]] - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - safe_prompt: NotRequired[bool] - r"""Whether to inject a safety prompt before all conversations.""" - - -class ChatCompletionRequest(BaseModel): - model: str - r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - - messages: List[Messages] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = None - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = False - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - - stop: Optional[Stop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - response_format: Optional[ResponseFormat] = None - - tools: OptionalNullable[List[Tool]] = UNSET - - tool_choice: Optional[ChatCompletionRequestToolChoice] = None - - presence_penalty: Optional[float] = None - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - - frequency_penalty: Optional[float] = None - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - - n: OptionalNullable[int] = UNSET - r"""Number of completions to return for each request, input tokens are only billed once.""" - - prediction: Optional[Prediction] = None - - parallel_tool_calls: Optional[bool] = None - - prompt_mode: Annotated[ - OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False)) - ] = UNSET - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - - safe_prompt: Optional[bool] = None - r"""Whether to inject a safety prompt before all conversations.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "response_format", - "tools", - "tool_choice", - "presence_penalty", - "frequency_penalty", - "n", - "prediction", - "parallel_tool_calls", - "prompt_mode", - "safe_prompt", - ] - nullable_fields = [ - "temperature", - "max_tokens", - "random_seed", - "tools", - "n", - "prompt_mode", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/chatcompletionresponse.py b/src/mistralai/models/chatcompletionresponse.py deleted file mode 100644 index 3d03b126..00000000 --- a/src/mistralai/models/chatcompletionresponse.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ChatCompletionResponseTypedDict(TypedDict): - id: str - object: str - model: str - usage: UsageInfoTypedDict - created: int - choices: List[ChatCompletionChoiceTypedDict] - - -class ChatCompletionResponse(BaseModel): - id: str - - object: str - - model: str - - usage: UsageInfo - - created: int - - choices: List[ChatCompletionChoice] diff --git a/src/mistralai/models/chatcompletionstreamrequest.py b/src/mistralai/models/chatcompletionstreamrequest.py deleted file mode 100644 index 0fa102e5..00000000 --- a/src/mistralai/models/chatcompletionstreamrequest.py +++ /dev/null @@ -1,203 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .mistralpromptmode import MistralPromptMode -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .tool import Tool, ToolTypedDict -from .toolchoice import ToolChoice, ToolChoiceTypedDict -from .toolchoiceenum import ToolChoiceEnum -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator, validate_open_enum -from pydantic import Discriminator, Tag, model_serializer -from pydantic.functional_validators import PlainValidator -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -ChatCompletionStreamRequestStopTypedDict = TypeAliasType( - "ChatCompletionStreamRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -ChatCompletionStreamRequestStop = TypeAliasType( - "ChatCompletionStreamRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -ChatCompletionStreamRequestMessagesTypedDict = TypeAliasType( - "ChatCompletionStreamRequestMessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -ChatCompletionStreamRequestMessages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -ChatCompletionStreamRequestToolChoiceTypedDict = TypeAliasType( - "ChatCompletionStreamRequestToolChoiceTypedDict", - Union[ToolChoiceTypedDict, ToolChoiceEnum], -) - - -ChatCompletionStreamRequestToolChoice = TypeAliasType( - "ChatCompletionStreamRequestToolChoice", Union[ToolChoice, ToolChoiceEnum] -) - - -class ChatCompletionStreamRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - messages: List[ChatCompletionStreamRequestMessagesTypedDict] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - stop: NotRequired[ChatCompletionStreamRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - response_format: NotRequired[ResponseFormatTypedDict] - tools: NotRequired[Nullable[List[ToolTypedDict]]] - tool_choice: NotRequired[ChatCompletionStreamRequestToolChoiceTypedDict] - presence_penalty: NotRequired[float] - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - frequency_penalty: NotRequired[float] - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - n: NotRequired[Nullable[int]] - r"""Number of completions to return for each request, input tokens are only billed once.""" - prediction: NotRequired[PredictionTypedDict] - parallel_tool_calls: NotRequired[bool] - prompt_mode: NotRequired[Nullable[MistralPromptMode]] - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - safe_prompt: NotRequired[bool] - r"""Whether to inject a safety prompt before all conversations.""" - - -class ChatCompletionStreamRequest(BaseModel): - model: str - r"""ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions.""" - - messages: List[ChatCompletionStreamRequestMessages] - r"""The prompt(s) to generate completions for, encoded as a list of dict with role and content.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = None - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = True - - stop: Optional[ChatCompletionStreamRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - response_format: Optional[ResponseFormat] = None - - tools: OptionalNullable[List[Tool]] = UNSET - - tool_choice: Optional[ChatCompletionStreamRequestToolChoice] = None - - presence_penalty: Optional[float] = None - r"""presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.""" - - frequency_penalty: Optional[float] = None - r"""frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.""" - - n: OptionalNullable[int] = UNSET - r"""Number of completions to return for each request, input tokens are only billed once.""" - - prediction: Optional[Prediction] = None - - parallel_tool_calls: Optional[bool] = None - - prompt_mode: Annotated[ - OptionalNullable[MistralPromptMode], PlainValidator(validate_open_enum(False)) - ] = UNSET - r"""Allows toggling between the reasoning mode and no system prompt. When set to `reasoning` the system prompt for reasoning models will be used.""" - - safe_prompt: Optional[bool] = None - r"""Whether to inject a safety prompt before all conversations.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "response_format", - "tools", - "tool_choice", - "presence_penalty", - "frequency_penalty", - "n", - "prediction", - "parallel_tool_calls", - "prompt_mode", - "safe_prompt", - ] - nullable_fields = [ - "temperature", - "max_tokens", - "random_seed", - "tools", - "n", - "prompt_mode", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/chatmoderationrequest.py b/src/mistralai/models/chatmoderationrequest.py deleted file mode 100644 index 2f58d52f..00000000 --- a/src/mistralai/models/chatmoderationrequest.py +++ /dev/null @@ -1,83 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai.types import BaseModel -from mistralai.utils import get_discriminator -import pydantic -from pydantic import Discriminator, Tag -from typing import List, Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -TwoTypedDict = TypeAliasType( - "TwoTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -Two = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -OneTypedDict = TypeAliasType( - "OneTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -One = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -ChatModerationRequestInputsTypedDict = TypeAliasType( - "ChatModerationRequestInputsTypedDict", - Union[List[OneTypedDict], List[List[TwoTypedDict]]], -) -r"""Chat to classify""" - - -ChatModerationRequestInputs = TypeAliasType( - "ChatModerationRequestInputs", Union[List[One], List[List[Two]]] -) -r"""Chat to classify""" - - -class ChatModerationRequestTypedDict(TypedDict): - inputs: ChatModerationRequestInputsTypedDict - r"""Chat to classify""" - model: str - - -class ChatModerationRequest(BaseModel): - inputs: Annotated[ChatModerationRequestInputs, pydantic.Field(alias="input")] - r"""Chat to classify""" - - model: str diff --git a/src/mistralai/models/checkpointout.py b/src/mistralai/models/checkpointout.py deleted file mode 100644 index aefb7731..00000000 --- a/src/mistralai/models/checkpointout.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .metricout import MetricOut, MetricOutTypedDict -from mistralai.types import BaseModel -from typing_extensions import TypedDict - - -class CheckpointOutTypedDict(TypedDict): - metrics: MetricOutTypedDict - r"""Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase).""" - step_number: int - r"""The step number that the checkpoint was created at.""" - created_at: int - r"""The UNIX timestamp (in seconds) for when the checkpoint was created.""" - - -class CheckpointOut(BaseModel): - metrics: MetricOut - r"""Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase).""" - - step_number: int - r"""The step number that the checkpoint was created at.""" - - created_at: int - r"""The UNIX timestamp (in seconds) for when the checkpoint was created.""" diff --git a/src/mistralai/models/classificationrequest.py b/src/mistralai/models/classificationrequest.py deleted file mode 100644 index 39e25390..00000000 --- a/src/mistralai/models/classificationrequest.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -import pydantic -from typing import List, Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -ClassificationRequestInputsTypedDict = TypeAliasType( - "ClassificationRequestInputsTypedDict", Union[str, List[str]] -) -r"""Text to classify.""" - - -ClassificationRequestInputs = TypeAliasType( - "ClassificationRequestInputs", Union[str, List[str]] -) -r"""Text to classify.""" - - -class ClassificationRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use.""" - inputs: ClassificationRequestInputsTypedDict - r"""Text to classify.""" - - -class ClassificationRequest(BaseModel): - model: str - r"""ID of the model to use.""" - - inputs: Annotated[ClassificationRequestInputs, pydantic.Field(alias="input")] - r"""Text to classify.""" diff --git a/src/mistralai/models/classifierdetailedjobout.py b/src/mistralai/models/classifierdetailedjobout.py deleted file mode 100644 index da5bd281..00000000 --- a/src/mistralai/models/classifierdetailedjobout.py +++ /dev/null @@ -1,156 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .checkpointout import CheckpointOut, CheckpointOutTypedDict -from .classifiertargetout import ClassifierTargetOut, ClassifierTargetOutTypedDict -from .classifiertrainingparameters import ( - ClassifierTrainingParameters, - ClassifierTrainingParametersTypedDict, -) -from .eventout import EventOut, EventOutTypedDict -from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict -from .wandbintegrationout import WandbIntegrationOut, WandbIntegrationOutTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ClassifierDetailedJobOutStatus = Literal[ - "QUEUED", - "STARTED", - "VALIDATING", - "VALIDATED", - "RUNNING", - "FAILED_VALIDATION", - "FAILED", - "SUCCESS", - "CANCELLED", - "CANCELLATION_REQUESTED", -] - -ClassifierDetailedJobOutObject = Literal["job"] - -ClassifierDetailedJobOutIntegrationsTypedDict = WandbIntegrationOutTypedDict - - -ClassifierDetailedJobOutIntegrations = WandbIntegrationOut - - -ClassifierDetailedJobOutJobType = Literal["classifier"] - - -class ClassifierDetailedJobOutTypedDict(TypedDict): - id: str - auto_start: bool - model: str - r"""The name of the model to fine-tune.""" - status: ClassifierDetailedJobOutStatus - created_at: int - modified_at: int - training_files: List[str] - hyperparameters: ClassifierTrainingParametersTypedDict - classifier_targets: List[ClassifierTargetOutTypedDict] - validation_files: NotRequired[Nullable[List[str]]] - object: NotRequired[ClassifierDetailedJobOutObject] - fine_tuned_model: NotRequired[Nullable[str]] - suffix: NotRequired[Nullable[str]] - integrations: NotRequired[ - Nullable[List[ClassifierDetailedJobOutIntegrationsTypedDict]] - ] - trained_tokens: NotRequired[Nullable[int]] - metadata: NotRequired[Nullable[JobMetadataOutTypedDict]] - job_type: NotRequired[ClassifierDetailedJobOutJobType] - events: NotRequired[List[EventOutTypedDict]] - r"""Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here.""" - checkpoints: NotRequired[List[CheckpointOutTypedDict]] - - -class ClassifierDetailedJobOut(BaseModel): - id: str - - auto_start: bool - - model: str - r"""The name of the model to fine-tune.""" - - status: ClassifierDetailedJobOutStatus - - created_at: int - - modified_at: int - - training_files: List[str] - - hyperparameters: ClassifierTrainingParameters - - classifier_targets: List[ClassifierTargetOut] - - validation_files: OptionalNullable[List[str]] = UNSET - - object: Optional[ClassifierDetailedJobOutObject] = "job" - - fine_tuned_model: OptionalNullable[str] = UNSET - - suffix: OptionalNullable[str] = UNSET - - integrations: OptionalNullable[List[ClassifierDetailedJobOutIntegrations]] = UNSET - - trained_tokens: OptionalNullable[int] = UNSET - - metadata: OptionalNullable[JobMetadataOut] = UNSET - - job_type: Optional[ClassifierDetailedJobOutJobType] = "classifier" - - events: Optional[List[EventOut]] = None - r"""Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here.""" - - checkpoints: Optional[List[CheckpointOut]] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "validation_files", - "object", - "fine_tuned_model", - "suffix", - "integrations", - "trained_tokens", - "metadata", - "job_type", - "events", - "checkpoints", - ] - nullable_fields = [ - "validation_files", - "fine_tuned_model", - "suffix", - "integrations", - "trained_tokens", - "metadata", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/classifierftmodelout.py b/src/mistralai/models/classifierftmodelout.py deleted file mode 100644 index 56ffe96d..00000000 --- a/src/mistralai/models/classifierftmodelout.py +++ /dev/null @@ -1,107 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifiertargetout import ClassifierTargetOut, ClassifierTargetOutTypedDict -from .ftmodelcapabilitiesout import ( - FTModelCapabilitiesOut, - FTModelCapabilitiesOutTypedDict, -) -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ClassifierFTModelOutObject = Literal["model"] - -ClassifierFTModelOutModelType = Literal["classifier"] - - -class ClassifierFTModelOutTypedDict(TypedDict): - id: str - created: int - owned_by: str - workspace_id: str - root: str - root_version: str - archived: bool - capabilities: FTModelCapabilitiesOutTypedDict - job: str - classifier_targets: List[ClassifierTargetOutTypedDict] - object: NotRequired[ClassifierFTModelOutObject] - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - max_context_length: NotRequired[int] - aliases: NotRequired[List[str]] - model_type: NotRequired[ClassifierFTModelOutModelType] - - -class ClassifierFTModelOut(BaseModel): - id: str - - created: int - - owned_by: str - - workspace_id: str - - root: str - - root_version: str - - archived: bool - - capabilities: FTModelCapabilitiesOut - - job: str - - classifier_targets: List[ClassifierTargetOut] - - object: Optional[ClassifierFTModelOutObject] = "model" - - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - max_context_length: Optional[int] = 32768 - - aliases: Optional[List[str]] = None - - model_type: Optional[ClassifierFTModelOutModelType] = "classifier" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "object", - "name", - "description", - "max_context_length", - "aliases", - "model_type", - ] - nullable_fields = ["name", "description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/classifierjobout.py b/src/mistralai/models/classifierjobout.py deleted file mode 100644 index c8df6da3..00000000 --- a/src/mistralai/models/classifierjobout.py +++ /dev/null @@ -1,165 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifiertrainingparameters import ( - ClassifierTrainingParameters, - ClassifierTrainingParametersTypedDict, -) -from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict -from .wandbintegrationout import WandbIntegrationOut, WandbIntegrationOutTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ClassifierJobOutStatus = Literal[ - "QUEUED", - "STARTED", - "VALIDATING", - "VALIDATED", - "RUNNING", - "FAILED_VALIDATION", - "FAILED", - "SUCCESS", - "CANCELLED", - "CANCELLATION_REQUESTED", -] -r"""The current status of the fine-tuning job.""" - -ClassifierJobOutObject = Literal["job"] -r"""The object type of the fine-tuning job.""" - -ClassifierJobOutIntegrationsTypedDict = WandbIntegrationOutTypedDict - - -ClassifierJobOutIntegrations = WandbIntegrationOut - - -ClassifierJobOutJobType = Literal["classifier"] -r"""The type of job (`FT` for fine-tuning).""" - - -class ClassifierJobOutTypedDict(TypedDict): - id: str - r"""The ID of the job.""" - auto_start: bool - model: str - r"""The name of the model to fine-tune.""" - status: ClassifierJobOutStatus - r"""The current status of the fine-tuning job.""" - created_at: int - r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" - modified_at: int - r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" - training_files: List[str] - r"""A list containing the IDs of uploaded files that contain training data.""" - hyperparameters: ClassifierTrainingParametersTypedDict - validation_files: NotRequired[Nullable[List[str]]] - r"""A list containing the IDs of uploaded files that contain validation data.""" - object: NotRequired[ClassifierJobOutObject] - r"""The object type of the fine-tuning job.""" - fine_tuned_model: NotRequired[Nullable[str]] - r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" - suffix: NotRequired[Nullable[str]] - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - integrations: NotRequired[Nullable[List[ClassifierJobOutIntegrationsTypedDict]]] - r"""A list of integrations enabled for your fine-tuning job.""" - trained_tokens: NotRequired[Nullable[int]] - r"""Total number of tokens trained.""" - metadata: NotRequired[Nullable[JobMetadataOutTypedDict]] - job_type: NotRequired[ClassifierJobOutJobType] - r"""The type of job (`FT` for fine-tuning).""" - - -class ClassifierJobOut(BaseModel): - id: str - r"""The ID of the job.""" - - auto_start: bool - - model: str - r"""The name of the model to fine-tune.""" - - status: ClassifierJobOutStatus - r"""The current status of the fine-tuning job.""" - - created_at: int - r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" - - modified_at: int - r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" - - training_files: List[str] - r"""A list containing the IDs of uploaded files that contain training data.""" - - hyperparameters: ClassifierTrainingParameters - - validation_files: OptionalNullable[List[str]] = UNSET - r"""A list containing the IDs of uploaded files that contain validation data.""" - - object: Optional[ClassifierJobOutObject] = "job" - r"""The object type of the fine-tuning job.""" - - fine_tuned_model: OptionalNullable[str] = UNSET - r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" - - suffix: OptionalNullable[str] = UNSET - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - - integrations: OptionalNullable[List[ClassifierJobOutIntegrations]] = UNSET - r"""A list of integrations enabled for your fine-tuning job.""" - - trained_tokens: OptionalNullable[int] = UNSET - r"""Total number of tokens trained.""" - - metadata: OptionalNullable[JobMetadataOut] = UNSET - - job_type: Optional[ClassifierJobOutJobType] = "classifier" - r"""The type of job (`FT` for fine-tuning).""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "validation_files", - "object", - "fine_tuned_model", - "suffix", - "integrations", - "trained_tokens", - "metadata", - "job_type", - ] - nullable_fields = [ - "validation_files", - "fine_tuned_model", - "suffix", - "integrations", - "trained_tokens", - "metadata", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/classifiertargetin.py b/src/mistralai/models/classifiertargetin.py deleted file mode 100644 index d8a060e4..00000000 --- a/src/mistralai/models/classifiertargetin.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .ftclassifierlossfunction import FTClassifierLossFunction -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class ClassifierTargetInTypedDict(TypedDict): - name: str - labels: List[str] - weight: NotRequired[float] - loss_function: NotRequired[Nullable[FTClassifierLossFunction]] - - -class ClassifierTargetIn(BaseModel): - name: str - - labels: List[str] - - weight: Optional[float] = 1 - - loss_function: OptionalNullable[FTClassifierLossFunction] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["weight", "loss_function"] - nullable_fields = ["loss_function"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/classifiertargetout.py b/src/mistralai/models/classifiertargetout.py deleted file mode 100644 index ddc587f4..00000000 --- a/src/mistralai/models/classifiertargetout.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .ftclassifierlossfunction import FTClassifierLossFunction -from mistralai.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ClassifierTargetOutTypedDict(TypedDict): - name: str - labels: List[str] - weight: float - loss_function: FTClassifierLossFunction - - -class ClassifierTargetOut(BaseModel): - name: str - - labels: List[str] - - weight: float - - loss_function: FTClassifierLossFunction diff --git a/src/mistralai/models/classifiertrainingparameters.py b/src/mistralai/models/classifiertrainingparameters.py deleted file mode 100644 index 718beeac..00000000 --- a/src/mistralai/models/classifiertrainingparameters.py +++ /dev/null @@ -1,73 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class ClassifierTrainingParametersTypedDict(TypedDict): - training_steps: NotRequired[Nullable[int]] - learning_rate: NotRequired[float] - weight_decay: NotRequired[Nullable[float]] - warmup_fraction: NotRequired[Nullable[float]] - epochs: NotRequired[Nullable[float]] - seq_len: NotRequired[Nullable[int]] - - -class ClassifierTrainingParameters(BaseModel): - training_steps: OptionalNullable[int] = UNSET - - learning_rate: Optional[float] = 0.0001 - - weight_decay: OptionalNullable[float] = UNSET - - warmup_fraction: OptionalNullable[float] = UNSET - - epochs: OptionalNullable[float] = UNSET - - seq_len: OptionalNullable[int] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "training_steps", - "learning_rate", - "weight_decay", - "warmup_fraction", - "epochs", - "seq_len", - ] - nullable_fields = [ - "training_steps", - "weight_decay", - "warmup_fraction", - "epochs", - "seq_len", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/classifiertrainingparametersin.py b/src/mistralai/models/classifiertrainingparametersin.py deleted file mode 100644 index 9868843f..00000000 --- a/src/mistralai/models/classifiertrainingparametersin.py +++ /dev/null @@ -1,85 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class ClassifierTrainingParametersInTypedDict(TypedDict): - r"""The fine-tuning hyperparameter settings used in a classifier fine-tune job.""" - - training_steps: NotRequired[Nullable[int]] - r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" - learning_rate: NotRequired[float] - r"""A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.""" - weight_decay: NotRequired[Nullable[float]] - r"""(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.""" - warmup_fraction: NotRequired[Nullable[float]] - r"""(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)""" - epochs: NotRequired[Nullable[float]] - seq_len: NotRequired[Nullable[int]] - - -class ClassifierTrainingParametersIn(BaseModel): - r"""The fine-tuning hyperparameter settings used in a classifier fine-tune job.""" - - training_steps: OptionalNullable[int] = UNSET - r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" - - learning_rate: Optional[float] = 0.0001 - r"""A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.""" - - weight_decay: OptionalNullable[float] = UNSET - r"""(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.""" - - warmup_fraction: OptionalNullable[float] = UNSET - r"""(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)""" - - epochs: OptionalNullable[float] = UNSET - - seq_len: OptionalNullable[int] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "training_steps", - "learning_rate", - "weight_decay", - "warmup_fraction", - "epochs", - "seq_len", - ] - nullable_fields = [ - "training_steps", - "weight_decay", - "warmup_fraction", - "epochs", - "seq_len", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/codeinterpretertool.py b/src/mistralai/models/codeinterpretertool.py deleted file mode 100644 index b0fc4d20..00000000 --- a/src/mistralai/models/codeinterpretertool.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -CodeInterpreterToolType = Literal["code_interpreter"] - - -class CodeInterpreterToolTypedDict(TypedDict): - type: NotRequired[CodeInterpreterToolType] - - -class CodeInterpreterTool(BaseModel): - type: Optional[CodeInterpreterToolType] = "code_interpreter" diff --git a/src/mistralai/models/completionargs.py b/src/mistralai/models/completionargs.py deleted file mode 100644 index 40aa0314..00000000 --- a/src/mistralai/models/completionargs.py +++ /dev/null @@ -1,101 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionargsstop import CompletionArgsStop, CompletionArgsStopTypedDict -from .prediction import Prediction, PredictionTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from .toolchoiceenum import ToolChoiceEnum -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class CompletionArgsTypedDict(TypedDict): - r"""White-listed arguments from the completion API""" - - stop: NotRequired[Nullable[CompletionArgsStopTypedDict]] - presence_penalty: NotRequired[Nullable[float]] - frequency_penalty: NotRequired[Nullable[float]] - temperature: NotRequired[Nullable[float]] - top_p: NotRequired[Nullable[float]] - max_tokens: NotRequired[Nullable[int]] - random_seed: NotRequired[Nullable[int]] - prediction: NotRequired[Nullable[PredictionTypedDict]] - response_format: NotRequired[Nullable[ResponseFormatTypedDict]] - tool_choice: NotRequired[ToolChoiceEnum] - - -class CompletionArgs(BaseModel): - r"""White-listed arguments from the completion API""" - - stop: OptionalNullable[CompletionArgsStop] = UNSET - - presence_penalty: OptionalNullable[float] = UNSET - - frequency_penalty: OptionalNullable[float] = UNSET - - temperature: OptionalNullable[float] = UNSET - - top_p: OptionalNullable[float] = UNSET - - max_tokens: OptionalNullable[int] = UNSET - - random_seed: OptionalNullable[int] = UNSET - - prediction: OptionalNullable[Prediction] = UNSET - - response_format: OptionalNullable[ResponseFormat] = UNSET - - tool_choice: Optional[ToolChoiceEnum] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "stop", - "presence_penalty", - "frequency_penalty", - "temperature", - "top_p", - "max_tokens", - "random_seed", - "prediction", - "response_format", - "tool_choice", - ] - nullable_fields = [ - "stop", - "presence_penalty", - "frequency_penalty", - "temperature", - "top_p", - "max_tokens", - "random_seed", - "prediction", - "response_format", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/completionchunk.py b/src/mistralai/models/completionchunk.py deleted file mode 100644 index 4d1fcfbf..00000000 --- a/src/mistralai/models/completionchunk.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionresponsestreamchoice import ( - CompletionResponseStreamChoice, - CompletionResponseStreamChoiceTypedDict, -) -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai.types import BaseModel -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class CompletionChunkTypedDict(TypedDict): - id: str - model: str - choices: List[CompletionResponseStreamChoiceTypedDict] - object: NotRequired[str] - created: NotRequired[int] - usage: NotRequired[UsageInfoTypedDict] - - -class CompletionChunk(BaseModel): - id: str - - model: str - - choices: List[CompletionResponseStreamChoice] - - object: Optional[str] = None - - created: Optional[int] = None - - usage: Optional[UsageInfo] = None diff --git a/src/mistralai/models/completiondetailedjobout.py b/src/mistralai/models/completiondetailedjobout.py deleted file mode 100644 index 8fb1b62a..00000000 --- a/src/mistralai/models/completiondetailedjobout.py +++ /dev/null @@ -1,162 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .checkpointout import CheckpointOut, CheckpointOutTypedDict -from .completiontrainingparameters import ( - CompletionTrainingParameters, - CompletionTrainingParametersTypedDict, -) -from .eventout import EventOut, EventOutTypedDict -from .githubrepositoryout import GithubRepositoryOut, GithubRepositoryOutTypedDict -from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict -from .wandbintegrationout import WandbIntegrationOut, WandbIntegrationOutTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -CompletionDetailedJobOutStatus = Literal[ - "QUEUED", - "STARTED", - "VALIDATING", - "VALIDATED", - "RUNNING", - "FAILED_VALIDATION", - "FAILED", - "SUCCESS", - "CANCELLED", - "CANCELLATION_REQUESTED", -] - -CompletionDetailedJobOutObject = Literal["job"] - -CompletionDetailedJobOutIntegrationsTypedDict = WandbIntegrationOutTypedDict - - -CompletionDetailedJobOutIntegrations = WandbIntegrationOut - - -CompletionDetailedJobOutJobType = Literal["completion"] - -CompletionDetailedJobOutRepositoriesTypedDict = GithubRepositoryOutTypedDict - - -CompletionDetailedJobOutRepositories = GithubRepositoryOut - - -class CompletionDetailedJobOutTypedDict(TypedDict): - id: str - auto_start: bool - model: str - r"""The name of the model to fine-tune.""" - status: CompletionDetailedJobOutStatus - created_at: int - modified_at: int - training_files: List[str] - hyperparameters: CompletionTrainingParametersTypedDict - validation_files: NotRequired[Nullable[List[str]]] - object: NotRequired[CompletionDetailedJobOutObject] - fine_tuned_model: NotRequired[Nullable[str]] - suffix: NotRequired[Nullable[str]] - integrations: NotRequired[ - Nullable[List[CompletionDetailedJobOutIntegrationsTypedDict]] - ] - trained_tokens: NotRequired[Nullable[int]] - metadata: NotRequired[Nullable[JobMetadataOutTypedDict]] - job_type: NotRequired[CompletionDetailedJobOutJobType] - repositories: NotRequired[List[CompletionDetailedJobOutRepositoriesTypedDict]] - events: NotRequired[List[EventOutTypedDict]] - r"""Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here.""" - checkpoints: NotRequired[List[CheckpointOutTypedDict]] - - -class CompletionDetailedJobOut(BaseModel): - id: str - - auto_start: bool - - model: str - r"""The name of the model to fine-tune.""" - - status: CompletionDetailedJobOutStatus - - created_at: int - - modified_at: int - - training_files: List[str] - - hyperparameters: CompletionTrainingParameters - - validation_files: OptionalNullable[List[str]] = UNSET - - object: Optional[CompletionDetailedJobOutObject] = "job" - - fine_tuned_model: OptionalNullable[str] = UNSET - - suffix: OptionalNullable[str] = UNSET - - integrations: OptionalNullable[List[CompletionDetailedJobOutIntegrations]] = UNSET - - trained_tokens: OptionalNullable[int] = UNSET - - metadata: OptionalNullable[JobMetadataOut] = UNSET - - job_type: Optional[CompletionDetailedJobOutJobType] = "completion" - - repositories: Optional[List[CompletionDetailedJobOutRepositories]] = None - - events: Optional[List[EventOut]] = None - r"""Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here.""" - - checkpoints: Optional[List[CheckpointOut]] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "validation_files", - "object", - "fine_tuned_model", - "suffix", - "integrations", - "trained_tokens", - "metadata", - "job_type", - "repositories", - "events", - "checkpoints", - ] - nullable_fields = [ - "validation_files", - "fine_tuned_model", - "suffix", - "integrations", - "trained_tokens", - "metadata", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/completionevent.py b/src/mistralai/models/completionevent.py deleted file mode 100644 index cc859910..00000000 --- a/src/mistralai/models/completionevent.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionchunk import CompletionChunk, CompletionChunkTypedDict -from mistralai.types import BaseModel -from typing_extensions import TypedDict - - -class CompletionEventTypedDict(TypedDict): - data: CompletionChunkTypedDict - - -class CompletionEvent(BaseModel): - data: CompletionChunk diff --git a/src/mistralai/models/completionftmodelout.py b/src/mistralai/models/completionftmodelout.py deleted file mode 100644 index ab71168b..00000000 --- a/src/mistralai/models/completionftmodelout.py +++ /dev/null @@ -1,103 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .ftmodelcapabilitiesout import ( - FTModelCapabilitiesOut, - FTModelCapabilitiesOutTypedDict, -) -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -CompletionFTModelOutObject = Literal["model"] - -ModelType = Literal["completion"] - - -class CompletionFTModelOutTypedDict(TypedDict): - id: str - created: int - owned_by: str - workspace_id: str - root: str - root_version: str - archived: bool - capabilities: FTModelCapabilitiesOutTypedDict - job: str - object: NotRequired[CompletionFTModelOutObject] - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - max_context_length: NotRequired[int] - aliases: NotRequired[List[str]] - model_type: NotRequired[ModelType] - - -class CompletionFTModelOut(BaseModel): - id: str - - created: int - - owned_by: str - - workspace_id: str - - root: str - - root_version: str - - archived: bool - - capabilities: FTModelCapabilitiesOut - - job: str - - object: Optional[CompletionFTModelOutObject] = "model" - - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - max_context_length: Optional[int] = 32768 - - aliases: Optional[List[str]] = None - - model_type: Optional[ModelType] = "completion" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "object", - "name", - "description", - "max_context_length", - "aliases", - "model_type", - ] - nullable_fields = ["name", "description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/completionjobout.py b/src/mistralai/models/completionjobout.py deleted file mode 100644 index bed67b50..00000000 --- a/src/mistralai/models/completionjobout.py +++ /dev/null @@ -1,175 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completiontrainingparameters import ( - CompletionTrainingParameters, - CompletionTrainingParametersTypedDict, -) -from .githubrepositoryout import GithubRepositoryOut, GithubRepositoryOutTypedDict -from .jobmetadataout import JobMetadataOut, JobMetadataOutTypedDict -from .wandbintegrationout import WandbIntegrationOut, WandbIntegrationOutTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -Status = Literal[ - "QUEUED", - "STARTED", - "VALIDATING", - "VALIDATED", - "RUNNING", - "FAILED_VALIDATION", - "FAILED", - "SUCCESS", - "CANCELLED", - "CANCELLATION_REQUESTED", -] -r"""The current status of the fine-tuning job.""" - -CompletionJobOutObject = Literal["job"] -r"""The object type of the fine-tuning job.""" - -IntegrationsTypedDict = WandbIntegrationOutTypedDict - - -Integrations = WandbIntegrationOut - - -JobType = Literal["completion"] -r"""The type of job (`FT` for fine-tuning).""" - -RepositoriesTypedDict = GithubRepositoryOutTypedDict - - -Repositories = GithubRepositoryOut - - -class CompletionJobOutTypedDict(TypedDict): - id: str - r"""The ID of the job.""" - auto_start: bool - model: str - r"""The name of the model to fine-tune.""" - status: Status - r"""The current status of the fine-tuning job.""" - created_at: int - r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" - modified_at: int - r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" - training_files: List[str] - r"""A list containing the IDs of uploaded files that contain training data.""" - hyperparameters: CompletionTrainingParametersTypedDict - validation_files: NotRequired[Nullable[List[str]]] - r"""A list containing the IDs of uploaded files that contain validation data.""" - object: NotRequired[CompletionJobOutObject] - r"""The object type of the fine-tuning job.""" - fine_tuned_model: NotRequired[Nullable[str]] - r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" - suffix: NotRequired[Nullable[str]] - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - integrations: NotRequired[Nullable[List[IntegrationsTypedDict]]] - r"""A list of integrations enabled for your fine-tuning job.""" - trained_tokens: NotRequired[Nullable[int]] - r"""Total number of tokens trained.""" - metadata: NotRequired[Nullable[JobMetadataOutTypedDict]] - job_type: NotRequired[JobType] - r"""The type of job (`FT` for fine-tuning).""" - repositories: NotRequired[List[RepositoriesTypedDict]] - - -class CompletionJobOut(BaseModel): - id: str - r"""The ID of the job.""" - - auto_start: bool - - model: str - r"""The name of the model to fine-tune.""" - - status: Status - r"""The current status of the fine-tuning job.""" - - created_at: int - r"""The UNIX timestamp (in seconds) for when the fine-tuning job was created.""" - - modified_at: int - r"""The UNIX timestamp (in seconds) for when the fine-tuning job was last modified.""" - - training_files: List[str] - r"""A list containing the IDs of uploaded files that contain training data.""" - - hyperparameters: CompletionTrainingParameters - - validation_files: OptionalNullable[List[str]] = UNSET - r"""A list containing the IDs of uploaded files that contain validation data.""" - - object: Optional[CompletionJobOutObject] = "job" - r"""The object type of the fine-tuning job.""" - - fine_tuned_model: OptionalNullable[str] = UNSET - r"""The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running.""" - - suffix: OptionalNullable[str] = UNSET - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - - integrations: OptionalNullable[List[Integrations]] = UNSET - r"""A list of integrations enabled for your fine-tuning job.""" - - trained_tokens: OptionalNullable[int] = UNSET - r"""Total number of tokens trained.""" - - metadata: OptionalNullable[JobMetadataOut] = UNSET - - job_type: Optional[JobType] = "completion" - r"""The type of job (`FT` for fine-tuning).""" - - repositories: Optional[List[Repositories]] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "validation_files", - "object", - "fine_tuned_model", - "suffix", - "integrations", - "trained_tokens", - "metadata", - "job_type", - "repositories", - ] - nullable_fields = [ - "validation_files", - "fine_tuned_model", - "suffix", - "integrations", - "trained_tokens", - "metadata", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/completionresponsestreamchoice.py b/src/mistralai/models/completionresponsestreamchoice.py deleted file mode 100644 index 2426148c..00000000 --- a/src/mistralai/models/completionresponsestreamchoice.py +++ /dev/null @@ -1,62 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .deltamessage import DeltaMessage, DeltaMessageTypedDict -from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr -from mistralai.utils import validate_open_enum -from pydantic import model_serializer -from pydantic.functional_validators import PlainValidator -from typing import Literal, Union -from typing_extensions import Annotated, TypedDict - - -CompletionResponseStreamChoiceFinishReason = Union[ - Literal["stop", "length", "error", "tool_calls"], UnrecognizedStr -] - - -class CompletionResponseStreamChoiceTypedDict(TypedDict): - index: int - delta: DeltaMessageTypedDict - finish_reason: Nullable[CompletionResponseStreamChoiceFinishReason] - - -class CompletionResponseStreamChoice(BaseModel): - index: int - - delta: DeltaMessage - - finish_reason: Annotated[ - Nullable[CompletionResponseStreamChoiceFinishReason], - PlainValidator(validate_open_enum(False)), - ] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [] - nullable_fields = ["finish_reason"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/completiontrainingparameters.py b/src/mistralai/models/completiontrainingparameters.py deleted file mode 100644 index 0200e81c..00000000 --- a/src/mistralai/models/completiontrainingparameters.py +++ /dev/null @@ -1,78 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class CompletionTrainingParametersTypedDict(TypedDict): - training_steps: NotRequired[Nullable[int]] - learning_rate: NotRequired[float] - weight_decay: NotRequired[Nullable[float]] - warmup_fraction: NotRequired[Nullable[float]] - epochs: NotRequired[Nullable[float]] - seq_len: NotRequired[Nullable[int]] - fim_ratio: NotRequired[Nullable[float]] - - -class CompletionTrainingParameters(BaseModel): - training_steps: OptionalNullable[int] = UNSET - - learning_rate: Optional[float] = 0.0001 - - weight_decay: OptionalNullable[float] = UNSET - - warmup_fraction: OptionalNullable[float] = UNSET - - epochs: OptionalNullable[float] = UNSET - - seq_len: OptionalNullable[int] = UNSET - - fim_ratio: OptionalNullable[float] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "training_steps", - "learning_rate", - "weight_decay", - "warmup_fraction", - "epochs", - "seq_len", - "fim_ratio", - ] - nullable_fields = [ - "training_steps", - "weight_decay", - "warmup_fraction", - "epochs", - "seq_len", - "fim_ratio", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/completiontrainingparametersin.py b/src/mistralai/models/completiontrainingparametersin.py deleted file mode 100644 index 1f74bb9d..00000000 --- a/src/mistralai/models/completiontrainingparametersin.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class CompletionTrainingParametersInTypedDict(TypedDict): - r"""The fine-tuning hyperparameter settings used in a fine-tune job.""" - - training_steps: NotRequired[Nullable[int]] - r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" - learning_rate: NotRequired[float] - r"""A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.""" - weight_decay: NotRequired[Nullable[float]] - r"""(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.""" - warmup_fraction: NotRequired[Nullable[float]] - r"""(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)""" - epochs: NotRequired[Nullable[float]] - seq_len: NotRequired[Nullable[int]] - fim_ratio: NotRequired[Nullable[float]] - - -class CompletionTrainingParametersIn(BaseModel): - r"""The fine-tuning hyperparameter settings used in a fine-tune job.""" - - training_steps: OptionalNullable[int] = UNSET - r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" - - learning_rate: Optional[float] = 0.0001 - r"""A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process.""" - - weight_decay: OptionalNullable[float] = UNSET - r"""(Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large.""" - - warmup_fraction: OptionalNullable[float] = UNSET - r"""(Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune)""" - - epochs: OptionalNullable[float] = UNSET - - seq_len: OptionalNullable[int] = UNSET - - fim_ratio: OptionalNullable[float] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "training_steps", - "learning_rate", - "weight_decay", - "warmup_fraction", - "epochs", - "seq_len", - "fim_ratio", - ] - nullable_fields = [ - "training_steps", - "weight_decay", - "warmup_fraction", - "epochs", - "seq_len", - "fim_ratio", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/contentchunk.py b/src/mistralai/models/contentchunk.py deleted file mode 100644 index 47170eef..00000000 --- a/src/mistralai/models/contentchunk.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .audiochunk import AudioChunk, AudioChunkTypedDict -from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict -from .filechunk import FileChunk, FileChunkTypedDict -from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict -from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict -from .textchunk import TextChunk, TextChunkTypedDict -from .thinkchunk import ThinkChunk, ThinkChunkTypedDict -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType - - -ContentChunkTypedDict = TypeAliasType( - "ContentChunkTypedDict", - Union[ - TextChunkTypedDict, - ImageURLChunkTypedDict, - ReferenceChunkTypedDict, - FileChunkTypedDict, - AudioChunkTypedDict, - DocumentURLChunkTypedDict, - ThinkChunkTypedDict, - ], -) - - -ContentChunk = Annotated[ - Union[ - Annotated[ImageURLChunk, Tag("image_url")], - Annotated[DocumentURLChunk, Tag("document_url")], - Annotated[TextChunk, Tag("text")], - Annotated[ReferenceChunk, Tag("reference")], - Annotated[FileChunk, Tag("file")], - Annotated[ThinkChunk, Tag("thinking")], - Annotated[AudioChunk, Tag("input_audio")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] diff --git a/src/mistralai/models/conversationappendrequest.py b/src/mistralai/models/conversationappendrequest.py deleted file mode 100644 index ecc47e45..00000000 --- a/src/mistralai/models/conversationappendrequest.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .conversationinputs import ConversationInputs, ConversationInputsTypedDict -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ConversationAppendRequestHandoffExecution = Literal["client", "server"] - - -class ConversationAppendRequestTypedDict(TypedDict): - inputs: ConversationInputsTypedDict - stream: NotRequired[bool] - store: NotRequired[bool] - r"""Whether to store the results into our servers or not.""" - handoff_execution: NotRequired[ConversationAppendRequestHandoffExecution] - completion_args: NotRequired[CompletionArgsTypedDict] - r"""White-listed arguments from the completion API""" - - -class ConversationAppendRequest(BaseModel): - inputs: ConversationInputs - - stream: Optional[bool] = False - - store: Optional[bool] = True - r"""Whether to store the results into our servers or not.""" - - handoff_execution: Optional[ConversationAppendRequestHandoffExecution] = "server" - - completion_args: Optional[CompletionArgs] = None - r"""White-listed arguments from the completion API""" diff --git a/src/mistralai/models/conversationappendstreamrequest.py b/src/mistralai/models/conversationappendstreamrequest.py deleted file mode 100644 index 25ffe5fb..00000000 --- a/src/mistralai/models/conversationappendstreamrequest.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .conversationinputs import ConversationInputs, ConversationInputsTypedDict -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ConversationAppendStreamRequestHandoffExecution = Literal["client", "server"] - - -class ConversationAppendStreamRequestTypedDict(TypedDict): - inputs: ConversationInputsTypedDict - stream: NotRequired[bool] - store: NotRequired[bool] - r"""Whether to store the results into our servers or not.""" - handoff_execution: NotRequired[ConversationAppendStreamRequestHandoffExecution] - completion_args: NotRequired[CompletionArgsTypedDict] - r"""White-listed arguments from the completion API""" - - -class ConversationAppendStreamRequest(BaseModel): - inputs: ConversationInputs - - stream: Optional[bool] = True - - store: Optional[bool] = True - r"""Whether to store the results into our servers or not.""" - - handoff_execution: Optional[ConversationAppendStreamRequestHandoffExecution] = ( - "server" - ) - - completion_args: Optional[CompletionArgs] = None - r"""White-listed arguments from the completion API""" diff --git a/src/mistralai/models/conversationevents.py b/src/mistralai/models/conversationevents.py deleted file mode 100644 index ba4c628c..00000000 --- a/src/mistralai/models/conversationevents.py +++ /dev/null @@ -1,78 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .agenthandoffdoneevent import AgentHandoffDoneEvent, AgentHandoffDoneEventTypedDict -from .agenthandoffstartedevent import ( - AgentHandoffStartedEvent, - AgentHandoffStartedEventTypedDict, -) -from .functioncallevent import FunctionCallEvent, FunctionCallEventTypedDict -from .messageoutputevent import MessageOutputEvent, MessageOutputEventTypedDict -from .responsedoneevent import ResponseDoneEvent, ResponseDoneEventTypedDict -from .responseerrorevent import ResponseErrorEvent, ResponseErrorEventTypedDict -from .responsestartedevent import ResponseStartedEvent, ResponseStartedEventTypedDict -from .ssetypes import SSETypes -from .toolexecutiondeltaevent import ( - ToolExecutionDeltaEvent, - ToolExecutionDeltaEventTypedDict, -) -from .toolexecutiondoneevent import ( - ToolExecutionDoneEvent, - ToolExecutionDoneEventTypedDict, -) -from .toolexecutionstartedevent import ( - ToolExecutionStartedEvent, - ToolExecutionStartedEventTypedDict, -) -from mistralai.types import BaseModel -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -ConversationEventsDataTypedDict = TypeAliasType( - "ConversationEventsDataTypedDict", - Union[ - ResponseStartedEventTypedDict, - ResponseDoneEventTypedDict, - ResponseErrorEventTypedDict, - ToolExecutionStartedEventTypedDict, - ToolExecutionDeltaEventTypedDict, - ToolExecutionDoneEventTypedDict, - AgentHandoffStartedEventTypedDict, - AgentHandoffDoneEventTypedDict, - FunctionCallEventTypedDict, - MessageOutputEventTypedDict, - ], -) - - -ConversationEventsData = Annotated[ - Union[ - Annotated[AgentHandoffDoneEvent, Tag("agent.handoff.done")], - Annotated[AgentHandoffStartedEvent, Tag("agent.handoff.started")], - Annotated[ResponseDoneEvent, Tag("conversation.response.done")], - Annotated[ResponseErrorEvent, Tag("conversation.response.error")], - Annotated[ResponseStartedEvent, Tag("conversation.response.started")], - Annotated[FunctionCallEvent, Tag("function.call.delta")], - Annotated[MessageOutputEvent, Tag("message.output.delta")], - Annotated[ToolExecutionDeltaEvent, Tag("tool.execution.delta")], - Annotated[ToolExecutionDoneEvent, Tag("tool.execution.done")], - Annotated[ToolExecutionStartedEvent, Tag("tool.execution.started")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -class ConversationEventsTypedDict(TypedDict): - event: SSETypes - r"""Server side events sent when streaming a conversation response.""" - data: ConversationEventsDataTypedDict - - -class ConversationEvents(BaseModel): - event: SSETypes - r"""Server side events sent when streaming a conversation response.""" - - data: ConversationEventsData diff --git a/src/mistralai/models/conversationhistory.py b/src/mistralai/models/conversationhistory.py deleted file mode 100644 index 472915fe..00000000 --- a/src/mistralai/models/conversationhistory.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .agenthandoffentry import AgentHandoffEntry, AgentHandoffEntryTypedDict -from .functioncallentry import FunctionCallEntry, FunctionCallEntryTypedDict -from .functionresultentry import FunctionResultEntry, FunctionResultEntryTypedDict -from .messageinputentry import MessageInputEntry, MessageInputEntryTypedDict -from .messageoutputentry import MessageOutputEntry, MessageOutputEntryTypedDict -from .toolexecutionentry import ToolExecutionEntry, ToolExecutionEntryTypedDict -from mistralai.types import BaseModel -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ConversationHistoryObject = Literal["conversation.history"] - -EntriesTypedDict = TypeAliasType( - "EntriesTypedDict", - Union[ - FunctionResultEntryTypedDict, - MessageInputEntryTypedDict, - FunctionCallEntryTypedDict, - ToolExecutionEntryTypedDict, - MessageOutputEntryTypedDict, - AgentHandoffEntryTypedDict, - ], -) - - -Entries = TypeAliasType( - "Entries", - Union[ - FunctionResultEntry, - MessageInputEntry, - FunctionCallEntry, - ToolExecutionEntry, - MessageOutputEntry, - AgentHandoffEntry, - ], -) - - -class ConversationHistoryTypedDict(TypedDict): - r"""Retrieve all entries in a conversation.""" - - conversation_id: str - entries: List[EntriesTypedDict] - object: NotRequired[ConversationHistoryObject] - - -class ConversationHistory(BaseModel): - r"""Retrieve all entries in a conversation.""" - - conversation_id: str - - entries: List[Entries] - - object: Optional[ConversationHistoryObject] = "conversation.history" diff --git a/src/mistralai/models/conversationmessages.py b/src/mistralai/models/conversationmessages.py deleted file mode 100644 index 9027045b..00000000 --- a/src/mistralai/models/conversationmessages.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .messageentries import MessageEntries, MessageEntriesTypedDict -from mistralai.types import BaseModel -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ConversationMessagesObject = Literal["conversation.messages"] - - -class ConversationMessagesTypedDict(TypedDict): - r"""Similar to the conversation history but only keep the messages""" - - conversation_id: str - messages: List[MessageEntriesTypedDict] - object: NotRequired[ConversationMessagesObject] - - -class ConversationMessages(BaseModel): - r"""Similar to the conversation history but only keep the messages""" - - conversation_id: str - - messages: List[MessageEntries] - - object: Optional[ConversationMessagesObject] = "conversation.messages" diff --git a/src/mistralai/models/conversationrequest.py b/src/mistralai/models/conversationrequest.py deleted file mode 100644 index 0fcca512..00000000 --- a/src/mistralai/models/conversationrequest.py +++ /dev/null @@ -1,133 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .conversationinputs import ConversationInputs, ConversationInputsTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict -from .functiontool import FunctionTool, FunctionToolTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -HandoffExecution = Literal["client", "server"] - -ToolsTypedDict = TypeAliasType( - "ToolsTypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - FunctionToolTypedDict, - DocumentLibraryToolTypedDict, - ], -) - - -Tools = Annotated[ - Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -class ConversationRequestTypedDict(TypedDict): - inputs: ConversationInputsTypedDict - stream: NotRequired[bool] - store: NotRequired[Nullable[bool]] - handoff_execution: NotRequired[Nullable[HandoffExecution]] - instructions: NotRequired[Nullable[str]] - tools: NotRequired[Nullable[List[ToolsTypedDict]]] - completion_args: NotRequired[Nullable[CompletionArgsTypedDict]] - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - agent_id: NotRequired[Nullable[str]] - model: NotRequired[Nullable[str]] - - -class ConversationRequest(BaseModel): - inputs: ConversationInputs - - stream: Optional[bool] = False - - store: OptionalNullable[bool] = UNSET - - handoff_execution: OptionalNullable[HandoffExecution] = UNSET - - instructions: OptionalNullable[str] = UNSET - - tools: OptionalNullable[List[Tools]] = UNSET - - completion_args: OptionalNullable[CompletionArgs] = UNSET - - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - agent_id: OptionalNullable[str] = UNSET - - model: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "stream", - "store", - "handoff_execution", - "instructions", - "tools", - "completion_args", - "name", - "description", - "agent_id", - "model", - ] - nullable_fields = [ - "store", - "handoff_execution", - "instructions", - "tools", - "completion_args", - "name", - "description", - "agent_id", - "model", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/conversationresponse.py b/src/mistralai/models/conversationresponse.py deleted file mode 100644 index 61de8565..00000000 --- a/src/mistralai/models/conversationresponse.py +++ /dev/null @@ -1,51 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .agenthandoffentry import AgentHandoffEntry, AgentHandoffEntryTypedDict -from .conversationusageinfo import ConversationUsageInfo, ConversationUsageInfoTypedDict -from .functioncallentry import FunctionCallEntry, FunctionCallEntryTypedDict -from .messageoutputentry import MessageOutputEntry, MessageOutputEntryTypedDict -from .toolexecutionentry import ToolExecutionEntry, ToolExecutionEntryTypedDict -from mistralai.types import BaseModel -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ConversationResponseObject = Literal["conversation.response"] - -OutputsTypedDict = TypeAliasType( - "OutputsTypedDict", - Union[ - ToolExecutionEntryTypedDict, - FunctionCallEntryTypedDict, - MessageOutputEntryTypedDict, - AgentHandoffEntryTypedDict, - ], -) - - -Outputs = TypeAliasType( - "Outputs", - Union[ToolExecutionEntry, FunctionCallEntry, MessageOutputEntry, AgentHandoffEntry], -) - - -class ConversationResponseTypedDict(TypedDict): - r"""The response after appending new entries to the conversation.""" - - conversation_id: str - outputs: List[OutputsTypedDict] - usage: ConversationUsageInfoTypedDict - object: NotRequired[ConversationResponseObject] - - -class ConversationResponse(BaseModel): - r"""The response after appending new entries to the conversation.""" - - conversation_id: str - - outputs: List[Outputs] - - usage: ConversationUsageInfo - - object: Optional[ConversationResponseObject] = "conversation.response" diff --git a/src/mistralai/models/conversationrestartrequest.py b/src/mistralai/models/conversationrestartrequest.py deleted file mode 100644 index 58376140..00000000 --- a/src/mistralai/models/conversationrestartrequest.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .conversationinputs import ConversationInputs, ConversationInputsTypedDict -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ConversationRestartRequestHandoffExecution = Literal["client", "server"] - - -class ConversationRestartRequestTypedDict(TypedDict): - r"""Request to restart a new conversation from a given entry in the conversation.""" - - inputs: ConversationInputsTypedDict - from_entry_id: str - stream: NotRequired[bool] - store: NotRequired[bool] - r"""Whether to store the results into our servers or not.""" - handoff_execution: NotRequired[ConversationRestartRequestHandoffExecution] - completion_args: NotRequired[CompletionArgsTypedDict] - r"""White-listed arguments from the completion API""" - - -class ConversationRestartRequest(BaseModel): - r"""Request to restart a new conversation from a given entry in the conversation.""" - - inputs: ConversationInputs - - from_entry_id: str - - stream: Optional[bool] = False - - store: Optional[bool] = True - r"""Whether to store the results into our servers or not.""" - - handoff_execution: Optional[ConversationRestartRequestHandoffExecution] = "server" - - completion_args: Optional[CompletionArgs] = None - r"""White-listed arguments from the completion API""" diff --git a/src/mistralai/models/conversationrestartstreamrequest.py b/src/mistralai/models/conversationrestartstreamrequest.py deleted file mode 100644 index f213aea3..00000000 --- a/src/mistralai/models/conversationrestartstreamrequest.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .conversationinputs import ConversationInputs, ConversationInputsTypedDict -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ConversationRestartStreamRequestHandoffExecution = Literal["client", "server"] - - -class ConversationRestartStreamRequestTypedDict(TypedDict): - r"""Request to restart a new conversation from a given entry in the conversation.""" - - inputs: ConversationInputsTypedDict - from_entry_id: str - stream: NotRequired[bool] - store: NotRequired[bool] - r"""Whether to store the results into our servers or not.""" - handoff_execution: NotRequired[ConversationRestartStreamRequestHandoffExecution] - completion_args: NotRequired[CompletionArgsTypedDict] - r"""White-listed arguments from the completion API""" - - -class ConversationRestartStreamRequest(BaseModel): - r"""Request to restart a new conversation from a given entry in the conversation.""" - - inputs: ConversationInputs - - from_entry_id: str - - stream: Optional[bool] = True - - store: Optional[bool] = True - r"""Whether to store the results into our servers or not.""" - - handoff_execution: Optional[ConversationRestartStreamRequestHandoffExecution] = ( - "server" - ) - - completion_args: Optional[CompletionArgs] = None - r"""White-listed arguments from the completion API""" diff --git a/src/mistralai/models/conversationstreamrequest.py b/src/mistralai/models/conversationstreamrequest.py deleted file mode 100644 index 0880727e..00000000 --- a/src/mistralai/models/conversationstreamrequest.py +++ /dev/null @@ -1,135 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .conversationinputs import ConversationInputs, ConversationInputsTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict -from .functiontool import FunctionTool, FunctionToolTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -ConversationStreamRequestHandoffExecution = Literal["client", "server"] - -ConversationStreamRequestToolsTypedDict = TypeAliasType( - "ConversationStreamRequestToolsTypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - FunctionToolTypedDict, - DocumentLibraryToolTypedDict, - ], -) - - -ConversationStreamRequestTools = Annotated[ - Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -class ConversationStreamRequestTypedDict(TypedDict): - inputs: ConversationInputsTypedDict - stream: NotRequired[bool] - store: NotRequired[Nullable[bool]] - handoff_execution: NotRequired[Nullable[ConversationStreamRequestHandoffExecution]] - instructions: NotRequired[Nullable[str]] - tools: NotRequired[Nullable[List[ConversationStreamRequestToolsTypedDict]]] - completion_args: NotRequired[Nullable[CompletionArgsTypedDict]] - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - agent_id: NotRequired[Nullable[str]] - model: NotRequired[Nullable[str]] - - -class ConversationStreamRequest(BaseModel): - inputs: ConversationInputs - - stream: Optional[bool] = True - - store: OptionalNullable[bool] = UNSET - - handoff_execution: OptionalNullable[ConversationStreamRequestHandoffExecution] = ( - UNSET - ) - - instructions: OptionalNullable[str] = UNSET - - tools: OptionalNullable[List[ConversationStreamRequestTools]] = UNSET - - completion_args: OptionalNullable[CompletionArgs] = UNSET - - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - agent_id: OptionalNullable[str] = UNSET - - model: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "stream", - "store", - "handoff_execution", - "instructions", - "tools", - "completion_args", - "name", - "description", - "agent_id", - "model", - ] - nullable_fields = [ - "store", - "handoff_execution", - "instructions", - "tools", - "completion_args", - "name", - "description", - "agent_id", - "model", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/conversationusageinfo.py b/src/mistralai/models/conversationusageinfo.py deleted file mode 100644 index 9ae6f4fb..00000000 --- a/src/mistralai/models/conversationusageinfo.py +++ /dev/null @@ -1,63 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Dict, Optional -from typing_extensions import NotRequired, TypedDict - - -class ConversationUsageInfoTypedDict(TypedDict): - prompt_tokens: NotRequired[int] - completion_tokens: NotRequired[int] - total_tokens: NotRequired[int] - connector_tokens: NotRequired[Nullable[int]] - connectors: NotRequired[Nullable[Dict[str, int]]] - - -class ConversationUsageInfo(BaseModel): - prompt_tokens: Optional[int] = 0 - - completion_tokens: Optional[int] = 0 - - total_tokens: Optional[int] = 0 - - connector_tokens: OptionalNullable[int] = UNSET - - connectors: OptionalNullable[Dict[str, int]] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "prompt_tokens", - "completion_tokens", - "total_tokens", - "connector_tokens", - "connectors", - ] - nullable_fields = ["connector_tokens", "connectors"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/deletefileout.py b/src/mistralai/models/deletefileout.py deleted file mode 100644 index 2b346ec4..00000000 --- a/src/mistralai/models/deletefileout.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing_extensions import TypedDict - - -class DeleteFileOutTypedDict(TypedDict): - id: str - r"""The ID of the deleted file.""" - object: str - r"""The object type that was deleted""" - deleted: bool - r"""The deletion status.""" - - -class DeleteFileOut(BaseModel): - id: str - r"""The ID of the deleted file.""" - - object: str - r"""The object type that was deleted""" - - deleted: bool - r"""The deletion status.""" diff --git a/src/mistralai/models/deletemodelout.py b/src/mistralai/models/deletemodelout.py deleted file mode 100644 index c1b1effc..00000000 --- a/src/mistralai/models/deletemodelout.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class DeleteModelOutTypedDict(TypedDict): - id: str - r"""The ID of the deleted model.""" - object: NotRequired[str] - r"""The object type that was deleted""" - deleted: NotRequired[bool] - r"""The deletion status""" - - -class DeleteModelOut(BaseModel): - id: str - r"""The ID of the deleted model.""" - - object: Optional[str] = "model" - r"""The object type that was deleted""" - - deleted: Optional[bool] = True - r"""The deletion status""" diff --git a/src/mistralai/models/deltamessage.py b/src/mistralai/models/deltamessage.py deleted file mode 100644 index 88aefe7f..00000000 --- a/src/mistralai/models/deltamessage.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from .toolcall import ToolCall, ToolCallTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ContentTypedDict = TypeAliasType( - "ContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -Content = TypeAliasType("Content", Union[str, List[ContentChunk]]) - - -class DeltaMessageTypedDict(TypedDict): - role: NotRequired[Nullable[str]] - content: NotRequired[Nullable[ContentTypedDict]] - tool_calls: NotRequired[Nullable[List[ToolCallTypedDict]]] - - -class DeltaMessage(BaseModel): - role: OptionalNullable[str] = UNSET - - content: OptionalNullable[Content] = UNSET - - tool_calls: OptionalNullable[List[ToolCall]] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["role", "content", "tool_calls"] - nullable_fields = ["role", "content", "tool_calls"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/documentlibrarytool.py b/src/mistralai/models/documentlibrarytool.py deleted file mode 100644 index f36de710..00000000 --- a/src/mistralai/models/documentlibrarytool.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -DocumentLibraryToolType = Literal["document_library"] - - -class DocumentLibraryToolTypedDict(TypedDict): - library_ids: List[str] - r"""Ids of the library in which to search.""" - type: NotRequired[DocumentLibraryToolType] - - -class DocumentLibraryTool(BaseModel): - library_ids: List[str] - r"""Ids of the library in which to search.""" - - type: Optional[DocumentLibraryToolType] = "document_library" diff --git a/src/mistralai/models/documentout.py b/src/mistralai/models/documentout.py deleted file mode 100644 index 65f1be80..00000000 --- a/src/mistralai/models/documentout.py +++ /dev/null @@ -1,105 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class DocumentOutTypedDict(TypedDict): - id: str - library_id: str - hash: str - mime_type: str - extension: str - size: int - name: str - created_at: datetime - processing_status: str - uploaded_by_id: str - uploaded_by_type: str - tokens_processing_total: int - summary: NotRequired[Nullable[str]] - last_processed_at: NotRequired[Nullable[datetime]] - number_of_pages: NotRequired[Nullable[int]] - tokens_processing_main_content: NotRequired[Nullable[int]] - tokens_processing_summary: NotRequired[Nullable[int]] - - -class DocumentOut(BaseModel): - id: str - - library_id: str - - hash: str - - mime_type: str - - extension: str - - size: int - - name: str - - created_at: datetime - - processing_status: str - - uploaded_by_id: str - - uploaded_by_type: str - - tokens_processing_total: int - - summary: OptionalNullable[str] = UNSET - - last_processed_at: OptionalNullable[datetime] = UNSET - - number_of_pages: OptionalNullable[int] = UNSET - - tokens_processing_main_content: OptionalNullable[int] = UNSET - - tokens_processing_summary: OptionalNullable[int] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "summary", - "last_processed_at", - "number_of_pages", - "tokens_processing_main_content", - "tokens_processing_summary", - ] - nullable_fields = [ - "summary", - "last_processed_at", - "number_of_pages", - "tokens_processing_main_content", - "tokens_processing_summary", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/documentupdatein.py b/src/mistralai/models/documentupdatein.py deleted file mode 100644 index 0f6abd5b..00000000 --- a/src/mistralai/models/documentupdatein.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class DocumentUpdateInTypedDict(TypedDict): - name: NotRequired[Nullable[str]] - - -class DocumentUpdateIn(BaseModel): - name: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["name"] - nullable_fields = ["name"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/documenturlchunk.py b/src/mistralai/models/documenturlchunk.py deleted file mode 100644 index 33f29ba8..00000000 --- a/src/mistralai/models/documenturlchunk.py +++ /dev/null @@ -1,56 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -DocumentURLChunkType = Literal["document_url"] - - -class DocumentURLChunkTypedDict(TypedDict): - document_url: str - document_name: NotRequired[Nullable[str]] - r"""The filename of the document""" - type: NotRequired[DocumentURLChunkType] - - -class DocumentURLChunk(BaseModel): - document_url: str - - document_name: OptionalNullable[str] = UNSET - r"""The filename of the document""" - - type: Optional[DocumentURLChunkType] = "document_url" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["document_name", "type"] - nullable_fields = ["document_name"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/embeddingdtype.py b/src/mistralai/models/embeddingdtype.py deleted file mode 100644 index 4f3c41bd..00000000 --- a/src/mistralai/models/embeddingdtype.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -EmbeddingDtype = Literal["float", "int8", "uint8", "binary", "ubinary"] diff --git a/src/mistralai/models/embeddingrequest.py b/src/mistralai/models/embeddingrequest.py deleted file mode 100644 index 685f27fd..00000000 --- a/src/mistralai/models/embeddingrequest.py +++ /dev/null @@ -1,76 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .embeddingdtype import EmbeddingDtype -from .encodingformat import EncodingFormat -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -import pydantic -from pydantic import model_serializer -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -EmbeddingRequestInputsTypedDict = TypeAliasType( - "EmbeddingRequestInputsTypedDict", Union[str, List[str]] -) -r"""Text to embed.""" - - -EmbeddingRequestInputs = TypeAliasType("EmbeddingRequestInputs", Union[str, List[str]]) -r"""Text to embed.""" - - -class EmbeddingRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use.""" - inputs: EmbeddingRequestInputsTypedDict - r"""Text to embed.""" - output_dimension: NotRequired[Nullable[int]] - r"""The dimension of the output embeddings.""" - output_dtype: NotRequired[EmbeddingDtype] - encoding_format: NotRequired[EncodingFormat] - - -class EmbeddingRequest(BaseModel): - model: str - r"""ID of the model to use.""" - - inputs: Annotated[EmbeddingRequestInputs, pydantic.Field(alias="input")] - r"""Text to embed.""" - - output_dimension: OptionalNullable[int] = UNSET - r"""The dimension of the output embeddings.""" - - output_dtype: Optional[EmbeddingDtype] = None - - encoding_format: Optional[EncodingFormat] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["output_dimension", "output_dtype", "encoding_format"] - nullable_fields = ["output_dimension"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/embeddingresponsedata.py b/src/mistralai/models/embeddingresponsedata.py deleted file mode 100644 index 01e2765f..00000000 --- a/src/mistralai/models/embeddingresponsedata.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class EmbeddingResponseDataTypedDict(TypedDict): - object: NotRequired[str] - embedding: NotRequired[List[float]] - index: NotRequired[int] - - -class EmbeddingResponseData(BaseModel): - object: Optional[str] = None - - embedding: Optional[List[float]] = None - - index: Optional[int] = None diff --git a/src/mistralai/models/encodingformat.py b/src/mistralai/models/encodingformat.py deleted file mode 100644 index 6c28a15a..00000000 --- a/src/mistralai/models/encodingformat.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -EncodingFormat = Literal["float", "base64"] diff --git a/src/mistralai/models/entitytype.py b/src/mistralai/models/entitytype.py deleted file mode 100644 index b5149c5f..00000000 --- a/src/mistralai/models/entitytype.py +++ /dev/null @@ -1,9 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import UnrecognizedStr -from typing import Literal, Union - - -EntityType = Union[Literal["User", "Workspace", "Org"], UnrecognizedStr] -r"""The type of entity, used to share a library.""" diff --git a/src/mistralai/models/eventout.py b/src/mistralai/models/eventout.py deleted file mode 100644 index 32819034..00000000 --- a/src/mistralai/models/eventout.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Any, Dict -from typing_extensions import NotRequired, TypedDict - - -class EventOutTypedDict(TypedDict): - name: str - r"""The name of the event.""" - created_at: int - r"""The UNIX timestamp (in seconds) of the event.""" - data: NotRequired[Nullable[Dict[str, Any]]] - - -class EventOut(BaseModel): - name: str - r"""The name of the event.""" - - created_at: int - r"""The UNIX timestamp (in seconds) of the event.""" - - data: OptionalNullable[Dict[str, Any]] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["data"] - nullable_fields = ["data"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/file.py b/src/mistralai/models/file.py deleted file mode 100644 index 682d7f6e..00000000 --- a/src/mistralai/models/file.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -import io -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, MultipartFormMetadata -import pydantic -from typing import IO, Optional, Union -from typing_extensions import Annotated, NotRequired, TypedDict - - -class FileTypedDict(TypedDict): - file_name: str - content: Union[bytes, IO[bytes], io.BufferedReader] - content_type: NotRequired[str] - - -class File(BaseModel): - file_name: Annotated[ - str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) - ] - - content: Annotated[ - Union[bytes, IO[bytes], io.BufferedReader], - pydantic.Field(alias=""), - FieldMetadata(multipart=MultipartFormMetadata(content=True)), - ] - - content_type: Annotated[ - Optional[str], - pydantic.Field(alias="Content-Type"), - FieldMetadata(multipart=True), - ] = None diff --git a/src/mistralai/models/filechunk.py b/src/mistralai/models/filechunk.py deleted file mode 100644 index 83e60cef..00000000 --- a/src/mistralai/models/filechunk.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import validate_const -import pydantic -from pydantic.functional_validators import AfterValidator -from typing import Literal, Optional -from typing_extensions import Annotated, TypedDict - - -class FileChunkTypedDict(TypedDict): - file_id: str - type: Literal["file"] - - -class FileChunk(BaseModel): - file_id: str - - TYPE: Annotated[ - Annotated[Optional[Literal["file"]], AfterValidator(validate_const("file"))], - pydantic.Field(alias="type"), - ] = "file" diff --git a/src/mistralai/models/filepurpose.py b/src/mistralai/models/filepurpose.py deleted file mode 100644 index 8599192b..00000000 --- a/src/mistralai/models/filepurpose.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import UnrecognizedStr -from typing import Literal, Union - - -FilePurpose = Union[Literal["fine-tune", "batch", "ocr"], UnrecognizedStr] diff --git a/src/mistralai/models/files_api_routes_delete_fileop.py b/src/mistralai/models/files_api_routes_delete_fileop.py deleted file mode 100644 index a84a7a8e..00000000 --- a/src/mistralai/models/files_api_routes_delete_fileop.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class FilesAPIRoutesDeleteFileRequestTypedDict(TypedDict): - file_id: str - - -class FilesAPIRoutesDeleteFileRequest(BaseModel): - file_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/files_api_routes_download_fileop.py b/src/mistralai/models/files_api_routes_download_fileop.py deleted file mode 100644 index 168a7fa6..00000000 --- a/src/mistralai/models/files_api_routes_download_fileop.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class FilesAPIRoutesDownloadFileRequestTypedDict(TypedDict): - file_id: str - - -class FilesAPIRoutesDownloadFileRequest(BaseModel): - file_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/files_api_routes_get_signed_urlop.py b/src/mistralai/models/files_api_routes_get_signed_urlop.py deleted file mode 100644 index 708d40ab..00000000 --- a/src/mistralai/models/files_api_routes_get_signed_urlop.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class FilesAPIRoutesGetSignedURLRequestTypedDict(TypedDict): - file_id: str - expiry: NotRequired[int] - r"""Number of hours before the url becomes invalid. Defaults to 24h""" - - -class FilesAPIRoutesGetSignedURLRequest(BaseModel): - file_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - expiry: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 24 - r"""Number of hours before the url becomes invalid. Defaults to 24h""" diff --git a/src/mistralai/models/files_api_routes_list_filesop.py b/src/mistralai/models/files_api_routes_list_filesop.py deleted file mode 100644 index 5060c3b8..00000000 --- a/src/mistralai/models/files_api_routes_list_filesop.py +++ /dev/null @@ -1,96 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .filepurpose import FilePurpose -from .sampletype import SampleType -from .source import Source -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import FieldMetadata, QueryParamMetadata, validate_open_enum -from pydantic import model_serializer -from pydantic.functional_validators import PlainValidator -from typing import List, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class FilesAPIRoutesListFilesRequestTypedDict(TypedDict): - page: NotRequired[int] - page_size: NotRequired[int] - sample_type: NotRequired[Nullable[List[SampleType]]] - source: NotRequired[Nullable[List[Source]]] - search: NotRequired[Nullable[str]] - purpose: NotRequired[Nullable[FilePurpose]] - - -class FilesAPIRoutesListFilesRequest(BaseModel): - page: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 0 - - page_size: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 100 - - sample_type: Annotated[ - OptionalNullable[ - List[Annotated[SampleType, PlainValidator(validate_open_enum(False))]] - ], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - source: Annotated[ - OptionalNullable[ - List[Annotated[Source, PlainValidator(validate_open_enum(False))]] - ], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - search: Annotated[ - OptionalNullable[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - purpose: Annotated[ - Annotated[ - OptionalNullable[FilePurpose], PlainValidator(validate_open_enum(False)) - ], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "page", - "page_size", - "sample_type", - "source", - "search", - "purpose", - ] - nullable_fields = ["sample_type", "source", "search", "purpose"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/files_api_routes_retrieve_fileop.py b/src/mistralai/models/files_api_routes_retrieve_fileop.py deleted file mode 100644 index 0c2a95ef..00000000 --- a/src/mistralai/models/files_api_routes_retrieve_fileop.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class FilesAPIRoutesRetrieveFileRequestTypedDict(TypedDict): - file_id: str - - -class FilesAPIRoutesRetrieveFileRequest(BaseModel): - file_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/files_api_routes_upload_fileop.py b/src/mistralai/models/files_api_routes_upload_fileop.py deleted file mode 100644 index 34321cf5..00000000 --- a/src/mistralai/models/files_api_routes_upload_fileop.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .file import File, FileTypedDict -from .filepurpose import FilePurpose -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, MultipartFormMetadata, validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class FilesAPIRoutesUploadFileMultiPartBodyParamsTypedDict(TypedDict): - file: FileTypedDict - r"""The File object (not file name) to be uploaded. - To upload a file and specify a custom file name you should format your request as such: - ```bash - file=@path/to/your/file.jsonl;filename=custom_name.jsonl - ``` - Otherwise, you can just keep the original file name: - ```bash - file=@path/to/your/file.jsonl - ``` - """ - purpose: NotRequired[FilePurpose] - - -class FilesAPIRoutesUploadFileMultiPartBodyParams(BaseModel): - file: Annotated[File, FieldMetadata(multipart=MultipartFormMetadata(file=True))] - r"""The File object (not file name) to be uploaded. - To upload a file and specify a custom file name you should format your request as such: - ```bash - file=@path/to/your/file.jsonl;filename=custom_name.jsonl - ``` - Otherwise, you can just keep the original file name: - ```bash - file=@path/to/your/file.jsonl - ``` - """ - - purpose: Annotated[ - Annotated[Optional[FilePurpose], PlainValidator(validate_open_enum(False))], - FieldMetadata(multipart=True), - ] = None diff --git a/src/mistralai/models/fileschema.py b/src/mistralai/models/fileschema.py deleted file mode 100644 index 7c7b60c6..00000000 --- a/src/mistralai/models/fileschema.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .filepurpose import FilePurpose -from .sampletype import SampleType -from .source import Source -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import validate_open_enum -import pydantic -from pydantic import model_serializer -from pydantic.functional_validators import PlainValidator -from typing_extensions import Annotated, NotRequired, TypedDict - - -class FileSchemaTypedDict(TypedDict): - id: str - r"""The unique identifier of the file.""" - object: str - r"""The object type, which is always \"file\".""" - size_bytes: int - r"""The size of the file, in bytes.""" - created_at: int - r"""The UNIX timestamp (in seconds) of the event.""" - filename: str - r"""The name of the uploaded file.""" - purpose: FilePurpose - sample_type: SampleType - source: Source - num_lines: NotRequired[Nullable[int]] - mimetype: NotRequired[Nullable[str]] - signature: NotRequired[Nullable[str]] - - -class FileSchema(BaseModel): - id: str - r"""The unique identifier of the file.""" - - object: str - r"""The object type, which is always \"file\".""" - - size_bytes: Annotated[int, pydantic.Field(alias="bytes")] - r"""The size of the file, in bytes.""" - - created_at: int - r"""The UNIX timestamp (in seconds) of the event.""" - - filename: str - r"""The name of the uploaded file.""" - - purpose: Annotated[FilePurpose, PlainValidator(validate_open_enum(False))] - - sample_type: Annotated[SampleType, PlainValidator(validate_open_enum(False))] - - source: Annotated[Source, PlainValidator(validate_open_enum(False))] - - num_lines: OptionalNullable[int] = UNSET - - mimetype: OptionalNullable[str] = UNSET - - signature: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["num_lines", "mimetype", "signature"] - nullable_fields = ["num_lines", "mimetype", "signature"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/filesignedurl.py b/src/mistralai/models/filesignedurl.py deleted file mode 100644 index 092be7f8..00000000 --- a/src/mistralai/models/filesignedurl.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing_extensions import TypedDict - - -class FileSignedURLTypedDict(TypedDict): - url: str - - -class FileSignedURL(BaseModel): - url: str diff --git a/src/mistralai/models/fimcompletionrequest.py b/src/mistralai/models/fimcompletionrequest.py deleted file mode 100644 index 06210139..00000000 --- a/src/mistralai/models/fimcompletionrequest.py +++ /dev/null @@ -1,125 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -FIMCompletionRequestStopTypedDict = TypeAliasType( - "FIMCompletionRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -FIMCompletionRequestStop = TypeAliasType( - "FIMCompletionRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -class FIMCompletionRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use. Only compatible for now with: - - `codestral-2405` - - `codestral-latest` - """ - prompt: str - r"""The text/code to complete.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - stop: NotRequired[FIMCompletionRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - suffix: NotRequired[Nullable[str]] - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - min_tokens: NotRequired[Nullable[int]] - r"""The minimum number of tokens to generate in the completion.""" - - -class FIMCompletionRequest(BaseModel): - model: str - r"""ID of the model to use. Only compatible for now with: - - `codestral-2405` - - `codestral-latest` - """ - - prompt: str - r"""The text/code to complete.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = 1 - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = False - r"""Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.""" - - stop: Optional[FIMCompletionRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - suffix: OptionalNullable[str] = UNSET - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - - min_tokens: OptionalNullable[int] = UNSET - r"""The minimum number of tokens to generate in the completion.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "suffix", - "min_tokens", - ] - nullable_fields = [ - "temperature", - "max_tokens", - "random_seed", - "suffix", - "min_tokens", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/fimcompletionresponse.py b/src/mistralai/models/fimcompletionresponse.py deleted file mode 100644 index f27972b9..00000000 --- a/src/mistralai/models/fimcompletionresponse.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .chatcompletionchoice import ChatCompletionChoice, ChatCompletionChoiceTypedDict -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class FIMCompletionResponseTypedDict(TypedDict): - id: str - object: str - model: str - usage: UsageInfoTypedDict - created: int - choices: List[ChatCompletionChoiceTypedDict] - - -class FIMCompletionResponse(BaseModel): - id: str - - object: str - - model: str - - usage: UsageInfo - - created: int - - choices: List[ChatCompletionChoice] diff --git a/src/mistralai/models/fimcompletionstreamrequest.py b/src/mistralai/models/fimcompletionstreamrequest.py deleted file mode 100644 index 05cc345b..00000000 --- a/src/mistralai/models/fimcompletionstreamrequest.py +++ /dev/null @@ -1,123 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -FIMCompletionStreamRequestStopTypedDict = TypeAliasType( - "FIMCompletionStreamRequestStopTypedDict", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -FIMCompletionStreamRequestStop = TypeAliasType( - "FIMCompletionStreamRequestStop", Union[str, List[str]] -) -r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - -class FIMCompletionStreamRequestTypedDict(TypedDict): - model: str - r"""ID of the model to use. Only compatible for now with: - - `codestral-2405` - - `codestral-latest` - """ - prompt: str - r"""The text/code to complete.""" - temperature: NotRequired[Nullable[float]] - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - top_p: NotRequired[float] - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - max_tokens: NotRequired[Nullable[int]] - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - stream: NotRequired[bool] - stop: NotRequired[FIMCompletionStreamRequestStopTypedDict] - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - random_seed: NotRequired[Nullable[int]] - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - suffix: NotRequired[Nullable[str]] - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - min_tokens: NotRequired[Nullable[int]] - r"""The minimum number of tokens to generate in the completion.""" - - -class FIMCompletionStreamRequest(BaseModel): - model: str - r"""ID of the model to use. Only compatible for now with: - - `codestral-2405` - - `codestral-latest` - """ - - prompt: str - r"""The text/code to complete.""" - - temperature: OptionalNullable[float] = UNSET - r"""What sampling temperature to use, we recommend between 0.0 and 0.7. Higher values like 0.7 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. The default value varies depending on the model you are targeting. Call the `/models` endpoint to retrieve the appropriate value.""" - - top_p: Optional[float] = 1 - r"""Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.""" - - max_tokens: OptionalNullable[int] = UNSET - r"""The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length.""" - - stream: Optional[bool] = True - - stop: Optional[FIMCompletionStreamRequestStop] = None - r"""Stop generation if this token is detected. Or if one of these tokens is detected when providing an array""" - - random_seed: OptionalNullable[int] = UNSET - r"""The seed to use for random sampling. If set, different calls will generate deterministic results.""" - - suffix: OptionalNullable[str] = UNSET - r"""Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`.""" - - min_tokens: OptionalNullable[int] = UNSET - r"""The minimum number of tokens to generate in the completion.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "temperature", - "top_p", - "max_tokens", - "stream", - "stop", - "random_seed", - "suffix", - "min_tokens", - ] - nullable_fields = [ - "temperature", - "max_tokens", - "random_seed", - "suffix", - "min_tokens", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/finetuneablemodeltype.py b/src/mistralai/models/finetuneablemodeltype.py deleted file mode 100644 index 3507dc91..00000000 --- a/src/mistralai/models/finetuneablemodeltype.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -FineTuneableModelType = Literal["completion", "classifier"] diff --git a/src/mistralai/models/ftclassifierlossfunction.py b/src/mistralai/models/ftclassifierlossfunction.py deleted file mode 100644 index df2d19ff..00000000 --- a/src/mistralai/models/ftclassifierlossfunction.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -FTClassifierLossFunction = Literal["single_class", "multi_class"] diff --git a/src/mistralai/models/ftmodelcapabilitiesout.py b/src/mistralai/models/ftmodelcapabilitiesout.py deleted file mode 100644 index 7f3aa18b..00000000 --- a/src/mistralai/models/ftmodelcapabilitiesout.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class FTModelCapabilitiesOutTypedDict(TypedDict): - completion_chat: NotRequired[bool] - completion_fim: NotRequired[bool] - function_calling: NotRequired[bool] - fine_tuning: NotRequired[bool] - classification: NotRequired[bool] - - -class FTModelCapabilitiesOut(BaseModel): - completion_chat: Optional[bool] = True - - completion_fim: Optional[bool] = False - - function_calling: Optional[bool] = False - - fine_tuning: Optional[bool] = False - - classification: Optional[bool] = False diff --git a/src/mistralai/models/ftmodelcard.py b/src/mistralai/models/ftmodelcard.py deleted file mode 100644 index 7159ce00..00000000 --- a/src/mistralai/models/ftmodelcard.py +++ /dev/null @@ -1,126 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .modelcapabilities import ModelCapabilities, ModelCapabilitiesTypedDict -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import validate_const -import pydantic -from pydantic import model_serializer -from pydantic.functional_validators import AfterValidator -from typing import List, Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -FTModelCardType = Literal["fine-tuned"] - - -class FTModelCardTypedDict(TypedDict): - r"""Extra fields for fine-tuned models.""" - - id: str - capabilities: ModelCapabilitiesTypedDict - job: str - root: str - object: NotRequired[str] - created: NotRequired[int] - owned_by: NotRequired[str] - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - max_context_length: NotRequired[int] - aliases: NotRequired[List[str]] - deprecation: NotRequired[Nullable[datetime]] - deprecation_replacement_model: NotRequired[Nullable[str]] - default_model_temperature: NotRequired[Nullable[float]] - type: FTModelCardType - archived: NotRequired[bool] - - -class FTModelCard(BaseModel): - r"""Extra fields for fine-tuned models.""" - - id: str - - capabilities: ModelCapabilities - - job: str - - root: str - - object: Optional[str] = "model" - - created: Optional[int] = None - - owned_by: Optional[str] = "mistralai" - - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - max_context_length: Optional[int] = 32768 - - aliases: Optional[List[str]] = None - - deprecation: OptionalNullable[datetime] = UNSET - - deprecation_replacement_model: OptionalNullable[str] = UNSET - - default_model_temperature: OptionalNullable[float] = UNSET - - TYPE: Annotated[ - Annotated[ - Optional[FTModelCardType], AfterValidator(validate_const("fine-tuned")) - ], - pydantic.Field(alias="type"), - ] = "fine-tuned" - - archived: Optional[bool] = False - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "object", - "created", - "owned_by", - "name", - "description", - "max_context_length", - "aliases", - "deprecation", - "deprecation_replacement_model", - "default_model_temperature", - "type", - "archived", - ] - nullable_fields = [ - "name", - "description", - "deprecation", - "deprecation_replacement_model", - "default_model_temperature", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/function.py b/src/mistralai/models/function.py deleted file mode 100644 index 7d40cf75..00000000 --- a/src/mistralai/models/function.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Any, Dict, Optional -from typing_extensions import NotRequired, TypedDict - - -class FunctionTypedDict(TypedDict): - name: str - parameters: Dict[str, Any] - description: NotRequired[str] - strict: NotRequired[bool] - - -class Function(BaseModel): - name: str - - parameters: Dict[str, Any] - - description: Optional[str] = None - - strict: Optional[bool] = None diff --git a/src/mistralai/models/functioncall.py b/src/mistralai/models/functioncall.py deleted file mode 100644 index 0cce622a..00000000 --- a/src/mistralai/models/functioncall.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Any, Dict, Union -from typing_extensions import TypeAliasType, TypedDict - - -ArgumentsTypedDict = TypeAliasType("ArgumentsTypedDict", Union[Dict[str, Any], str]) - - -Arguments = TypeAliasType("Arguments", Union[Dict[str, Any], str]) - - -class FunctionCallTypedDict(TypedDict): - name: str - arguments: ArgumentsTypedDict - - -class FunctionCall(BaseModel): - name: str - - arguments: Arguments diff --git a/src/mistralai/models/functioncallentry.py b/src/mistralai/models/functioncallentry.py deleted file mode 100644 index 1e47fda9..00000000 --- a/src/mistralai/models/functioncallentry.py +++ /dev/null @@ -1,76 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .functioncallentryarguments import ( - FunctionCallEntryArguments, - FunctionCallEntryArgumentsTypedDict, -) -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -FunctionCallEntryObject = Literal["entry"] - -FunctionCallEntryType = Literal["function.call"] - - -class FunctionCallEntryTypedDict(TypedDict): - tool_call_id: str - name: str - arguments: FunctionCallEntryArgumentsTypedDict - object: NotRequired[FunctionCallEntryObject] - type: NotRequired[FunctionCallEntryType] - created_at: NotRequired[datetime] - completed_at: NotRequired[Nullable[datetime]] - id: NotRequired[str] - - -class FunctionCallEntry(BaseModel): - tool_call_id: str - - name: str - - arguments: FunctionCallEntryArguments - - object: Optional[FunctionCallEntryObject] = "entry" - - type: Optional[FunctionCallEntryType] = "function.call" - - created_at: Optional[datetime] = None - - completed_at: OptionalNullable[datetime] = UNSET - - id: Optional[str] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["object", "type", "created_at", "completed_at", "id"] - nullable_fields = ["completed_at"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/functioncallevent.py b/src/mistralai/models/functioncallevent.py deleted file mode 100644 index 90b4b226..00000000 --- a/src/mistralai/models/functioncallevent.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -FunctionCallEventType = Literal["function.call.delta"] - - -class FunctionCallEventTypedDict(TypedDict): - id: str - name: str - tool_call_id: str - arguments: str - type: NotRequired[FunctionCallEventType] - created_at: NotRequired[datetime] - output_index: NotRequired[int] - - -class FunctionCallEvent(BaseModel): - id: str - - name: str - - tool_call_id: str - - arguments: str - - type: Optional[FunctionCallEventType] = "function.call.delta" - - created_at: Optional[datetime] = None - - output_index: Optional[int] = 0 diff --git a/src/mistralai/models/functionname.py b/src/mistralai/models/functionname.py deleted file mode 100644 index 0a6c0b14..00000000 --- a/src/mistralai/models/functionname.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing_extensions import TypedDict - - -class FunctionNameTypedDict(TypedDict): - r"""this restriction of `Function` is used to select a specific function to call""" - - name: str - - -class FunctionName(BaseModel): - r"""this restriction of `Function` is used to select a specific function to call""" - - name: str diff --git a/src/mistralai/models/functionresultentry.py b/src/mistralai/models/functionresultentry.py deleted file mode 100644 index f09e11ae..00000000 --- a/src/mistralai/models/functionresultentry.py +++ /dev/null @@ -1,69 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -FunctionResultEntryObject = Literal["entry"] - -FunctionResultEntryType = Literal["function.result"] - - -class FunctionResultEntryTypedDict(TypedDict): - tool_call_id: str - result: str - object: NotRequired[FunctionResultEntryObject] - type: NotRequired[FunctionResultEntryType] - created_at: NotRequired[datetime] - completed_at: NotRequired[Nullable[datetime]] - id: NotRequired[str] - - -class FunctionResultEntry(BaseModel): - tool_call_id: str - - result: str - - object: Optional[FunctionResultEntryObject] = "entry" - - type: Optional[FunctionResultEntryType] = "function.result" - - created_at: Optional[datetime] = None - - completed_at: OptionalNullable[datetime] = UNSET - - id: Optional[str] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["object", "type", "created_at", "completed_at", "id"] - nullable_fields = ["completed_at"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/functiontool.py b/src/mistralai/models/functiontool.py deleted file mode 100644 index 7ce5c464..00000000 --- a/src/mistralai/models/functiontool.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .function import Function, FunctionTypedDict -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -FunctionToolType = Literal["function"] - - -class FunctionToolTypedDict(TypedDict): - function: FunctionTypedDict - type: NotRequired[FunctionToolType] - - -class FunctionTool(BaseModel): - function: Function - - type: Optional[FunctionToolType] = "function" diff --git a/src/mistralai/models/githubrepositoryin.py b/src/mistralai/models/githubrepositoryin.py deleted file mode 100644 index 801c0540..00000000 --- a/src/mistralai/models/githubrepositoryin.py +++ /dev/null @@ -1,63 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -GithubRepositoryInType = Literal["github"] - - -class GithubRepositoryInTypedDict(TypedDict): - name: str - owner: str - token: str - type: NotRequired[GithubRepositoryInType] - ref: NotRequired[Nullable[str]] - weight: NotRequired[float] - - -class GithubRepositoryIn(BaseModel): - name: str - - owner: str - - token: str - - type: Optional[GithubRepositoryInType] = "github" - - ref: OptionalNullable[str] = UNSET - - weight: Optional[float] = 1 - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "ref", "weight"] - nullable_fields = ["ref"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/githubrepositoryout.py b/src/mistralai/models/githubrepositoryout.py deleted file mode 100644 index 0d74c17a..00000000 --- a/src/mistralai/models/githubrepositoryout.py +++ /dev/null @@ -1,63 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -GithubRepositoryOutType = Literal["github"] - - -class GithubRepositoryOutTypedDict(TypedDict): - name: str - owner: str - commit_id: str - type: NotRequired[GithubRepositoryOutType] - ref: NotRequired[Nullable[str]] - weight: NotRequired[float] - - -class GithubRepositoryOut(BaseModel): - name: str - - owner: str - - commit_id: str - - type: Optional[GithubRepositoryOutType] = "github" - - ref: OptionalNullable[str] = UNSET - - weight: Optional[float] = 1 - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "ref", "weight"] - nullable_fields = ["ref"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/httpvalidationerror.py b/src/mistralai/models/httpvalidationerror.py deleted file mode 100644 index e9136063..00000000 --- a/src/mistralai/models/httpvalidationerror.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .validationerror import ValidationError -import httpx -from mistralai.models import MistralError -from mistralai.types import BaseModel -from typing import List, Optional - - -class HTTPValidationErrorData(BaseModel): - detail: Optional[List[ValidationError]] = None - - -class HTTPValidationError(MistralError): - data: HTTPValidationErrorData - - def __init__( - self, - data: HTTPValidationErrorData, - raw_response: httpx.Response, - body: Optional[str] = None, - ): - message = body or raw_response.text - super().__init__(message, raw_response, body) - self.data = data diff --git a/src/mistralai/models/imagegenerationtool.py b/src/mistralai/models/imagegenerationtool.py deleted file mode 100644 index 27bb2d12..00000000 --- a/src/mistralai/models/imagegenerationtool.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ImageGenerationToolType = Literal["image_generation"] - - -class ImageGenerationToolTypedDict(TypedDict): - type: NotRequired[ImageGenerationToolType] - - -class ImageGenerationTool(BaseModel): - type: Optional[ImageGenerationToolType] = "image_generation" diff --git a/src/mistralai/models/imageurl.py b/src/mistralai/models/imageurl.py deleted file mode 100644 index 6f077b69..00000000 --- a/src/mistralai/models/imageurl.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class ImageURLTypedDict(TypedDict): - url: str - detail: NotRequired[Nullable[str]] - - -class ImageURL(BaseModel): - url: str - - detail: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["detail"] - nullable_fields = ["detail"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/imageurlchunk.py b/src/mistralai/models/imageurlchunk.py deleted file mode 100644 index 498690f5..00000000 --- a/src/mistralai/models/imageurlchunk.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .imageurl import ImageURL, ImageURLTypedDict -from mistralai.types import BaseModel -from typing import Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ImageURLChunkImageURLTypedDict = TypeAliasType( - "ImageURLChunkImageURLTypedDict", Union[ImageURLTypedDict, str] -) - - -ImageURLChunkImageURL = TypeAliasType("ImageURLChunkImageURL", Union[ImageURL, str]) - - -ImageURLChunkType = Literal["image_url"] - - -class ImageURLChunkTypedDict(TypedDict): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURLTypedDict - type: NotRequired[ImageURLChunkType] - - -class ImageURLChunk(BaseModel): - r"""{\"type\":\"image_url\",\"image_url\":{\"url\":\"data:image/png;base64,iVBORw0""" - - image_url: ImageURLChunkImageURL - - type: Optional[ImageURLChunkType] = "image_url" diff --git a/src/mistralai/models/inputs.py b/src/mistralai/models/inputs.py deleted file mode 100644 index 34d20f34..00000000 --- a/src/mistralai/models/inputs.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .instructrequest import InstructRequest, InstructRequestTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai.types import BaseModel -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import List, Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -InstructRequestInputsMessagesTypedDict = TypeAliasType( - "InstructRequestInputsMessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -InstructRequestInputsMessages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -class InstructRequestInputsTypedDict(TypedDict): - messages: List[InstructRequestInputsMessagesTypedDict] - - -class InstructRequestInputs(BaseModel): - messages: List[InstructRequestInputsMessages] - - -InputsTypedDict = TypeAliasType( - "InputsTypedDict", - Union[InstructRequestInputsTypedDict, List[InstructRequestTypedDict]], -) -r"""Chat to classify""" - - -Inputs = TypeAliasType("Inputs", Union[InstructRequestInputs, List[InstructRequest]]) -r"""Chat to classify""" diff --git a/src/mistralai/models/instructrequest.py b/src/mistralai/models/instructrequest.py deleted file mode 100644 index dddbda00..00000000 --- a/src/mistralai/models/instructrequest.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .assistantmessage import AssistantMessage, AssistantMessageTypedDict -from .systemmessage import SystemMessage, SystemMessageTypedDict -from .toolmessage import ToolMessage, ToolMessageTypedDict -from .usermessage import UserMessage, UserMessageTypedDict -from mistralai.types import BaseModel -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import List, Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -InstructRequestMessagesTypedDict = TypeAliasType( - "InstructRequestMessagesTypedDict", - Union[ - SystemMessageTypedDict, - UserMessageTypedDict, - AssistantMessageTypedDict, - ToolMessageTypedDict, - ], -) - - -InstructRequestMessages = Annotated[ - Union[ - Annotated[AssistantMessage, Tag("assistant")], - Annotated[SystemMessage, Tag("system")], - Annotated[ToolMessage, Tag("tool")], - Annotated[UserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] - - -class InstructRequestTypedDict(TypedDict): - messages: List[InstructRequestMessagesTypedDict] - - -class InstructRequest(BaseModel): - messages: List[InstructRequestMessages] diff --git a/src/mistralai/models/jobin.py b/src/mistralai/models/jobin.py deleted file mode 100644 index aa0cd06c..00000000 --- a/src/mistralai/models/jobin.py +++ /dev/null @@ -1,141 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifiertargetin import ClassifierTargetIn, ClassifierTargetInTypedDict -from .classifiertrainingparametersin import ( - ClassifierTrainingParametersIn, - ClassifierTrainingParametersInTypedDict, -) -from .completiontrainingparametersin import ( - CompletionTrainingParametersIn, - CompletionTrainingParametersInTypedDict, -) -from .finetuneablemodeltype import FineTuneableModelType -from .githubrepositoryin import GithubRepositoryIn, GithubRepositoryInTypedDict -from .trainingfile import TrainingFile, TrainingFileTypedDict -from .wandbintegration import WandbIntegration, WandbIntegrationTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -JobInIntegrationsTypedDict = WandbIntegrationTypedDict - - -JobInIntegrations = WandbIntegration - - -HyperparametersTypedDict = TypeAliasType( - "HyperparametersTypedDict", - Union[ - ClassifierTrainingParametersInTypedDict, CompletionTrainingParametersInTypedDict - ], -) - - -Hyperparameters = TypeAliasType( - "Hyperparameters", - Union[ClassifierTrainingParametersIn, CompletionTrainingParametersIn], -) - - -JobInRepositoriesTypedDict = GithubRepositoryInTypedDict - - -JobInRepositories = GithubRepositoryIn - - -class JobInTypedDict(TypedDict): - model: str - r"""The name of the model to fine-tune.""" - hyperparameters: HyperparametersTypedDict - training_files: NotRequired[List[TrainingFileTypedDict]] - validation_files: NotRequired[Nullable[List[str]]] - r"""A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files.""" - suffix: NotRequired[Nullable[str]] - r"""A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...`""" - integrations: NotRequired[Nullable[List[JobInIntegrationsTypedDict]]] - r"""A list of integrations to enable for your fine-tuning job.""" - auto_start: NotRequired[bool] - r"""This field will be required in a future release.""" - invalid_sample_skip_percentage: NotRequired[float] - job_type: NotRequired[Nullable[FineTuneableModelType]] - repositories: NotRequired[Nullable[List[JobInRepositoriesTypedDict]]] - classifier_targets: NotRequired[Nullable[List[ClassifierTargetInTypedDict]]] - - -class JobIn(BaseModel): - model: str - r"""The name of the model to fine-tune.""" - - hyperparameters: Hyperparameters - - training_files: Optional[List[TrainingFile]] = None - - validation_files: OptionalNullable[List[str]] = UNSET - r"""A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files.""" - - suffix: OptionalNullable[str] = UNSET - r"""A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...`""" - - integrations: OptionalNullable[List[JobInIntegrations]] = UNSET - r"""A list of integrations to enable for your fine-tuning job.""" - - auto_start: Optional[bool] = None - r"""This field will be required in a future release.""" - - invalid_sample_skip_percentage: Optional[float] = 0 - - job_type: OptionalNullable[FineTuneableModelType] = UNSET - - repositories: OptionalNullable[List[JobInRepositories]] = UNSET - - classifier_targets: OptionalNullable[List[ClassifierTargetIn]] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "training_files", - "validation_files", - "suffix", - "integrations", - "auto_start", - "invalid_sample_skip_percentage", - "job_type", - "repositories", - "classifier_targets", - ] - nullable_fields = [ - "validation_files", - "suffix", - "integrations", - "job_type", - "repositories", - "classifier_targets", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/jobmetadataout.py b/src/mistralai/models/jobmetadataout.py deleted file mode 100644 index 10ef781e..00000000 --- a/src/mistralai/models/jobmetadataout.py +++ /dev/null @@ -1,78 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class JobMetadataOutTypedDict(TypedDict): - expected_duration_seconds: NotRequired[Nullable[int]] - cost: NotRequired[Nullable[float]] - cost_currency: NotRequired[Nullable[str]] - train_tokens_per_step: NotRequired[Nullable[int]] - train_tokens: NotRequired[Nullable[int]] - data_tokens: NotRequired[Nullable[int]] - estimated_start_time: NotRequired[Nullable[int]] - - -class JobMetadataOut(BaseModel): - expected_duration_seconds: OptionalNullable[int] = UNSET - - cost: OptionalNullable[float] = UNSET - - cost_currency: OptionalNullable[str] = UNSET - - train_tokens_per_step: OptionalNullable[int] = UNSET - - train_tokens: OptionalNullable[int] = UNSET - - data_tokens: OptionalNullable[int] = UNSET - - estimated_start_time: OptionalNullable[int] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "expected_duration_seconds", - "cost", - "cost_currency", - "train_tokens_per_step", - "train_tokens", - "data_tokens", - "estimated_start_time", - ] - nullable_fields = [ - "expected_duration_seconds", - "cost", - "cost_currency", - "train_tokens_per_step", - "train_tokens", - "data_tokens", - "estimated_start_time", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/jobs_api_routes_batch_cancel_batch_jobop.py b/src/mistralai/models/jobs_api_routes_batch_cancel_batch_jobop.py deleted file mode 100644 index 5b83d534..00000000 --- a/src/mistralai/models/jobs_api_routes_batch_cancel_batch_jobop.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class JobsAPIRoutesBatchCancelBatchJobRequestTypedDict(TypedDict): - job_id: str - - -class JobsAPIRoutesBatchCancelBatchJobRequest(BaseModel): - job_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/jobs_api_routes_batch_get_batch_jobop.py b/src/mistralai/models/jobs_api_routes_batch_get_batch_jobop.py deleted file mode 100644 index d9c7b398..00000000 --- a/src/mistralai/models/jobs_api_routes_batch_get_batch_jobop.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class JobsAPIRoutesBatchGetBatchJobRequestTypedDict(TypedDict): - job_id: str - - -class JobsAPIRoutesBatchGetBatchJobRequest(BaseModel): - job_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py b/src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py deleted file mode 100644 index c48246d5..00000000 --- a/src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +++ /dev/null @@ -1,102 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .batchjobstatus import BatchJobStatus -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import FieldMetadata, QueryParamMetadata -from pydantic import model_serializer -from typing import Any, Dict, List, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class JobsAPIRoutesBatchGetBatchJobsRequestTypedDict(TypedDict): - page: NotRequired[int] - page_size: NotRequired[int] - model: NotRequired[Nullable[str]] - agent_id: NotRequired[Nullable[str]] - metadata: NotRequired[Nullable[Dict[str, Any]]] - created_after: NotRequired[Nullable[datetime]] - created_by_me: NotRequired[bool] - status: NotRequired[Nullable[List[BatchJobStatus]]] - - -class JobsAPIRoutesBatchGetBatchJobsRequest(BaseModel): - page: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 0 - - page_size: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 100 - - model: Annotated[ - OptionalNullable[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - agent_id: Annotated[ - OptionalNullable[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - metadata: Annotated[ - OptionalNullable[Dict[str, Any]], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - created_after: Annotated[ - OptionalNullable[datetime], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - created_by_me: Annotated[ - Optional[bool], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = False - - status: Annotated[ - OptionalNullable[List[BatchJobStatus]], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "page", - "page_size", - "model", - "agent_id", - "metadata", - "created_after", - "created_by_me", - "status", - ] - nullable_fields = ["model", "agent_id", "metadata", "created_after", "status"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py b/src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py deleted file mode 100644 index ceb19a69..00000000 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifierdetailedjobout import ( - ClassifierDetailedJobOut, - ClassifierDetailedJobOutTypedDict, -) -from .completiondetailedjobout import ( - CompletionDetailedJobOut, - CompletionDetailedJobOutTypedDict, -) -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -class JobsAPIRoutesFineTuningCancelFineTuningJobRequestTypedDict(TypedDict): - job_id: str - r"""The ID of the job to cancel.""" - - -class JobsAPIRoutesFineTuningCancelFineTuningJobRequest(BaseModel): - job_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - r"""The ID of the job to cancel.""" - - -JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict = TypeAliasType( - "JobsAPIRoutesFineTuningCancelFineTuningJobResponseTypedDict", - Union[CompletionDetailedJobOutTypedDict, ClassifierDetailedJobOutTypedDict], -) -r"""OK""" - - -JobsAPIRoutesFineTuningCancelFineTuningJobResponse = Annotated[ - Union[ - Annotated[ClassifierDetailedJobOut, Tag("classifier")], - Annotated[CompletionDetailedJobOut, Tag("completion")], - ], - Discriminator(lambda m: get_discriminator(m, "job_type", "job_type")), -] -r"""OK""" diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py b/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py deleted file mode 100644 index 39af3ea6..00000000 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifierjobout import ClassifierJobOut, ClassifierJobOutTypedDict -from .completionjobout import CompletionJobOut, CompletionJobOutTypedDict -from .legacyjobmetadataout import LegacyJobMetadataOut, LegacyJobMetadataOutTypedDict -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType - - -Response1TypedDict = TypeAliasType( - "Response1TypedDict", Union[ClassifierJobOutTypedDict, CompletionJobOutTypedDict] -) - - -Response1 = Annotated[ - Union[ - Annotated[ClassifierJobOut, Tag("classifier")], - Annotated[CompletionJobOut, Tag("completion")], - ], - Discriminator(lambda m: get_discriminator(m, "job_type", "job_type")), -] - - -JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict = TypeAliasType( - "JobsAPIRoutesFineTuningCreateFineTuningJobResponseTypedDict", - Union[LegacyJobMetadataOutTypedDict, Response1TypedDict], -) -r"""OK""" - - -JobsAPIRoutesFineTuningCreateFineTuningJobResponse = TypeAliasType( - "JobsAPIRoutesFineTuningCreateFineTuningJobResponse", - Union[LegacyJobMetadataOut, Response1], -) -r"""OK""" diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py b/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py deleted file mode 100644 index be99dd2d..00000000 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifierdetailedjobout import ( - ClassifierDetailedJobOut, - ClassifierDetailedJobOutTypedDict, -) -from .completiondetailedjobout import ( - CompletionDetailedJobOut, - CompletionDetailedJobOutTypedDict, -) -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -class JobsAPIRoutesFineTuningGetFineTuningJobRequestTypedDict(TypedDict): - job_id: str - r"""The ID of the job to analyse.""" - - -class JobsAPIRoutesFineTuningGetFineTuningJobRequest(BaseModel): - job_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - r"""The ID of the job to analyse.""" - - -JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict = TypeAliasType( - "JobsAPIRoutesFineTuningGetFineTuningJobResponseTypedDict", - Union[CompletionDetailedJobOutTypedDict, ClassifierDetailedJobOutTypedDict], -) -r"""OK""" - - -JobsAPIRoutesFineTuningGetFineTuningJobResponse = Annotated[ - Union[ - Annotated[ClassifierDetailedJobOut, Tag("classifier")], - Annotated[CompletionDetailedJobOut, Tag("completion")], - ], - Discriminator(lambda m: get_discriminator(m, "job_type", "job_type")), -] -r"""OK""" diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py b/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py deleted file mode 100644 index 9aec8eb2..00000000 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +++ /dev/null @@ -1,156 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import FieldMetadata, QueryParamMetadata -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -QueryParamStatus = Literal[ - "QUEUED", - "STARTED", - "VALIDATING", - "VALIDATED", - "RUNNING", - "FAILED_VALIDATION", - "FAILED", - "SUCCESS", - "CANCELLED", - "CANCELLATION_REQUESTED", -] -r"""The current job state to filter on. When set, the other results are not displayed.""" - - -class JobsAPIRoutesFineTuningGetFineTuningJobsRequestTypedDict(TypedDict): - page: NotRequired[int] - r"""The page number of the results to be returned.""" - page_size: NotRequired[int] - r"""The number of items to return per page.""" - model: NotRequired[Nullable[str]] - r"""The model name used for fine-tuning to filter on. When set, the other results are not displayed.""" - created_after: NotRequired[Nullable[datetime]] - r"""The date/time to filter on. When set, the results for previous creation times are not displayed.""" - created_before: NotRequired[Nullable[datetime]] - created_by_me: NotRequired[bool] - r"""When set, only return results for jobs created by the API caller. Other results are not displayed.""" - status: NotRequired[Nullable[QueryParamStatus]] - r"""The current job state to filter on. When set, the other results are not displayed.""" - wandb_project: NotRequired[Nullable[str]] - r"""The Weights and Biases project to filter on. When set, the other results are not displayed.""" - wandb_name: NotRequired[Nullable[str]] - r"""The Weight and Biases run name to filter on. When set, the other results are not displayed.""" - suffix: NotRequired[Nullable[str]] - r"""The model suffix to filter on. When set, the other results are not displayed.""" - - -class JobsAPIRoutesFineTuningGetFineTuningJobsRequest(BaseModel): - page: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 0 - r"""The page number of the results to be returned.""" - - page_size: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 100 - r"""The number of items to return per page.""" - - model: Annotated[ - OptionalNullable[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - r"""The model name used for fine-tuning to filter on. When set, the other results are not displayed.""" - - created_after: Annotated[ - OptionalNullable[datetime], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - r"""The date/time to filter on. When set, the results for previous creation times are not displayed.""" - - created_before: Annotated[ - OptionalNullable[datetime], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - created_by_me: Annotated[ - Optional[bool], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = False - r"""When set, only return results for jobs created by the API caller. Other results are not displayed.""" - - status: Annotated[ - OptionalNullable[QueryParamStatus], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - r"""The current job state to filter on. When set, the other results are not displayed.""" - - wandb_project: Annotated[ - OptionalNullable[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - r"""The Weights and Biases project to filter on. When set, the other results are not displayed.""" - - wandb_name: Annotated[ - OptionalNullable[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - r"""The Weight and Biases run name to filter on. When set, the other results are not displayed.""" - - suffix: Annotated[ - OptionalNullable[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - r"""The model suffix to filter on. When set, the other results are not displayed.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "page", - "page_size", - "model", - "created_after", - "created_before", - "created_by_me", - "status", - "wandb_project", - "wandb_name", - "suffix", - ] - nullable_fields = [ - "model", - "created_after", - "created_before", - "status", - "wandb_project", - "wandb_name", - "suffix", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py b/src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py deleted file mode 100644 index 8103b67b..00000000 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py +++ /dev/null @@ -1,43 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifierdetailedjobout import ( - ClassifierDetailedJobOut, - ClassifierDetailedJobOutTypedDict, -) -from .completiondetailedjobout import ( - CompletionDetailedJobOut, - CompletionDetailedJobOutTypedDict, -) -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -class JobsAPIRoutesFineTuningStartFineTuningJobRequestTypedDict(TypedDict): - job_id: str - - -class JobsAPIRoutesFineTuningStartFineTuningJobRequest(BaseModel): - job_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - -JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict = TypeAliasType( - "JobsAPIRoutesFineTuningStartFineTuningJobResponseTypedDict", - Union[CompletionDetailedJobOutTypedDict, ClassifierDetailedJobOutTypedDict], -) -r"""OK""" - - -JobsAPIRoutesFineTuningStartFineTuningJobResponse = Annotated[ - Union[ - Annotated[ClassifierDetailedJobOut, Tag("classifier")], - Annotated[CompletionDetailedJobOut, Tag("completion")], - ], - Discriminator(lambda m: get_discriminator(m, "job_type", "job_type")), -] -r"""OK""" diff --git a/src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py b/src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py deleted file mode 100644 index a10528ca..00000000 --- a/src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py +++ /dev/null @@ -1,51 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifierftmodelout import ClassifierFTModelOut, ClassifierFTModelOutTypedDict -from .completionftmodelout import CompletionFTModelOut, CompletionFTModelOutTypedDict -from .updateftmodelin import UpdateFTModelIn, UpdateFTModelInTypedDict -from mistralai.types import BaseModel -from mistralai.utils import ( - FieldMetadata, - PathParamMetadata, - RequestMetadata, - get_discriminator, -) -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -class JobsAPIRoutesFineTuningUpdateFineTunedModelRequestTypedDict(TypedDict): - model_id: str - r"""The ID of the model to update.""" - update_ft_model_in: UpdateFTModelInTypedDict - - -class JobsAPIRoutesFineTuningUpdateFineTunedModelRequest(BaseModel): - model_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - r"""The ID of the model to update.""" - - update_ft_model_in: Annotated[ - UpdateFTModelIn, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - -JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict = TypeAliasType( - "JobsAPIRoutesFineTuningUpdateFineTunedModelResponseTypedDict", - Union[CompletionFTModelOutTypedDict, ClassifierFTModelOutTypedDict], -) -r"""OK""" - - -JobsAPIRoutesFineTuningUpdateFineTunedModelResponse = Annotated[ - Union[ - Annotated[ClassifierFTModelOut, Tag("classifier")], - Annotated[CompletionFTModelOut, Tag("completion")], - ], - Discriminator(lambda m: get_discriminator(m, "model_type", "model_type")), -] -r"""OK""" diff --git a/src/mistralai/models/jobsout.py b/src/mistralai/models/jobsout.py deleted file mode 100644 index abdf18fd..00000000 --- a/src/mistralai/models/jobsout.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .classifierjobout import ClassifierJobOut, ClassifierJobOutTypedDict -from .completionjobout import CompletionJobOut, CompletionJobOutTypedDict -from mistralai.types import BaseModel -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -JobsOutDataTypedDict = TypeAliasType( - "JobsOutDataTypedDict", Union[ClassifierJobOutTypedDict, CompletionJobOutTypedDict] -) - - -JobsOutData = Annotated[ - Union[ - Annotated[ClassifierJobOut, Tag("classifier")], - Annotated[CompletionJobOut, Tag("completion")], - ], - Discriminator(lambda m: get_discriminator(m, "job_type", "job_type")), -] - - -JobsOutObject = Literal["list"] - - -class JobsOutTypedDict(TypedDict): - total: int - data: NotRequired[List[JobsOutDataTypedDict]] - object: NotRequired[JobsOutObject] - - -class JobsOut(BaseModel): - total: int - - data: Optional[List[JobsOutData]] = None - - object: Optional[JobsOutObject] = "list" diff --git a/src/mistralai/models/jsonschema.py b/src/mistralai/models/jsonschema.py deleted file mode 100644 index e2b6a45e..00000000 --- a/src/mistralai/models/jsonschema.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -import pydantic -from pydantic import model_serializer -from typing import Any, Dict, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class JSONSchemaTypedDict(TypedDict): - name: str - schema_definition: Dict[str, Any] - description: NotRequired[Nullable[str]] - strict: NotRequired[bool] - - -class JSONSchema(BaseModel): - name: str - - schema_definition: Annotated[Dict[str, Any], pydantic.Field(alias="schema")] - - description: OptionalNullable[str] = UNSET - - strict: Optional[bool] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["description", "strict"] - nullable_fields = ["description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/legacyjobmetadataout.py b/src/mistralai/models/legacyjobmetadataout.py deleted file mode 100644 index d878173b..00000000 --- a/src/mistralai/models/legacyjobmetadataout.py +++ /dev/null @@ -1,119 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -LegacyJobMetadataOutObject = Literal["job.metadata"] - - -class LegacyJobMetadataOutTypedDict(TypedDict): - details: str - expected_duration_seconds: NotRequired[Nullable[int]] - r"""The approximated time (in seconds) for the fine-tuning process to complete.""" - cost: NotRequired[Nullable[float]] - r"""The cost of the fine-tuning job.""" - cost_currency: NotRequired[Nullable[str]] - r"""The currency used for the fine-tuning job cost.""" - train_tokens_per_step: NotRequired[Nullable[int]] - r"""The number of tokens consumed by one training step.""" - train_tokens: NotRequired[Nullable[int]] - r"""The total number of tokens used during the fine-tuning process.""" - data_tokens: NotRequired[Nullable[int]] - r"""The total number of tokens in the training dataset.""" - estimated_start_time: NotRequired[Nullable[int]] - deprecated: NotRequired[bool] - epochs: NotRequired[Nullable[float]] - r"""The number of complete passes through the entire training dataset.""" - training_steps: NotRequired[Nullable[int]] - r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" - object: NotRequired[LegacyJobMetadataOutObject] - - -class LegacyJobMetadataOut(BaseModel): - details: str - - expected_duration_seconds: OptionalNullable[int] = UNSET - r"""The approximated time (in seconds) for the fine-tuning process to complete.""" - - cost: OptionalNullable[float] = UNSET - r"""The cost of the fine-tuning job.""" - - cost_currency: OptionalNullable[str] = UNSET - r"""The currency used for the fine-tuning job cost.""" - - train_tokens_per_step: OptionalNullable[int] = UNSET - r"""The number of tokens consumed by one training step.""" - - train_tokens: OptionalNullable[int] = UNSET - r"""The total number of tokens used during the fine-tuning process.""" - - data_tokens: OptionalNullable[int] = UNSET - r"""The total number of tokens in the training dataset.""" - - estimated_start_time: OptionalNullable[int] = UNSET - - deprecated: Optional[bool] = True - - epochs: OptionalNullable[float] = UNSET - r"""The number of complete passes through the entire training dataset.""" - - training_steps: OptionalNullable[int] = UNSET - r"""The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset.""" - - object: Optional[LegacyJobMetadataOutObject] = "job.metadata" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "expected_duration_seconds", - "cost", - "cost_currency", - "train_tokens_per_step", - "train_tokens", - "data_tokens", - "estimated_start_time", - "deprecated", - "epochs", - "training_steps", - "object", - ] - nullable_fields = [ - "expected_duration_seconds", - "cost", - "cost_currency", - "train_tokens_per_step", - "train_tokens", - "data_tokens", - "estimated_start_time", - "epochs", - "training_steps", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/libraries_delete_v1op.py b/src/mistralai/models/libraries_delete_v1op.py deleted file mode 100644 index 56f8f8a8..00000000 --- a/src/mistralai/models/libraries_delete_v1op.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class LibrariesDeleteV1RequestTypedDict(TypedDict): - library_id: str - - -class LibrariesDeleteV1Request(BaseModel): - library_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/libraries_documents_get_text_content_v1op.py b/src/mistralai/models/libraries_documents_get_text_content_v1op.py deleted file mode 100644 index 21a131ad..00000000 --- a/src/mistralai/models/libraries_documents_get_text_content_v1op.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class LibrariesDocumentsGetTextContentV1RequestTypedDict(TypedDict): - library_id: str - document_id: str - - -class LibrariesDocumentsGetTextContentV1Request(BaseModel): - library_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - document_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/libraries_documents_list_v1op.py b/src/mistralai/models/libraries_documents_list_v1op.py deleted file mode 100644 index 04a3ed25..00000000 --- a/src/mistralai/models/libraries_documents_list_v1op.py +++ /dev/null @@ -1,78 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class LibrariesDocumentsListV1RequestTypedDict(TypedDict): - library_id: str - search: NotRequired[Nullable[str]] - page_size: NotRequired[int] - page: NotRequired[int] - sort_by: NotRequired[str] - sort_order: NotRequired[str] - - -class LibrariesDocumentsListV1Request(BaseModel): - library_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - search: Annotated[ - OptionalNullable[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = UNSET - - page_size: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 100 - - page: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = 0 - - sort_by: Annotated[ - Optional[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = "created_at" - - sort_order: Annotated[ - Optional[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = "desc" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["search", "page_size", "page", "sort_by", "sort_order"] - nullable_fields = ["search"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/libraries_documents_update_v1op.py b/src/mistralai/models/libraries_documents_update_v1op.py deleted file mode 100644 index 5551d5ee..00000000 --- a/src/mistralai/models/libraries_documents_update_v1op.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .documentupdatein import DocumentUpdateIn, DocumentUpdateInTypedDict -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata -from typing_extensions import Annotated, TypedDict - - -class LibrariesDocumentsUpdateV1RequestTypedDict(TypedDict): - library_id: str - document_id: str - document_update_in: DocumentUpdateInTypedDict - - -class LibrariesDocumentsUpdateV1Request(BaseModel): - library_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - document_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - document_update_in: Annotated[ - DocumentUpdateIn, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] diff --git a/src/mistralai/models/libraries_get_v1op.py b/src/mistralai/models/libraries_get_v1op.py deleted file mode 100644 index b87090f6..00000000 --- a/src/mistralai/models/libraries_get_v1op.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class LibrariesGetV1RequestTypedDict(TypedDict): - library_id: str - - -class LibrariesGetV1Request(BaseModel): - library_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/libraries_share_create_v1op.py b/src/mistralai/models/libraries_share_create_v1op.py deleted file mode 100644 index a8b0e35d..00000000 --- a/src/mistralai/models/libraries_share_create_v1op.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .sharingin import SharingIn, SharingInTypedDict -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata -from typing_extensions import Annotated, TypedDict - - -class LibrariesShareCreateV1RequestTypedDict(TypedDict): - library_id: str - sharing_in: SharingInTypedDict - - -class LibrariesShareCreateV1Request(BaseModel): - library_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - sharing_in: Annotated[ - SharingIn, FieldMetadata(request=RequestMetadata(media_type="application/json")) - ] diff --git a/src/mistralai/models/libraries_share_list_v1op.py b/src/mistralai/models/libraries_share_list_v1op.py deleted file mode 100644 index b276d756..00000000 --- a/src/mistralai/models/libraries_share_list_v1op.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata -from typing_extensions import Annotated, TypedDict - - -class LibrariesShareListV1RequestTypedDict(TypedDict): - library_id: str - - -class LibrariesShareListV1Request(BaseModel): - library_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] diff --git a/src/mistralai/models/libraries_update_v1op.py b/src/mistralai/models/libraries_update_v1op.py deleted file mode 100644 index c93895d9..00000000 --- a/src/mistralai/models/libraries_update_v1op.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .libraryinupdate import LibraryInUpdate, LibraryInUpdateTypedDict -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, RequestMetadata -from typing_extensions import Annotated, TypedDict - - -class LibrariesUpdateV1RequestTypedDict(TypedDict): - library_id: str - library_in_update: LibraryInUpdateTypedDict - - -class LibrariesUpdateV1Request(BaseModel): - library_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - library_in_update: Annotated[ - LibraryInUpdate, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] diff --git a/src/mistralai/models/libraryin.py b/src/mistralai/models/libraryin.py deleted file mode 100644 index 872d494d..00000000 --- a/src/mistralai/models/libraryin.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class LibraryInTypedDict(TypedDict): - name: str - description: NotRequired[Nullable[str]] - chunk_size: NotRequired[Nullable[int]] - - -class LibraryIn(BaseModel): - name: str - - description: OptionalNullable[str] = UNSET - - chunk_size: OptionalNullable[int] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["description", "chunk_size"] - nullable_fields = ["description", "chunk_size"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/libraryinupdate.py b/src/mistralai/models/libraryinupdate.py deleted file mode 100644 index 6e8ab81a..00000000 --- a/src/mistralai/models/libraryinupdate.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class LibraryInUpdateTypedDict(TypedDict): - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - - -class LibraryInUpdate(BaseModel): - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["name", "description"] - nullable_fields = ["name", "description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/libraryout.py b/src/mistralai/models/libraryout.py deleted file mode 100644 index 6a13130d..00000000 --- a/src/mistralai/models/libraryout.py +++ /dev/null @@ -1,107 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class LibraryOutTypedDict(TypedDict): - id: str - name: str - created_at: datetime - updated_at: datetime - owner_id: str - owner_type: str - total_size: int - nb_documents: int - chunk_size: Nullable[int] - emoji: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - generated_name: NotRequired[Nullable[str]] - generated_description: NotRequired[Nullable[str]] - explicit_user_members_count: NotRequired[Nullable[int]] - explicit_workspace_members_count: NotRequired[Nullable[int]] - org_sharing_role: NotRequired[Nullable[str]] - - -class LibraryOut(BaseModel): - id: str - - name: str - - created_at: datetime - - updated_at: datetime - - owner_id: str - - owner_type: str - - total_size: int - - nb_documents: int - - chunk_size: Nullable[int] - - emoji: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - generated_name: OptionalNullable[str] = UNSET - - generated_description: OptionalNullable[str] = UNSET - - explicit_user_members_count: OptionalNullable[int] = UNSET - - explicit_workspace_members_count: OptionalNullable[int] = UNSET - - org_sharing_role: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "emoji", - "description", - "generated_name", - "generated_description", - "explicit_user_members_count", - "explicit_workspace_members_count", - "org_sharing_role", - ] - nullable_fields = [ - "chunk_size", - "emoji", - "description", - "generated_name", - "generated_description", - "explicit_user_members_count", - "explicit_workspace_members_count", - "org_sharing_role", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/listdocumentout.py b/src/mistralai/models/listdocumentout.py deleted file mode 100644 index 9d39e087..00000000 --- a/src/mistralai/models/listdocumentout.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .documentout import DocumentOut, DocumentOutTypedDict -from .paginationinfo import PaginationInfo, PaginationInfoTypedDict -from mistralai.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ListDocumentOutTypedDict(TypedDict): - pagination: PaginationInfoTypedDict - data: List[DocumentOutTypedDict] - - -class ListDocumentOut(BaseModel): - pagination: PaginationInfo - - data: List[DocumentOut] diff --git a/src/mistralai/models/listfilesout.py b/src/mistralai/models/listfilesout.py deleted file mode 100644 index b032f632..00000000 --- a/src/mistralai/models/listfilesout.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .fileschema import FileSchema, FileSchemaTypedDict -from mistralai.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ListFilesOutTypedDict(TypedDict): - data: List[FileSchemaTypedDict] - object: str - total: int - - -class ListFilesOut(BaseModel): - data: List[FileSchema] - - object: str - - total: int diff --git a/src/mistralai/models/listlibraryout.py b/src/mistralai/models/listlibraryout.py deleted file mode 100644 index 1e647fe1..00000000 --- a/src/mistralai/models/listlibraryout.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .libraryout import LibraryOut, LibraryOutTypedDict -from mistralai.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ListLibraryOutTypedDict(TypedDict): - data: List[LibraryOutTypedDict] - - -class ListLibraryOut(BaseModel): - data: List[LibraryOut] diff --git a/src/mistralai/models/listsharingout.py b/src/mistralai/models/listsharingout.py deleted file mode 100644 index 38c0dbe0..00000000 --- a/src/mistralai/models/listsharingout.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .sharingout import SharingOut, SharingOutTypedDict -from mistralai.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ListSharingOutTypedDict(TypedDict): - data: List[SharingOutTypedDict] - - -class ListSharingOut(BaseModel): - data: List[SharingOut] diff --git a/src/mistralai/models/messageinputentry.py b/src/mistralai/models/messageinputentry.py deleted file mode 100644 index c14ad5ae..00000000 --- a/src/mistralai/models/messageinputentry.py +++ /dev/null @@ -1,99 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .messageinputcontentchunks import ( - MessageInputContentChunks, - MessageInputContentChunksTypedDict, -) -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -Object = Literal["entry"] - -MessageInputEntryType = Literal["message.input"] - -MessageInputEntryRole = Literal["assistant", "user"] - -MessageInputEntryContentTypedDict = TypeAliasType( - "MessageInputEntryContentTypedDict", - Union[str, List[MessageInputContentChunksTypedDict]], -) - - -MessageInputEntryContent = TypeAliasType( - "MessageInputEntryContent", Union[str, List[MessageInputContentChunks]] -) - - -class MessageInputEntryTypedDict(TypedDict): - r"""Representation of an input message inside the conversation.""" - - role: MessageInputEntryRole - content: MessageInputEntryContentTypedDict - object: NotRequired[Object] - type: NotRequired[MessageInputEntryType] - created_at: NotRequired[datetime] - completed_at: NotRequired[Nullable[datetime]] - id: NotRequired[str] - prefix: NotRequired[bool] - - -class MessageInputEntry(BaseModel): - r"""Representation of an input message inside the conversation.""" - - role: MessageInputEntryRole - - content: MessageInputEntryContent - - object: Optional[Object] = "entry" - - type: Optional[MessageInputEntryType] = "message.input" - - created_at: Optional[datetime] = None - - completed_at: OptionalNullable[datetime] = UNSET - - id: Optional[str] = None - - prefix: Optional[bool] = False - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "object", - "type", - "created_at", - "completed_at", - "id", - "prefix", - ] - nullable_fields = ["completed_at"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/messageoutputentry.py b/src/mistralai/models/messageoutputentry.py deleted file mode 100644 index 1c2e4107..00000000 --- a/src/mistralai/models/messageoutputentry.py +++ /dev/null @@ -1,100 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .messageoutputcontentchunks import ( - MessageOutputContentChunks, - MessageOutputContentChunksTypedDict, -) -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -MessageOutputEntryObject = Literal["entry"] - -MessageOutputEntryType = Literal["message.output"] - -MessageOutputEntryRole = Literal["assistant"] - -MessageOutputEntryContentTypedDict = TypeAliasType( - "MessageOutputEntryContentTypedDict", - Union[str, List[MessageOutputContentChunksTypedDict]], -) - - -MessageOutputEntryContent = TypeAliasType( - "MessageOutputEntryContent", Union[str, List[MessageOutputContentChunks]] -) - - -class MessageOutputEntryTypedDict(TypedDict): - content: MessageOutputEntryContentTypedDict - object: NotRequired[MessageOutputEntryObject] - type: NotRequired[MessageOutputEntryType] - created_at: NotRequired[datetime] - completed_at: NotRequired[Nullable[datetime]] - id: NotRequired[str] - agent_id: NotRequired[Nullable[str]] - model: NotRequired[Nullable[str]] - role: NotRequired[MessageOutputEntryRole] - - -class MessageOutputEntry(BaseModel): - content: MessageOutputEntryContent - - object: Optional[MessageOutputEntryObject] = "entry" - - type: Optional[MessageOutputEntryType] = "message.output" - - created_at: Optional[datetime] = None - - completed_at: OptionalNullable[datetime] = UNSET - - id: Optional[str] = None - - agent_id: OptionalNullable[str] = UNSET - - model: OptionalNullable[str] = UNSET - - role: Optional[MessageOutputEntryRole] = "assistant" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "object", - "type", - "created_at", - "completed_at", - "id", - "agent_id", - "model", - "role", - ] - nullable_fields = ["completed_at", "agent_id", "model"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/messageoutputevent.py b/src/mistralai/models/messageoutputevent.py deleted file mode 100644 index 474cb081..00000000 --- a/src/mistralai/models/messageoutputevent.py +++ /dev/null @@ -1,93 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .outputcontentchunks import OutputContentChunks, OutputContentChunksTypedDict -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -MessageOutputEventType = Literal["message.output.delta"] - -MessageOutputEventRole = Literal["assistant"] - -MessageOutputEventContentTypedDict = TypeAliasType( - "MessageOutputEventContentTypedDict", Union[str, OutputContentChunksTypedDict] -) - - -MessageOutputEventContent = TypeAliasType( - "MessageOutputEventContent", Union[str, OutputContentChunks] -) - - -class MessageOutputEventTypedDict(TypedDict): - id: str - content: MessageOutputEventContentTypedDict - type: NotRequired[MessageOutputEventType] - created_at: NotRequired[datetime] - output_index: NotRequired[int] - content_index: NotRequired[int] - model: NotRequired[Nullable[str]] - agent_id: NotRequired[Nullable[str]] - role: NotRequired[MessageOutputEventRole] - - -class MessageOutputEvent(BaseModel): - id: str - - content: MessageOutputEventContent - - type: Optional[MessageOutputEventType] = "message.output.delta" - - created_at: Optional[datetime] = None - - output_index: Optional[int] = 0 - - content_index: Optional[int] = 0 - - model: OptionalNullable[str] = UNSET - - agent_id: OptionalNullable[str] = UNSET - - role: Optional[MessageOutputEventRole] = "assistant" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "type", - "created_at", - "output_index", - "content_index", - "model", - "agent_id", - "role", - ] - nullable_fields = ["model", "agent_id"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/metricout.py b/src/mistralai/models/metricout.py deleted file mode 100644 index 930b5c21..00000000 --- a/src/mistralai/models/metricout.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class MetricOutTypedDict(TypedDict): - r"""Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase).""" - - train_loss: NotRequired[Nullable[float]] - valid_loss: NotRequired[Nullable[float]] - valid_mean_token_accuracy: NotRequired[Nullable[float]] - - -class MetricOut(BaseModel): - r"""Metrics at the step number during the fine-tuning job. Use these metrics to assess if the training is going smoothly (loss should decrease, token accuracy should increase).""" - - train_loss: OptionalNullable[float] = UNSET - - valid_loss: OptionalNullable[float] = UNSET - - valid_mean_token_accuracy: OptionalNullable[float] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["train_loss", "valid_loss", "valid_mean_token_accuracy"] - nullable_fields = ["train_loss", "valid_loss", "valid_mean_token_accuracy"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/mistralerror.py b/src/mistralai/models/mistralerror.py deleted file mode 100644 index a0ee5078..00000000 --- a/src/mistralai/models/mistralerror.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import httpx -from typing import Optional - - -class MistralError(Exception): - """The base class for all HTTP error responses.""" - - message: str - status_code: int - body: str - headers: httpx.Headers - raw_response: httpx.Response - - def __init__( - self, message: str, raw_response: httpx.Response, body: Optional[str] = None - ): - self.message = message - self.status_code = raw_response.status_code - self.body = body if body is not None else raw_response.text - self.headers = raw_response.headers - self.raw_response = raw_response - - def __str__(self): - return self.message diff --git a/src/mistralai/models/mistralpromptmode.py b/src/mistralai/models/mistralpromptmode.py deleted file mode 100644 index 0ffd6787..00000000 --- a/src/mistralai/models/mistralpromptmode.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import UnrecognizedStr -from typing import Literal, Union - - -MistralPromptMode = Union[Literal["reasoning"], UnrecognizedStr] diff --git a/src/mistralai/models/modelcapabilities.py b/src/mistralai/models/modelcapabilities.py deleted file mode 100644 index 54c5f2a2..00000000 --- a/src/mistralai/models/modelcapabilities.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class ModelCapabilitiesTypedDict(TypedDict): - completion_chat: NotRequired[bool] - completion_fim: NotRequired[bool] - function_calling: NotRequired[bool] - fine_tuning: NotRequired[bool] - vision: NotRequired[bool] - classification: NotRequired[bool] - - -class ModelCapabilities(BaseModel): - completion_chat: Optional[bool] = True - - completion_fim: Optional[bool] = False - - function_calling: Optional[bool] = True - - fine_tuning: Optional[bool] = False - - vision: Optional[bool] = False - - classification: Optional[bool] = False diff --git a/src/mistralai/models/modelconversation.py b/src/mistralai/models/modelconversation.py deleted file mode 100644 index 4ced79ea..00000000 --- a/src/mistralai/models/modelconversation.py +++ /dev/null @@ -1,127 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .codeinterpretertool import CodeInterpreterTool, CodeInterpreterToolTypedDict -from .completionargs import CompletionArgs, CompletionArgsTypedDict -from .documentlibrarytool import DocumentLibraryTool, DocumentLibraryToolTypedDict -from .functiontool import FunctionTool, FunctionToolTypedDict -from .imagegenerationtool import ImageGenerationTool, ImageGenerationToolTypedDict -from .websearchpremiumtool import WebSearchPremiumTool, WebSearchPremiumToolTypedDict -from .websearchtool import WebSearchTool, WebSearchToolTypedDict -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag, model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -ModelConversationToolsTypedDict = TypeAliasType( - "ModelConversationToolsTypedDict", - Union[ - WebSearchToolTypedDict, - WebSearchPremiumToolTypedDict, - CodeInterpreterToolTypedDict, - ImageGenerationToolTypedDict, - FunctionToolTypedDict, - DocumentLibraryToolTypedDict, - ], -) - - -ModelConversationTools = Annotated[ - Union[ - Annotated[CodeInterpreterTool, Tag("code_interpreter")], - Annotated[DocumentLibraryTool, Tag("document_library")], - Annotated[FunctionTool, Tag("function")], - Annotated[ImageGenerationTool, Tag("image_generation")], - Annotated[WebSearchTool, Tag("web_search")], - Annotated[WebSearchPremiumTool, Tag("web_search_premium")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -ModelConversationObject = Literal["conversation"] - - -class ModelConversationTypedDict(TypedDict): - id: str - created_at: datetime - updated_at: datetime - model: str - instructions: NotRequired[Nullable[str]] - r"""Instruction prompt the model will follow during the conversation.""" - tools: NotRequired[List[ModelConversationToolsTypedDict]] - r"""List of tools which are available to the model during the conversation.""" - completion_args: NotRequired[CompletionArgsTypedDict] - r"""White-listed arguments from the completion API""" - name: NotRequired[Nullable[str]] - r"""Name given to the conversation.""" - description: NotRequired[Nullable[str]] - r"""Description of the what the conversation is about.""" - object: NotRequired[ModelConversationObject] - - -class ModelConversation(BaseModel): - id: str - - created_at: datetime - - updated_at: datetime - - model: str - - instructions: OptionalNullable[str] = UNSET - r"""Instruction prompt the model will follow during the conversation.""" - - tools: Optional[List[ModelConversationTools]] = None - r"""List of tools which are available to the model during the conversation.""" - - completion_args: Optional[CompletionArgs] = None - r"""White-listed arguments from the completion API""" - - name: OptionalNullable[str] = UNSET - r"""Name given to the conversation.""" - - description: OptionalNullable[str] = UNSET - r"""Description of the what the conversation is about.""" - - object: Optional[ModelConversationObject] = "conversation" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "instructions", - "tools", - "completion_args", - "name", - "description", - "object", - ] - nullable_fields = ["instructions", "name", "description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/modellist.py b/src/mistralai/models/modellist.py deleted file mode 100644 index 394cb3fa..00000000 --- a/src/mistralai/models/modellist.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .basemodelcard import BaseModelCard, BaseModelCardTypedDict -from .ftmodelcard import FTModelCard, FTModelCardTypedDict -from mistralai.types import BaseModel -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -DataTypedDict = TypeAliasType( - "DataTypedDict", Union[BaseModelCardTypedDict, FTModelCardTypedDict] -) - - -Data = Annotated[ - Union[ - Annotated[BaseModelCard, Tag("base")], Annotated[FTModelCard, Tag("fine-tuned")] - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -class ModelListTypedDict(TypedDict): - object: NotRequired[str] - data: NotRequired[List[DataTypedDict]] - - -class ModelList(BaseModel): - object: Optional[str] = "list" - - data: Optional[List[Data]] = None diff --git a/src/mistralai/models/moderationobject.py b/src/mistralai/models/moderationobject.py deleted file mode 100644 index 5eff2d2a..00000000 --- a/src/mistralai/models/moderationobject.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Dict, Optional -from typing_extensions import NotRequired, TypedDict - - -class ModerationObjectTypedDict(TypedDict): - categories: NotRequired[Dict[str, bool]] - r"""Moderation result thresholds""" - category_scores: NotRequired[Dict[str, float]] - r"""Moderation result""" - - -class ModerationObject(BaseModel): - categories: Optional[Dict[str, bool]] = None - r"""Moderation result thresholds""" - - category_scores: Optional[Dict[str, float]] = None - r"""Moderation result""" diff --git a/src/mistralai/models/no_response_error.py b/src/mistralai/models/no_response_error.py deleted file mode 100644 index f98beea2..00000000 --- a/src/mistralai/models/no_response_error.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -class NoResponseError(Exception): - """Error raised when no HTTP response is received from the server.""" - - message: str - - def __init__(self, message: str = "No response received"): - self.message = message - super().__init__(message) - - def __str__(self): - return self.message diff --git a/src/mistralai/models/ocrimageobject.py b/src/mistralai/models/ocrimageobject.py deleted file mode 100644 index cec0acf4..00000000 --- a/src/mistralai/models/ocrimageobject.py +++ /dev/null @@ -1,83 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class OCRImageObjectTypedDict(TypedDict): - id: str - r"""Image ID for extracted image in a page""" - top_left_x: Nullable[int] - r"""X coordinate of top-left corner of the extracted image""" - top_left_y: Nullable[int] - r"""Y coordinate of top-left corner of the extracted image""" - bottom_right_x: Nullable[int] - r"""X coordinate of bottom-right corner of the extracted image""" - bottom_right_y: Nullable[int] - r"""Y coordinate of bottom-right corner of the extracted image""" - image_base64: NotRequired[Nullable[str]] - r"""Base64 string of the extracted image""" - image_annotation: NotRequired[Nullable[str]] - r"""Annotation of the extracted image in json str""" - - -class OCRImageObject(BaseModel): - id: str - r"""Image ID for extracted image in a page""" - - top_left_x: Nullable[int] - r"""X coordinate of top-left corner of the extracted image""" - - top_left_y: Nullable[int] - r"""Y coordinate of top-left corner of the extracted image""" - - bottom_right_x: Nullable[int] - r"""X coordinate of bottom-right corner of the extracted image""" - - bottom_right_y: Nullable[int] - r"""Y coordinate of bottom-right corner of the extracted image""" - - image_base64: OptionalNullable[str] = UNSET - r"""Base64 string of the extracted image""" - - image_annotation: OptionalNullable[str] = UNSET - r"""Annotation of the extracted image in json str""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["image_base64", "image_annotation"] - nullable_fields = [ - "top_left_x", - "top_left_y", - "bottom_right_x", - "bottom_right_y", - "image_base64", - "image_annotation", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/ocrpagedimensions.py b/src/mistralai/models/ocrpagedimensions.py deleted file mode 100644 index d1aeb54d..00000000 --- a/src/mistralai/models/ocrpagedimensions.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing_extensions import TypedDict - - -class OCRPageDimensionsTypedDict(TypedDict): - dpi: int - r"""Dots per inch of the page-image""" - height: int - r"""Height of the image in pixels""" - width: int - r"""Width of the image in pixels""" - - -class OCRPageDimensions(BaseModel): - dpi: int - r"""Dots per inch of the page-image""" - - height: int - r"""Height of the image in pixels""" - - width: int - r"""Width of the image in pixels""" diff --git a/src/mistralai/models/ocrpageobject.py b/src/mistralai/models/ocrpageobject.py deleted file mode 100644 index 94624a16..00000000 --- a/src/mistralai/models/ocrpageobject.py +++ /dev/null @@ -1,64 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .ocrimageobject import OCRImageObject, OCRImageObjectTypedDict -from .ocrpagedimensions import OCRPageDimensions, OCRPageDimensionsTypedDict -from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List -from typing_extensions import TypedDict - - -class OCRPageObjectTypedDict(TypedDict): - index: int - r"""The page index in a pdf document starting from 0""" - markdown: str - r"""The markdown string response of the page""" - images: List[OCRImageObjectTypedDict] - r"""List of all extracted images in the page""" - dimensions: Nullable[OCRPageDimensionsTypedDict] - r"""The dimensions of the PDF Page's screenshot image""" - - -class OCRPageObject(BaseModel): - index: int - r"""The page index in a pdf document starting from 0""" - - markdown: str - r"""The markdown string response of the page""" - - images: List[OCRImageObject] - r"""List of all extracted images in the page""" - - dimensions: Nullable[OCRPageDimensions] - r"""The dimensions of the PDF Page's screenshot image""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [] - nullable_fields = ["dimensions"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/ocrrequest.py b/src/mistralai/models/ocrrequest.py deleted file mode 100644 index df932c2a..00000000 --- a/src/mistralai/models/ocrrequest.py +++ /dev/null @@ -1,114 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .documenturlchunk import DocumentURLChunk, DocumentURLChunkTypedDict -from .filechunk import FileChunk, FileChunkTypedDict -from .imageurlchunk import ImageURLChunk, ImageURLChunkTypedDict -from .responseformat import ResponseFormat, ResponseFormatTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -DocumentTypedDict = TypeAliasType( - "DocumentTypedDict", - Union[FileChunkTypedDict, ImageURLChunkTypedDict, DocumentURLChunkTypedDict], -) -r"""Document to run OCR on""" - - -Document = TypeAliasType("Document", Union[FileChunk, ImageURLChunk, DocumentURLChunk]) -r"""Document to run OCR on""" - - -class OCRRequestTypedDict(TypedDict): - model: Nullable[str] - document: DocumentTypedDict - r"""Document to run OCR on""" - id: NotRequired[str] - pages: NotRequired[Nullable[List[int]]] - r"""Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0""" - include_image_base64: NotRequired[Nullable[bool]] - r"""Include image URLs in response""" - image_limit: NotRequired[Nullable[int]] - r"""Max images to extract""" - image_min_size: NotRequired[Nullable[int]] - r"""Minimum height and width of image to extract""" - bbox_annotation_format: NotRequired[Nullable[ResponseFormatTypedDict]] - r"""Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field""" - document_annotation_format: NotRequired[Nullable[ResponseFormatTypedDict]] - r"""Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field""" - - -class OCRRequest(BaseModel): - model: Nullable[str] - - document: Document - r"""Document to run OCR on""" - - id: Optional[str] = None - - pages: OptionalNullable[List[int]] = UNSET - r"""Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0""" - - include_image_base64: OptionalNullable[bool] = UNSET - r"""Include image URLs in response""" - - image_limit: OptionalNullable[int] = UNSET - r"""Max images to extract""" - - image_min_size: OptionalNullable[int] = UNSET - r"""Minimum height and width of image to extract""" - - bbox_annotation_format: OptionalNullable[ResponseFormat] = UNSET - r"""Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field""" - - document_annotation_format: OptionalNullable[ResponseFormat] = UNSET - r"""Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "id", - "pages", - "include_image_base64", - "image_limit", - "image_min_size", - "bbox_annotation_format", - "document_annotation_format", - ] - nullable_fields = [ - "model", - "pages", - "include_image_base64", - "image_limit", - "image_min_size", - "bbox_annotation_format", - "document_annotation_format", - ] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/ocrresponse.py b/src/mistralai/models/ocrresponse.py deleted file mode 100644 index 7b65bee7..00000000 --- a/src/mistralai/models/ocrresponse.py +++ /dev/null @@ -1,62 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .ocrpageobject import OCRPageObject, OCRPageObjectTypedDict -from .ocrusageinfo import OCRUsageInfo, OCRUsageInfoTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List -from typing_extensions import NotRequired, TypedDict - - -class OCRResponseTypedDict(TypedDict): - pages: List[OCRPageObjectTypedDict] - r"""List of OCR info for pages.""" - model: str - r"""The model used to generate the OCR.""" - usage_info: OCRUsageInfoTypedDict - document_annotation: NotRequired[Nullable[str]] - r"""Formatted response in the request_format if provided in json str""" - - -class OCRResponse(BaseModel): - pages: List[OCRPageObject] - r"""List of OCR info for pages.""" - - model: str - r"""The model used to generate the OCR.""" - - usage_info: OCRUsageInfo - - document_annotation: OptionalNullable[str] = UNSET - r"""Formatted response in the request_format if provided in json str""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["document_annotation"] - nullable_fields = ["document_annotation"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/ocrusageinfo.py b/src/mistralai/models/ocrusageinfo.py deleted file mode 100644 index 36c9f826..00000000 --- a/src/mistralai/models/ocrusageinfo.py +++ /dev/null @@ -1,51 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class OCRUsageInfoTypedDict(TypedDict): - pages_processed: int - r"""Number of pages processed""" - doc_size_bytes: NotRequired[Nullable[int]] - r"""Document size in bytes""" - - -class OCRUsageInfo(BaseModel): - pages_processed: int - r"""Number of pages processed""" - - doc_size_bytes: OptionalNullable[int] = UNSET - r"""Document size in bytes""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["doc_size_bytes"] - nullable_fields = ["doc_size_bytes"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/prediction.py b/src/mistralai/models/prediction.py deleted file mode 100644 index 7937c9d1..00000000 --- a/src/mistralai/models/prediction.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import validate_const -import pydantic -from pydantic.functional_validators import AfterValidator -from typing import Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class PredictionTypedDict(TypedDict): - type: Literal["content"] - content: NotRequired[str] - - -class Prediction(BaseModel): - TYPE: Annotated[ - Annotated[ - Optional[Literal["content"]], AfterValidator(validate_const("content")) - ], - pydantic.Field(alias="type"), - ] = "content" - - content: Optional[str] = "" diff --git a/src/mistralai/models/processingstatusout.py b/src/mistralai/models/processingstatusout.py deleted file mode 100644 index e67bfa86..00000000 --- a/src/mistralai/models/processingstatusout.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing_extensions import TypedDict - - -class ProcessingStatusOutTypedDict(TypedDict): - document_id: str - processing_status: str - - -class ProcessingStatusOut(BaseModel): - document_id: str - - processing_status: str diff --git a/src/mistralai/models/referencechunk.py b/src/mistralai/models/referencechunk.py deleted file mode 100644 index 4a5503f2..00000000 --- a/src/mistralai/models/referencechunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ReferenceChunkType = Literal["reference"] - - -class ReferenceChunkTypedDict(TypedDict): - reference_ids: List[int] - type: NotRequired[ReferenceChunkType] - - -class ReferenceChunk(BaseModel): - reference_ids: List[int] - - type: Optional[ReferenceChunkType] = "reference" diff --git a/src/mistralai/models/responsedoneevent.py b/src/mistralai/models/responsedoneevent.py deleted file mode 100644 index 296cb430..00000000 --- a/src/mistralai/models/responsedoneevent.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .conversationusageinfo import ConversationUsageInfo, ConversationUsageInfoTypedDict -from datetime import datetime -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ResponseDoneEventType = Literal["conversation.response.done"] - - -class ResponseDoneEventTypedDict(TypedDict): - usage: ConversationUsageInfoTypedDict - type: NotRequired[ResponseDoneEventType] - created_at: NotRequired[datetime] - - -class ResponseDoneEvent(BaseModel): - usage: ConversationUsageInfo - - type: Optional[ResponseDoneEventType] = "conversation.response.done" - - created_at: Optional[datetime] = None diff --git a/src/mistralai/models/responseerrorevent.py b/src/mistralai/models/responseerrorevent.py deleted file mode 100644 index e4190d17..00000000 --- a/src/mistralai/models/responseerrorevent.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ResponseErrorEventType = Literal["conversation.response.error"] - - -class ResponseErrorEventTypedDict(TypedDict): - message: str - code: int - type: NotRequired[ResponseErrorEventType] - created_at: NotRequired[datetime] - - -class ResponseErrorEvent(BaseModel): - message: str - - code: int - - type: Optional[ResponseErrorEventType] = "conversation.response.error" - - created_at: Optional[datetime] = None diff --git a/src/mistralai/models/responseformat.py b/src/mistralai/models/responseformat.py deleted file mode 100644 index c9319989..00000000 --- a/src/mistralai/models/responseformat.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .jsonschema import JSONSchema, JSONSchemaTypedDict -from .responseformats import ResponseFormats -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class ResponseFormatTypedDict(TypedDict): - type: NotRequired[ResponseFormats] - r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" - json_schema: NotRequired[Nullable[JSONSchemaTypedDict]] - - -class ResponseFormat(BaseModel): - type: Optional[ResponseFormats] = None - r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" - - json_schema: OptionalNullable[JSONSchema] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "json_schema"] - nullable_fields = ["json_schema"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/responseformats.py b/src/mistralai/models/responseformats.py deleted file mode 100644 index 08c39951..00000000 --- a/src/mistralai/models/responseformats.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -ResponseFormats = Literal["text", "json_object", "json_schema"] -r"""An object specifying the format that the model must output. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message.""" diff --git a/src/mistralai/models/responsestartedevent.py b/src/mistralai/models/responsestartedevent.py deleted file mode 100644 index 6acb483e..00000000 --- a/src/mistralai/models/responsestartedevent.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from datetime import datetime -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ResponseStartedEventType = Literal["conversation.response.started"] - - -class ResponseStartedEventTypedDict(TypedDict): - conversation_id: str - type: NotRequired[ResponseStartedEventType] - created_at: NotRequired[datetime] - - -class ResponseStartedEvent(BaseModel): - conversation_id: str - - type: Optional[ResponseStartedEventType] = "conversation.response.started" - - created_at: Optional[datetime] = None diff --git a/src/mistralai/models/responsevalidationerror.py b/src/mistralai/models/responsevalidationerror.py deleted file mode 100644 index fe31cfbd..00000000 --- a/src/mistralai/models/responsevalidationerror.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import httpx -from typing import Optional - -from mistralai.models import MistralError - - -class ResponseValidationError(MistralError): - """Error raised when there is a type mismatch between the response data and the expected Pydantic model.""" - - def __init__( - self, - message: str, - raw_response: httpx.Response, - cause: Exception, - body: Optional[str] = None, - ): - message = f"{message}: {cause}" - super().__init__(message, raw_response, body) - - @property - def cause(self): - """Normally the Pydantic ValidationError""" - return self.__cause__ diff --git a/src/mistralai/models/retrieve_model_v1_models_model_id_getop.py b/src/mistralai/models/retrieve_model_v1_models_model_id_getop.py deleted file mode 100644 index bfe62474..00000000 --- a/src/mistralai/models/retrieve_model_v1_models_model_id_getop.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .basemodelcard import BaseModelCard, BaseModelCardTypedDict -from .ftmodelcard import FTModelCard, FTModelCardTypedDict -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, PathParamMetadata, get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -class RetrieveModelV1ModelsModelIDGetRequestTypedDict(TypedDict): - model_id: str - r"""The ID of the model to retrieve.""" - - -class RetrieveModelV1ModelsModelIDGetRequest(BaseModel): - model_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - r"""The ID of the model to retrieve.""" - - -RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict = TypeAliasType( - "RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetTypedDict", - Union[BaseModelCardTypedDict, FTModelCardTypedDict], -) -r"""Successful Response""" - - -RetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGet = Annotated[ - Union[ - Annotated[BaseModelCard, Tag("base")], Annotated[FTModelCard, Tag("fine-tuned")] - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] -r"""Successful Response""" diff --git a/src/mistralai/models/retrievefileout.py b/src/mistralai/models/retrievefileout.py deleted file mode 100644 index 7d734b0f..00000000 --- a/src/mistralai/models/retrievefileout.py +++ /dev/null @@ -1,93 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .filepurpose import FilePurpose -from .sampletype import SampleType -from .source import Source -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import validate_open_enum -import pydantic -from pydantic import model_serializer -from pydantic.functional_validators import PlainValidator -from typing_extensions import Annotated, NotRequired, TypedDict - - -class RetrieveFileOutTypedDict(TypedDict): - id: str - r"""The unique identifier of the file.""" - object: str - r"""The object type, which is always \"file\".""" - size_bytes: int - r"""The size of the file, in bytes.""" - created_at: int - r"""The UNIX timestamp (in seconds) of the event.""" - filename: str - r"""The name of the uploaded file.""" - purpose: FilePurpose - sample_type: SampleType - source: Source - deleted: bool - num_lines: NotRequired[Nullable[int]] - mimetype: NotRequired[Nullable[str]] - signature: NotRequired[Nullable[str]] - - -class RetrieveFileOut(BaseModel): - id: str - r"""The unique identifier of the file.""" - - object: str - r"""The object type, which is always \"file\".""" - - size_bytes: Annotated[int, pydantic.Field(alias="bytes")] - r"""The size of the file, in bytes.""" - - created_at: int - r"""The UNIX timestamp (in seconds) of the event.""" - - filename: str - r"""The name of the uploaded file.""" - - purpose: Annotated[FilePurpose, PlainValidator(validate_open_enum(False))] - - sample_type: Annotated[SampleType, PlainValidator(validate_open_enum(False))] - - source: Annotated[Source, PlainValidator(validate_open_enum(False))] - - deleted: bool - - num_lines: OptionalNullable[int] = UNSET - - mimetype: OptionalNullable[str] = UNSET - - signature: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["num_lines", "mimetype", "signature"] - nullable_fields = ["num_lines", "mimetype", "signature"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/sampletype.py b/src/mistralai/models/sampletype.py deleted file mode 100644 index adc90ec7..00000000 --- a/src/mistralai/models/sampletype.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import UnrecognizedStr -from typing import Literal, Union - - -SampleType = Union[ - Literal["pretrain", "instruct", "batch_request", "batch_result", "batch_error"], - UnrecognizedStr, -] diff --git a/src/mistralai/models/sdkerror.py b/src/mistralai/models/sdkerror.py deleted file mode 100644 index 2513f36b..00000000 --- a/src/mistralai/models/sdkerror.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import httpx -from typing import Optional - -from mistralai.models import MistralError - -MAX_MESSAGE_LEN = 10_000 - - -class SDKError(MistralError): - """The fallback error class if no more specific error class is matched.""" - - def __init__( - self, message: str, raw_response: httpx.Response, body: Optional[str] = None - ): - body_display = body or raw_response.text or '""' - - if message: - message += ": " - message += f"Status {raw_response.status_code}" - - headers = raw_response.headers - content_type = headers.get("content-type", '""') - if content_type != "application/json": - if " " in content_type: - content_type = f'"{content_type}"' - message += f" Content-Type {content_type}" - - if len(body_display) > MAX_MESSAGE_LEN: - truncated = body_display[:MAX_MESSAGE_LEN] - remaining = len(body_display) - MAX_MESSAGE_LEN - body_display = f"{truncated}...and {remaining} more chars" - - message += f". Body: {body_display}" - message = message.strip() - - super().__init__(message, raw_response, body) diff --git a/src/mistralai/models/security.py b/src/mistralai/models/security.py deleted file mode 100644 index cf05ba8f..00000000 --- a/src/mistralai/models/security.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from mistralai.utils import FieldMetadata, SecurityMetadata -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class SecurityTypedDict(TypedDict): - api_key: NotRequired[str] - - -class Security(BaseModel): - api_key: Annotated[ - Optional[str], - FieldMetadata( - security=SecurityMetadata( - scheme=True, - scheme_type="http", - sub_type="bearer", - field_name="Authorization", - ) - ), - ] = None diff --git a/src/mistralai/models/shareenum.py b/src/mistralai/models/shareenum.py deleted file mode 100644 index c2945514..00000000 --- a/src/mistralai/models/shareenum.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import UnrecognizedStr -from typing import Literal, Union - - -ShareEnum = Union[Literal["Viewer", "Editor"], UnrecognizedStr] diff --git a/src/mistralai/models/sharingdelete.py b/src/mistralai/models/sharingdelete.py deleted file mode 100644 index b9df5f9d..00000000 --- a/src/mistralai/models/sharingdelete.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .entitytype import EntityType -from mistralai.types import BaseModel -from mistralai.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing_extensions import Annotated, TypedDict - - -class SharingDeleteTypedDict(TypedDict): - org_id: str - share_with_uuid: str - r"""The id of the entity (user, workspace or organization) to share with""" - share_with_type: EntityType - r"""The type of entity, used to share a library.""" - - -class SharingDelete(BaseModel): - org_id: str - - share_with_uuid: str - r"""The id of the entity (user, workspace or organization) to share with""" - - share_with_type: Annotated[EntityType, PlainValidator(validate_open_enum(False))] - r"""The type of entity, used to share a library.""" diff --git a/src/mistralai/models/sharingin.py b/src/mistralai/models/sharingin.py deleted file mode 100644 index af20fd14..00000000 --- a/src/mistralai/models/sharingin.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .entitytype import EntityType -from .shareenum import ShareEnum -from mistralai.types import BaseModel -from mistralai.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing_extensions import Annotated, TypedDict - - -class SharingInTypedDict(TypedDict): - org_id: str - level: ShareEnum - share_with_uuid: str - r"""The id of the entity (user, workspace or organization) to share with""" - share_with_type: EntityType - r"""The type of entity, used to share a library.""" - - -class SharingIn(BaseModel): - org_id: str - - level: Annotated[ShareEnum, PlainValidator(validate_open_enum(False))] - - share_with_uuid: str - r"""The id of the entity (user, workspace or organization) to share with""" - - share_with_type: Annotated[EntityType, PlainValidator(validate_open_enum(False))] - r"""The type of entity, used to share a library.""" diff --git a/src/mistralai/models/sharingout.py b/src/mistralai/models/sharingout.py deleted file mode 100644 index a78a7764..00000000 --- a/src/mistralai/models/sharingout.py +++ /dev/null @@ -1,59 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class SharingOutTypedDict(TypedDict): - library_id: str - org_id: str - role: str - share_with_type: str - share_with_uuid: str - user_id: NotRequired[Nullable[str]] - - -class SharingOut(BaseModel): - library_id: str - - org_id: str - - role: str - - share_with_type: str - - share_with_uuid: str - - user_id: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["user_id"] - nullable_fields = ["user_id"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/source.py b/src/mistralai/models/source.py deleted file mode 100644 index c21550f2..00000000 --- a/src/mistralai/models/source.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import UnrecognizedStr -from typing import Literal, Union - - -Source = Union[Literal["upload", "repository", "mistral"], UnrecognizedStr] diff --git a/src/mistralai/models/ssetypes.py b/src/mistralai/models/ssetypes.py deleted file mode 100644 index 796f0327..00000000 --- a/src/mistralai/models/ssetypes.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -SSETypes = Literal[ - "conversation.response.started", - "conversation.response.done", - "conversation.response.error", - "message.output.delta", - "tool.execution.started", - "tool.execution.delta", - "tool.execution.done", - "agent.handoff.started", - "agent.handoff.done", - "function.call.delta", -] -r"""Server side events sent when streaming a conversation response.""" diff --git a/src/mistralai/models/systemmessage.py b/src/mistralai/models/systemmessage.py deleted file mode 100644 index 25b51f95..00000000 --- a/src/mistralai/models/systemmessage.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .systemmessagecontentchunks import ( - SystemMessageContentChunks, - SystemMessageContentChunksTypedDict, -) -from mistralai.types import BaseModel -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -SystemMessageContentTypedDict = TypeAliasType( - "SystemMessageContentTypedDict", - Union[str, List[SystemMessageContentChunksTypedDict]], -) - - -SystemMessageContent = TypeAliasType( - "SystemMessageContent", Union[str, List[SystemMessageContentChunks]] -) - - -Role = Literal["system"] - - -class SystemMessageTypedDict(TypedDict): - content: SystemMessageContentTypedDict - role: NotRequired[Role] - - -class SystemMessage(BaseModel): - content: SystemMessageContent - - role: Optional[Role] = "system" diff --git a/src/mistralai/models/systemmessagecontentchunks.py b/src/mistralai/models/systemmessagecontentchunks.py deleted file mode 100644 index a1f04d1e..00000000 --- a/src/mistralai/models/systemmessagecontentchunks.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .textchunk import TextChunk, TextChunkTypedDict -from .thinkchunk import ThinkChunk, ThinkChunkTypedDict -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType - - -SystemMessageContentChunksTypedDict = TypeAliasType( - "SystemMessageContentChunksTypedDict", - Union[TextChunkTypedDict, ThinkChunkTypedDict], -) - - -SystemMessageContentChunks = Annotated[ - Union[Annotated[TextChunk, Tag("text")], Annotated[ThinkChunk, Tag("thinking")]], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] diff --git a/src/mistralai/models/textchunk.py b/src/mistralai/models/textchunk.py deleted file mode 100644 index 02b115f6..00000000 --- a/src/mistralai/models/textchunk.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -TextChunkType = Literal["text"] - - -class TextChunkTypedDict(TypedDict): - text: str - type: NotRequired[TextChunkType] - - -class TextChunk(BaseModel): - text: str - - type: Optional[TextChunkType] = "text" diff --git a/src/mistralai/models/thinkchunk.py b/src/mistralai/models/thinkchunk.py deleted file mode 100644 index 24b466f9..00000000 --- a/src/mistralai/models/thinkchunk.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .referencechunk import ReferenceChunk, ReferenceChunkTypedDict -from .textchunk import TextChunk, TextChunkTypedDict -from mistralai.types import BaseModel -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ThinkingTypedDict = TypeAliasType( - "ThinkingTypedDict", Union[ReferenceChunkTypedDict, TextChunkTypedDict] -) - - -Thinking = TypeAliasType("Thinking", Union[ReferenceChunk, TextChunk]) - - -ThinkChunkType = Literal["thinking"] - - -class ThinkChunkTypedDict(TypedDict): - thinking: List[ThinkingTypedDict] - closed: NotRequired[bool] - r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" - type: NotRequired[ThinkChunkType] - - -class ThinkChunk(BaseModel): - thinking: List[Thinking] - - closed: Optional[bool] = None - r"""Whether the thinking chunk is closed or not. Currently only used for prefixing.""" - - type: Optional[ThinkChunkType] = "thinking" diff --git a/src/mistralai/models/timestampgranularity.py b/src/mistralai/models/timestampgranularity.py deleted file mode 100644 index dd1b6446..00000000 --- a/src/mistralai/models/timestampgranularity.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -TimestampGranularity = Literal["segment"] diff --git a/src/mistralai/models/tool.py b/src/mistralai/models/tool.py deleted file mode 100644 index 6e746df3..00000000 --- a/src/mistralai/models/tool.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .function import Function, FunctionTypedDict -from .tooltypes import ToolTypes -from mistralai.types import BaseModel -from mistralai.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolTypedDict(TypedDict): - function: FunctionTypedDict - type: NotRequired[ToolTypes] - - -class Tool(BaseModel): - function: Function - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) diff --git a/src/mistralai/models/toolcall.py b/src/mistralai/models/toolcall.py deleted file mode 100644 index 92dbb4a9..00000000 --- a/src/mistralai/models/toolcall.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .functioncall import FunctionCall, FunctionCallTypedDict -from .tooltypes import ToolTypes -from mistralai.types import BaseModel -from mistralai.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolCallTypedDict(TypedDict): - function: FunctionCallTypedDict - id: NotRequired[str] - type: NotRequired[ToolTypes] - index: NotRequired[int] - - -class ToolCall(BaseModel): - function: FunctionCall - - id: Optional[str] = "null" - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) - - index: Optional[int] = 0 diff --git a/src/mistralai/models/toolchoice.py b/src/mistralai/models/toolchoice.py deleted file mode 100644 index 3b7d60e0..00000000 --- a/src/mistralai/models/toolchoice.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .functionname import FunctionName, FunctionNameTypedDict -from .tooltypes import ToolTypes -from mistralai.types import BaseModel -from mistralai.utils import validate_open_enum -from pydantic.functional_validators import PlainValidator -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ToolChoiceTypedDict(TypedDict): - r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" - - function: FunctionNameTypedDict - r"""this restriction of `Function` is used to select a specific function to call""" - type: NotRequired[ToolTypes] - - -class ToolChoice(BaseModel): - r"""ToolChoice is either a ToolChoiceEnum or a ToolChoice""" - - function: FunctionName - r"""this restriction of `Function` is used to select a specific function to call""" - - type: Annotated[Optional[ToolTypes], PlainValidator(validate_open_enum(False))] = ( - None - ) diff --git a/src/mistralai/models/toolchoiceenum.py b/src/mistralai/models/toolchoiceenum.py deleted file mode 100644 index 8e6a6ad8..00000000 --- a/src/mistralai/models/toolchoiceenum.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -ToolChoiceEnum = Literal["auto", "none", "any", "required"] diff --git a/src/mistralai/models/toolexecutiondeltaevent.py b/src/mistralai/models/toolexecutiondeltaevent.py deleted file mode 100644 index 99b97e68..00000000 --- a/src/mistralai/models/toolexecutiondeltaevent.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .builtinconnectors import BuiltInConnectors -from datetime import datetime -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ToolExecutionDeltaEventType = Literal["tool.execution.delta"] - - -class ToolExecutionDeltaEventTypedDict(TypedDict): - id: str - name: BuiltInConnectors - arguments: str - type: NotRequired[ToolExecutionDeltaEventType] - created_at: NotRequired[datetime] - output_index: NotRequired[int] - - -class ToolExecutionDeltaEvent(BaseModel): - id: str - - name: BuiltInConnectors - - arguments: str - - type: Optional[ToolExecutionDeltaEventType] = "tool.execution.delta" - - created_at: Optional[datetime] = None - - output_index: Optional[int] = 0 diff --git a/src/mistralai/models/toolexecutiondoneevent.py b/src/mistralai/models/toolexecutiondoneevent.py deleted file mode 100644 index c73d943a..00000000 --- a/src/mistralai/models/toolexecutiondoneevent.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .builtinconnectors import BuiltInConnectors -from datetime import datetime -from mistralai.types import BaseModel -from typing import Any, Dict, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ToolExecutionDoneEventType = Literal["tool.execution.done"] - - -class ToolExecutionDoneEventTypedDict(TypedDict): - id: str - name: BuiltInConnectors - type: NotRequired[ToolExecutionDoneEventType] - created_at: NotRequired[datetime] - output_index: NotRequired[int] - info: NotRequired[Dict[str, Any]] - - -class ToolExecutionDoneEvent(BaseModel): - id: str - - name: BuiltInConnectors - - type: Optional[ToolExecutionDoneEventType] = "tool.execution.done" - - created_at: Optional[datetime] = None - - output_index: Optional[int] = 0 - - info: Optional[Dict[str, Any]] = None diff --git a/src/mistralai/models/toolexecutionentry.py b/src/mistralai/models/toolexecutionentry.py deleted file mode 100644 index db503ea8..00000000 --- a/src/mistralai/models/toolexecutionentry.py +++ /dev/null @@ -1,73 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .builtinconnectors import BuiltInConnectors -from datetime import datetime -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Any, Dict, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ToolExecutionEntryObject = Literal["entry"] - -ToolExecutionEntryType = Literal["tool.execution"] - - -class ToolExecutionEntryTypedDict(TypedDict): - name: BuiltInConnectors - arguments: str - object: NotRequired[ToolExecutionEntryObject] - type: NotRequired[ToolExecutionEntryType] - created_at: NotRequired[datetime] - completed_at: NotRequired[Nullable[datetime]] - id: NotRequired[str] - info: NotRequired[Dict[str, Any]] - - -class ToolExecutionEntry(BaseModel): - name: BuiltInConnectors - - arguments: str - - object: Optional[ToolExecutionEntryObject] = "entry" - - type: Optional[ToolExecutionEntryType] = "tool.execution" - - created_at: Optional[datetime] = None - - completed_at: OptionalNullable[datetime] = UNSET - - id: Optional[str] = None - - info: Optional[Dict[str, Any]] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["object", "type", "created_at", "completed_at", "id", "info"] - nullable_fields = ["completed_at"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/toolexecutionstartedevent.py b/src/mistralai/models/toolexecutionstartedevent.py deleted file mode 100644 index 7a54058f..00000000 --- a/src/mistralai/models/toolexecutionstartedevent.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .builtinconnectors import BuiltInConnectors -from datetime import datetime -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ToolExecutionStartedEventType = Literal["tool.execution.started"] - - -class ToolExecutionStartedEventTypedDict(TypedDict): - id: str - name: BuiltInConnectors - arguments: str - type: NotRequired[ToolExecutionStartedEventType] - created_at: NotRequired[datetime] - output_index: NotRequired[int] - - -class ToolExecutionStartedEvent(BaseModel): - id: str - - name: BuiltInConnectors - - arguments: str - - type: Optional[ToolExecutionStartedEventType] = "tool.execution.started" - - created_at: Optional[datetime] = None - - output_index: Optional[int] = 0 diff --git a/src/mistralai/models/toolfilechunk.py b/src/mistralai/models/toolfilechunk.py deleted file mode 100644 index 77c07d6d..00000000 --- a/src/mistralai/models/toolfilechunk.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .builtinconnectors import BuiltInConnectors -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ToolFileChunkType = Literal["tool_file"] - - -class ToolFileChunkTypedDict(TypedDict): - tool: BuiltInConnectors - file_id: str - type: NotRequired[ToolFileChunkType] - file_name: NotRequired[Nullable[str]] - file_type: NotRequired[Nullable[str]] - - -class ToolFileChunk(BaseModel): - tool: BuiltInConnectors - - file_id: str - - type: Optional[ToolFileChunkType] = "tool_file" - - file_name: OptionalNullable[str] = UNSET - - file_type: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "file_name", "file_type"] - nullable_fields = ["file_name", "file_type"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/toolmessage.py b/src/mistralai/models/toolmessage.py deleted file mode 100644 index 82f62e0f..00000000 --- a/src/mistralai/models/toolmessage.py +++ /dev/null @@ -1,66 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -ToolMessageContentTypedDict = TypeAliasType( - "ToolMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -ToolMessageContent = TypeAliasType("ToolMessageContent", Union[str, List[ContentChunk]]) - - -ToolMessageRole = Literal["tool"] - - -class ToolMessageTypedDict(TypedDict): - content: Nullable[ToolMessageContentTypedDict] - tool_call_id: NotRequired[Nullable[str]] - name: NotRequired[Nullable[str]] - role: NotRequired[ToolMessageRole] - - -class ToolMessage(BaseModel): - content: Nullable[ToolMessageContent] - - tool_call_id: OptionalNullable[str] = UNSET - - name: OptionalNullable[str] = UNSET - - role: Optional[ToolMessageRole] = "tool" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["tool_call_id", "name", "role"] - nullable_fields = ["content", "tool_call_id", "name"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/toolreferencechunk.py b/src/mistralai/models/toolreferencechunk.py deleted file mode 100644 index e50b8451..00000000 --- a/src/mistralai/models/toolreferencechunk.py +++ /dev/null @@ -1,64 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .builtinconnectors import BuiltInConnectors -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -ToolReferenceChunkType = Literal["tool_reference"] - - -class ToolReferenceChunkTypedDict(TypedDict): - tool: BuiltInConnectors - title: str - type: NotRequired[ToolReferenceChunkType] - url: NotRequired[Nullable[str]] - favicon: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - - -class ToolReferenceChunk(BaseModel): - tool: BuiltInConnectors - - title: str - - type: Optional[ToolReferenceChunkType] = "tool_reference" - - url: OptionalNullable[str] = UNSET - - favicon: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "url", "favicon", "description"] - nullable_fields = ["url", "favicon", "description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/tooltypes.py b/src/mistralai/models/tooltypes.py deleted file mode 100644 index fb581820..00000000 --- a/src/mistralai/models/tooltypes.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import UnrecognizedStr -from typing import Literal, Union - - -ToolTypes = Union[Literal["function"], UnrecognizedStr] diff --git a/src/mistralai/models/trainingfile.py b/src/mistralai/models/trainingfile.py deleted file mode 100644 index 99bd49dd..00000000 --- a/src/mistralai/models/trainingfile.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class TrainingFileTypedDict(TypedDict): - file_id: str - weight: NotRequired[float] - - -class TrainingFile(BaseModel): - file_id: str - - weight: Optional[float] = 1 diff --git a/src/mistralai/models/transcriptionresponse.py b/src/mistralai/models/transcriptionresponse.py deleted file mode 100644 index 54a98a5b..00000000 --- a/src/mistralai/models/transcriptionresponse.py +++ /dev/null @@ -1,79 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .transcriptionsegmentchunk import ( - TranscriptionSegmentChunk, - TranscriptionSegmentChunkTypedDict, -) -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL -import pydantic -from pydantic import ConfigDict, model_serializer -from typing import Any, Dict, List, Optional -from typing_extensions import NotRequired, TypedDict - - -class TranscriptionResponseTypedDict(TypedDict): - model: str - text: str - usage: UsageInfoTypedDict - language: Nullable[str] - segments: NotRequired[List[TranscriptionSegmentChunkTypedDict]] - - -class TranscriptionResponse(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - - model: str - - text: str - - usage: UsageInfo - - language: Nullable[str] - - segments: Optional[List[TranscriptionSegmentChunk]] = None - - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["segments"] - nullable_fields = ["language"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - for k, v in serialized.items(): - m[k] = v - - return m diff --git a/src/mistralai/models/transcriptionsegmentchunk.py b/src/mistralai/models/transcriptionsegmentchunk.py deleted file mode 100644 index 53f1b397..00000000 --- a/src/mistralai/models/transcriptionsegmentchunk.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -import pydantic -from pydantic import ConfigDict -from typing import Any, Dict, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -Type = Literal["transcription_segment"] - - -class TranscriptionSegmentChunkTypedDict(TypedDict): - text: str - start: float - end: float - type: NotRequired[Type] - - -class TranscriptionSegmentChunk(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - - text: str - - start: float - - end: float - - type: Optional[Type] = "transcription_segment" - - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/src/mistralai/models/transcriptionstreamdone.py b/src/mistralai/models/transcriptionstreamdone.py deleted file mode 100644 index ffd0e080..00000000 --- a/src/mistralai/models/transcriptionstreamdone.py +++ /dev/null @@ -1,85 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .transcriptionsegmentchunk import ( - TranscriptionSegmentChunk, - TranscriptionSegmentChunkTypedDict, -) -from .usageinfo import UsageInfo, UsageInfoTypedDict -from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL -import pydantic -from pydantic import ConfigDict, model_serializer -from typing import Any, Dict, List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -TranscriptionStreamDoneType = Literal["transcription.done"] - - -class TranscriptionStreamDoneTypedDict(TypedDict): - model: str - text: str - usage: UsageInfoTypedDict - language: Nullable[str] - segments: NotRequired[List[TranscriptionSegmentChunkTypedDict]] - type: NotRequired[TranscriptionStreamDoneType] - - -class TranscriptionStreamDone(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - - model: str - - text: str - - usage: UsageInfo - - language: Nullable[str] - - segments: Optional[List[TranscriptionSegmentChunk]] = None - - type: Optional[TranscriptionStreamDoneType] = "transcription.done" - - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["segments", "type"] - nullable_fields = ["language"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - for k, v in serialized.items(): - m[k] = v - - return m diff --git a/src/mistralai/models/transcriptionstreamevents.py b/src/mistralai/models/transcriptionstreamevents.py deleted file mode 100644 index 8207c03f..00000000 --- a/src/mistralai/models/transcriptionstreamevents.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .transcriptionstreamdone import ( - TranscriptionStreamDone, - TranscriptionStreamDoneTypedDict, -) -from .transcriptionstreameventtypes import TranscriptionStreamEventTypes -from .transcriptionstreamlanguage import ( - TranscriptionStreamLanguage, - TranscriptionStreamLanguageTypedDict, -) -from .transcriptionstreamsegmentdelta import ( - TranscriptionStreamSegmentDelta, - TranscriptionStreamSegmentDeltaTypedDict, -) -from .transcriptionstreamtextdelta import ( - TranscriptionStreamTextDelta, - TranscriptionStreamTextDeltaTypedDict, -) -from mistralai.types import BaseModel -from mistralai.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -TranscriptionStreamEventsDataTypedDict = TypeAliasType( - "TranscriptionStreamEventsDataTypedDict", - Union[ - TranscriptionStreamTextDeltaTypedDict, - TranscriptionStreamLanguageTypedDict, - TranscriptionStreamSegmentDeltaTypedDict, - TranscriptionStreamDoneTypedDict, - ], -) - - -TranscriptionStreamEventsData = Annotated[ - Union[ - Annotated[TranscriptionStreamDone, Tag("transcription.done")], - Annotated[TranscriptionStreamLanguage, Tag("transcription.language")], - Annotated[TranscriptionStreamSegmentDelta, Tag("transcription.segment")], - Annotated[TranscriptionStreamTextDelta, Tag("transcription.text.delta")], - ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] - - -class TranscriptionStreamEventsTypedDict(TypedDict): - event: TranscriptionStreamEventTypes - data: TranscriptionStreamEventsDataTypedDict - - -class TranscriptionStreamEvents(BaseModel): - event: TranscriptionStreamEventTypes - - data: TranscriptionStreamEventsData diff --git a/src/mistralai/models/transcriptionstreameventtypes.py b/src/mistralai/models/transcriptionstreameventtypes.py deleted file mode 100644 index 4a910f0a..00000000 --- a/src/mistralai/models/transcriptionstreameventtypes.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from typing import Literal - - -TranscriptionStreamEventTypes = Literal[ - "transcription.language", - "transcription.segment", - "transcription.text.delta", - "transcription.done", -] diff --git a/src/mistralai/models/transcriptionstreamlanguage.py b/src/mistralai/models/transcriptionstreamlanguage.py deleted file mode 100644 index 8fc2aa6e..00000000 --- a/src/mistralai/models/transcriptionstreamlanguage.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -import pydantic -from pydantic import ConfigDict -from typing import Any, Dict, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -TranscriptionStreamLanguageType = Literal["transcription.language"] - - -class TranscriptionStreamLanguageTypedDict(TypedDict): - audio_language: str - type: NotRequired[TranscriptionStreamLanguageType] - - -class TranscriptionStreamLanguage(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - - audio_language: str - - type: Optional[TranscriptionStreamLanguageType] = "transcription.language" - - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/src/mistralai/models/transcriptionstreamsegmentdelta.py b/src/mistralai/models/transcriptionstreamsegmentdelta.py deleted file mode 100644 index 61b396b4..00000000 --- a/src/mistralai/models/transcriptionstreamsegmentdelta.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -import pydantic -from pydantic import ConfigDict -from typing import Any, Dict, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -TranscriptionStreamSegmentDeltaType = Literal["transcription.segment"] - - -class TranscriptionStreamSegmentDeltaTypedDict(TypedDict): - text: str - start: float - end: float - type: NotRequired[TranscriptionStreamSegmentDeltaType] - - -class TranscriptionStreamSegmentDelta(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - - text: str - - start: float - - end: float - - type: Optional[TranscriptionStreamSegmentDeltaType] = "transcription.segment" - - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/src/mistralai/models/transcriptionstreamtextdelta.py b/src/mistralai/models/transcriptionstreamtextdelta.py deleted file mode 100644 index 8f0b0e59..00000000 --- a/src/mistralai/models/transcriptionstreamtextdelta.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -import pydantic -from pydantic import ConfigDict -from typing import Any, Dict, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -TranscriptionStreamTextDeltaType = Literal["transcription.text.delta"] - - -class TranscriptionStreamTextDeltaTypedDict(TypedDict): - text: str - type: NotRequired[TranscriptionStreamTextDeltaType] - - -class TranscriptionStreamTextDelta(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - - text: str - - type: Optional[TranscriptionStreamTextDeltaType] = "transcription.text.delta" - - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/src/mistralai/models/unarchiveftmodelout.py b/src/mistralai/models/unarchiveftmodelout.py deleted file mode 100644 index 6b2f730d..00000000 --- a/src/mistralai/models/unarchiveftmodelout.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -UnarchiveFTModelOutObject = Literal["model"] - - -class UnarchiveFTModelOutTypedDict(TypedDict): - id: str - object: NotRequired[UnarchiveFTModelOutObject] - archived: NotRequired[bool] - - -class UnarchiveFTModelOut(BaseModel): - id: str - - object: Optional[UnarchiveFTModelOutObject] = "model" - - archived: Optional[bool] = False diff --git a/src/mistralai/models/updateftmodelin.py b/src/mistralai/models/updateftmodelin.py deleted file mode 100644 index 1bd0eaf2..00000000 --- a/src/mistralai/models/updateftmodelin.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict - - -class UpdateFTModelInTypedDict(TypedDict): - name: NotRequired[Nullable[str]] - description: NotRequired[Nullable[str]] - - -class UpdateFTModelIn(BaseModel): - name: OptionalNullable[str] = UNSET - - description: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["name", "description"] - nullable_fields = ["name", "description"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/uploadfileout.py b/src/mistralai/models/uploadfileout.py deleted file mode 100644 index 8f9f1067..00000000 --- a/src/mistralai/models/uploadfileout.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .filepurpose import FilePurpose -from .sampletype import SampleType -from .source import Source -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from mistralai.utils import validate_open_enum -import pydantic -from pydantic import model_serializer -from pydantic.functional_validators import PlainValidator -from typing_extensions import Annotated, NotRequired, TypedDict - - -class UploadFileOutTypedDict(TypedDict): - id: str - r"""The unique identifier of the file.""" - object: str - r"""The object type, which is always \"file\".""" - size_bytes: int - r"""The size of the file, in bytes.""" - created_at: int - r"""The UNIX timestamp (in seconds) of the event.""" - filename: str - r"""The name of the uploaded file.""" - purpose: FilePurpose - sample_type: SampleType - source: Source - num_lines: NotRequired[Nullable[int]] - mimetype: NotRequired[Nullable[str]] - signature: NotRequired[Nullable[str]] - - -class UploadFileOut(BaseModel): - id: str - r"""The unique identifier of the file.""" - - object: str - r"""The object type, which is always \"file\".""" - - size_bytes: Annotated[int, pydantic.Field(alias="bytes")] - r"""The size of the file, in bytes.""" - - created_at: int - r"""The UNIX timestamp (in seconds) of the event.""" - - filename: str - r"""The name of the uploaded file.""" - - purpose: Annotated[FilePurpose, PlainValidator(validate_open_enum(False))] - - sample_type: Annotated[SampleType, PlainValidator(validate_open_enum(False))] - - source: Annotated[Source, PlainValidator(validate_open_enum(False))] - - num_lines: OptionalNullable[int] = UNSET - - mimetype: OptionalNullable[str] = UNSET - - signature: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["num_lines", "mimetype", "signature"] - nullable_fields = ["num_lines", "mimetype", "signature"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/usageinfo.py b/src/mistralai/models/usageinfo.py deleted file mode 100644 index cedad5c1..00000000 --- a/src/mistralai/models/usageinfo.py +++ /dev/null @@ -1,76 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -import pydantic -from pydantic import ConfigDict, model_serializer -from typing import Any, Dict, Optional -from typing_extensions import NotRequired, TypedDict - - -class UsageInfoTypedDict(TypedDict): - prompt_tokens: NotRequired[int] - completion_tokens: NotRequired[int] - total_tokens: NotRequired[int] - prompt_audio_seconds: NotRequired[Nullable[int]] - - -class UsageInfo(BaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, extra="allow" - ) - __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) - - prompt_tokens: Optional[int] = 0 - - completion_tokens: Optional[int] = 0 - - total_tokens: Optional[int] = 0 - - prompt_audio_seconds: OptionalNullable[int] = UNSET - - @property - def additional_properties(self): - return self.__pydantic_extra__ - - @additional_properties.setter - def additional_properties(self, value): - self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "prompt_tokens", - "completion_tokens", - "total_tokens", - "prompt_audio_seconds", - ] - nullable_fields = ["prompt_audio_seconds"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - for k, v in serialized.items(): - m[k] = v - - return m diff --git a/src/mistralai/models/usermessage.py b/src/mistralai/models/usermessage.py deleted file mode 100644 index 049bc755..00000000 --- a/src/mistralai/models/usermessage.py +++ /dev/null @@ -1,60 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .contentchunk import ContentChunk, ContentChunkTypedDict -from mistralai.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -UserMessageContentTypedDict = TypeAliasType( - "UserMessageContentTypedDict", Union[str, List[ContentChunkTypedDict]] -) - - -UserMessageContent = TypeAliasType("UserMessageContent", Union[str, List[ContentChunk]]) - - -UserMessageRole = Literal["user"] - - -class UserMessageTypedDict(TypedDict): - content: Nullable[UserMessageContentTypedDict] - role: NotRequired[UserMessageRole] - - -class UserMessage(BaseModel): - content: Nullable[UserMessageContent] - - role: Optional[UserMessageRole] = "user" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["role"] - nullable_fields = ["content"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/validationerror.py b/src/mistralai/models/validationerror.py deleted file mode 100644 index e971e016..00000000 --- a/src/mistralai/models/validationerror.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import List, Union -from typing_extensions import TypeAliasType, TypedDict - - -LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int]) - - -Loc = TypeAliasType("Loc", Union[str, int]) - - -class ValidationErrorTypedDict(TypedDict): - loc: List[LocTypedDict] - msg: str - type: str - - -class ValidationError(BaseModel): - loc: List[Loc] - - msg: str - - type: str diff --git a/src/mistralai/models/wandbintegration.py b/src/mistralai/models/wandbintegration.py deleted file mode 100644 index 0789b648..00000000 --- a/src/mistralai/models/wandbintegration.py +++ /dev/null @@ -1,66 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -WandbIntegrationType = Literal["wandb"] - - -class WandbIntegrationTypedDict(TypedDict): - project: str - r"""The name of the project that the new run will be created under.""" - api_key: str - r"""The WandB API key to use for authentication.""" - type: NotRequired[WandbIntegrationType] - name: NotRequired[Nullable[str]] - r"""A display name to set for the run. If not set, will use the job ID as the name.""" - run_name: NotRequired[Nullable[str]] - - -class WandbIntegration(BaseModel): - project: str - r"""The name of the project that the new run will be created under.""" - - api_key: str - r"""The WandB API key to use for authentication.""" - - type: Optional[WandbIntegrationType] = "wandb" - - name: OptionalNullable[str] = UNSET - r"""A display name to set for the run. If not set, will use the job ID as the name.""" - - run_name: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "name", "run_name"] - nullable_fields = ["name", "run_name"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/wandbintegrationout.py b/src/mistralai/models/wandbintegrationout.py deleted file mode 100644 index a1c2f570..00000000 --- a/src/mistralai/models/wandbintegrationout.py +++ /dev/null @@ -1,64 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -WandbIntegrationOutType = Literal["wandb"] - - -class WandbIntegrationOutTypedDict(TypedDict): - project: str - r"""The name of the project that the new run will be created under.""" - type: NotRequired[WandbIntegrationOutType] - name: NotRequired[Nullable[str]] - r"""A display name to set for the run. If not set, will use the job ID as the name.""" - run_name: NotRequired[Nullable[str]] - url: NotRequired[Nullable[str]] - - -class WandbIntegrationOut(BaseModel): - project: str - r"""The name of the project that the new run will be created under.""" - - type: Optional[WandbIntegrationOutType] = "wandb" - - name: OptionalNullable[str] = UNSET - r"""A display name to set for the run. If not set, will use the job ID as the name.""" - - run_name: OptionalNullable[str] = UNSET - - url: OptionalNullable[str] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["type", "name", "run_name", "url"] - nullable_fields = ["name", "run_name", "url"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/mistralai/models/websearchpremiumtool.py b/src/mistralai/models/websearchpremiumtool.py deleted file mode 100644 index 70fc5626..00000000 --- a/src/mistralai/models/websearchpremiumtool.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -WebSearchPremiumToolType = Literal["web_search_premium"] - - -class WebSearchPremiumToolTypedDict(TypedDict): - type: NotRequired[WebSearchPremiumToolType] - - -class WebSearchPremiumTool(BaseModel): - type: Optional[WebSearchPremiumToolType] = "web_search_premium" diff --git a/src/mistralai/models/websearchtool.py b/src/mistralai/models/websearchtool.py deleted file mode 100644 index 3dfd1c53..00000000 --- a/src/mistralai/models/websearchtool.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from mistralai.types import BaseModel -from typing import Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -WebSearchToolType = Literal["web_search"] - - -class WebSearchToolTypedDict(TypedDict): - type: NotRequired[WebSearchToolType] - - -class WebSearchTool(BaseModel): - type: Optional[WebSearchToolType] = "web_search" diff --git a/src/mistralai/ocr.py b/src/mistralai/ocr.py deleted file mode 100644 index bed8b7be..00000000 --- a/src/mistralai/ocr.py +++ /dev/null @@ -1,257 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from mistralai import models, utils -from mistralai._hooks import HookContext -from mistralai.types import Nullable, OptionalNullable, UNSET -from mistralai.utils import get_security_from_env -from mistralai.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, List, Mapping, Optional, Union - - -class Ocr(BaseSDK): - r"""OCR API""" - - def process( - self, - *, - model: Nullable[str], - document: Union[models.Document, models.DocumentTypedDict], - id: Optional[str] = None, - pages: OptionalNullable[List[int]] = UNSET, - include_image_base64: OptionalNullable[bool] = UNSET, - image_limit: OptionalNullable[int] = UNSET, - image_min_size: OptionalNullable[int] = UNSET, - bbox_annotation_format: OptionalNullable[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = UNSET, - document_annotation_format: OptionalNullable[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.OCRResponse: - r"""OCR - - :param model: - :param document: Document to run OCR on - :param id: - :param pages: Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 - :param include_image_base64: Include image URLs in response - :param image_limit: Max images to extract - :param image_min_size: Minimum height and width of image to extract - :param bbox_annotation_format: Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field - :param document_annotation_format: Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.OCRRequest( - model=model, - id=id, - document=utils.get_pydantic_model(document, models.Document), - pages=pages, - include_image_base64=include_image_base64, - image_limit=image_limit, - image_min_size=image_min_size, - bbox_annotation_format=utils.get_pydantic_model( - bbox_annotation_format, OptionalNullable[models.ResponseFormat] - ), - document_annotation_format=utils.get_pydantic_model( - document_annotation_format, OptionalNullable[models.ResponseFormat] - ), - ) - - req = self._build_request( - method="POST", - path="/v1/ocr", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.OCRRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="ocr_v1_ocr_post", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.OCRResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) - - async def process_async( - self, - *, - model: Nullable[str], - document: Union[models.Document, models.DocumentTypedDict], - id: Optional[str] = None, - pages: OptionalNullable[List[int]] = UNSET, - include_image_base64: OptionalNullable[bool] = UNSET, - image_limit: OptionalNullable[int] = UNSET, - image_min_size: OptionalNullable[int] = UNSET, - bbox_annotation_format: OptionalNullable[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = UNSET, - document_annotation_format: OptionalNullable[ - Union[models.ResponseFormat, models.ResponseFormatTypedDict] - ] = UNSET, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> models.OCRResponse: - r"""OCR - - :param model: - :param document: Document to run OCR on - :param id: - :param pages: Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0 - :param include_image_base64: Include image URLs in response - :param image_limit: Max images to extract - :param image_min_size: Minimum height and width of image to extract - :param bbox_annotation_format: Structured output class for extracting useful information from each extracted bounding box / image from document. Only json_schema is valid for this field - :param document_annotation_format: Structured output class for extracting useful information from the entire document. Only json_schema is valid for this field - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = models.OCRRequest( - model=model, - id=id, - document=utils.get_pydantic_model(document, models.Document), - pages=pages, - include_image_base64=include_image_base64, - image_limit=image_limit, - image_min_size=image_min_size, - bbox_annotation_format=utils.get_pydantic_model( - bbox_annotation_format, OptionalNullable[models.ResponseFormat] - ), - document_annotation_format=utils.get_pydantic_model( - document_annotation_format, OptionalNullable[models.ResponseFormat] - ), - ) - - req = self._build_request_async( - method="POST", - path="/v1/ocr", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request, False, False, "json", models.OCRRequest - ), - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="ocr_v1_ocr_post", - oauth2_scopes=[], - security_source=get_security_from_env( - self.sdk_configuration.security, models.Security - ), - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(models.OCRResponse, http_res) - if utils.match_response(http_res, "422", "application/json"): - response_data = unmarshal_json_response( - models.HTTPValidationErrorData, http_res - ) - raise models.HTTPValidationError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise models.SDKError("API error occurred", http_res, http_res_text) - - raise models.SDKError("Unexpected response received", http_res) diff --git a/src/mistralai/sdk.py b/src/mistralai/sdk.py deleted file mode 100644 index 311147fd..00000000 --- a/src/mistralai/sdk.py +++ /dev/null @@ -1,222 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients -from .sdkconfiguration import SDKConfiguration -from .utils.logger import Logger, get_default_logger -from .utils.retries import RetryConfig -import httpx -import importlib -from mistralai import models, utils -from mistralai._hooks import SDKHooks -from mistralai.types import OptionalNullable, UNSET -import sys -from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast -import weakref - -if TYPE_CHECKING: - from mistralai.agents import Agents - from mistralai.audio import Audio - from mistralai.batch import Batch - from mistralai.beta import Beta - from mistralai.chat import Chat - from mistralai.classifiers import Classifiers - from mistralai.embeddings import Embeddings - from mistralai.files import Files - from mistralai.fim import Fim - from mistralai.fine_tuning import FineTuning - from mistralai.models_ import Models - from mistralai.ocr import Ocr - - -class Mistral(BaseSDK): - r"""Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.""" - - models: "Models" - r"""Model Management API""" - beta: "Beta" - files: "Files" - r"""Files API""" - fine_tuning: "FineTuning" - batch: "Batch" - chat: "Chat" - r"""Chat Completion API.""" - fim: "Fim" - r"""Fill-in-the-middle API.""" - agents: "Agents" - r"""Agents API.""" - embeddings: "Embeddings" - r"""Embeddings API.""" - classifiers: "Classifiers" - r"""Classifiers API.""" - ocr: "Ocr" - r"""OCR API""" - audio: "Audio" - _sub_sdk_map = { - "models": ("mistralai.models_", "Models"), - "beta": ("mistralai.beta", "Beta"), - "files": ("mistralai.files", "Files"), - "fine_tuning": ("mistralai.fine_tuning", "FineTuning"), - "batch": ("mistralai.batch", "Batch"), - "chat": ("mistralai.chat", "Chat"), - "fim": ("mistralai.fim", "Fim"), - "agents": ("mistralai.agents", "Agents"), - "embeddings": ("mistralai.embeddings", "Embeddings"), - "classifiers": ("mistralai.classifiers", "Classifiers"), - "ocr": ("mistralai.ocr", "Ocr"), - "audio": ("mistralai.audio", "Audio"), - } - - def __init__( - self, - api_key: Optional[Union[Optional[str], Callable[[], Optional[str]]]] = None, - server: Optional[str] = None, - server_url: Optional[str] = None, - url_params: Optional[Dict[str, str]] = None, - client: Optional[HttpClient] = None, - async_client: Optional[AsyncHttpClient] = None, - retry_config: OptionalNullable[RetryConfig] = UNSET, - timeout_ms: Optional[int] = None, - debug_logger: Optional[Logger] = None, - ) -> None: - r"""Instantiates the SDK configuring it with the provided parameters. - - :param api_key: The api_key required for authentication - :param server: The server by name to use for all methods - :param server_url: The server URL to use for all methods - :param url_params: Parameters to optionally template the server URL with - :param client: The HTTP client to use for all synchronous methods - :param async_client: The Async HTTP client to use for all asynchronous methods - :param retry_config: The retry configuration to use for all supported methods - :param timeout_ms: Optional request timeout applied to each operation in milliseconds - """ - client_supplied = True - if client is None: - client = httpx.Client() - client_supplied = False - - assert issubclass( - type(client), HttpClient - ), "The provided client must implement the HttpClient protocol." - - async_client_supplied = True - if async_client is None: - async_client = httpx.AsyncClient() - async_client_supplied = False - - if debug_logger is None: - debug_logger = get_default_logger() - - assert issubclass( - type(async_client), AsyncHttpClient - ), "The provided async_client must implement the AsyncHttpClient protocol." - - security: Any = None - if callable(api_key): - # pylint: disable=unnecessary-lambda-assignment - security = lambda: models.Security(api_key=api_key()) - else: - security = models.Security(api_key=api_key) - - if server_url is not None: - if url_params is not None: - server_url = utils.template_url(server_url, url_params) - - BaseSDK.__init__( - self, - SDKConfiguration( - client=client, - client_supplied=client_supplied, - async_client=async_client, - async_client_supplied=async_client_supplied, - security=security, - server_url=server_url, - server=server, - retry_config=retry_config, - timeout_ms=timeout_ms, - debug_logger=debug_logger, - ), - parent_ref=self, - ) - - hooks = SDKHooks() - - # pylint: disable=protected-access - self.sdk_configuration.__dict__["_hooks"] = hooks - - current_server_url, *_ = self.sdk_configuration.get_server_details() - server_url, self.sdk_configuration.client = hooks.sdk_init( - current_server_url, client - ) - if current_server_url != server_url: - self.sdk_configuration.server_url = server_url - - weakref.finalize( - self, - close_clients, - cast(ClientOwner, self.sdk_configuration), - self.sdk_configuration.client, - self.sdk_configuration.client_supplied, - self.sdk_configuration.async_client, - self.sdk_configuration.async_client_supplied, - ) - - def dynamic_import(self, modname, retries=3): - for attempt in range(retries): - try: - return importlib.import_module(modname) - except KeyError: - # Clear any half-initialized module and retry - sys.modules.pop(modname, None) - if attempt == retries - 1: - break - raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") - - def __getattr__(self, name: str): - if name in self._sub_sdk_map: - module_path, class_name = self._sub_sdk_map[name] - try: - module = self.dynamic_import(module_path) - klass = getattr(module, class_name) - instance = klass(self.sdk_configuration, parent_ref=self) - setattr(self, name, instance) - return instance - except ImportError as e: - raise AttributeError( - f"Failed to import module {module_path} for attribute {name}: {e}" - ) from e - except AttributeError as e: - raise AttributeError( - f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}" - ) from e - - raise AttributeError( - f"'{type(self).__name__}' object has no attribute '{name}'" - ) - - def __dir__(self): - default_attrs = list(super().__dir__()) - lazy_attrs = list(self._sub_sdk_map.keys()) - return sorted(list(set(default_attrs + lazy_attrs))) - - def __enter__(self): - return self - - async def __aenter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - if ( - self.sdk_configuration.client is not None - and not self.sdk_configuration.client_supplied - ): - self.sdk_configuration.client.close() - self.sdk_configuration.client = None - - async def __aexit__(self, exc_type, exc_val, exc_tb): - if ( - self.sdk_configuration.async_client is not None - and not self.sdk_configuration.async_client_supplied - ): - await self.sdk_configuration.async_client.aclose() - self.sdk_configuration.async_client = None diff --git a/src/mistralai/sdkconfiguration.py b/src/mistralai/sdkconfiguration.py deleted file mode 100644 index 7e77925d..00000000 --- a/src/mistralai/sdkconfiguration.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from ._version import ( - __gen_version__, - __openapi_doc_version__, - __user_agent__, - __version__, -) -from .httpclient import AsyncHttpClient, HttpClient -from .utils import Logger, RetryConfig, remove_suffix -from dataclasses import dataclass -from mistralai import models -from mistralai.types import OptionalNullable, UNSET -from pydantic import Field -from typing import Callable, Dict, Optional, Tuple, Union - - -SERVER_EU = "eu" -r"""EU Production server""" -SERVERS = { - SERVER_EU: "https://api.mistral.ai", -} -"""Contains the list of servers available to the SDK""" - - -@dataclass -class SDKConfiguration: - client: Union[HttpClient, None] - client_supplied: bool - async_client: Union[AsyncHttpClient, None] - async_client_supplied: bool - debug_logger: Logger - security: Optional[Union[models.Security, Callable[[], models.Security]]] = None - server_url: Optional[str] = "" - server: Optional[str] = "" - language: str = "python" - openapi_doc_version: str = __openapi_doc_version__ - sdk_version: str = __version__ - gen_version: str = __gen_version__ - user_agent: str = __user_agent__ - retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) - timeout_ms: Optional[int] = None - - def get_server_details(self) -> Tuple[str, Dict[str, str]]: - if self.server_url is not None and self.server_url: - return remove_suffix(self.server_url, "/"), {} - if not self.server: - self.server = SERVER_EU - - if self.server not in SERVERS: - raise ValueError(f'Invalid server "{self.server}"') - - return SERVERS[self.server], {} diff --git a/src/mistralai/types/__init__.py b/src/mistralai/types/__init__.py deleted file mode 100644 index fc76fe0c..00000000 --- a/src/mistralai/types/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basemodel import ( - BaseModel, - Nullable, - OptionalNullable, - UnrecognizedInt, - UnrecognizedStr, - UNSET, - UNSET_SENTINEL, -) - -__all__ = [ - "BaseModel", - "Nullable", - "OptionalNullable", - "UnrecognizedInt", - "UnrecognizedStr", - "UNSET", - "UNSET_SENTINEL", -] diff --git a/src/mistralai/types/basemodel.py b/src/mistralai/types/basemodel.py deleted file mode 100644 index 231c2e37..00000000 --- a/src/mistralai/types/basemodel.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from pydantic import ConfigDict, model_serializer -from pydantic import BaseModel as PydanticBaseModel -from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union -from typing_extensions import TypeAliasType, TypeAlias - - -class BaseModel(PydanticBaseModel): - model_config = ConfigDict( - populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() - ) - - -class Unset(BaseModel): - @model_serializer(mode="plain") - def serialize_model(self): - return UNSET_SENTINEL - - def __bool__(self) -> Literal[False]: - return False - - -UNSET = Unset() -UNSET_SENTINEL = "~?~unset~?~sentinel~?~" - - -T = TypeVar("T") -if TYPE_CHECKING: - Nullable: TypeAlias = Union[T, None] - OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] -else: - Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) - OptionalNullable = TypeAliasType( - "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) - ) - -UnrecognizedInt: TypeAlias = int -UnrecognizedStr: TypeAlias = str diff --git a/src/mistralai/utils/__init__.py b/src/mistralai/utils/__init__.py deleted file mode 100644 index 87192dde..00000000 --- a/src/mistralai/utils/__init__.py +++ /dev/null @@ -1,200 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import TYPE_CHECKING -from importlib import import_module -import builtins -import sys - -if TYPE_CHECKING: - from .annotations import get_discriminator - from .datetimes import parse_datetime - from .enums import OpenEnumMeta - from .headers import get_headers, get_response_headers - from .metadata import ( - FieldMetadata, - find_metadata, - FormMetadata, - HeaderMetadata, - MultipartFormMetadata, - PathParamMetadata, - QueryParamMetadata, - RequestMetadata, - SecurityMetadata, - ) - from .queryparams import get_query_params - from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig - from .requestbodies import serialize_request_body, SerializedRequestBody - from .security import get_security, get_security_from_env - - from .serializers import ( - get_pydantic_model, - marshal_json, - unmarshal, - unmarshal_json, - serialize_decimal, - serialize_float, - serialize_int, - stream_to_text, - stream_to_text_async, - stream_to_bytes, - stream_to_bytes_async, - validate_const, - validate_decimal, - validate_float, - validate_int, - validate_open_enum, - ) - from .url import generate_url, template_url, remove_suffix - from .values import ( - get_global_from_env, - match_content_type, - match_status_codes, - match_response, - cast_partial, - ) - from .logger import Logger, get_body_content, get_default_logger - -__all__ = [ - "BackoffStrategy", - "FieldMetadata", - "find_metadata", - "FormMetadata", - "generate_url", - "get_body_content", - "get_default_logger", - "get_discriminator", - "parse_datetime", - "get_global_from_env", - "get_headers", - "get_pydantic_model", - "get_query_params", - "get_response_headers", - "get_security", - "get_security_from_env", - "HeaderMetadata", - "Logger", - "marshal_json", - "match_content_type", - "match_status_codes", - "match_response", - "MultipartFormMetadata", - "OpenEnumMeta", - "PathParamMetadata", - "QueryParamMetadata", - "remove_suffix", - "Retries", - "retry", - "retry_async", - "RetryConfig", - "RequestMetadata", - "SecurityMetadata", - "serialize_decimal", - "serialize_float", - "serialize_int", - "serialize_request_body", - "SerializedRequestBody", - "stream_to_text", - "stream_to_text_async", - "stream_to_bytes", - "stream_to_bytes_async", - "template_url", - "unmarshal", - "unmarshal_json", - "validate_decimal", - "validate_const", - "validate_float", - "validate_int", - "validate_open_enum", - "cast_partial", -] - -_dynamic_imports: dict[str, str] = { - "BackoffStrategy": ".retries", - "FieldMetadata": ".metadata", - "find_metadata": ".metadata", - "FormMetadata": ".metadata", - "generate_url": ".url", - "get_body_content": ".logger", - "get_default_logger": ".logger", - "get_discriminator": ".annotations", - "parse_datetime": ".datetimes", - "get_global_from_env": ".values", - "get_headers": ".headers", - "get_pydantic_model": ".serializers", - "get_query_params": ".queryparams", - "get_response_headers": ".headers", - "get_security": ".security", - "get_security_from_env": ".security", - "HeaderMetadata": ".metadata", - "Logger": ".logger", - "marshal_json": ".serializers", - "match_content_type": ".values", - "match_status_codes": ".values", - "match_response": ".values", - "MultipartFormMetadata": ".metadata", - "OpenEnumMeta": ".enums", - "PathParamMetadata": ".metadata", - "QueryParamMetadata": ".metadata", - "remove_suffix": ".url", - "Retries": ".retries", - "retry": ".retries", - "retry_async": ".retries", - "RetryConfig": ".retries", - "RequestMetadata": ".metadata", - "SecurityMetadata": ".metadata", - "serialize_decimal": ".serializers", - "serialize_float": ".serializers", - "serialize_int": ".serializers", - "serialize_request_body": ".requestbodies", - "SerializedRequestBody": ".requestbodies", - "stream_to_text": ".serializers", - "stream_to_text_async": ".serializers", - "stream_to_bytes": ".serializers", - "stream_to_bytes_async": ".serializers", - "template_url": ".url", - "unmarshal": ".serializers", - "unmarshal_json": ".serializers", - "validate_decimal": ".serializers", - "validate_const": ".serializers", - "validate_float": ".serializers", - "validate_int": ".serializers", - "validate_open_enum": ".serializers", - "cast_partial": ".values", -} - - -def dynamic_import(modname, retries=3): - for attempt in range(retries): - try: - return import_module(modname, __package__) - except KeyError: - # Clear any half-initialized module and retry - sys.modules.pop(modname, None) - if attempt == retries - 1: - break - raise KeyError(f"Failed to import module '{modname}' after {retries} attempts") - - -def __getattr__(attr_name: str) -> object: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError( - f"no {attr_name} found in _dynamic_imports, module name -> {__name__} " - ) - - try: - module = dynamic_import(module_name) - return getattr(module, attr_name) - except ImportError as e: - raise ImportError( - f"Failed to import {attr_name} from {module_name}: {e}" - ) from e - except AttributeError as e: - raise AttributeError( - f"Failed to get {attr_name} from {module_name}: {e}" - ) from e - - -def __dir__(): - lazy_attrs = builtins.list(_dynamic_imports.keys()) - return builtins.sorted(lazy_attrs) diff --git a/src/mistralai/utils/annotations.py b/src/mistralai/utils/annotations.py deleted file mode 100644 index 387874ed..00000000 --- a/src/mistralai/utils/annotations.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from enum import Enum -from typing import Any, Optional - -def get_discriminator(model: Any, fieldname: str, key: str) -> str: - """ - Recursively search for the discriminator attribute in a model. - - Args: - model (Any): The model to search within. - fieldname (str): The name of the field to search for. - key (str): The key to search for in dictionaries. - - Returns: - str: The name of the discriminator attribute. - - Raises: - ValueError: If the discriminator attribute is not found. - """ - upper_fieldname = fieldname.upper() - - def get_field_discriminator(field: Any) -> Optional[str]: - """Search for the discriminator attribute in a given field.""" - - if isinstance(field, dict): - if key in field: - return f'{field[key]}' - - if hasattr(field, fieldname): - attr = getattr(field, fieldname) - if isinstance(attr, Enum): - return f'{attr.value}' - return f'{attr}' - - if hasattr(field, upper_fieldname): - attr = getattr(field, upper_fieldname) - if isinstance(attr, Enum): - return f'{attr.value}' - return f'{attr}' - - return None - - - if isinstance(model, list): - for field in model: - discriminator = get_field_discriminator(field) - if discriminator is not None: - return discriminator - - discriminator = get_field_discriminator(model) - if discriminator is not None: - return discriminator - - raise ValueError(f'Could not find discriminator field {fieldname} in {model}') diff --git a/src/mistralai/utils/enums.py b/src/mistralai/utils/enums.py deleted file mode 100644 index c3bc13cf..00000000 --- a/src/mistralai/utils/enums.py +++ /dev/null @@ -1,74 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import enum -import sys - -class OpenEnumMeta(enum.EnumMeta): - # The __call__ method `boundary` kwarg was added in 3.11 and must be present - # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 - # pylint: disable=unexpected-keyword-arg - # The __call__ method `values` varg must be named for pyright. - # pylint: disable=keyword-arg-before-vararg - - if sys.version_info >= (3, 11): - def __call__( - cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin - - if names is not None: - return super().__call__( - value, - names=names, - *values, - module=module, - qualname=qualname, - type=type, - start=start, - boundary=boundary, - ) - - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - *values, - module=module, - qualname=qualname, - type=type, - start=start, - boundary=boundary, - ) - except ValueError: - return value - else: - def __call__( - cls, value, names=None, *, module=None, qualname=None, type=None, start=1 - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin - - if names is not None: - return super().__call__( - value, - names=names, - module=module, - qualname=qualname, - type=type, - start=start, - ) - - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - module=module, - qualname=qualname, - type=type, - start=start, - ) - except ValueError: - return value diff --git a/src/mistralai/utils/eventstreaming.py b/src/mistralai/utils/eventstreaming.py deleted file mode 100644 index 0969899b..00000000 --- a/src/mistralai/utils/eventstreaming.py +++ /dev/null @@ -1,248 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import re -import json -from typing import ( - Callable, - Generic, - TypeVar, - Optional, - Generator, - AsyncGenerator, - Tuple, -) -import httpx - -T = TypeVar("T") - - -class EventStream(Generic[T]): - # Holds a reference to the SDK client to avoid it being garbage collected - # and cause termination of the underlying httpx client. - client_ref: Optional[object] - response: httpx.Response - generator: Generator[T, None, None] - - def __init__( - self, - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, - client_ref: Optional[object] = None, - ): - self.response = response - self.generator = stream_events(response, decoder, sentinel) - self.client_ref = client_ref - - def __iter__(self): - return self - - def __next__(self): - return next(self.generator) - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - self.response.close() - - -class EventStreamAsync(Generic[T]): - # Holds a reference to the SDK client to avoid it being garbage collected - # and cause termination of the underlying httpx client. - client_ref: Optional[object] - response: httpx.Response - generator: AsyncGenerator[T, None] - - def __init__( - self, - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, - client_ref: Optional[object] = None, - ): - self.response = response - self.generator = stream_events_async(response, decoder, sentinel) - self.client_ref = client_ref - - def __aiter__(self): - return self - - async def __anext__(self): - return await self.generator.__anext__() - - async def __aenter__(self): - return self - - async def __aexit__(self, exc_type, exc_val, exc_tb): - await self.response.aclose() - - -class ServerEvent: - id: Optional[str] = None - event: Optional[str] = None - data: Optional[str] = None - retry: Optional[int] = None - - -MESSAGE_BOUNDARIES = [ - b"\r\n\r\n", - b"\n\n", - b"\r\r", -] - - -async def stream_events_async( - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, -) -> AsyncGenerator[T, None]: - buffer = bytearray() - position = 0 - discard = False - async for chunk in response.aiter_bytes(): - # We've encountered the sentinel value and should no longer process - # incoming data. Instead we throw new data away until the server closes - # the connection. - if discard: - continue - - buffer += chunk - for i in range(position, len(buffer)): - char = buffer[i : i + 1] - seq: Optional[bytes] = None - if char in [b"\r", b"\n"]: - for boundary in MESSAGE_BOUNDARIES: - seq = _peek_sequence(i, buffer, boundary) - if seq is not None: - break - if seq is None: - continue - - block = buffer[position:i] - position = i + len(seq) - event, discard = _parse_event(block, decoder, sentinel) - if event is not None: - yield event - - if position > 0: - buffer = buffer[position:] - position = 0 - - event, discard = _parse_event(buffer, decoder, sentinel) - if event is not None: - yield event - - -def stream_events( - response: httpx.Response, - decoder: Callable[[str], T], - sentinel: Optional[str] = None, -) -> Generator[T, None, None]: - buffer = bytearray() - position = 0 - discard = False - for chunk in response.iter_bytes(): - # We've encountered the sentinel value and should no longer process - # incoming data. Instead we throw new data away until the server closes - # the connection. - if discard: - continue - - buffer += chunk - for i in range(position, len(buffer)): - char = buffer[i : i + 1] - seq: Optional[bytes] = None - if char in [b"\r", b"\n"]: - for boundary in MESSAGE_BOUNDARIES: - seq = _peek_sequence(i, buffer, boundary) - if seq is not None: - break - if seq is None: - continue - - block = buffer[position:i] - position = i + len(seq) - event, discard = _parse_event(block, decoder, sentinel) - if event is not None: - yield event - - if position > 0: - buffer = buffer[position:] - position = 0 - - event, discard = _parse_event(buffer, decoder, sentinel) - if event is not None: - yield event - - -def _parse_event( - raw: bytearray, decoder: Callable[[str], T], sentinel: Optional[str] = None -) -> Tuple[Optional[T], bool]: - block = raw.decode() - lines = re.split(r"\r?\n|\r", block) - publish = False - event = ServerEvent() - data = "" - for line in lines: - if not line: - continue - - delim = line.find(":") - if delim <= 0: - continue - - field = line[0:delim] - value = line[delim + 1 :] if delim < len(line) - 1 else "" - if len(value) and value[0] == " ": - value = value[1:] - - if field == "event": - event.event = value - publish = True - elif field == "data": - data += value + "\n" - publish = True - elif field == "id": - event.id = value - publish = True - elif field == "retry": - event.retry = int(value) if value.isdigit() else None - publish = True - - if sentinel and data == f"{sentinel}\n": - return None, True - - if data: - data = data[:-1] - event.data = data - - data_is_primitive = ( - data.isnumeric() or data == "true" or data == "false" or data == "null" - ) - data_is_json = ( - data.startswith("{") or data.startswith("[") or data.startswith('"') - ) - - if data_is_primitive or data_is_json: - try: - event.data = json.loads(data) - except Exception: - pass - - out = None - if publish: - out = decoder(json.dumps(event.__dict__)) - - return out, False - - -def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): - if len(sequence) > (len(buffer) - position): - return None - - for i, seq in enumerate(sequence): - if buffer[position + i] != seq: - return None - - return sequence diff --git a/src/mistralai/utils/forms.py b/src/mistralai/utils/forms.py deleted file mode 100644 index e873495f..00000000 --- a/src/mistralai/utils/forms.py +++ /dev/null @@ -1,223 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import ( - Any, - Dict, - get_type_hints, - List, - Tuple, -) -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .serializers import marshal_json - -from .metadata import ( - FormMetadata, - MultipartFormMetadata, - find_field_metadata, -) -from .values import _is_set, _val_to_string - - -def _populate_form( - field_name: str, - explode: bool, - obj: Any, - delimiter: str, - form: Dict[str, List[str]], -): - if not _is_set(obj): - return form - - if isinstance(obj, BaseModel): - items = [] - - obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields - for name in obj_fields: - obj_field = obj_fields[name] - obj_field_name = obj_field.alias if obj_field.alias is not None else name - if obj_field_name == "": - continue - - val = getattr(obj, name) - if not _is_set(val): - continue - - if explode: - form[obj_field_name] = [_val_to_string(val)] - else: - items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, Dict): - items = [] - for key, value in obj.items(): - if not _is_set(value): - continue - - if explode: - form[key] = [_val_to_string(value)] - else: - items.append(f"{key}{delimiter}{_val_to_string(value)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, List): - items = [] - - for value in obj: - if not _is_set(value): - continue - - if explode: - if not field_name in form: - form[field_name] = [] - form[field_name].append(_val_to_string(value)) - else: - items.append(_val_to_string(value)) - - if len(items) > 0: - form[field_name] = [delimiter.join([str(item) for item in items])] - else: - form[field_name] = [_val_to_string(obj)] - - return form - - -def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]: - """Extract file name, content, and content type from a file object.""" - file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields - - file_name = "" - content = None - content_type = None - - for file_field_name in file_fields: - file_field = file_fields[file_field_name] - - file_metadata = find_field_metadata(file_field, MultipartFormMetadata) - if file_metadata is None: - continue - - if file_metadata.content: - content = getattr(file_obj, file_field_name, None) - elif file_field_name == "content_type": - content_type = getattr(file_obj, file_field_name, None) - else: - file_name = getattr(file_obj, file_field_name) - - if file_name == "" or content is None: - raise ValueError("invalid multipart/form-data file") - - return file_name, content, content_type - - -def serialize_multipart_form( - media_type: str, request: Any -) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]: - form: Dict[str, Any] = {} - files: List[Tuple[str, Any]] = [] - - if not isinstance(request, BaseModel): - raise TypeError("invalid request body type") - - request_fields: Dict[str, FieldInfo] = request.__class__.model_fields - request_field_types = get_type_hints(request.__class__) - - for name in request_fields: - field = request_fields[name] - - val = getattr(request, name) - if not _is_set(val): - continue - - field_metadata = find_field_metadata(field, MultipartFormMetadata) - if not field_metadata: - continue - - f_name = field.alias if field.alias else name - - if field_metadata.file: - if isinstance(val, List): - # Handle array of files - for file_obj in val: - if not _is_set(file_obj): - continue - - file_name, content, content_type = _extract_file_properties(file_obj) - - if content_type is not None: - files.append((f_name + "[]", (file_name, content, content_type))) - else: - files.append((f_name + "[]", (file_name, content))) - else: - # Handle single file - file_name, content, content_type = _extract_file_properties(val) - - if content_type is not None: - files.append((f_name, (file_name, content, content_type))) - else: - files.append((f_name, (file_name, content))) - elif field_metadata.json: - files.append((f_name, ( - None, - marshal_json(val, request_field_types[name]), - "application/json", - ))) - else: - if isinstance(val, List): - values = [] - - for value in val: - if not _is_set(value): - continue - values.append(_val_to_string(value)) - - form[f_name + "[]"] = values - else: - form[f_name] = _val_to_string(val) - return media_type, form, files - - -def serialize_form_data(data: Any) -> Dict[str, Any]: - form: Dict[str, List[str]] = {} - - if isinstance(data, BaseModel): - data_fields: Dict[str, FieldInfo] = data.__class__.model_fields - data_field_types = get_type_hints(data.__class__) - for name in data_fields: - field = data_fields[name] - - val = getattr(data, name) - if not _is_set(val): - continue - - metadata = find_field_metadata(field, FormMetadata) - if metadata is None: - continue - - f_name = field.alias if field.alias is not None else name - - if metadata.json: - form[f_name] = [marshal_json(val, data_field_types[name])] - else: - if metadata.style == "form": - _populate_form( - f_name, - metadata.explode, - val, - ",", - form, - ) - else: - raise ValueError(f"Invalid form style for field {name}") - elif isinstance(data, Dict): - for key, value in data.items(): - if _is_set(value): - form[key] = [_val_to_string(value)] - else: - raise TypeError(f"Invalid request body type {type(data)} for form data") - - return form diff --git a/src/mistralai/utils/queryparams.py b/src/mistralai/utils/queryparams.py deleted file mode 100644 index 37a6e7f9..00000000 --- a/src/mistralai/utils/queryparams.py +++ /dev/null @@ -1,205 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import ( - Any, - Dict, - get_type_hints, - List, - Optional, -) - -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .metadata import ( - QueryParamMetadata, - find_field_metadata, -) -from .values import ( - _get_serialized_params, - _is_set, - _populate_from_globals, - _val_to_string, -) -from .forms import _populate_form - - -def get_query_params( - query_params: Any, - gbls: Optional[Any] = None, -) -> Dict[str, List[str]]: - params: Dict[str, List[str]] = {} - - globals_already_populated = _populate_query_params(query_params, gbls, params, []) - if _is_set(gbls): - _populate_query_params(gbls, None, params, globals_already_populated) - - return params - - -def _populate_query_params( - query_params: Any, - gbls: Any, - query_param_values: Dict[str, List[str]], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - if not isinstance(query_params, BaseModel): - return globals_already_populated - - param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields - param_field_types = get_type_hints(query_params.__class__) - for name in param_fields: - if name in skip_fields: - continue - - field = param_fields[name] - - metadata = find_field_metadata(field, QueryParamMetadata) - if not metadata: - continue - - value = getattr(query_params, name) if _is_set(query_params) else None - - value, global_found = _populate_from_globals( - name, value, QueryParamMetadata, gbls - ) - if global_found: - globals_already_populated.append(name) - - f_name = field.alias if field.alias is not None else name - serialization = metadata.serialization - if serialization is not None: - serialized_parms = _get_serialized_params( - metadata, f_name, value, param_field_types[name] - ) - for key, value in serialized_parms.items(): - if key in query_param_values: - query_param_values[key].extend(value) - else: - query_param_values[key] = [value] - else: - style = metadata.style - if style == "deepObject": - _populate_deep_object_query_params(f_name, value, query_param_values) - elif style == "form": - _populate_delimited_query_params( - metadata, f_name, value, ",", query_param_values - ) - elif style == "pipeDelimited": - _populate_delimited_query_params( - metadata, f_name, value, "|", query_param_values - ) - else: - raise NotImplementedError( - f"query param style {style} not yet supported" - ) - - return globals_already_populated - - -def _populate_deep_object_query_params( - field_name: str, - obj: Any, - params: Dict[str, List[str]], -): - if not _is_set(obj): - return - - if isinstance(obj, BaseModel): - _populate_deep_object_query_params_basemodel(field_name, obj, params) - elif isinstance(obj, Dict): - _populate_deep_object_query_params_dict(field_name, obj, params) - - -def _populate_deep_object_query_params_basemodel( - prior_params_key: str, - obj: Any, - params: Dict[str, List[str]], -): - if not _is_set(obj) or not isinstance(obj, BaseModel): - return - - obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields - for name in obj_fields: - obj_field = obj_fields[name] - - f_name = obj_field.alias if obj_field.alias is not None else name - - params_key = f"{prior_params_key}[{f_name}]" - - obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) - if not _is_set(obj_param_metadata): - continue - - obj_val = getattr(obj, name) - if not _is_set(obj_val): - continue - - if isinstance(obj_val, BaseModel): - _populate_deep_object_query_params_basemodel(params_key, obj_val, params) - elif isinstance(obj_val, Dict): - _populate_deep_object_query_params_dict(params_key, obj_val, params) - elif isinstance(obj_val, List): - _populate_deep_object_query_params_list(params_key, obj_val, params) - else: - params[params_key] = [_val_to_string(obj_val)] - - -def _populate_deep_object_query_params_dict( - prior_params_key: str, - value: Dict, - params: Dict[str, List[str]], -): - if not _is_set(value): - return - - for key, val in value.items(): - if not _is_set(val): - continue - - params_key = f"{prior_params_key}[{key}]" - - if isinstance(val, BaseModel): - _populate_deep_object_query_params_basemodel(params_key, val, params) - elif isinstance(val, Dict): - _populate_deep_object_query_params_dict(params_key, val, params) - elif isinstance(val, List): - _populate_deep_object_query_params_list(params_key, val, params) - else: - params[params_key] = [_val_to_string(val)] - - -def _populate_deep_object_query_params_list( - params_key: str, - value: List, - params: Dict[str, List[str]], -): - if not _is_set(value): - return - - for val in value: - if not _is_set(val): - continue - - if params.get(params_key) is None: - params[params_key] = [] - - params[params_key].append(_val_to_string(val)) - - -def _populate_delimited_query_params( - metadata: QueryParamMetadata, - field_name: str, - obj: Any, - delimiter: str, - query_param_values: Dict[str, List[str]], -): - _populate_form( - field_name, - metadata.explode, - obj, - delimiter, - query_param_values, - ) diff --git a/src/mistralai/utils/requestbodies.py b/src/mistralai/utils/requestbodies.py deleted file mode 100644 index d5240dd5..00000000 --- a/src/mistralai/utils/requestbodies.py +++ /dev/null @@ -1,66 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import io -from dataclasses import dataclass -import re -from typing import ( - Any, - Optional, -) - -from .forms import serialize_form_data, serialize_multipart_form - -from .serializers import marshal_json - -SERIALIZATION_METHOD_TO_CONTENT_TYPE = { - "json": "application/json", - "form": "application/x-www-form-urlencoded", - "multipart": "multipart/form-data", - "raw": "application/octet-stream", - "string": "text/plain", -} - - -@dataclass -class SerializedRequestBody: - media_type: Optional[str] = None - content: Optional[Any] = None - data: Optional[Any] = None - files: Optional[Any] = None - - -def serialize_request_body( - request_body: Any, - nullable: bool, - optional: bool, - serialization_method: str, - request_body_type, -) -> Optional[SerializedRequestBody]: - if request_body is None: - if not nullable and optional: - return None - - media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] - - serialized_request_body = SerializedRequestBody(media_type) - - if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None: - serialized_request_body.content = marshal_json(request_body, request_body_type) - elif re.match(r"multipart\/.*", media_type) is not None: - ( - serialized_request_body.media_type, - serialized_request_body.data, - serialized_request_body.files, - ) = serialize_multipart_form(media_type, request_body) - elif re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None: - serialized_request_body.data = serialize_form_data(request_body) - elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): - serialized_request_body.content = request_body - elif isinstance(request_body, str): - serialized_request_body.content = request_body - else: - raise TypeError( - f"invalid request body type {type(request_body)} for mediaType {media_type}" - ) - - return serialized_request_body diff --git a/src/mistralai/utils/retries.py b/src/mistralai/utils/retries.py deleted file mode 100644 index 4d608671..00000000 --- a/src/mistralai/utils/retries.py +++ /dev/null @@ -1,217 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import asyncio -import random -import time -from typing import List - -import httpx - - -class BackoffStrategy: - initial_interval: int - max_interval: int - exponent: float - max_elapsed_time: int - - def __init__( - self, - initial_interval: int, - max_interval: int, - exponent: float, - max_elapsed_time: int, - ): - self.initial_interval = initial_interval - self.max_interval = max_interval - self.exponent = exponent - self.max_elapsed_time = max_elapsed_time - - -class RetryConfig: - strategy: str - backoff: BackoffStrategy - retry_connection_errors: bool - - def __init__( - self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool - ): - self.strategy = strategy - self.backoff = backoff - self.retry_connection_errors = retry_connection_errors - - -class Retries: - config: RetryConfig - status_codes: List[str] - - def __init__(self, config: RetryConfig, status_codes: List[str]): - self.config = config - self.status_codes = status_codes - - -class TemporaryError(Exception): - response: httpx.Response - - def __init__(self, response: httpx.Response): - self.response = response - - -class PermanentError(Exception): - inner: Exception - - def __init__(self, inner: Exception): - self.inner = inner - - -def retry(func, retries: Retries): - if retries.config.strategy == "backoff": - - def do_request() -> httpx.Response: - res: httpx.Response - try: - res = func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if code_range <= status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except httpx.ConnectError as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except httpx.TimeoutException as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return retry_with_backoff( - do_request, - retries.config.backoff.initial_interval, - retries.config.backoff.max_interval, - retries.config.backoff.exponent, - retries.config.backoff.max_elapsed_time, - ) - - return func() - - -async def retry_async(func, retries: Retries): - if retries.config.strategy == "backoff": - - async def do_request() -> httpx.Response: - res: httpx.Response - try: - res = await func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if code_range <= status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except httpx.ConnectError as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except httpx.TimeoutException as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return await retry_with_backoff_async( - do_request, - retries.config.backoff.initial_interval, - retries.config.backoff.max_interval, - retries.config.backoff.exponent, - retries.config.backoff.max_elapsed_time, - ) - - return await func() - - -def retry_with_backoff( - func, - initial_interval=500, - max_interval=60000, - exponent=1.5, - max_elapsed_time=3600000, -): - start = round(time.time() * 1000) - retries = 0 - - while True: - try: - return func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time() * 1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) - sleep = min(sleep, max_interval / 1000) - time.sleep(sleep) - retries += 1 - - -async def retry_with_backoff_async( - func, - initial_interval=500, - max_interval=60000, - exponent=1.5, - max_elapsed_time=3600000, -): - start = round(time.time() * 1000) - retries = 0 - - while True: - try: - return await func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time() * 1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) - sleep = min(sleep, max_interval / 1000) - await asyncio.sleep(sleep) - retries += 1 diff --git a/src/mistralai/utils/security.py b/src/mistralai/utils/security.py deleted file mode 100644 index 3b8526bf..00000000 --- a/src/mistralai/utils/security.py +++ /dev/null @@ -1,192 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -import base64 - -from typing import ( - Any, - Dict, - List, - Optional, - Tuple, -) -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -from .metadata import ( - SecurityMetadata, - find_field_metadata, -) -import os - - -def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: - headers: Dict[str, str] = {} - query_params: Dict[str, List[str]] = {} - - if security is None: - return headers, query_params - - if not isinstance(security, BaseModel): - raise TypeError("security must be a pydantic model") - - sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields - for name in sec_fields: - sec_field = sec_fields[name] - - value = getattr(security, name) - if value is None: - continue - - metadata = find_field_metadata(sec_field, SecurityMetadata) - if metadata is None: - continue - if metadata.option: - _parse_security_option(headers, query_params, value) - return headers, query_params - if metadata.scheme: - # Special case for basic auth or custom auth which could be a flattened model - if metadata.sub_type in ["basic", "custom"] and not isinstance( - value, BaseModel - ): - _parse_security_scheme(headers, query_params, metadata, name, security) - else: - _parse_security_scheme(headers, query_params, metadata, name, value) - - return headers, query_params - - -def get_security_from_env(security: Any, security_class: Any) -> Optional[BaseModel]: - if security is not None: - return security - - if not issubclass(security_class, BaseModel): - raise TypeError("security_class must be a pydantic model class") - - security_dict: Any = {} - - if os.getenv("MISTRAL_API_KEY"): - security_dict["api_key"] = os.getenv("MISTRAL_API_KEY") - - return security_class(**security_dict) if security_dict else None - - -def _parse_security_option( - headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any -): - if not isinstance(option, BaseModel): - raise TypeError("security option must be a pydantic model") - - opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields - for name in opt_fields: - opt_field = opt_fields[name] - - metadata = find_field_metadata(opt_field, SecurityMetadata) - if metadata is None or not metadata.scheme: - continue - _parse_security_scheme( - headers, query_params, metadata, name, getattr(option, name) - ) - - -def _parse_security_scheme( - headers: Dict[str, str], - query_params: Dict[str, List[str]], - scheme_metadata: SecurityMetadata, - field_name: str, - scheme: Any, -): - scheme_type = scheme_metadata.scheme_type - sub_type = scheme_metadata.sub_type - - if isinstance(scheme, BaseModel): - if scheme_type == "http": - if sub_type == "basic": - _parse_basic_auth_scheme(headers, scheme) - return - if sub_type == "custom": - return - - scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields - for name in scheme_fields: - scheme_field = scheme_fields[name] - - metadata = find_field_metadata(scheme_field, SecurityMetadata) - if metadata is None or metadata.field_name is None: - continue - - value = getattr(scheme, name) - - _parse_security_scheme_value( - headers, query_params, scheme_metadata, metadata, name, value - ) - else: - _parse_security_scheme_value( - headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme - ) - - -def _parse_security_scheme_value( - headers: Dict[str, str], - query_params: Dict[str, List[str]], - scheme_metadata: SecurityMetadata, - security_metadata: SecurityMetadata, - field_name: str, - value: Any, -): - scheme_type = scheme_metadata.scheme_type - sub_type = scheme_metadata.sub_type - - header_name = security_metadata.get_field_name(field_name) - - if scheme_type == "apiKey": - if sub_type == "header": - headers[header_name] = value - elif sub_type == "query": - query_params[header_name] = [value] - else: - raise ValueError("sub type {sub_type} not supported") - elif scheme_type == "openIdConnect": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "oauth2": - if sub_type != "client_credentials": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "http": - if sub_type == "bearer": - headers[header_name] = _apply_bearer(value) - elif sub_type == "custom": - return - else: - raise ValueError("sub type {sub_type} not supported") - else: - raise ValueError("scheme type {scheme_type} not supported") - - -def _apply_bearer(token: str) -> str: - return token.lower().startswith("bearer ") and token or f"Bearer {token}" - - -def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): - username = "" - password = "" - - if not isinstance(scheme, BaseModel): - raise TypeError("basic auth scheme must be a pydantic model") - - scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields - for name in scheme_fields: - scheme_field = scheme_fields[name] - - metadata = find_field_metadata(scheme_field, SecurityMetadata) - if metadata is None or metadata.field_name is None: - continue - - field_name = metadata.field_name - value = getattr(scheme, name) - - if field_name == "username": - username = value - if field_name == "password": - password = value - - data = f"{username}:{password}".encode() - headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/src/mistralai/utils/serializers.py b/src/mistralai/utils/serializers.py deleted file mode 100644 index 378a14c0..00000000 --- a/src/mistralai/utils/serializers.py +++ /dev/null @@ -1,249 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from decimal import Decimal -import functools -import json -import typing -from typing import Any, Dict, List, Tuple, Union, get_args -import typing_extensions -from typing_extensions import get_origin - -import httpx -from pydantic import ConfigDict, create_model -from pydantic_core import from_json - -from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset - - -def serialize_decimal(as_str: bool): - def serialize(d): - # Optional[T] is a Union[T, None] - if is_union(type(d)) and type(None) in get_args(type(d)) and d is None: - return None - if isinstance(d, Unset): - return d - - if not isinstance(d, Decimal): - raise ValueError("Expected Decimal object") - - return str(d) if as_str else float(d) - - return serialize - - -def validate_decimal(d): - if d is None: - return None - - if isinstance(d, (Decimal, Unset)): - return d - - if not isinstance(d, (str, int, float)): - raise ValueError("Expected string, int or float") - - return Decimal(str(d)) - - -def serialize_float(as_str: bool): - def serialize(f): - # Optional[T] is a Union[T, None] - if is_union(type(f)) and type(None) in get_args(type(f)) and f is None: - return None - if isinstance(f, Unset): - return f - - if not isinstance(f, float): - raise ValueError("Expected float") - - return str(f) if as_str else f - - return serialize - - -def validate_float(f): - if f is None: - return None - - if isinstance(f, (float, Unset)): - return f - - if not isinstance(f, str): - raise ValueError("Expected string") - - return float(f) - - -def serialize_int(as_str: bool): - def serialize(i): - # Optional[T] is a Union[T, None] - if is_union(type(i)) and type(None) in get_args(type(i)) and i is None: - return None - if isinstance(i, Unset): - return i - - if not isinstance(i, int): - raise ValueError("Expected int") - - return str(i) if as_str else i - - return serialize - - -def validate_int(b): - if b is None: - return None - - if isinstance(b, (int, Unset)): - return b - - if not isinstance(b, str): - raise ValueError("Expected string") - - return int(b) - - -def validate_open_enum(is_int: bool): - def validate(e): - if e is None: - return None - - if isinstance(e, Unset): - return e - - if is_int: - if not isinstance(e, int): - raise ValueError("Expected int") - else: - if not isinstance(e, str): - raise ValueError("Expected string") - - return e - - return validate - - -def validate_const(v): - def validate(c): - # Optional[T] is a Union[T, None] - if is_union(type(c)) and type(None) in get_args(type(c)) and c is None: - return None - - if v != c: - raise ValueError(f"Expected {v}") - - return c - - return validate - - -def unmarshal_json(raw, typ: Any) -> Any: - return unmarshal(from_json(raw), typ) - - -def unmarshal(val, typ: Any) -> Any: - unmarshaller = create_model( - "Unmarshaller", - body=(typ, ...), - __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), - ) - - m = unmarshaller(body=val) - - # pyright: ignore[reportAttributeAccessIssue] - return m.body # type: ignore - - -def marshal_json(val, typ): - if is_nullable(typ) and val is None: - return "null" - - marshaller = create_model( - "Marshaller", - body=(typ, ...), - __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), - ) - - m = marshaller(body=val) - - d = m.model_dump(by_alias=True, mode="json", exclude_none=True) - - if len(d) == 0: - return "" - - return json.dumps(d[next(iter(d))], separators=(",", ":")) - - -def is_nullable(field): - origin = get_origin(field) - if origin is Nullable or origin is OptionalNullable: - return True - - if not origin is Union or type(None) not in get_args(field): - return False - - for arg in get_args(field): - if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: - return True - - return False - - -def is_union(obj: object) -> bool: - """ - Returns True if the given object is a typing.Union or typing_extensions.Union. - """ - return any( - obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union") - ) - - -def stream_to_text(stream: httpx.Response) -> str: - return "".join(stream.iter_text()) - - -async def stream_to_text_async(stream: httpx.Response) -> str: - return "".join([chunk async for chunk in stream.aiter_text()]) - - -def stream_to_bytes(stream: httpx.Response) -> bytes: - return stream.content - - -async def stream_to_bytes_async(stream: httpx.Response) -> bytes: - return await stream.aread() - - -def get_pydantic_model(data: Any, typ: Any) -> Any: - if not _contains_pydantic_model(data): - return unmarshal(data, typ) - - return data - - -def _contains_pydantic_model(data: Any) -> bool: - if isinstance(data, BaseModel): - return True - if isinstance(data, List): - return any(_contains_pydantic_model(item) for item in data) - if isinstance(data, Dict): - return any(_contains_pydantic_model(value) for value in data.values()) - - return False - - -@functools.cache -def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: - """ - Get typing objects by name from typing and typing_extensions. - Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types - """ - result = tuple( - getattr(module, name) - for module in (typing, typing_extensions) - if hasattr(module, name) - ) - if not result: - raise ValueError( - f"Neither typing nor typing_extensions has an object called {name!r}" - ) - return result diff --git a/src/mistralai/utils/unmarshal_json_response.py b/src/mistralai/utils/unmarshal_json_response.py deleted file mode 100644 index c0ce7e0f..00000000 --- a/src/mistralai/utils/unmarshal_json_response.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from typing import Any, Optional - -import httpx - -from .serializers import unmarshal_json -from mistralai import models - - -def unmarshal_json_response( - typ: Any, http_res: httpx.Response, body: Optional[str] = None -) -> Any: - if body is None: - body = http_res.text - try: - return unmarshal_json(body, typ) - except Exception as e: - raise models.ResponseValidationError( - "Response validation failed", - http_res, - e, - body, - ) from e diff --git a/tasks.py b/tasks.py index 0d5483e1..8b1bc3f0 100644 --- a/tasks.py +++ b/tasks.py @@ -19,8 +19,6 @@ def update_speakeasy( workflow_lock_path: str = WORKFLOW_LOCK_PATH, verbose: bool = False, ): - if not re.match(r'^\d+\.\d+\.\d+$', version): - raise ValueError(f"Invalid version format: {version}. Expected format: X.Y.Z (e.g., 1.2.3)") """ Update the speakeasy version and pin the openapi specs to the current revision. @@ -30,6 +28,8 @@ def update_speakeasy( inv update-speakeasy --version "1.580.2" --targets "mistralai-sdk" --workflow-path ".speakeasy/workflow.yaml" --workflow-lock-path ".speakeasy/workflow.lock.yaml" inv update-speakeasy --version "1.580.2" --targets "mistralai-sdk" --workflow-path ".speakeasy/workflow.yaml" --workflow-lock-path ".speakeasy/workflow.lock.yaml" --verbose """ + if not re.match(r'^\d+\.\d+\.\d+$', version): + raise ValueError(f"Invalid version format: {version}. Expected format: X.Y.Z (e.g., 1.2.3)") for target in targets: try: SpeakeasyTargets(target) diff --git a/tests/test_azure_integration.py b/tests/test_azure_integration.py new file mode 100644 index 00000000..ad6da971 --- /dev/null +++ b/tests/test_azure_integration.py @@ -0,0 +1,465 @@ +""" +Integration tests for Azure SDK. + +These tests require credentials and make real API calls. +Skip if AZURE_API_KEY env var is not set. + +Usage: + AZURE_API_KEY=xxx AZURE_SERVER_URL=https://.services.ai.azure.com AZURE_MODEL= AZURE_OCR_MODEL= pytest tests/test_azure_integration.py -v + +Environment variables: + AZURE_API_KEY: API key (required) + AZURE_SERVER_URL: Base host URL (required, e.g. https://.services.ai.azure.com) + AZURE_MODEL: Chat model name (required) + AZURE_OCR_MODEL: OCR model name (required) + AZURE_API_VERSION: API version (default: 2024-05-01-preview) + +Note: AZURE_SERVER_URL should be the base host URL without any path suffix. +The SDK appends the correct path per operation type: + - Chat: /models/chat/completions + - OCR: /providers/mistral/azure/ocr +The api_version parameter is automatically injected as a query parameter. +""" +import base64 +import json +import os + +import pytest + +# Configuration from env vars +AZURE_API_KEY = os.environ.get("AZURE_API_KEY") +AZURE_SERVER_URL = os.environ.get("AZURE_SERVER_URL") +AZURE_MODEL = os.environ.get("AZURE_MODEL") +AZURE_OCR_MODEL = os.environ.get("AZURE_OCR_MODEL") +AZURE_API_VERSION = os.environ.get("AZURE_API_VERSION", "2024-05-01-preview") + +SKIP_REASON = "Required env vars: AZURE_API_KEY, AZURE_SERVER_URL, AZURE_MODEL, AZURE_OCR_MODEL" + +pytestmark = pytest.mark.skipif( + not all([AZURE_API_KEY, AZURE_SERVER_URL, AZURE_MODEL, AZURE_OCR_MODEL]), + reason=SKIP_REASON, +) + +# Shared tool definition for tool-call tests +WEATHER_TOOL = { + "type": "function", + "function": { + "name": "get_weather", + "description": "Get the weather in a city", + "parameters": { + "type": "object", + "properties": {"city": {"type": "string"}}, + "required": ["city"], + }, + }, +} + +# Minimal valid PDF for OCR tests (single blank page) +MINIMAL_PDF = ( + b"%PDF-1.0\n1 0 obj<>endobj\n" + b"2 0 obj<>endobj\n" + b"3 0 obj<>endobj\n" + b"trailer<>" +) + + +@pytest.fixture +def azure_client(): + """Create an Azure client for Foundry Resource endpoints.""" + from mistralai.azure.client import MistralAzure + assert AZURE_API_KEY is not None, "AZURE_API_KEY must be set" + return MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_SERVER_URL, + api_version=AZURE_API_VERSION, + ) + + +class TestAzureChatComplete: + """Test synchronous chat completion.""" + + def test_basic_completion(self, azure_client): + """Test basic chat completion returns a response.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message is not None + assert res.choices[0].message.content is not None + assert len(res.choices[0].message.content) > 0 + + def test_completion_with_system_message(self, azure_client): + """Test chat completion with system + user message.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "system", "content": "You are a pirate. Respond in pirate speak."}, + {"role": "user", "content": "Say hello."}, + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + assert len(res.choices[0].message.content) > 0 + + def test_completion_with_max_tokens(self, azure_client): + """Test chat completion respects max_tokens.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Count from 1 to 100."} + ], + max_tokens=10, + ) + assert res is not None + assert res.choices[0].finish_reason in ("length", "stop") + + def test_completion_with_temperature(self, azure_client): + """Test chat completion accepts temperature parameter.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'test'."} + ], + temperature=0.0, + ) + assert res is not None + assert res.choices[0].message.content is not None + + def test_completion_with_stop_sequence(self, azure_client): + """Test chat completion stops at stop sequence.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Write three sentences about the sky."} + ], + stop=["."], + ) + assert res is not None + content = res.choices[0].message.content + assert content is not None + # The model should stop at or before the first period + assert content.count(".") <= 1 + + def test_completion_with_random_seed(self, azure_client): + """Test chat completion with random_seed returns valid responses.""" + res1 = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'deterministic'."} + ], + random_seed=42, + ) + res2 = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'deterministic'."} + ], + random_seed=42, + ) + # Both should return valid responses (not asserting equality due to model non-determinism) + assert res1.choices[0].message.content is not None + assert res2.choices[0].message.content is not None + + def test_multi_turn_conversation(self, azure_client): + """Test multi-turn conversation with user/assistant round-trip.""" + res1 = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "My name is Alice."} + ], + ) + assert res1.choices[0].message.content is not None + + res2 = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "My name is Alice."}, + {"role": "assistant", "content": res1.choices[0].message.content}, + {"role": "user", "content": "What is my name?"}, + ], + ) + assert res2.choices[0].message.content is not None + assert "Alice" in res2.choices[0].message.content + + def test_tool_call(self, azure_client): + """Test that the model returns a tool call when given tools.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + assert res is not None + choice = res.choices[0] + assert choice.message.tool_calls is not None + assert len(choice.message.tool_calls) > 0 + tool_call = choice.message.tool_calls[0] + assert tool_call.function.name == "get_weather" + args = json.loads(tool_call.function.arguments) + assert "city" in args + + def test_json_response_format(self, azure_client): + """Test JSON response format returns valid JSON.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Return a JSON object with a key 'greeting' and value 'hello'."} + ], + response_format={"type": "json_object"}, + ) + assert res is not None + content = res.choices[0].message.content + assert content is not None + parsed = json.loads(content) + assert isinstance(parsed, dict) + + def test_completion_with_n(self, azure_client): + """Test completion with n=2 returns multiple choices.""" + res = azure_client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say a random word."} + ], + n=2, + ) + assert res is not None + assert len(res.choices) == 2 + for choice in res.choices: + assert choice.message.content is not None + + +class TestAzureChatStream: + """Test streaming chat completion.""" + + def test_basic_stream(self, azure_client): + """Test streaming returns chunks with content.""" + stream = azure_client.chat.stream( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + + chunks = list(stream) + assert len(chunks) > 0 + + content = "" + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + + assert len(content) > 0 + + def test_stream_with_max_tokens(self, azure_client): + """Test streaming respects max_tokens truncation.""" + stream = azure_client.chat.stream( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Count from 1 to 100."} + ], + max_tokens=10, + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # Find finish_reason in any chunk + finish_reasons = [ + chunk.data.choices[0].finish_reason + for chunk in chunks + if chunk.data.choices and chunk.data.choices[0].finish_reason is not None + ] + assert len(finish_reasons) > 0 + assert finish_reasons[-1] in ("length", "stop") + + def test_stream_finish_reason(self, azure_client): + """Test that the last chunk has a finish_reason.""" + stream = azure_client.chat.stream( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hi'."} + ], + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # The final chunk(s) should contain a finish_reason + finish_reasons = [ + chunk.data.choices[0].finish_reason + for chunk in chunks + if chunk.data.choices and chunk.data.choices[0].finish_reason is not None + ] + assert len(finish_reasons) > 0 + assert finish_reasons[-1] == "stop" + + def test_stream_tool_call(self, azure_client): + """Test tool call via streaming, collecting tool_call delta chunks.""" + stream = azure_client.chat.stream( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # Collect tool call information from delta chunks + tool_call_found = False + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.tool_calls: + tool_call_found = True + break + + assert tool_call_found, "Expected tool_call delta chunks in stream" + + +class TestAzureOcr: + """Test OCR endpoint.""" + + def test_basic_ocr(self, azure_client): + """Test OCR processes a document and returns pages.""" + encoded = base64.b64encode(MINIMAL_PDF).decode("utf-8") + res = azure_client.ocr.process( + model=AZURE_OCR_MODEL, + document={ + "type": "document_url", + "document_url": f"data:application/pdf;base64,{encoded}", + }, + ) + assert res is not None + assert res.pages is not None + + @pytest.mark.asyncio + async def test_basic_ocr_async(self, azure_client): + """Test async OCR processes a document and returns pages.""" + encoded = base64.b64encode(MINIMAL_PDF).decode("utf-8") + res = await azure_client.ocr.process_async( + model=AZURE_OCR_MODEL, + document={ + "type": "document_url", + "document_url": f"data:application/pdf;base64,{encoded}", + }, + ) + assert res is not None + assert res.pages is not None + + +class TestAzureChatCompleteAsync: + """Test async chat completion.""" + + @pytest.mark.asyncio + async def test_basic_completion_async(self, azure_client): + """Test async chat completion returns a response.""" + res = await azure_client.chat.complete_async( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_completion_with_system_message_async(self, azure_client): + """Test async chat completion with system + user message.""" + res = await azure_client.chat.complete_async( + model=AZURE_MODEL, + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Say 'hello'."}, + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_tool_call_async(self, azure_client): + """Test async tool call returns tool_calls.""" + res = await azure_client.chat.complete_async( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + assert res is not None + choice = res.choices[0] + assert choice.message.tool_calls is not None + assert len(choice.message.tool_calls) > 0 + assert choice.message.tool_calls[0].function.name == "get_weather" + + +class TestAzureChatStreamAsync: + """Test async streaming chat completion.""" + + @pytest.mark.asyncio + async def test_basic_stream_async(self, azure_client): + """Test async streaming returns chunks with content.""" + stream = await azure_client.chat.stream_async( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + + content = "" + async for chunk in stream: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + + assert len(content) > 0 + + +class TestAzureContextManager: + """Test context manager support.""" + + def test_sync_context_manager(self): + """Test that MistralAzure works as a sync context manager.""" + from mistralai.azure.client import MistralAzure + assert AZURE_API_KEY is not None, "AZURE_API_KEY must be set" + with MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_SERVER_URL, + api_version=AZURE_API_VERSION, + ) as client: + res = client.chat.complete( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'context'."} + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_async_context_manager(self): + """Test that MistralAzure works as an async context manager.""" + from mistralai.azure.client import MistralAzure + assert AZURE_API_KEY is not None, "AZURE_API_KEY must be set" + async with MistralAzure( + api_key=AZURE_API_KEY, + server_url=AZURE_SERVER_URL, + api_version=AZURE_API_VERSION, + ) as client: + res = await client.chat.complete_async( + model=AZURE_MODEL, + messages=[ + {"role": "user", "content": "Say 'async context'."} + ], + ) + assert res is not None + assert res.choices[0].message.content is not None diff --git a/tests/test_azure_v2_parity.py b/tests/test_azure_v2_parity.py new file mode 100644 index 00000000..8cd89bf4 --- /dev/null +++ b/tests/test_azure_v2_parity.py @@ -0,0 +1,269 @@ +""" +Parity tests for the Azure v2 SDK. + +Verifies that the regenerated mistralai.azure package exposes +the same public API surface as the v1 mistralai_azure package. +Uses introspection only — no API calls or credentials required. +""" +import inspect + +import pytest + +from mistralai.azure.client import MistralAzure +from mistralai.azure.client.chat import Chat +from mistralai.azure.client.ocr import Ocr +from mistralai.azure.client.types import UNSET + +AZURE_METHODS: dict[str, set[str]] = { + "chat": {"complete", "stream"}, + "ocr": {"process"}, +} + +TESTED_METHODS: set[str] = set() + +_EMPTY = inspect.Parameter.empty + + +def mark_tested(resource: str, method: str) -> None: + TESTED_METHODS.add(f"{resource}.{method}") + + +# --------------------------------------------------------------------------- +# Expected parameter specs: (name, expected_default) +# Use _EMPTY for required params, UNSET for OptionalNullable, None for Optional +# --------------------------------------------------------------------------- + +CONSTRUCTOR_PARAMS = [ + ("api_key", _EMPTY), + ("server", None), + ("server_url", None), + ("url_params", None), + ("client", None), + ("async_client", None), + ("retry_config", UNSET), + ("timeout_ms", None), + ("debug_logger", None), + ("api_version", "2024-05-01-preview"), +] + +CHAT_COMPLETE_PARAMS = [ + ("messages", _EMPTY), + ("model", "azureai"), + ("temperature", UNSET), + ("top_p", None), + ("max_tokens", UNSET), + ("stream", False), + ("stop", None), + ("random_seed", UNSET), + ("metadata", UNSET), + ("response_format", None), + ("tools", UNSET), + ("tool_choice", None), + ("presence_penalty", None), + ("frequency_penalty", None), + ("n", UNSET), + ("prediction", None), + ("parallel_tool_calls", None), + ("prompt_mode", UNSET), + ("safe_prompt", None), + ("retries", UNSET), + ("server_url", None), + ("timeout_ms", None), + ("http_headers", None), +] + +CHAT_STREAM_PARAMS = [ + (name, True if name == "stream" else default) + for name, default in CHAT_COMPLETE_PARAMS +] + +OCR_PROCESS_PARAMS = [ + ("model", _EMPTY), + ("document", _EMPTY), + ("id", None), + ("pages", UNSET), + ("include_image_base64", UNSET), + ("image_limit", UNSET), + ("image_min_size", UNSET), + ("bbox_annotation_format", UNSET), + ("document_annotation_format", UNSET), + ("document_annotation_prompt", UNSET), + ("table_format", UNSET), + ("extract_header", None), + ("extract_footer", None), + ("retries", UNSET), + ("server_url", None), + ("timeout_ms", None), + ("http_headers", None), +] + + +# --------------------------------------------------------------------------- +# Tests +# --------------------------------------------------------------------------- + + +class TestAzureSDKStructure: + def test_sdk_has_chat(self): + assert "chat" in MistralAzure.__annotations__ + + def test_sdk_has_ocr(self): + assert "ocr" in MistralAzure.__annotations__ + + @pytest.mark.parametrize("param_name,expected_default", CONSTRUCTOR_PARAMS) + def test_constructor_param(self, param_name, expected_default): + sig = inspect.signature(MistralAzure.__init__) + assert param_name in sig.parameters, f"Missing constructor param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Constructor param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + @pytest.mark.parametrize("method", ["__enter__", "__exit__", "__aenter__", "__aexit__"]) + def test_context_manager_support(self, method): + assert hasattr(MistralAzure, method), f"MistralAzure missing {method}" + + +class TestAzureChat: + def test_has_complete(self): + assert hasattr(Chat, "complete") + mark_tested("chat", "complete") + + def test_has_complete_async(self): + assert hasattr(Chat, "complete_async") + mark_tested("chat", "complete_async") + + def test_has_stream(self): + assert hasattr(Chat, "stream") + mark_tested("chat", "stream") + + def test_has_stream_async(self): + assert hasattr(Chat, "stream_async") + mark_tested("chat", "stream_async") + + # -- complete params -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_COMPLETE_PARAMS) + def test_complete_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.complete) + assert param_name in sig.parameters, f"Chat.complete missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.complete param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream params -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_STREAM_PARAMS) + def test_stream_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.stream) + assert param_name in sig.parameters, f"Chat.stream missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.stream param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- complete_async matches complete -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_COMPLETE_PARAMS) + def test_complete_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.complete_async) + assert param_name in sig.parameters, f"Chat.complete_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.complete_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream_async matches stream -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_STREAM_PARAMS) + def test_stream_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.stream_async) + assert param_name in sig.parameters, f"Chat.stream_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.stream_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- sync/async parity -- + def test_complete_async_matches_complete(self): + sync_params = set(inspect.signature(Chat.complete).parameters) - {"self"} + async_params = set(inspect.signature(Chat.complete_async).parameters) - {"self"} + assert sync_params == async_params + + def test_stream_async_matches_stream(self): + sync_params = set(inspect.signature(Chat.stream).parameters) - {"self"} + async_params = set(inspect.signature(Chat.stream_async).parameters) - {"self"} + assert sync_params == async_params + + # -- key defaults -- + def test_complete_model_defaults_azureai(self): + sig = inspect.signature(Chat.complete) + assert sig.parameters["model"].default == "azureai" + + def test_stream_model_defaults_azureai(self): + sig = inspect.signature(Chat.stream) + assert sig.parameters["model"].default == "azureai" + + def test_complete_stream_defaults_false(self): + sig = inspect.signature(Chat.complete) + assert sig.parameters["stream"].default is False + + def test_stream_stream_defaults_true(self): + sig = inspect.signature(Chat.stream) + assert sig.parameters["stream"].default is True + + +class TestAzureOcr: + def test_has_process(self): + assert hasattr(Ocr, "process") + mark_tested("ocr", "process") + + def test_has_process_async(self): + assert hasattr(Ocr, "process_async") + mark_tested("ocr", "process_async") + + # -- process params -- + @pytest.mark.parametrize("param_name,expected_default", OCR_PROCESS_PARAMS) + def test_process_has_param(self, param_name, expected_default): + sig = inspect.signature(Ocr.process) + assert param_name in sig.parameters, f"Ocr.process missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Ocr.process param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- process_async matches process -- + @pytest.mark.parametrize("param_name,expected_default", OCR_PROCESS_PARAMS) + def test_process_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Ocr.process_async) + assert param_name in sig.parameters, f"Ocr.process_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Ocr.process_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- sync/async parity -- + def test_process_async_matches_process(self): + sync_params = set(inspect.signature(Ocr.process).parameters) - {"self"} + async_params = set(inspect.signature(Ocr.process_async).parameters) - {"self"} + assert sync_params == async_params + + +class TestAzureCoverage: + def test_all_methods_tested(self): + expected = set() + for resource, methods in AZURE_METHODS.items(): + for method in methods: + expected.add(f"{resource}.{method}") + expected.add(f"{resource}.{method}_async") + untested = expected - TESTED_METHODS + assert not untested, f"Untested methods: {untested}" + + def test_no_unexpected_public_methods_on_chat(self): + public = {m for m in dir(Chat) if not m.startswith("_") and callable(getattr(Chat, m, None))} + known = {"complete", "complete_async", "stream", "stream_async", "do_request", "do_request_async"} + unexpected = public - known + assert not unexpected, f"Unexpected Chat methods: {unexpected}" + + def test_no_unexpected_public_methods_on_ocr(self): + public = {m for m in dir(Ocr) if not m.startswith("_") and callable(getattr(Ocr, m, None))} + known = {"process", "process_async", "do_request", "do_request_async"} + unexpected = public - known + assert not unexpected, f"Unexpected Ocr methods: {unexpected}" diff --git a/tests/test_gcp_integration.py b/tests/test_gcp_integration.py new file mode 100644 index 00000000..1ed2fecc --- /dev/null +++ b/tests/test_gcp_integration.py @@ -0,0 +1,512 @@ +""" +Integration tests for GCP SDK. + +These tests require GCP credentials and make real API calls. +Skip if GCP_PROJECT_ID env var is not set. + +Prerequisites: + 1. Authenticate with GCP: gcloud auth application-default login + 2. Have "Vertex AI User" role on the project + +The SDK automatically: + - Detects credentials via google.auth.default() + - Auto-refreshes tokens when they expire + - Builds the Vertex AI URL from project_id and region + +Available models: + - Chat: mistral-small-2503, mistral-large-2501, ... + - FIM: codestral-2 + See: https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/mistral + +Usage: + GCP_PROJECT_ID= pytest tests/test_gcp_integration.py -v + +Environment variables: + GCP_PROJECT_ID: GCP project ID (required, or auto-detected from credentials) + GCP_REGION: Vertex AI region (default: us-central1) + GCP_MODEL: Model name for chat (default: mistral-small-2503) + GCP_FIM_MODEL: Model name for FIM (default: codestral-2) + +""" +import json +import os + +import pytest + +# Configuration from env vars +GCP_PROJECT_ID = os.environ.get("GCP_PROJECT_ID") +GCP_REGION = os.environ.get("GCP_REGION", "us-central1") +GCP_MODEL = os.environ.get("GCP_MODEL", "mistral-small-2503") +GCP_FIM_MODEL = os.environ.get("GCP_FIM_MODEL", "codestral-2") + +SKIP_REASON = "GCP_PROJECT_ID env var required" + +pytestmark = pytest.mark.skipif( + not GCP_PROJECT_ID, + reason=SKIP_REASON +) + +# Shared tool definition for tool-call tests +WEATHER_TOOL = { + "type": "function", + "function": { + "name": "get_weather", + "description": "Get the weather in a city", + "parameters": { + "type": "object", + "properties": {"city": {"type": "string"}}, + "required": ["city"], + }, + }, +} + + +@pytest.fixture +def gcp_client(): + """Create a GCP client for chat tests. + + The SDK automatically: + - Detects credentials via google.auth.default() + - Auto-refreshes tokens when they expire + - Builds the Vertex AI URL from project_id and region + """ + from mistralai.gcp.client import MistralGCP + return MistralGCP( + project_id=GCP_PROJECT_ID, + region=GCP_REGION, + ) + + +class TestGCPChatComplete: + """Test synchronous chat completion.""" + + def test_basic_completion(self, gcp_client): + """Test basic chat completion returns a response.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message is not None + assert res.choices[0].message.content is not None + assert len(res.choices[0].message.content) > 0 + + def test_completion_with_system_message(self, gcp_client): + """Test chat completion with system + user message.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "system", "content": "You are a pirate. Respond in pirate speak."}, + {"role": "user", "content": "Say hello."}, + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + assert len(res.choices[0].message.content) > 0 + + def test_completion_with_max_tokens(self, gcp_client): + """Test chat completion respects max_tokens.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Count from 1 to 100."} + ], + max_tokens=10, + ) + assert res is not None + assert res.choices[0].finish_reason in ("length", "stop") + + def test_completion_with_temperature(self, gcp_client): + """Test chat completion accepts temperature parameter.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'test'."} + ], + temperature=0.0, + ) + assert res is not None + assert res.choices[0].message.content is not None + + def test_completion_with_stop_sequence(self, gcp_client): + """Test chat completion stops at stop sequence.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Write three sentences about the sky."} + ], + stop=["."], + ) + assert res is not None + content = res.choices[0].message.content + assert content is not None + # The model should stop at or before the first period + assert content.count(".") <= 1 + + def test_completion_with_random_seed(self, gcp_client): + """Test chat completion with random_seed returns valid responses.""" + res1 = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'deterministic'."} + ], + random_seed=42, + ) + res2 = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'deterministic'."} + ], + random_seed=42, + ) + # Both should return valid responses (not asserting equality due to model non-determinism) + assert res1.choices[0].message.content is not None + assert res2.choices[0].message.content is not None + + def test_multi_turn_conversation(self, gcp_client): + """Test multi-turn conversation with user/assistant round-trip.""" + res1 = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "My name is Alice."} + ], + ) + assert res1.choices[0].message.content is not None + + res2 = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "My name is Alice."}, + {"role": "assistant", "content": res1.choices[0].message.content}, + {"role": "user", "content": "What is my name?"}, + ], + ) + assert res2.choices[0].message.content is not None + assert "Alice" in res2.choices[0].message.content + + def test_tool_call(self, gcp_client): + """Test that the model returns a tool call when given tools.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + assert res is not None + choice = res.choices[0] + assert choice.message.tool_calls is not None + assert len(choice.message.tool_calls) > 0 + tool_call = choice.message.tool_calls[0] + assert tool_call.function.name == "get_weather" + args = json.loads(tool_call.function.arguments) + assert "city" in args + + def test_json_response_format(self, gcp_client): + """Test JSON response format returns valid JSON.""" + res = gcp_client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Return a JSON object with a key 'greeting' and value 'hello'."} + ], + response_format={"type": "json_object"}, + ) + assert res is not None + content = res.choices[0].message.content + assert content is not None + parsed = json.loads(content) + assert isinstance(parsed, dict) + + +class TestGCPChatStream: + """Test streaming chat completion.""" + + def test_basic_stream(self, gcp_client): + """Test streaming returns chunks with content.""" + stream = gcp_client.chat.stream( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + + chunks = list(stream) + assert len(chunks) > 0 + + content = "" + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + + assert len(content) > 0 + + def test_stream_with_max_tokens(self, gcp_client): + """Test streaming respects max_tokens truncation.""" + stream = gcp_client.chat.stream( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Count from 1 to 100."} + ], + max_tokens=10, + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # Find finish_reason in any chunk + finish_reasons = [ + chunk.data.choices[0].finish_reason + for chunk in chunks + if chunk.data.choices and chunk.data.choices[0].finish_reason is not None + ] + assert len(finish_reasons) > 0 + assert finish_reasons[-1] in ("length", "stop") + + def test_stream_finish_reason(self, gcp_client): + """Test that the last chunk has a finish_reason.""" + stream = gcp_client.chat.stream( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hi'."} + ], + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # The final chunk(s) should contain a finish_reason + finish_reasons = [ + chunk.data.choices[0].finish_reason + for chunk in chunks + if chunk.data.choices and chunk.data.choices[0].finish_reason is not None + ] + assert len(finish_reasons) > 0 + assert finish_reasons[-1] == "stop" + + def test_stream_tool_call(self, gcp_client): + """Test tool call via streaming, collecting tool_call delta chunks.""" + stream = gcp_client.chat.stream( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + + chunks = list(stream) + assert len(chunks) > 0 + + # Collect tool call information from delta chunks + tool_call_found = False + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.tool_calls: + tool_call_found = True + break + + assert tool_call_found, "Expected tool_call delta chunks in stream" + + +class TestGCPChatCompleteAsync: + """Test async chat completion.""" + + @pytest.mark.asyncio + async def test_basic_completion_async(self, gcp_client): + """Test async chat completion returns a response.""" + res = await gcp_client.chat.complete_async( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_completion_with_system_message_async(self, gcp_client): + """Test async chat completion with system + user message.""" + res = await gcp_client.chat.complete_async( + model=GCP_MODEL, + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "Say 'hello'."}, + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_tool_call_async(self, gcp_client): + """Test async tool call returns tool_calls.""" + res = await gcp_client.chat.complete_async( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "What is the weather in Paris?"} + ], + tools=[WEATHER_TOOL], + tool_choice="any", + ) + assert res is not None + choice = res.choices[0] + assert choice.message.tool_calls is not None + assert len(choice.message.tool_calls) > 0 + assert choice.message.tool_calls[0].function.name == "get_weather" + + +class TestGCPChatStreamAsync: + """Test async streaming chat completion.""" + + @pytest.mark.asyncio + async def test_basic_stream_async(self, gcp_client): + """Test async streaming returns chunks with content.""" + stream = await gcp_client.chat.stream_async( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'hello' and nothing else."} + ], + ) + + content = "" + async for chunk in stream: + if chunk.data.choices and chunk.data.choices[0].delta.content: + content += chunk.data.choices[0].delta.content + + assert len(content) > 0 + + +class TestGCPContextManager: + """Test context manager support.""" + + def test_sync_context_manager(self): + """Test that MistralGCP works as a sync context manager.""" + from mistralai.gcp.client import MistralGCP + with MistralGCP( + project_id=GCP_PROJECT_ID, + region=GCP_REGION, + ) as client: + res = client.chat.complete( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'context'."} + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_async_context_manager(self): + """Test that MistralGCP works as an async context manager.""" + from mistralai.gcp.client import MistralGCP + async with MistralGCP( + project_id=GCP_PROJECT_ID, + region=GCP_REGION, + ) as client: + res = await client.chat.complete_async( + model=GCP_MODEL, + messages=[ + {"role": "user", "content": "Say 'async context'."} + ], + ) + assert res is not None + assert res.choices[0].message.content is not None + + +class TestGCPFIM: + """Test FIM (Fill-in-the-middle) completion.""" + + def _make_fim_client(self): + """Create a GCP client configured for FIM model.""" + from mistralai.gcp.client import MistralGCP + return MistralGCP(project_id=GCP_PROJECT_ID, region=GCP_REGION) + + def test_fim_complete(self): + """Test FIM completion returns a response.""" + client = self._make_fim_client() + res = client.fim.complete( + model=GCP_FIM_MODEL, + prompt="def fib():", + suffix=" return result", + timeout_ms=10000, + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message.content is not None + + def test_fim_stream(self): + """Test FIM streaming returns chunks.""" + client = self._make_fim_client() + stream = client.fim.stream( + model=GCP_FIM_MODEL, + prompt="def hello():", + suffix=" return greeting", + timeout_ms=10000, + ) + chunks = list(stream) + assert len(chunks) > 0 + + content = "" + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.content: + delta_content = chunk.data.choices[0].delta.content + if isinstance(delta_content, str): + content += delta_content + assert len(content) > 0 + + def test_fim_with_max_tokens(self): + """Test FIM completion with max_tokens.""" + client = self._make_fim_client() + res = client.fim.complete( + model=GCP_FIM_MODEL, + prompt="def add(a, b):", + suffix=" return result", + max_tokens=10, + timeout_ms=10000, + ) + assert res is not None + assert res.choices[0].finish_reason in ("length", "stop") + + @pytest.mark.asyncio + async def test_fim_complete_async(self): + """Test async FIM completion returns a response.""" + client = self._make_fim_client() + res = await client.fim.complete_async( + model=GCP_FIM_MODEL, + prompt="def fib():", + suffix=" return result", + timeout_ms=10000, + ) + assert res is not None + assert res.choices is not None + assert len(res.choices) > 0 + assert res.choices[0].message.content is not None + + @pytest.mark.asyncio + async def test_fim_stream_async(self): + """Test async FIM streaming returns chunks.""" + client = self._make_fim_client() + stream = await client.fim.stream_async( + model=GCP_FIM_MODEL, + prompt="def hello():", + suffix=" return greeting", + timeout_ms=10000, + ) + chunks = [] + async for chunk in stream: + chunks.append(chunk) + assert len(chunks) > 0 + + content = "" + for chunk in chunks: + if chunk.data.choices and chunk.data.choices[0].delta.content: + delta_content = chunk.data.choices[0].delta.content + if isinstance(delta_content, str): + content += delta_content + assert len(content) > 0 diff --git a/tests/test_gcp_v2_parity.py b/tests/test_gcp_v2_parity.py new file mode 100644 index 00000000..0d6471e4 --- /dev/null +++ b/tests/test_gcp_v2_parity.py @@ -0,0 +1,330 @@ +""" +Parity tests for the GCP v2 SDK. + +Verifies that the regenerated mistralai.gcp package exposes +the same public API surface as the v1 mistralai_gcp package. +Uses introspection only — no API calls or credentials required. +""" +import inspect + +import pytest + +from mistralai.gcp.client import MistralGCP +from mistralai.gcp.client.chat import Chat +from mistralai.gcp.client.fim import Fim +from mistralai.gcp.client.types import UNSET + +GCP_METHODS: dict[str, set[str]] = { + "chat": {"complete", "stream"}, + "fim": {"complete", "stream"}, +} + +TESTED_METHODS: set[str] = set() + +_EMPTY = inspect.Parameter.empty + + +def mark_tested(resource: str, method: str) -> None: + TESTED_METHODS.add(f"{resource}.{method}") + + +# --------------------------------------------------------------------------- +# Expected parameter specs: (name, expected_default) +# Use _EMPTY for required params, UNSET for OptionalNullable, None for Optional +# --------------------------------------------------------------------------- + +CONSTRUCTOR_PARAMS = [ + ("project_id", None), + ("region", "europe-west4"), + ("access_token", None), + ("server", None), + ("server_url", None), + ("url_params", None), + ("client", None), + ("async_client", None), + ("retry_config", UNSET), + ("timeout_ms", None), + ("debug_logger", None), +] + +CHAT_COMPLETE_PARAMS = [ + ("model", _EMPTY), + ("messages", _EMPTY), + ("temperature", UNSET), + ("top_p", None), + ("max_tokens", UNSET), + ("stream", False), + ("stop", None), + ("random_seed", UNSET), + ("metadata", UNSET), + ("response_format", None), + ("tools", UNSET), + ("tool_choice", None), + ("presence_penalty", None), + ("frequency_penalty", None), + ("n", UNSET), + ("prediction", None), + ("parallel_tool_calls", None), + ("prompt_mode", UNSET), + ("retries", UNSET), + ("server_url", None), + ("timeout_ms", None), + ("http_headers", None), +] + +CHAT_STREAM_PARAMS = [ + (name, True if name == "stream" else default) + for name, default in CHAT_COMPLETE_PARAMS +] + +FIM_COMPLETE_PARAMS = [ + ("model", _EMPTY), + ("prompt", _EMPTY), + ("temperature", UNSET), + ("top_p", 1), + ("max_tokens", UNSET), + ("stream", False), + ("stop", None), + ("random_seed", UNSET), + ("metadata", UNSET), + ("suffix", UNSET), + ("min_tokens", UNSET), + ("retries", UNSET), + ("server_url", None), + ("timeout_ms", None), + ("http_headers", None), +] + +FIM_STREAM_PARAMS = [ + (name, True if name == "stream" else default) + for name, default in FIM_COMPLETE_PARAMS +] + + +# --------------------------------------------------------------------------- +# Tests +# --------------------------------------------------------------------------- + + +class TestGCPSDKStructure: + def test_sdk_has_chat(self): + assert "chat" in MistralGCP.__annotations__ + + def test_sdk_has_fim(self): + assert "fim" in MistralGCP.__annotations__ + + @pytest.mark.parametrize("param_name,expected_default", CONSTRUCTOR_PARAMS) + def test_constructor_param(self, param_name, expected_default): + sig = inspect.signature(MistralGCP.__init__) + assert param_name in sig.parameters, f"Missing constructor param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Constructor param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + @pytest.mark.parametrize("method", ["__enter__", "__exit__", "__aenter__", "__aexit__"]) + def test_context_manager_support(self, method): + assert hasattr(MistralGCP, method), f"MistralGCP missing {method}" + + +class TestGCPChat: + def test_has_complete(self): + assert hasattr(Chat, "complete") + mark_tested("chat", "complete") + + def test_has_complete_async(self): + assert hasattr(Chat, "complete_async") + mark_tested("chat", "complete_async") + + def test_has_stream(self): + assert hasattr(Chat, "stream") + mark_tested("chat", "stream") + + def test_has_stream_async(self): + assert hasattr(Chat, "stream_async") + mark_tested("chat", "stream_async") + + # -- complete params -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_COMPLETE_PARAMS) + def test_complete_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.complete) + assert param_name in sig.parameters, f"Chat.complete missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.complete param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream params -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_STREAM_PARAMS) + def test_stream_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.stream) + assert param_name in sig.parameters, f"Chat.stream missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.stream param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- complete_async matches complete -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_COMPLETE_PARAMS) + def test_complete_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.complete_async) + assert param_name in sig.parameters, f"Chat.complete_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.complete_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream_async matches stream -- + @pytest.mark.parametrize("param_name,expected_default", CHAT_STREAM_PARAMS) + def test_stream_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Chat.stream_async) + assert param_name in sig.parameters, f"Chat.stream_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Chat.stream_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- sync/async parity -- + def test_complete_async_matches_complete(self): + sync_params = set(inspect.signature(Chat.complete).parameters) - {"self"} + async_params = set(inspect.signature(Chat.complete_async).parameters) - {"self"} + assert sync_params == async_params + + def test_stream_async_matches_stream(self): + sync_params = set(inspect.signature(Chat.stream).parameters) - {"self"} + async_params = set(inspect.signature(Chat.stream_async).parameters) - {"self"} + assert sync_params == async_params + + # -- key defaults -- + def test_complete_model_required(self): + sig = inspect.signature(Chat.complete) + assert sig.parameters["model"].default is _EMPTY + + def test_stream_model_required(self): + sig = inspect.signature(Chat.stream) + assert sig.parameters["model"].default is _EMPTY + + def test_complete_stream_defaults_false(self): + sig = inspect.signature(Chat.complete) + assert sig.parameters["stream"].default is False + + def test_stream_stream_defaults_true(self): + sig = inspect.signature(Chat.stream) + assert sig.parameters["stream"].default is True + + +class TestGCPFim: + def test_has_complete(self): + assert hasattr(Fim, "complete") + mark_tested("fim", "complete") + + def test_has_complete_async(self): + assert hasattr(Fim, "complete_async") + mark_tested("fim", "complete_async") + + def test_has_stream(self): + assert hasattr(Fim, "stream") + mark_tested("fim", "stream") + + def test_has_stream_async(self): + assert hasattr(Fim, "stream_async") + mark_tested("fim", "stream_async") + + # -- complete params -- + @pytest.mark.parametrize("param_name,expected_default", FIM_COMPLETE_PARAMS) + def test_complete_has_param(self, param_name, expected_default): + sig = inspect.signature(Fim.complete) + assert param_name in sig.parameters, f"Fim.complete missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Fim.complete param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream params -- + @pytest.mark.parametrize("param_name,expected_default", FIM_STREAM_PARAMS) + def test_stream_has_param(self, param_name, expected_default): + sig = inspect.signature(Fim.stream) + assert param_name in sig.parameters, f"Fim.stream missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Fim.stream param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- complete_async matches complete -- + @pytest.mark.parametrize("param_name,expected_default", FIM_COMPLETE_PARAMS) + def test_complete_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Fim.complete_async) + assert param_name in sig.parameters, f"Fim.complete_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Fim.complete_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- stream_async matches stream -- + @pytest.mark.parametrize("param_name,expected_default", FIM_STREAM_PARAMS) + def test_stream_async_has_param(self, param_name, expected_default): + sig = inspect.signature(Fim.stream_async) + assert param_name in sig.parameters, f"Fim.stream_async missing param: {param_name}" + actual = sig.parameters[param_name].default + assert actual == expected_default, ( + f"Fim.stream_async param {param_name}: expected {expected_default!r}, got {actual!r}" + ) + + # -- sync/async parity -- + def test_complete_async_matches_complete(self): + sync_params = set(inspect.signature(Fim.complete).parameters) - {"self"} + async_params = set(inspect.signature(Fim.complete_async).parameters) - {"self"} + assert sync_params == async_params + + def test_stream_async_matches_stream(self): + sync_params = set(inspect.signature(Fim.stream).parameters) - {"self"} + async_params = set(inspect.signature(Fim.stream_async).parameters) - {"self"} + assert sync_params == async_params + + # -- key defaults -- + def test_complete_model_required(self): + sig = inspect.signature(Fim.complete) + assert sig.parameters["model"].default is _EMPTY + + def test_stream_model_required(self): + sig = inspect.signature(Fim.stream) + assert sig.parameters["model"].default is _EMPTY + + def test_complete_stream_defaults_false(self): + sig = inspect.signature(Fim.complete) + assert sig.parameters["stream"].default is False + + def test_stream_stream_defaults_true(self): + sig = inspect.signature(Fim.stream) + assert sig.parameters["stream"].default is True + + def test_complete_top_p_defaults_to_1(self): + sig = inspect.signature(Fim.complete) + assert sig.parameters["top_p"].default == 1 + + def test_stream_top_p_defaults_to_1(self): + sig = inspect.signature(Fim.stream) + assert sig.parameters["top_p"].default == 1 + + +class TestGCPCoverage: + def test_all_methods_tested(self): + expected = set() + for resource, methods in GCP_METHODS.items(): + for method in methods: + expected.add(f"{resource}.{method}") + expected.add(f"{resource}.{method}_async") + untested = expected - TESTED_METHODS + assert not untested, f"Untested methods: {untested}" + + def test_no_unexpected_public_methods_on_chat(self): + public = {m for m in dir(Chat) if not m.startswith("_") and callable(getattr(Chat, m, None))} + known = {"complete", "complete_async", "stream", "stream_async", "do_request", "do_request_async"} + unexpected = public - known + assert not unexpected, f"Unexpected Chat methods: {unexpected}" + + def test_no_unexpected_public_methods_on_fim(self): + public = {m for m in dir(Fim) if not m.startswith("_") and callable(getattr(Fim, m, None))} + known = {"complete", "complete_async", "stream", "stream_async", "do_request", "do_request_async"} + unexpected = public - known + assert not unexpected, f"Unexpected Fim methods: {unexpected}" diff --git a/tests/test_prepare_readme.py b/tests/test_prepare_readme.py new file mode 100644 index 00000000..76227ae4 --- /dev/null +++ b/tests/test_prepare_readme.py @@ -0,0 +1,92 @@ +import importlib.util +from pathlib import Path + +import pytest + +SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "prepare_readme.py" +SPEC = importlib.util.spec_from_file_location("prepare_readme", SCRIPT_PATH) +if SPEC is None or SPEC.loader is None: + raise ImportError(f"Unable to load prepare_readme from {SCRIPT_PATH}") +prepare_readme = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(prepare_readme) + +BASE_URL = "https://example.com/blob/main/" + + +def test_rewrite_relative_links_keeps_absolute() -> None: + contents = "[Migration](MIGRATION.md)\n[Docs](https://docs.mistral.ai)" + expected = ( + f"[Migration]({BASE_URL}MIGRATION.md)\n" + "[Docs](https://docs.mistral.ai)" + ) + assert prepare_readme._rewrite_relative_links(contents, BASE_URL) == expected + + +def test_rewrite_relative_links_keeps_http() -> None: + contents = "[Site](http://example.com)" + assert prepare_readme._rewrite_relative_links(contents, BASE_URL) == contents + + +def test_rewrite_relative_links_keeps_anchors() -> None: + contents = "[Retries](#retries)\n[File](docs/README.md#upload)" + expected = ( + "[Retries](#retries)\n" + f"[File]({BASE_URL}docs/README.md#upload)" + ) + assert prepare_readme._rewrite_relative_links(contents, BASE_URL) == expected + + +def test_rewrite_relative_links_keeps_mailto() -> None: + contents = "[Email](mailto:user@example.com)" + assert prepare_readme._rewrite_relative_links(contents, BASE_URL) == contents + + +def test_rewrite_relative_links_keeps_ftp() -> None: + contents = "[FTP](ftp://files.example.com/data)" + assert prepare_readme._rewrite_relative_links(contents, BASE_URL) == contents + + +def test_rewrite_strips_leading_dot_slash() -> None: + contents = "[Errors](./src/errors.py)" + expected = f"[Errors]({BASE_URL}src/errors.py)" + assert prepare_readme._rewrite_relative_links(contents, BASE_URL) == expected + + +def test_rewrite_strips_leading_slash() -> None: + contents = "[Examples](/examples/azure)" + expected = f"[Examples]({BASE_URL}examples/azure)" + assert prepare_readme._rewrite_relative_links(contents, BASE_URL) == expected + + +def test_rewrite_multiple_links_same_line() -> None: + contents = "[A](a.md) and [B](b.md)" + expected = f"[A]({BASE_URL}a.md) and [B]({BASE_URL}b.md)" + assert prepare_readme._rewrite_relative_links(contents, BASE_URL) == expected + + +def test_build_base_url_strips_git_suffix() -> None: + url = prepare_readme._build_base_url( + "https://github.com/org/repo.git", "main", "" + ) + assert url == "https://github.com/org/repo/blob/main/" + + +def test_build_base_url_no_git_suffix() -> None: + url = prepare_readme._build_base_url( + "https://github.com/org/repo", "main", "" + ) + assert url == "https://github.com/org/repo/blob/main/" + + +def test_build_base_url_with_subdir() -> None: + url = prepare_readme._build_base_url( + "https://github.com/org/repo.git", "main", "packages/azure" + ) + assert url == "https://github.com/org/repo/blob/main/packages/azure/" + + +def test_build_base_url_strips_subdir_slashes() -> None: + url = prepare_readme._build_base_url( + "https://github.com/org/repo.git", "main", "/packages/azure/" + ) + assert url == "https://github.com/org/repo/blob/main/packages/azure/" diff --git a/uv.lock b/uv.lock new file mode 100644 index 00000000..2f23fc8b --- /dev/null +++ b/uv.lock @@ -0,0 +1,2538 @@ +version = 1 +revision = 3 +requires-python = ">=3.10" +resolution-markers = [ + "python_full_version >= '3.12'", + "python_full_version == '3.11.*'", + "python_full_version < '3.11'", +] + +[[package]] +name = "aioboto3" +version = "12.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiobotocore", extra = ["boto3"] }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ac/36/b3fc229a5655e9d7875ea811c0006dcbd6aae5b196c6c4f12e8d5ee0c5cd/aioboto3-12.4.0.tar.gz", hash = "sha256:0fa03ac7a8c2c187358dd27cdf84da05e91bc1a3bd85519cad13521343a3d767", size = 30129, upload-time = "2024-04-15T21:22:57.353Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/3e/0640f85fd8c5cc8ded7cfd00ec0cd88cf3f861ed20ac31c585654b17e922/aioboto3-12.4.0-py3-none-any.whl", hash = "sha256:a8d5a60852482cc7a472f3544e5ad7d2f5a911054ffa066357140dc6690da94b", size = 32271, upload-time = "2024-04-15T21:22:54.973Z" }, +] + +[[package]] +name = "aiobotocore" +version = "2.12.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiohttp" }, + { name = "aioitertools" }, + { name = "botocore" }, + { name = "wrapt" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0d/3b/9f3d0f385fcb9ec848d9928acbd96382c403b253741f9b8777cda51df40e/aiobotocore-2.12.3.tar.gz", hash = "sha256:e2a2929207bc5d62eb556106c2224c1fd106d5c65be2eb69f15cc8c34c44c236", size = 103754, upload-time = "2024-04-11T16:38:42.397Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/71/86/bbe79b24d4603c65a67e405661092c2fe0fa9b14e78dc8270bc83777412e/aiobotocore-2.12.3-py3-none-any.whl", hash = "sha256:86737685f4625e8f05c4e7a608a07cc97607263279f66cf6b02b640c4eafd324", size = 76527, upload-time = "2024-04-11T16:38:39.675Z" }, +] + +[package.optional-dependencies] +boto3 = [ + { name = "boto3" }, +] + +[[package]] +name = "aiofiles" +version = "25.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/41/c3/534eac40372d8ee36ef40df62ec129bee4fdb5ad9706e58a29be53b2c970/aiofiles-25.1.0.tar.gz", hash = "sha256:a8d728f0a29de45dc521f18f07297428d56992a742f0cd2701ba86e44d23d5b2", size = 46354, upload-time = "2025-10-09T20:51:04.358Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bc/8a/340a1555ae33d7354dbca4faa54948d76d89a27ceef032c8c3bc661d003e/aiofiles-25.1.0-py3-none-any.whl", hash = "sha256:abe311e527c862958650f9438e859c1fa7568a141b22abcd015e120e86a85695", size = 14668, upload-time = "2025-10-09T20:51:03.174Z" }, +] + +[[package]] +name = "aiohappyeyeballs" +version = "2.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/26/30/f84a107a9c4331c14b2b586036f40965c128aa4fee4dda5d3d51cb14ad54/aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558", size = 22760, upload-time = "2025-03-12T01:42:48.764Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0f/15/5bf3b99495fb160b63f95972b81750f18f7f4e02ad051373b669d17d44f2/aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8", size = 15265, upload-time = "2025-03-12T01:42:47.083Z" }, +] + +[[package]] +name = "aiohttp" +version = "3.13.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiohappyeyeballs" }, + { name = "aiosignal" }, + { name = "async-timeout", marker = "python_full_version < '3.11'" }, + { name = "attrs" }, + { name = "frozenlist" }, + { name = "multidict" }, + { name = "propcache" }, + { name = "yarl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/77/9a/152096d4808df8e4268befa55fba462f440f14beab85e8ad9bf990516918/aiohttp-3.13.5.tar.gz", hash = "sha256:9d98cc980ecc96be6eb4c1994ce35d28d8b1f5e5208a23b421187d1209dbb7d1", size = 7858271, upload-time = "2026-03-31T22:01:03.343Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/85/cebc47ee74d8b408749073a1a46c6fcba13d170dc8af7e61996c6c9394ac/aiohttp-3.13.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:02222e7e233295f40e011c1b00e3b0bd451f22cf853a0304c3595633ee47da4b", size = 750547, upload-time = "2026-03-31T21:56:30.024Z" }, + { url = "https://files.pythonhosted.org/packages/05/98/afd308e35b9d3d8c9ec54c0918f1d722c86dc17ddfec272fcdbcce5a3124/aiohttp-3.13.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bace460460ed20614fa6bc8cb09966c0b8517b8c58ad8046828c6078d25333b5", size = 503535, upload-time = "2026-03-31T21:56:31.935Z" }, + { url = "https://files.pythonhosted.org/packages/6f/4d/926c183e06b09d5270a309eb50fbde7b09782bfd305dec1e800f329834fb/aiohttp-3.13.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f546a4dc1e6a5edbb9fd1fd6ad18134550e096a5a43f4ad74acfbd834fc6670", size = 497830, upload-time = "2026-03-31T21:56:33.654Z" }, + { url = "https://files.pythonhosted.org/packages/e4/d6/f47d1c690f115a5c2a5e8938cce4a232a5be9aac5c5fb2647efcbbbda333/aiohttp-3.13.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c86969d012e51b8e415a8c6ce96f7857d6a87d6207303ab02d5d11ef0cad2274", size = 1682474, upload-time = "2026-03-31T21:56:35.513Z" }, + { url = "https://files.pythonhosted.org/packages/01/44/056fd37b1bb52eac760303e5196acc74d9d546631b035704ae5927f7b4ac/aiohttp-3.13.5-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b6f6cd1560c5fa427e3b6074bb24d2c64e225afbb7165008903bd42e4e33e28a", size = 1655259, upload-time = "2026-03-31T21:56:37.843Z" }, + { url = "https://files.pythonhosted.org/packages/91/9f/78eb1a20c1c28ae02f6a3c0f4d7b0dcc66abce5290cadd53d78ce3084175/aiohttp-3.13.5-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:636bc362f0c5bbc7372bc3ae49737f9e3030dbce469f0f422c8f38079780363d", size = 1736204, upload-time = "2026-03-31T21:56:39.822Z" }, + { url = "https://files.pythonhosted.org/packages/de/6c/d20d7de23f0b52b8c1d9e2033b2db1ac4dacbb470bb74c56de0f5f86bb4f/aiohttp-3.13.5-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:6a7cbeb06d1070f1d14895eeeed4dac5913b22d7b456f2eb969f11f4b3993796", size = 1826198, upload-time = "2026-03-31T21:56:41.378Z" }, + { url = "https://files.pythonhosted.org/packages/2f/86/a6f3ff1fd795f49545a7c74b2c92f62729135d73e7e4055bf74da5a26c82/aiohttp-3.13.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bca9ef7517fd7874a1a08970ae88f497bf5c984610caa0bf40bd7e8450852b95", size = 1681329, upload-time = "2026-03-31T21:56:43.374Z" }, + { url = "https://files.pythonhosted.org/packages/fb/68/84cd3dab6b7b4f3e6fe9459a961acb142aaab846417f6e8905110d7027e5/aiohttp-3.13.5-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:019a67772e034a0e6b9b17c13d0a8fe56ad9fb150fc724b7f3ffd3724288d9e5", size = 1560023, upload-time = "2026-03-31T21:56:45.031Z" }, + { url = "https://files.pythonhosted.org/packages/41/2c/db61b64b0249e30f954a65ab4cb4970ced57544b1de2e3c98ee5dc24165f/aiohttp-3.13.5-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f34ecee82858e41dd217734f0c41a532bd066bcaab636ad830f03a30b2a96f2a", size = 1652372, upload-time = "2026-03-31T21:56:47.075Z" }, + { url = "https://files.pythonhosted.org/packages/25/6f/e96988a6c982d047810c772e28c43c64c300c943b0ed5c1c0c4ce1e1027c/aiohttp-3.13.5-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:4eac02d9af4813ee289cd63a361576da36dba57f5a1ab36377bc2600db0cbb73", size = 1662031, upload-time = "2026-03-31T21:56:48.835Z" }, + { url = "https://files.pythonhosted.org/packages/b7/26/a56feace81f3d347b4052403a9d03754a0ab23f7940780dada0849a38c92/aiohttp-3.13.5-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:4beac52e9fe46d6abf98b0176a88154b742e878fdf209d2248e99fcdf73cd297", size = 1708118, upload-time = "2026-03-31T21:56:50.833Z" }, + { url = "https://files.pythonhosted.org/packages/78/6e/b6173a8ff03d01d5e1a694bc06764b5dad1df2d4ed8f0ceec12bb3277936/aiohttp-3.13.5-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:c180f480207a9b2475f2b8d8bd7204e47aec952d084b2a2be58a782ffcf96074", size = 1548667, upload-time = "2026-03-31T21:56:52.81Z" }, + { url = "https://files.pythonhosted.org/packages/16/13/13296ffe2c132d888b3fe2c195c8b9c0c24c89c3fa5cc2c44464dc23b22e/aiohttp-3.13.5-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2837fb92951564d6339cedae4a7231692aa9f73cbc4fb2e04263b96844e03b4e", size = 1724490, upload-time = "2026-03-31T21:56:54.541Z" }, + { url = "https://files.pythonhosted.org/packages/7a/b4/1f1c287f4a79782ef36e5a6e62954c85343bc30470d862d30bd5f26c9fa2/aiohttp-3.13.5-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d9010032a0b9710f58012a1e9c222528763d860ba2ee1422c03473eab47703e7", size = 1667109, upload-time = "2026-03-31T21:56:56.21Z" }, + { url = "https://files.pythonhosted.org/packages/ef/42/8461a2aaf60a8f4ea4549a4056be36b904b0eb03d97ca9a8a2604681a500/aiohttp-3.13.5-cp310-cp310-win32.whl", hash = "sha256:7c4b6668b2b2b9027f209ddf647f2a4407784b5d88b8be4efcc72036f365baf9", size = 439478, upload-time = "2026-03-31T21:56:58.292Z" }, + { url = "https://files.pythonhosted.org/packages/e5/71/06956304cb5ee439dfe8d86e1b2e70088bd88ed1ced1f42fb29e5d855f0e/aiohttp-3.13.5-cp310-cp310-win_amd64.whl", hash = "sha256:cd3db5927bf9167d5a6157ddb2f036f6b6b0ad001ac82355d43e97a4bde76d76", size = 462047, upload-time = "2026-03-31T21:57:00.257Z" }, + { url = "https://files.pythonhosted.org/packages/d6/f5/a20c4ac64aeaef1679e25c9983573618ff765d7aa829fa2b84ae7573169e/aiohttp-3.13.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7ab7229b6f9b5c1ba4910d6c41a9eb11f543eadb3f384df1b4c293f4e73d44d6", size = 757513, upload-time = "2026-03-31T21:57:02.146Z" }, + { url = "https://files.pythonhosted.org/packages/75/0a/39fa6c6b179b53fcb3e4b3d2b6d6cad0180854eda17060c7218540102bef/aiohttp-3.13.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8f14c50708bb156b3a3ca7230b3d820199d56a48e3af76fa21c2d6087190fe3d", size = 506748, upload-time = "2026-03-31T21:57:04.275Z" }, + { url = "https://files.pythonhosted.org/packages/87/ec/e38ce072e724fd7add6243613f8d1810da084f54175353d25ccf9f9c7e5a/aiohttp-3.13.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e7d2f8616f0ff60bd332022279011776c3ac0faa0f1b463f7bb12326fbc97a1c", size = 501673, upload-time = "2026-03-31T21:57:06.208Z" }, + { url = "https://files.pythonhosted.org/packages/ba/ba/3bc7525d7e2beaa11b309a70d48b0d3cfc3c2089ec6a7d0820d59c657053/aiohttp-3.13.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a2567b72e1ffc3ab25510db43f355b29eeada56c0a622e58dcdb19530eb0a3cb", size = 1763757, upload-time = "2026-03-31T21:57:07.882Z" }, + { url = "https://files.pythonhosted.org/packages/5e/ab/e87744cf18f1bd78263aba24924d4953b41086bd3a31d22452378e9028a0/aiohttp-3.13.5-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:fb0540c854ac9c0c5ad495908fdfd3e332d553ec731698c0e29b1877ba0d2ec6", size = 1720152, upload-time = "2026-03-31T21:57:09.946Z" }, + { url = "https://files.pythonhosted.org/packages/6b/f3/ed17a6f2d742af17b50bae2d152315ed1b164b07a5fd5cc1754d99e4dfa5/aiohttp-3.13.5-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c9883051c6972f58bfc4ebb2116345ee2aa151178e99c3f2b2bbe2af712abd13", size = 1818010, upload-time = "2026-03-31T21:57:12.157Z" }, + { url = "https://files.pythonhosted.org/packages/53/06/ecbc63dc937192e2a5cb46df4d3edb21deb8225535818802f210a6ea5816/aiohttp-3.13.5-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2294172ce08a82fb7c7273485895de1fa1186cc8294cfeb6aef4af42ad261174", size = 1907251, upload-time = "2026-03-31T21:57:14.023Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a5/0521aa32c1ddf3aa1e71dcc466be0b7db2771907a13f18cddaa45967d97b/aiohttp-3.13.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3a807cabd5115fb55af198b98178997a5e0e57dead43eb74a93d9c07d6d4a7dc", size = 1759969, upload-time = "2026-03-31T21:57:16.146Z" }, + { url = "https://files.pythonhosted.org/packages/f6/78/a38f8c9105199dd3b9706745865a8a59d0041b6be0ca0cc4b2ccf1bab374/aiohttp-3.13.5-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:aa6d0d932e0f39c02b80744273cd5c388a2d9bc07760a03164f229c8e02662f6", size = 1616871, upload-time = "2026-03-31T21:57:17.856Z" }, + { url = "https://files.pythonhosted.org/packages/6f/41/27392a61ead8ab38072105c71aa44ff891e71653fe53d576a7067da2b4e8/aiohttp-3.13.5-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:60869c7ac4aaabe7110f26499f3e6e5696eae98144735b12a9c3d9eae2b51a49", size = 1739844, upload-time = "2026-03-31T21:57:19.679Z" }, + { url = "https://files.pythonhosted.org/packages/6e/55/5564e7ae26d94f3214250009a0b1c65a0c6af4bf88924ccb6fdab901de28/aiohttp-3.13.5-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:26d2f8546f1dfa75efa50c3488215a903c0168d253b75fba4210f57ab77a0fb8", size = 1731969, upload-time = "2026-03-31T21:57:22.006Z" }, + { url = "https://files.pythonhosted.org/packages/6d/c5/705a3929149865fc941bcbdd1047b238e4a72bcb215a9b16b9d7a2e8d992/aiohttp-3.13.5-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1162a1492032c82f14271e831c8f4b49f2b6078f4f5fc74de2c912fa225d51d", size = 1795193, upload-time = "2026-03-31T21:57:24.256Z" }, + { url = "https://files.pythonhosted.org/packages/a6/19/edabed62f718d02cff7231ca0db4ef1c72504235bc467f7b67adb1679f48/aiohttp-3.13.5-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:8b14eb3262fad0dc2f89c1a43b13727e709504972186ff6a99a3ecaa77102b6c", size = 1606477, upload-time = "2026-03-31T21:57:26.364Z" }, + { url = "https://files.pythonhosted.org/packages/de/fc/76f80ef008675637d88d0b21584596dc27410a990b0918cb1e5776545b5b/aiohttp-3.13.5-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:ca9ac61ac6db4eb6c2a0cd1d0f7e1357647b638ccc92f7e9d8d133e71ed3c6ac", size = 1813198, upload-time = "2026-03-31T21:57:28.316Z" }, + { url = "https://files.pythonhosted.org/packages/e5/67/5b3ac26b80adb20ea541c487f73730dc8fa107d632c998f25bbbab98fcda/aiohttp-3.13.5-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7996023b2ed59489ae4762256c8516df9820f751cf2c5da8ed2fb20ee50abab3", size = 1752321, upload-time = "2026-03-31T21:57:30.549Z" }, + { url = "https://files.pythonhosted.org/packages/88/06/e4a2e49255ea23fa4feeb5ab092d90240d927c15e47b5b5c48dff5a9ce29/aiohttp-3.13.5-cp311-cp311-win32.whl", hash = "sha256:77dfa48c9f8013271011e51c00f8ada19851f013cde2c48fca1ba5e0caf5bb06", size = 439069, upload-time = "2026-03-31T21:57:32.388Z" }, + { url = "https://files.pythonhosted.org/packages/c0/43/8c7163a596dab4f8be12c190cf467a1e07e4734cf90eebb39f7f5d53fc6a/aiohttp-3.13.5-cp311-cp311-win_amd64.whl", hash = "sha256:d3a4834f221061624b8887090637db9ad4f61752001eae37d56c52fddade2dc8", size = 462859, upload-time = "2026-03-31T21:57:34.455Z" }, + { url = "https://files.pythonhosted.org/packages/be/6f/353954c29e7dcce7cf00280a02c75f30e133c00793c7a2ed3776d7b2f426/aiohttp-3.13.5-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:023ecba036ddd840b0b19bf195bfae970083fd7024ce1ac22e9bba90464620e9", size = 748876, upload-time = "2026-03-31T21:57:36.319Z" }, + { url = "https://files.pythonhosted.org/packages/f5/1b/428a7c64687b3b2e9cd293186695affc0e1e54a445d0361743b231f11066/aiohttp-3.13.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:15c933ad7920b7d9a20de151efcd05a6e38302cbf0e10c9b2acb9a42210a2416", size = 499557, upload-time = "2026-03-31T21:57:38.236Z" }, + { url = "https://files.pythonhosted.org/packages/29/47/7be41556bfbb6917069d6a6634bb7dd5e163ba445b783a90d40f5ac7e3a7/aiohttp-3.13.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ab2899f9fa2f9f741896ebb6fa07c4c883bfa5c7f2ddd8cf2aafa86fa981b2d2", size = 500258, upload-time = "2026-03-31T21:57:39.923Z" }, + { url = "https://files.pythonhosted.org/packages/67/84/c9ecc5828cb0b3695856c07c0a6817a99d51e2473400f705275a2b3d9239/aiohttp-3.13.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a60eaa2d440cd4707696b52e40ed3e2b0f73f65be07fd0ef23b6b539c9c0b0b4", size = 1749199, upload-time = "2026-03-31T21:57:41.938Z" }, + { url = "https://files.pythonhosted.org/packages/f0/d3/3c6d610e66b495657622edb6ae7c7fd31b2e9086b4ec50b47897ad6042a9/aiohttp-3.13.5-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:55b3bdd3292283295774ab585160c4004f4f2f203946997f49aac032c84649e9", size = 1721013, upload-time = "2026-03-31T21:57:43.904Z" }, + { url = "https://files.pythonhosted.org/packages/49/a0/24409c12217456df0bae7babe3b014e460b0b38a8e60753d6cb339f6556d/aiohttp-3.13.5-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c2b2355dc094e5f7d45a7bb262fe7207aa0460b37a0d87027dcf21b5d890e7d5", size = 1781501, upload-time = "2026-03-31T21:57:46.285Z" }, + { url = "https://files.pythonhosted.org/packages/98/9d/b65ec649adc5bccc008b0957a9a9c691070aeac4e41cea18559fef49958b/aiohttp-3.13.5-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b38765950832f7d728297689ad78f5f2cf79ff82487131c4d26fe6ceecdc5f8e", size = 1878981, upload-time = "2026-03-31T21:57:48.734Z" }, + { url = "https://files.pythonhosted.org/packages/57/d8/8d44036d7eb7b6a8ec4c5494ea0c8c8b94fbc0ed3991c1a7adf230df03bf/aiohttp-3.13.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b18f31b80d5a33661e08c89e202edabf1986e9b49c42b4504371daeaa11b47c1", size = 1767934, upload-time = "2026-03-31T21:57:51.171Z" }, + { url = "https://files.pythonhosted.org/packages/31/04/d3f8211f273356f158e3464e9e45484d3fb8c4ce5eb2f6fe9405c3273983/aiohttp-3.13.5-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:33add2463dde55c4f2d9635c6ab33ce154e5ecf322bd26d09af95c5f81cfa286", size = 1566671, upload-time = "2026-03-31T21:57:53.326Z" }, + { url = "https://files.pythonhosted.org/packages/41/db/073e4ebe00b78e2dfcacff734291651729a62953b48933d765dc513bf798/aiohttp-3.13.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:327cc432fdf1356fb4fbc6fe833ad4e9f6aacb71a8acaa5f1855e4b25910e4a9", size = 1705219, upload-time = "2026-03-31T21:57:55.385Z" }, + { url = "https://files.pythonhosted.org/packages/48/45/7dfba71a2f9fd97b15c95c06819de7eb38113d2cdb6319669195a7d64270/aiohttp-3.13.5-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:7c35b0bf0b48a70b4cb4fc5d7bed9b932532728e124874355de1a0af8ec4bc88", size = 1743049, upload-time = "2026-03-31T21:57:57.341Z" }, + { url = "https://files.pythonhosted.org/packages/18/71/901db0061e0f717d226386a7f471bb59b19566f2cae5f0d93874b017271f/aiohttp-3.13.5-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:df23d57718f24badef8656c49743e11a89fd6f5358fa8a7b96e728fda2abf7d3", size = 1749557, upload-time = "2026-03-31T21:57:59.626Z" }, + { url = "https://files.pythonhosted.org/packages/08/d5/41eebd16066e59cd43728fe74bce953d7402f2b4ddfdfef2c0e9f17ca274/aiohttp-3.13.5-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:02e048037a6501a5ec1f6fc9736135aec6eb8a004ce48838cb951c515f32c80b", size = 1558931, upload-time = "2026-03-31T21:58:01.972Z" }, + { url = "https://files.pythonhosted.org/packages/30/e6/4a799798bf05740e66c3a1161079bda7a3dd8e22ca392481d7a7f9af82a6/aiohttp-3.13.5-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:31cebae8b26f8a615d2b546fee45d5ffb76852ae6450e2a03f42c9102260d6fe", size = 1774125, upload-time = "2026-03-31T21:58:04.007Z" }, + { url = "https://files.pythonhosted.org/packages/84/63/7749337c90f92bc2cb18f9560d67aa6258c7060d1397d21529b8004fcf6f/aiohttp-3.13.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:888e78eb5ca55a615d285c3c09a7a91b42e9dd6fc699b166ebd5dee87c9ccf14", size = 1732427, upload-time = "2026-03-31T21:58:06.337Z" }, + { url = "https://files.pythonhosted.org/packages/98/de/cf2f44ff98d307e72fb97d5f5bbae3bfcb442f0ea9790c0bf5c5c2331404/aiohttp-3.13.5-cp312-cp312-win32.whl", hash = "sha256:8bd3ec6376e68a41f9f95f5ed170e2fcf22d4eb27a1f8cb361d0508f6e0557f3", size = 433534, upload-time = "2026-03-31T21:58:08.712Z" }, + { url = "https://files.pythonhosted.org/packages/aa/ca/eadf6f9c8fa5e31d40993e3db153fb5ed0b11008ad5d9de98a95045bed84/aiohttp-3.13.5-cp312-cp312-win_amd64.whl", hash = "sha256:110e448e02c729bcebb18c60b9214a87ba33bac4a9fa5e9a5f139938b56c6cb1", size = 460446, upload-time = "2026-03-31T21:58:10.945Z" }, + { url = "https://files.pythonhosted.org/packages/78/e9/d76bf503005709e390122d34e15256b88f7008e246c4bdbe915cd4f1adce/aiohttp-3.13.5-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a5029cc80718bbd545123cd8fe5d15025eccaaaace5d0eeec6bd556ad6163d61", size = 742930, upload-time = "2026-03-31T21:58:13.155Z" }, + { url = "https://files.pythonhosted.org/packages/57/00/4b7b70223deaebd9bb85984d01a764b0d7bd6526fcdc73cca83bcbe7243e/aiohttp-3.13.5-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4bb6bf5811620003614076bdc807ef3b5e38244f9d25ca5fe888eaccea2a9832", size = 496927, upload-time = "2026-03-31T21:58:15.073Z" }, + { url = "https://files.pythonhosted.org/packages/9c/f5/0fb20fb49f8efdcdce6cd8127604ad2c503e754a8f139f5e02b01626523f/aiohttp-3.13.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a84792f8631bf5a94e52d9cc881c0b824ab42717165a5579c760b830d9392ac9", size = 497141, upload-time = "2026-03-31T21:58:17.009Z" }, + { url = "https://files.pythonhosted.org/packages/3b/86/b7c870053e36a94e8951b803cb5b909bfbc9b90ca941527f5fcafbf6b0fa/aiohttp-3.13.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:57653eac22c6a4c13eb22ecf4d673d64a12f266e72785ab1c8b8e5940d0e8090", size = 1732476, upload-time = "2026-03-31T21:58:18.925Z" }, + { url = "https://files.pythonhosted.org/packages/b5/e5/4e161f84f98d80c03a238671b4136e6530453d65262867d989bbe78244d0/aiohttp-3.13.5-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e5e5f7debc7a57af53fdf5c5009f9391d9f4c12867049d509bf7bb164a6e295b", size = 1706507, upload-time = "2026-03-31T21:58:21.094Z" }, + { url = "https://files.pythonhosted.org/packages/d4/56/ea11a9f01518bd5a2a2fcee869d248c4b8a0cfa0bb13401574fa31adf4d4/aiohttp-3.13.5-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c719f65bebcdf6716f10e9eff80d27567f7892d8988c06de12bbbd39307c6e3a", size = 1773465, upload-time = "2026-03-31T21:58:23.159Z" }, + { url = "https://files.pythonhosted.org/packages/eb/40/333ca27fb74b0383f17c90570c748f7582501507307350a79d9f9f3c6eb1/aiohttp-3.13.5-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d97f93fdae594d886c5a866636397e2bcab146fd7a132fd6bb9ce182224452f8", size = 1873523, upload-time = "2026-03-31T21:58:25.59Z" }, + { url = "https://files.pythonhosted.org/packages/f0/d2/e2f77eef1acb7111405433c707dc735e63f67a56e176e72e9e7a2cd3f493/aiohttp-3.13.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3df334e39d4c2f899a914f1dba283c1aadc311790733f705182998c6f7cae665", size = 1754113, upload-time = "2026-03-31T21:58:27.624Z" }, + { url = "https://files.pythonhosted.org/packages/fb/56/3f653d7f53c89669301ec9e42c95233e2a0c0a6dd051269e6e678db4fdb0/aiohttp-3.13.5-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:fe6970addfea9e5e081401bcbadf865d2b6da045472f58af08427e108d618540", size = 1562351, upload-time = "2026-03-31T21:58:29.918Z" }, + { url = "https://files.pythonhosted.org/packages/ec/a6/9b3e91eb8ae791cce4ee736da02211c85c6f835f1bdfac0594a8a3b7018c/aiohttp-3.13.5-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7becdf835feff2f4f335d7477f121af787e3504b48b449ff737afb35869ba7bb", size = 1693205, upload-time = "2026-03-31T21:58:32.214Z" }, + { url = "https://files.pythonhosted.org/packages/98/fc/bfb437a99a2fcebd6b6eaec609571954de2ed424f01c352f4b5504371dd3/aiohttp-3.13.5-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:676e5651705ad5d8a70aeb8eb6936c436d8ebbd56e63436cb7dd9bb36d2a9a46", size = 1730618, upload-time = "2026-03-31T21:58:34.728Z" }, + { url = "https://files.pythonhosted.org/packages/e4/b6/c8534862126191a034f68153194c389addc285a0f1347d85096d349bbc15/aiohttp-3.13.5-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:9b16c653d38eb1a611cc898c41e76859ca27f119d25b53c12875fd0474ae31a8", size = 1745185, upload-time = "2026-03-31T21:58:36.909Z" }, + { url = "https://files.pythonhosted.org/packages/0b/93/4ca8ee2ef5236e2707e0fd5fecb10ce214aee1ff4ab307af9c558bda3b37/aiohttp-3.13.5-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:999802d5fa0389f58decd24b537c54aa63c01c3219ce17d1214cbda3c2b22d2d", size = 1557311, upload-time = "2026-03-31T21:58:39.38Z" }, + { url = "https://files.pythonhosted.org/packages/57/ae/76177b15f18c5f5d094f19901d284025db28eccc5ae374d1d254181d33f4/aiohttp-3.13.5-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:ec707059ee75732b1ba130ed5f9580fe10ff75180c812bc267ded039db5128c6", size = 1773147, upload-time = "2026-03-31T21:58:41.476Z" }, + { url = "https://files.pythonhosted.org/packages/01/a4/62f05a0a98d88af59d93b7fcac564e5f18f513cb7471696ac286db970d6a/aiohttp-3.13.5-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2d6d44a5b48132053c2f6cd5c8cb14bc67e99a63594e336b0f2af81e94d5530c", size = 1730356, upload-time = "2026-03-31T21:58:44.049Z" }, + { url = "https://files.pythonhosted.org/packages/e4/85/fc8601f59dfa8c9523808281f2da571f8b4699685f9809a228adcc90838d/aiohttp-3.13.5-cp313-cp313-win32.whl", hash = "sha256:329f292ed14d38a6c4c435e465f48bebb47479fd676a0411936cc371643225cc", size = 432637, upload-time = "2026-03-31T21:58:46.167Z" }, + { url = "https://files.pythonhosted.org/packages/c0/1b/ac685a8882896acf0f6b31d689e3792199cfe7aba37969fa91da63a7fa27/aiohttp-3.13.5-cp313-cp313-win_amd64.whl", hash = "sha256:69f571de7500e0557801c0b51f4780482c0ec5fe2ac851af5a92cfce1af1cb83", size = 458896, upload-time = "2026-03-31T21:58:48.119Z" }, + { url = "https://files.pythonhosted.org/packages/5d/ce/46572759afc859e867a5bc8ec3487315869013f59281ce61764f76d879de/aiohttp-3.13.5-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:eb4639f32fd4a9904ab8fb45bf3383ba71137f3d9d4ba25b3b3f3109977c5b8c", size = 745721, upload-time = "2026-03-31T21:58:50.229Z" }, + { url = "https://files.pythonhosted.org/packages/13/fe/8a2efd7626dbe6049b2ef8ace18ffda8a4dfcbe1bcff3ac30c0c7575c20b/aiohttp-3.13.5-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:7e5dc4311bd5ac493886c63cbf76ab579dbe4641268e7c74e48e774c74b6f2be", size = 497663, upload-time = "2026-03-31T21:58:52.232Z" }, + { url = "https://files.pythonhosted.org/packages/9b/91/cc8cc78a111826c54743d88651e1687008133c37e5ee615fee9b57990fac/aiohttp-3.13.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:756c3c304d394977519824449600adaf2be0ccee76d206ee339c5e76b70ded25", size = 499094, upload-time = "2026-03-31T21:58:54.566Z" }, + { url = "https://files.pythonhosted.org/packages/0a/33/a8362cb15cf16a3af7e86ed11962d5cd7d59b449202dc576cdc731310bde/aiohttp-3.13.5-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ecc26751323224cf8186efcf7fbcbc30f4e1d8c7970659daf25ad995e4032a56", size = 1726701, upload-time = "2026-03-31T21:58:56.864Z" }, + { url = "https://files.pythonhosted.org/packages/45/0c/c091ac5c3a17114bd76cbf85d674650969ddf93387876cf67f754204bd77/aiohttp-3.13.5-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:10a75acfcf794edf9d8db50e5a7ec5fc818b2a8d3f591ce93bc7b1210df016d2", size = 1683360, upload-time = "2026-03-31T21:58:59.072Z" }, + { url = "https://files.pythonhosted.org/packages/23/73/bcee1c2b79bc275e964d1446c55c54441a461938e70267c86afaae6fba27/aiohttp-3.13.5-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0f7a18f258d124cd678c5fe072fe4432a4d5232b0657fca7c1847f599233c83a", size = 1773023, upload-time = "2026-03-31T21:59:01.776Z" }, + { url = "https://files.pythonhosted.org/packages/c7/ef/720e639df03004fee2d869f771799d8c23046dec47d5b81e396c7cda583a/aiohttp-3.13.5-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:df6104c009713d3a89621096f3e3e88cc323fd269dbd7c20afe18535094320be", size = 1853795, upload-time = "2026-03-31T21:59:04.568Z" }, + { url = "https://files.pythonhosted.org/packages/bd/c9/989f4034fb46841208de7aeeac2c6d8300745ab4f28c42f629ba77c2d916/aiohttp-3.13.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:241a94f7de7c0c3b616627aaad530fe2cb620084a8b144d3be7b6ecfe95bae3b", size = 1730405, upload-time = "2026-03-31T21:59:07.221Z" }, + { url = "https://files.pythonhosted.org/packages/ce/75/ee1fd286ca7dc599d824b5651dad7b3be7ff8d9a7e7b3fe9820d9180f7db/aiohttp-3.13.5-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c974fb66180e58709b6fc402846f13791240d180b74de81d23913abe48e96d94", size = 1558082, upload-time = "2026-03-31T21:59:09.484Z" }, + { url = "https://files.pythonhosted.org/packages/c3/20/1e9e6650dfc436340116b7aa89ff8cb2bbdf0abc11dfaceaad8f74273a10/aiohttp-3.13.5-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:6e27ea05d184afac78aabbac667450c75e54e35f62238d44463131bd3f96753d", size = 1692346, upload-time = "2026-03-31T21:59:12.068Z" }, + { url = "https://files.pythonhosted.org/packages/d8/40/8ebc6658d48ea630ac7903912fe0dd4e262f0e16825aa4c833c56c9f1f56/aiohttp-3.13.5-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:a79a6d399cef33a11b6f004c67bb07741d91f2be01b8d712d52c75711b1e07c7", size = 1698891, upload-time = "2026-03-31T21:59:14.552Z" }, + { url = "https://files.pythonhosted.org/packages/d8/78/ea0ae5ec8ba7a5c10bdd6e318f1ba5e76fcde17db8275188772afc7917a4/aiohttp-3.13.5-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:c632ce9c0b534fbe25b52c974515ed674937c5b99f549a92127c85f771a78772", size = 1742113, upload-time = "2026-03-31T21:59:17.068Z" }, + { url = "https://files.pythonhosted.org/packages/8a/66/9d308ed71e3f2491be1acb8769d96c6f0c47d92099f3bc9119cada27b357/aiohttp-3.13.5-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:fceedde51fbd67ee2bcc8c0b33d0126cc8b51ef3bbde2f86662bd6d5a6f10ec5", size = 1553088, upload-time = "2026-03-31T21:59:19.541Z" }, + { url = "https://files.pythonhosted.org/packages/da/a6/6cc25ed8dfc6e00c90f5c6d126a98e2cf28957ad06fa1036bd34b6f24a2c/aiohttp-3.13.5-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:f92995dfec9420bb69ae629abf422e516923ba79ba4403bc750d94fb4a6c68c1", size = 1757976, upload-time = "2026-03-31T21:59:22.311Z" }, + { url = "https://files.pythonhosted.org/packages/c1/2b/cce5b0ffe0de99c83e5e36d8f828e4161e415660a9f3e58339d07cce3006/aiohttp-3.13.5-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:20ae0ff08b1f2c8788d6fb85afcb798654ae6ba0b747575f8562de738078457b", size = 1712444, upload-time = "2026-03-31T21:59:24.635Z" }, + { url = "https://files.pythonhosted.org/packages/6c/cf/9e1795b4160c58d29421eafd1a69c6ce351e2f7c8d3c6b7e4ca44aea1a5b/aiohttp-3.13.5-cp314-cp314-win32.whl", hash = "sha256:b20df693de16f42b2472a9c485e1c948ee55524786a0a34345511afdd22246f3", size = 438128, upload-time = "2026-03-31T21:59:27.291Z" }, + { url = "https://files.pythonhosted.org/packages/22/4d/eaedff67fc805aeba4ba746aec891b4b24cebb1a7d078084b6300f79d063/aiohttp-3.13.5-cp314-cp314-win_amd64.whl", hash = "sha256:f85c6f327bf0b8c29da7d93b1cabb6363fb5e4e160a32fa241ed2dce21b73162", size = 464029, upload-time = "2026-03-31T21:59:29.429Z" }, + { url = "https://files.pythonhosted.org/packages/79/11/c27d9332ee20d68dd164dc12a6ecdef2e2e35ecc97ed6cf0d2442844624b/aiohttp-3.13.5-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:1efb06900858bb618ff5cee184ae2de5828896c448403d51fb633f09e109be0a", size = 778758, upload-time = "2026-03-31T21:59:31.547Z" }, + { url = "https://files.pythonhosted.org/packages/04/fb/377aead2e0a3ba5f09b7624f702a964bdf4f08b5b6728a9799830c80041e/aiohttp-3.13.5-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:fee86b7c4bd29bdaf0d53d14739b08a106fdda809ca5fe032a15f52fae5fe254", size = 512883, upload-time = "2026-03-31T21:59:34.098Z" }, + { url = "https://files.pythonhosted.org/packages/bb/a6/aa109a33671f7a5d3bd78b46da9d852797c5e665bfda7d6b373f56bff2ec/aiohttp-3.13.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:20058e23909b9e65f9da62b396b77dfa95965cbe840f8def6e572538b1d32e36", size = 516668, upload-time = "2026-03-31T21:59:36.497Z" }, + { url = "https://files.pythonhosted.org/packages/79/b3/ca078f9f2fa9563c36fb8ef89053ea2bb146d6f792c5104574d49d8acb63/aiohttp-3.13.5-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cf20a8d6868cb15a73cab329ffc07291ba8c22b1b88176026106ae39aa6df0f", size = 1883461, upload-time = "2026-03-31T21:59:38.723Z" }, + { url = "https://files.pythonhosted.org/packages/b7/e3/a7ad633ca1ca497b852233a3cce6906a56c3225fb6d9217b5e5e60b7419d/aiohttp-3.13.5-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:330f5da04c987f1d5bdb8ae189137c77139f36bd1cb23779ca1a354a4b027800", size = 1747661, upload-time = "2026-03-31T21:59:41.187Z" }, + { url = "https://files.pythonhosted.org/packages/33/b9/cd6fe579bed34a906d3d783fe60f2fa297ef55b27bb4538438ee49d4dc41/aiohttp-3.13.5-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6f1cbf0c7926d315c3c26c2da41fd2b5d2fe01ac0e157b78caefc51a782196cf", size = 1863800, upload-time = "2026-03-31T21:59:43.84Z" }, + { url = "https://files.pythonhosted.org/packages/c0/3f/2c1e2f5144cefa889c8afd5cf431994c32f3b29da9961698ff4e3811b79a/aiohttp-3.13.5-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:53fc049ed6390d05423ba33103ded7281fe897cf97878f369a527070bd95795b", size = 1958382, upload-time = "2026-03-31T21:59:46.187Z" }, + { url = "https://files.pythonhosted.org/packages/66/1d/f31ec3f1013723b3babe3609e7f119c2c2fb6ef33da90061a705ef3e1bc8/aiohttp-3.13.5-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:898703aa2667e3c5ca4c54ca36cd73f58b7a38ef87a5606414799ebce4d3fd3a", size = 1803724, upload-time = "2026-03-31T21:59:48.656Z" }, + { url = "https://files.pythonhosted.org/packages/0e/b4/57712dfc6f1542f067daa81eb61da282fab3e6f1966fca25db06c4fc62d5/aiohttp-3.13.5-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0494a01ca9584eea1e5fbd6d748e61ecff218c51b576ee1999c23db7066417d8", size = 1640027, upload-time = "2026-03-31T21:59:51.284Z" }, + { url = "https://files.pythonhosted.org/packages/25/3c/734c878fb43ec083d8e31bf029daae1beafeae582d1b35da234739e82ee7/aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:6cf81fe010b8c17b09495cbd15c1d35afbc8fb405c0c9cf4738e5ae3af1d65be", size = 1806644, upload-time = "2026-03-31T21:59:53.753Z" }, + { url = "https://files.pythonhosted.org/packages/20/a5/f671e5cbec1c21d044ff3078223f949748f3a7f86b14e34a365d74a5d21f/aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:c564dd5f09ddc9d8f2c2d0a301cd30a79a2cc1b46dd1a73bef8f0038863d016b", size = 1791630, upload-time = "2026-03-31T21:59:56.239Z" }, + { url = "https://files.pythonhosted.org/packages/0b/63/fb8d0ad63a0b8a99be97deac8c04dacf0785721c158bdf23d679a87aa99e/aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:2994be9f6e51046c4f864598fd9abeb4fba6e88f0b2152422c9666dcd4aea9c6", size = 1809403, upload-time = "2026-03-31T21:59:59.103Z" }, + { url = "https://files.pythonhosted.org/packages/59/0c/bfed7f30662fcf12206481c2aac57dedee43fe1c49275e85b3a1e1742294/aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:157826e2fa245d2ef46c83ea8a5faf77ca19355d278d425c29fda0beb3318037", size = 1634924, upload-time = "2026-03-31T22:00:02.116Z" }, + { url = "https://files.pythonhosted.org/packages/17/d6/fd518d668a09fd5a3319ae5e984d4d80b9a4b3df4e21c52f02251ef5a32e/aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:a8aca50daa9493e9e13c0f566201a9006f080e7c50e5e90d0b06f53146a54500", size = 1836119, upload-time = "2026-03-31T22:00:04.756Z" }, + { url = "https://files.pythonhosted.org/packages/78/b7/15fb7a9d52e112a25b621c67b69c167805cb1f2ab8f1708a5c490d1b52fe/aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:3b13560160d07e047a93f23aaa30718606493036253d5430887514715b67c9d9", size = 1772072, upload-time = "2026-03-31T22:00:07.494Z" }, + { url = "https://files.pythonhosted.org/packages/7e/df/57ba7f0c4a553fc2bd8b6321df236870ec6fd64a2a473a8a13d4f733214e/aiohttp-3.13.5-cp314-cp314t-win32.whl", hash = "sha256:9a0f4474b6ea6818b41f82172d799e4b3d29e22c2c520ce4357856fced9af2f8", size = 471819, upload-time = "2026-03-31T22:00:10.277Z" }, + { url = "https://files.pythonhosted.org/packages/62/29/2f8418269e46454a26171bfdd6a055d74febf32234e474930f2f60a17145/aiohttp-3.13.5-cp314-cp314t-win_amd64.whl", hash = "sha256:18a2f6c1182c51baa1d28d68fea51513cb2a76612f038853c0ad3c145423d3d9", size = 505441, upload-time = "2026-03-31T22:00:12.791Z" }, +] + +[[package]] +name = "aioitertools" +version = "0.13.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fd/3c/53c4a17a05fb9ea2313ee1777ff53f5e001aefd5cc85aa2f4c2d982e1e38/aioitertools-0.13.0.tar.gz", hash = "sha256:620bd241acc0bbb9ec819f1ab215866871b4bbd1f73836a55f799200ee86950c", size = 19322, upload-time = "2025-11-06T22:17:07.609Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/10/a1/510b0a7fadc6f43a6ce50152e69dbd86415240835868bb0bd9b5b88b1e06/aioitertools-0.13.0-py3-none-any.whl", hash = "sha256:0be0292b856f08dfac90e31f4739432f4cb6d7520ab9eb73e143f4f2fa5259be", size = 24182, upload-time = "2025-11-06T22:17:06.502Z" }, +] + +[[package]] +name = "aiosignal" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "frozenlist" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/61/62/06741b579156360248d1ec624842ad0edf697050bbaf7c3e46394e106ad1/aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7", size = 25007, upload-time = "2025-07-03T22:54:43.528Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e", size = 7490, upload-time = "2025-07-03T22:54:42.156Z" }, +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "anyio" +version = "4.12.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/16/ce/8a777047513153587e5434fd752e89334ac33e379aa3497db860eeb60377/anyio-4.12.0.tar.gz", hash = "sha256:73c693b567b0c55130c104d0b43a9baf3aa6a31fc6110116509f27bf75e21ec0", size = 228266, upload-time = "2025-11-28T23:37:38.911Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/9c/36c5c37947ebfb8c7f22e0eb6e4d188ee2d53aa3880f3f2744fb894f0cb1/anyio-4.12.0-py3-none-any.whl", hash = "sha256:dad2376a628f98eeca4881fc56cd06affd18f659b17a747d3ff0307ced94b1bb", size = 113362, upload-time = "2025-11-28T23:36:57.897Z" }, +] + +[[package]] +name = "astroid" +version = "3.2.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/53/1067e1113ecaf58312357f2cd93063674924119d80d173adc3f6f2387aa2/astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a", size = 397576, upload-time = "2024-07-20T12:57:43.26Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/80/96/b32bbbb46170a1c8b8b1f28c794202e25cfe743565e9d3469b8eb1e0cc05/astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25", size = 276348, upload-time = "2024-07-20T12:57:40.886Z" }, +] + +[[package]] +name = "async-timeout" +version = "5.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a5/ae/136395dfbfe00dfc94da3f3e136d0b13f394cba8f4841120e34226265780/async_timeout-5.0.1.tar.gz", hash = "sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3", size = 9274, upload-time = "2024-11-06T16:41:39.6Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fe/ba/e2081de779ca30d473f21f5b30e0e737c438205440784c7dfc81efc2b029/async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c", size = 6233, upload-time = "2024-11-06T16:41:37.9Z" }, +] + +[[package]] +name = "attrs" +version = "25.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6b/5c/685e6633917e101e5dcb62b9dd76946cbb57c26e133bae9e0cd36033c0a9/attrs-25.4.0.tar.gz", hash = "sha256:16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11", size = 934251, upload-time = "2025-10-06T13:54:44.725Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3a/2a/7cc015f5b9f5db42b7d48157e23356022889fc354a2813c15934b7cb5c0e/attrs-25.4.0-py3-none-any.whl", hash = "sha256:adcf7e2a1fb3b36ac48d97835bb6d8ade15b8dcce26aba8bf1d14847b57a3373", size = 67615, upload-time = "2025-10-06T13:54:43.17Z" }, +] + +[[package]] +name = "authlib" +version = "1.6.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bb/9b/b1661026ff24bc641b76b78c5222d614776b0c085bcfdac9bd15a1cb4b35/authlib-1.6.6.tar.gz", hash = "sha256:45770e8e056d0f283451d9996fbb59b70d45722b45d854d58f32878d0a40c38e", size = 164894, upload-time = "2025-12-12T08:01:41.464Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/51/321e821856452f7386c4e9df866f196720b1ad0c5ea1623ea7399969ae3b/authlib-1.6.6-py2.py3-none-any.whl", hash = "sha256:7d9e9bc535c13974313a87f53e8430eb6ea3d1cf6ae4f6efcd793f2e949143fd", size = 244005, upload-time = "2025-12-12T08:01:40.209Z" }, +] + +[[package]] +name = "azure-core" +version = "1.39.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "requests" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/34/83/bbde3faa84ddcb8eb0eca4b3ffb3221252281db4ce351300fe248c5c70b1/azure_core-1.39.0.tar.gz", hash = "sha256:8a90a562998dd44ce84597590fff6249701b98c0e8797c95fcdd695b54c35d74", size = 367531, upload-time = "2026-03-19T01:31:29.461Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/d6/8ebcd05b01a580f086ac9a97fb9fac65c09a4b012161cc97c21a336e880b/azure_core-1.39.0-py3-none-any.whl", hash = "sha256:4ac7b70fab5438c3f68770649a78daf97833caa83827f91df9c14e0e0ea7d34f", size = 218318, upload-time = "2026-03-19T01:31:31.25Z" }, +] + +[package.optional-dependencies] +aio = [ + { name = "aiohttp" }, +] + +[[package]] +name = "azure-storage-blob" +version = "12.28.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "azure-core" }, + { name = "cryptography" }, + { name = "isodate" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/71/24/072ba8e27b0e2d8fec401e9969b429d4f5fc4c8d4f0f05f4661e11f7234a/azure_storage_blob-12.28.0.tar.gz", hash = "sha256:e7d98ea108258d29aa0efbfd591b2e2075fa1722a2fae8699f0b3c9de11eff41", size = 604225, upload-time = "2026-01-06T23:48:57.282Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d8/3a/6ef2047a072e54e1142718d433d50e9514c999a58f51abfff7902f3a72f8/azure_storage_blob-12.28.0-py3-none-any.whl", hash = "sha256:00fb1db28bf6a7b7ecaa48e3b1d5c83bfadacc5a678b77826081304bd87d6461", size = 431499, upload-time = "2026-01-06T23:48:58.995Z" }, +] + +[package.optional-dependencies] +aio = [ + { name = "azure-core", extra = ["aio"] }, +] + +[[package]] +name = "backoff" +version = "2.2.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/47/d7/5bbeb12c44d7c4f2fb5b56abce497eb5ed9f34d85701de869acedd602619/backoff-2.2.1.tar.gz", hash = "sha256:03f829f5bb1923180821643f8753b0502c3b682293992485b0eef2807afa5cba", size = 17001, upload-time = "2022-10-05T19:19:32.061Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/73/b6e24bd22e6720ca8ee9a85a0c4a2971af8497d8f3193fa05390cbd46e09/backoff-2.2.1-py3-none-any.whl", hash = "sha256:63579f9a0628e06278f7e47b7d7d5b6ce20dc65c5e96a6f3ca99a6adca0396e8", size = 15148, upload-time = "2022-10-05T19:19:30.546Z" }, +] + +[[package]] +name = "boto3" +version = "1.34.69" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "botocore" }, + { name = "jmespath" }, + { name = "s3transfer" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/76/27/fd0b2f0218413aaf346959384ad756350c114c95715e505984cf8b4d1c95/boto3-1.34.69.tar.gz", hash = "sha256:898a5fed26b1351352703421d1a8b886ef2a74be6c97d5ecc92432ae01fda203", size = 108279, upload-time = "2024-03-22T19:14:54.311Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a1/f3/a6626ed248468ab33b2f68cc98f9cb0f40beab0803af382e6c52c5545a45/boto3-1.34.69-py3-none-any.whl", hash = "sha256:2e25ef6bd325217c2da329829478be063155897d8d3b29f31f7f23ab548519b1", size = 139323, upload-time = "2024-03-22T19:14:08.926Z" }, +] + +[[package]] +name = "botocore" +version = "1.34.69" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jmespath" }, + { name = "python-dateutil" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f7/38/493fd3057469208f350f82423da8dcf0fd2698fa4563169dd209b6952567/botocore-1.34.69.tar.gz", hash = "sha256:d1ab2bff3c2fd51719c2021d9fa2f30fbb9ed0a308f69e9a774ac92c8091380a", size = 12246645, upload-time = "2024-03-22T19:15:00.409Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c6/78/919e50b633035216dfb68627b1a4eac1235148b89b34a28f07fd99e8ac17/botocore-1.34.69-py3-none-any.whl", hash = "sha256:d3802d076d4d507bf506f9845a6970ce43adc3d819dd57c2791f5c19ed6e5950", size = 12026668, upload-time = "2024-03-22T19:14:33.057Z" }, +] + +[[package]] +name = "cachetools" +version = "6.2.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bc/1d/ede8680603f6016887c062a2cf4fc8fdba905866a3ab8831aa8aa651320c/cachetools-6.2.4.tar.gz", hash = "sha256:82c5c05585e70b6ba2d3ae09ea60b79548872185d2f24ae1f2709d37299fd607", size = 31731, upload-time = "2025-12-15T18:24:53.744Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/fc/1d7b80d0eb7b714984ce40efc78859c022cd930e402f599d8ca9e39c78a4/cachetools-6.2.4-py3-none-any.whl", hash = "sha256:69a7a52634fed8b8bf6e24a050fb60bff1c9bd8f6d24572b99c32d4e71e62a51", size = 11551, upload-time = "2025-12-15T18:24:52.332Z" }, +] + +[[package]] +name = "certifi" +version = "2025.11.12" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/8c/58f469717fa48465e4a50c014a0400602d3c437d7c0c468e17ada824da3a/certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316", size = 160538, upload-time = "2025-11-12T02:54:51.517Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/70/7d/9bc192684cea499815ff478dfcdc13835ddf401365057044fb721ec6bddb/certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b", size = 159438, upload-time = "2025-11-12T02:54:49.735Z" }, +] + +[[package]] +name = "cffi" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pycparser", marker = "implementation_name != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/eb/56/b1ba7935a17738ae8453301356628e8147c79dbb825bcbc73dc7401f9846/cffi-2.0.0.tar.gz", hash = "sha256:44d1b5909021139fe36001ae048dbdde8214afa20200eda0f64c068cac5d5529", size = 523588, upload-time = "2025-09-08T23:24:04.541Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/93/d7/516d984057745a6cd96575eea814fe1edd6646ee6efd552fb7b0921dec83/cffi-2.0.0-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:0cf2d91ecc3fcc0625c2c530fe004f82c110405f101548512cce44322fa8ac44", size = 184283, upload-time = "2025-09-08T23:22:08.01Z" }, + { url = "https://files.pythonhosted.org/packages/9e/84/ad6a0b408daa859246f57c03efd28e5dd1b33c21737c2db84cae8c237aa5/cffi-2.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f73b96c41e3b2adedc34a7356e64c8eb96e03a3782b535e043a986276ce12a49", size = 180504, upload-time = "2025-09-08T23:22:10.637Z" }, + { url = "https://files.pythonhosted.org/packages/50/bd/b1a6362b80628111e6653c961f987faa55262b4002fcec42308cad1db680/cffi-2.0.0-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:53f77cbe57044e88bbd5ed26ac1d0514d2acf0591dd6bb02a3ae37f76811b80c", size = 208811, upload-time = "2025-09-08T23:22:12.267Z" }, + { url = "https://files.pythonhosted.org/packages/4f/27/6933a8b2562d7bd1fb595074cf99cc81fc3789f6a6c05cdabb46284a3188/cffi-2.0.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3e837e369566884707ddaf85fc1744b47575005c0a229de3327f8f9a20f4efeb", size = 216402, upload-time = "2025-09-08T23:22:13.455Z" }, + { url = "https://files.pythonhosted.org/packages/05/eb/b86f2a2645b62adcfff53b0dd97e8dfafb5c8aa864bd0d9a2c2049a0d551/cffi-2.0.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:5eda85d6d1879e692d546a078b44251cdd08dd1cfb98dfb77b670c97cee49ea0", size = 203217, upload-time = "2025-09-08T23:22:14.596Z" }, + { url = "https://files.pythonhosted.org/packages/9f/e0/6cbe77a53acf5acc7c08cc186c9928864bd7c005f9efd0d126884858a5fe/cffi-2.0.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:9332088d75dc3241c702d852d4671613136d90fa6881da7d770a483fd05248b4", size = 203079, upload-time = "2025-09-08T23:22:15.769Z" }, + { url = "https://files.pythonhosted.org/packages/98/29/9b366e70e243eb3d14a5cb488dfd3a0b6b2f1fb001a203f653b93ccfac88/cffi-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fc7de24befaeae77ba923797c7c87834c73648a05a4bde34b3b7e5588973a453", size = 216475, upload-time = "2025-09-08T23:22:17.427Z" }, + { url = "https://files.pythonhosted.org/packages/21/7a/13b24e70d2f90a322f2900c5d8e1f14fa7e2a6b3332b7309ba7b2ba51a5a/cffi-2.0.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:cf364028c016c03078a23b503f02058f1814320a56ad535686f90565636a9495", size = 218829, upload-time = "2025-09-08T23:22:19.069Z" }, + { url = "https://files.pythonhosted.org/packages/60/99/c9dc110974c59cc981b1f5b66e1d8af8af764e00f0293266824d9c4254bc/cffi-2.0.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e11e82b744887154b182fd3e7e8512418446501191994dbf9c9fc1f32cc8efd5", size = 211211, upload-time = "2025-09-08T23:22:20.588Z" }, + { url = "https://files.pythonhosted.org/packages/49/72/ff2d12dbf21aca1b32a40ed792ee6b40f6dc3a9cf1644bd7ef6e95e0ac5e/cffi-2.0.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8ea985900c5c95ce9db1745f7933eeef5d314f0565b27625d9a10ec9881e1bfb", size = 218036, upload-time = "2025-09-08T23:22:22.143Z" }, + { url = "https://files.pythonhosted.org/packages/e2/cc/027d7fb82e58c48ea717149b03bcadcbdc293553edb283af792bd4bcbb3f/cffi-2.0.0-cp310-cp310-win32.whl", hash = "sha256:1f72fb8906754ac8a2cc3f9f5aaa298070652a0ffae577e0ea9bd480dc3c931a", size = 172184, upload-time = "2025-09-08T23:22:23.328Z" }, + { url = "https://files.pythonhosted.org/packages/33/fa/072dd15ae27fbb4e06b437eb6e944e75b068deb09e2a2826039e49ee2045/cffi-2.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:b18a3ed7d5b3bd8d9ef7a8cb226502c6bf8308df1525e1cc676c3680e7176739", size = 182790, upload-time = "2025-09-08T23:22:24.752Z" }, + { url = "https://files.pythonhosted.org/packages/12/4a/3dfd5f7850cbf0d06dc84ba9aa00db766b52ca38d8b86e3a38314d52498c/cffi-2.0.0-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:b4c854ef3adc177950a8dfc81a86f5115d2abd545751a304c5bcf2c2c7283cfe", size = 184344, upload-time = "2025-09-08T23:22:26.456Z" }, + { url = "https://files.pythonhosted.org/packages/4f/8b/f0e4c441227ba756aafbe78f117485b25bb26b1c059d01f137fa6d14896b/cffi-2.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2de9a304e27f7596cd03d16f1b7c72219bd944e99cc52b84d0145aefb07cbd3c", size = 180560, upload-time = "2025-09-08T23:22:28.197Z" }, + { url = "https://files.pythonhosted.org/packages/b1/b7/1200d354378ef52ec227395d95c2576330fd22a869f7a70e88e1447eb234/cffi-2.0.0-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:baf5215e0ab74c16e2dd324e8ec067ef59e41125d3eade2b863d294fd5035c92", size = 209613, upload-time = "2025-09-08T23:22:29.475Z" }, + { url = "https://files.pythonhosted.org/packages/b8/56/6033f5e86e8cc9bb629f0077ba71679508bdf54a9a5e112a3c0b91870332/cffi-2.0.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:730cacb21e1bdff3ce90babf007d0a0917cc3e6492f336c2f0134101e0944f93", size = 216476, upload-time = "2025-09-08T23:22:31.063Z" }, + { url = "https://files.pythonhosted.org/packages/dc/7f/55fecd70f7ece178db2f26128ec41430d8720f2d12ca97bf8f0a628207d5/cffi-2.0.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:6824f87845e3396029f3820c206e459ccc91760e8fa24422f8b0c3d1731cbec5", size = 203374, upload-time = "2025-09-08T23:22:32.507Z" }, + { url = "https://files.pythonhosted.org/packages/84/ef/a7b77c8bdc0f77adc3b46888f1ad54be8f3b7821697a7b89126e829e676a/cffi-2.0.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:9de40a7b0323d889cf8d23d1ef214f565ab154443c42737dfe52ff82cf857664", size = 202597, upload-time = "2025-09-08T23:22:34.132Z" }, + { url = "https://files.pythonhosted.org/packages/d7/91/500d892b2bf36529a75b77958edfcd5ad8e2ce4064ce2ecfeab2125d72d1/cffi-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8941aaadaf67246224cee8c3803777eed332a19d909b47e29c9842ef1e79ac26", size = 215574, upload-time = "2025-09-08T23:22:35.443Z" }, + { url = "https://files.pythonhosted.org/packages/44/64/58f6255b62b101093d5df22dcb752596066c7e89dd725e0afaed242a61be/cffi-2.0.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:a05d0c237b3349096d3981b727493e22147f934b20f6f125a3eba8f994bec4a9", size = 218971, upload-time = "2025-09-08T23:22:36.805Z" }, + { url = "https://files.pythonhosted.org/packages/ab/49/fa72cebe2fd8a55fbe14956f9970fe8eb1ac59e5df042f603ef7c8ba0adc/cffi-2.0.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:94698a9c5f91f9d138526b48fe26a199609544591f859c870d477351dc7b2414", size = 211972, upload-time = "2025-09-08T23:22:38.436Z" }, + { url = "https://files.pythonhosted.org/packages/0b/28/dd0967a76aab36731b6ebfe64dec4e981aff7e0608f60c2d46b46982607d/cffi-2.0.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:5fed36fccc0612a53f1d4d9a816b50a36702c28a2aa880cb8a122b3466638743", size = 217078, upload-time = "2025-09-08T23:22:39.776Z" }, + { url = "https://files.pythonhosted.org/packages/2b/c0/015b25184413d7ab0a410775fdb4a50fca20f5589b5dab1dbbfa3baad8ce/cffi-2.0.0-cp311-cp311-win32.whl", hash = "sha256:c649e3a33450ec82378822b3dad03cc228b8f5963c0c12fc3b1e0ab940f768a5", size = 172076, upload-time = "2025-09-08T23:22:40.95Z" }, + { url = "https://files.pythonhosted.org/packages/ae/8f/dc5531155e7070361eb1b7e4c1a9d896d0cb21c49f807a6c03fd63fc877e/cffi-2.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:66f011380d0e49ed280c789fbd08ff0d40968ee7b665575489afa95c98196ab5", size = 182820, upload-time = "2025-09-08T23:22:42.463Z" }, + { url = "https://files.pythonhosted.org/packages/95/5c/1b493356429f9aecfd56bc171285a4c4ac8697f76e9bbbbb105e537853a1/cffi-2.0.0-cp311-cp311-win_arm64.whl", hash = "sha256:c6638687455baf640e37344fe26d37c404db8b80d037c3d29f58fe8d1c3b194d", size = 177635, upload-time = "2025-09-08T23:22:43.623Z" }, + { url = "https://files.pythonhosted.org/packages/ea/47/4f61023ea636104d4f16ab488e268b93008c3d0bb76893b1b31db1f96802/cffi-2.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:6d02d6655b0e54f54c4ef0b94eb6be0607b70853c45ce98bd278dc7de718be5d", size = 185271, upload-time = "2025-09-08T23:22:44.795Z" }, + { url = "https://files.pythonhosted.org/packages/df/a2/781b623f57358e360d62cdd7a8c681f074a71d445418a776eef0aadb4ab4/cffi-2.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8eca2a813c1cb7ad4fb74d368c2ffbbb4789d377ee5bb8df98373c2cc0dee76c", size = 181048, upload-time = "2025-09-08T23:22:45.938Z" }, + { url = "https://files.pythonhosted.org/packages/ff/df/a4f0fbd47331ceeba3d37c2e51e9dfc9722498becbeec2bd8bc856c9538a/cffi-2.0.0-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:21d1152871b019407d8ac3985f6775c079416c282e431a4da6afe7aefd2bccbe", size = 212529, upload-time = "2025-09-08T23:22:47.349Z" }, + { url = "https://files.pythonhosted.org/packages/d5/72/12b5f8d3865bf0f87cf1404d8c374e7487dcf097a1c91c436e72e6badd83/cffi-2.0.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b21e08af67b8a103c71a250401c78d5e0893beff75e28c53c98f4de42f774062", size = 220097, upload-time = "2025-09-08T23:22:48.677Z" }, + { url = "https://files.pythonhosted.org/packages/c2/95/7a135d52a50dfa7c882ab0ac17e8dc11cec9d55d2c18dda414c051c5e69e/cffi-2.0.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:1e3a615586f05fc4065a8b22b8152f0c1b00cdbc60596d187c2a74f9e3036e4e", size = 207983, upload-time = "2025-09-08T23:22:50.06Z" }, + { url = "https://files.pythonhosted.org/packages/3a/c8/15cb9ada8895957ea171c62dc78ff3e99159ee7adb13c0123c001a2546c1/cffi-2.0.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:81afed14892743bbe14dacb9e36d9e0e504cd204e0b165062c488942b9718037", size = 206519, upload-time = "2025-09-08T23:22:51.364Z" }, + { url = "https://files.pythonhosted.org/packages/78/2d/7fa73dfa841b5ac06c7b8855cfc18622132e365f5b81d02230333ff26e9e/cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3e17ed538242334bf70832644a32a7aae3d83b57567f9fd60a26257e992b79ba", size = 219572, upload-time = "2025-09-08T23:22:52.902Z" }, + { url = "https://files.pythonhosted.org/packages/07/e0/267e57e387b4ca276b90f0434ff88b2c2241ad72b16d31836adddfd6031b/cffi-2.0.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3925dd22fa2b7699ed2617149842d2e6adde22b262fcbfada50e3d195e4b3a94", size = 222963, upload-time = "2025-09-08T23:22:54.518Z" }, + { url = "https://files.pythonhosted.org/packages/b6/75/1f2747525e06f53efbd878f4d03bac5b859cbc11c633d0fb81432d98a795/cffi-2.0.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2c8f814d84194c9ea681642fd164267891702542f028a15fc97d4674b6206187", size = 221361, upload-time = "2025-09-08T23:22:55.867Z" }, + { url = "https://files.pythonhosted.org/packages/7b/2b/2b6435f76bfeb6bbf055596976da087377ede68df465419d192acf00c437/cffi-2.0.0-cp312-cp312-win32.whl", hash = "sha256:da902562c3e9c550df360bfa53c035b2f241fed6d9aef119048073680ace4a18", size = 172932, upload-time = "2025-09-08T23:22:57.188Z" }, + { url = "https://files.pythonhosted.org/packages/f8/ed/13bd4418627013bec4ed6e54283b1959cf6db888048c7cf4b4c3b5b36002/cffi-2.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:da68248800ad6320861f129cd9c1bf96ca849a2771a59e0344e88681905916f5", size = 183557, upload-time = "2025-09-08T23:22:58.351Z" }, + { url = "https://files.pythonhosted.org/packages/95/31/9f7f93ad2f8eff1dbc1c3656d7ca5bfd8fb52c9d786b4dcf19b2d02217fa/cffi-2.0.0-cp312-cp312-win_arm64.whl", hash = "sha256:4671d9dd5ec934cb9a73e7ee9676f9362aba54f7f34910956b84d727b0d73fb6", size = 177762, upload-time = "2025-09-08T23:22:59.668Z" }, + { url = "https://files.pythonhosted.org/packages/4b/8d/a0a47a0c9e413a658623d014e91e74a50cdd2c423f7ccfd44086ef767f90/cffi-2.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:00bdf7acc5f795150faa6957054fbbca2439db2f775ce831222b66f192f03beb", size = 185230, upload-time = "2025-09-08T23:23:00.879Z" }, + { url = "https://files.pythonhosted.org/packages/4a/d2/a6c0296814556c68ee32009d9c2ad4f85f2707cdecfd7727951ec228005d/cffi-2.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:45d5e886156860dc35862657e1494b9bae8dfa63bf56796f2fb56e1679fc0bca", size = 181043, upload-time = "2025-09-08T23:23:02.231Z" }, + { url = "https://files.pythonhosted.org/packages/b0/1e/d22cc63332bd59b06481ceaac49d6c507598642e2230f201649058a7e704/cffi-2.0.0-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:07b271772c100085dd28b74fa0cd81c8fb1a3ba18b21e03d7c27f3436a10606b", size = 212446, upload-time = "2025-09-08T23:23:03.472Z" }, + { url = "https://files.pythonhosted.org/packages/a9/f5/a2c23eb03b61a0b8747f211eb716446c826ad66818ddc7810cc2cc19b3f2/cffi-2.0.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d48a880098c96020b02d5a1f7d9251308510ce8858940e6fa99ece33f610838b", size = 220101, upload-time = "2025-09-08T23:23:04.792Z" }, + { url = "https://files.pythonhosted.org/packages/f2/7f/e6647792fc5850d634695bc0e6ab4111ae88e89981d35ac269956605feba/cffi-2.0.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:f93fd8e5c8c0a4aa1f424d6173f14a892044054871c771f8566e4008eaa359d2", size = 207948, upload-time = "2025-09-08T23:23:06.127Z" }, + { url = "https://files.pythonhosted.org/packages/cb/1e/a5a1bd6f1fb30f22573f76533de12a00bf274abcdc55c8edab639078abb6/cffi-2.0.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:dd4f05f54a52fb558f1ba9f528228066954fee3ebe629fc1660d874d040ae5a3", size = 206422, upload-time = "2025-09-08T23:23:07.753Z" }, + { url = "https://files.pythonhosted.org/packages/98/df/0a1755e750013a2081e863e7cd37e0cdd02664372c754e5560099eb7aa44/cffi-2.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c8d3b5532fc71b7a77c09192b4a5a200ea992702734a2e9279a37f2478236f26", size = 219499, upload-time = "2025-09-08T23:23:09.648Z" }, + { url = "https://files.pythonhosted.org/packages/50/e1/a969e687fcf9ea58e6e2a928ad5e2dd88cc12f6f0ab477e9971f2309b57c/cffi-2.0.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d9b29c1f0ae438d5ee9acb31cadee00a58c46cc9c0b2f9038c6b0b3470877a8c", size = 222928, upload-time = "2025-09-08T23:23:10.928Z" }, + { url = "https://files.pythonhosted.org/packages/36/54/0362578dd2c9e557a28ac77698ed67323ed5b9775ca9d3fe73fe191bb5d8/cffi-2.0.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6d50360be4546678fc1b79ffe7a66265e28667840010348dd69a314145807a1b", size = 221302, upload-time = "2025-09-08T23:23:12.42Z" }, + { url = "https://files.pythonhosted.org/packages/eb/6d/bf9bda840d5f1dfdbf0feca87fbdb64a918a69bca42cfa0ba7b137c48cb8/cffi-2.0.0-cp313-cp313-win32.whl", hash = "sha256:74a03b9698e198d47562765773b4a8309919089150a0bb17d829ad7b44b60d27", size = 172909, upload-time = "2025-09-08T23:23:14.32Z" }, + { url = "https://files.pythonhosted.org/packages/37/18/6519e1ee6f5a1e579e04b9ddb6f1676c17368a7aba48299c3759bbc3c8b3/cffi-2.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:19f705ada2530c1167abacb171925dd886168931e0a7b78f5bffcae5c6b5be75", size = 183402, upload-time = "2025-09-08T23:23:15.535Z" }, + { url = "https://files.pythonhosted.org/packages/cb/0e/02ceeec9a7d6ee63bb596121c2c8e9b3a9e150936f4fbef6ca1943e6137c/cffi-2.0.0-cp313-cp313-win_arm64.whl", hash = "sha256:256f80b80ca3853f90c21b23ee78cd008713787b1b1e93eae9f3d6a7134abd91", size = 177780, upload-time = "2025-09-08T23:23:16.761Z" }, + { url = "https://files.pythonhosted.org/packages/92/c4/3ce07396253a83250ee98564f8d7e9789fab8e58858f35d07a9a2c78de9f/cffi-2.0.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:fc33c5141b55ed366cfaad382df24fe7dcbc686de5be719b207bb248e3053dc5", size = 185320, upload-time = "2025-09-08T23:23:18.087Z" }, + { url = "https://files.pythonhosted.org/packages/59/dd/27e9fa567a23931c838c6b02d0764611c62290062a6d4e8ff7863daf9730/cffi-2.0.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c654de545946e0db659b3400168c9ad31b5d29593291482c43e3564effbcee13", size = 181487, upload-time = "2025-09-08T23:23:19.622Z" }, + { url = "https://files.pythonhosted.org/packages/d6/43/0e822876f87ea8a4ef95442c3d766a06a51fc5298823f884ef87aaad168c/cffi-2.0.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:24b6f81f1983e6df8db3adc38562c83f7d4a0c36162885ec7f7b77c7dcbec97b", size = 220049, upload-time = "2025-09-08T23:23:20.853Z" }, + { url = "https://files.pythonhosted.org/packages/b4/89/76799151d9c2d2d1ead63c2429da9ea9d7aac304603de0c6e8764e6e8e70/cffi-2.0.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:12873ca6cb9b0f0d3a0da705d6086fe911591737a59f28b7936bdfed27c0d47c", size = 207793, upload-time = "2025-09-08T23:23:22.08Z" }, + { url = "https://files.pythonhosted.org/packages/bb/dd/3465b14bb9e24ee24cb88c9e3730f6de63111fffe513492bf8c808a3547e/cffi-2.0.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:d9b97165e8aed9272a6bb17c01e3cc5871a594a446ebedc996e2397a1c1ea8ef", size = 206300, upload-time = "2025-09-08T23:23:23.314Z" }, + { url = "https://files.pythonhosted.org/packages/47/d9/d83e293854571c877a92da46fdec39158f8d7e68da75bf73581225d28e90/cffi-2.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:afb8db5439b81cf9c9d0c80404b60c3cc9c3add93e114dcae767f1477cb53775", size = 219244, upload-time = "2025-09-08T23:23:24.541Z" }, + { url = "https://files.pythonhosted.org/packages/2b/0f/1f177e3683aead2bb00f7679a16451d302c436b5cbf2505f0ea8146ef59e/cffi-2.0.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:737fe7d37e1a1bffe70bd5754ea763a62a066dc5913ca57e957824b72a85e205", size = 222828, upload-time = "2025-09-08T23:23:26.143Z" }, + { url = "https://files.pythonhosted.org/packages/c6/0f/cafacebd4b040e3119dcb32fed8bdef8dfe94da653155f9d0b9dc660166e/cffi-2.0.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:38100abb9d1b1435bc4cc340bb4489635dc2f0da7456590877030c9b3d40b0c1", size = 220926, upload-time = "2025-09-08T23:23:27.873Z" }, + { url = "https://files.pythonhosted.org/packages/3e/aa/df335faa45b395396fcbc03de2dfcab242cd61a9900e914fe682a59170b1/cffi-2.0.0-cp314-cp314-win32.whl", hash = "sha256:087067fa8953339c723661eda6b54bc98c5625757ea62e95eb4898ad5e776e9f", size = 175328, upload-time = "2025-09-08T23:23:44.61Z" }, + { url = "https://files.pythonhosted.org/packages/bb/92/882c2d30831744296ce713f0feb4c1cd30f346ef747b530b5318715cc367/cffi-2.0.0-cp314-cp314-win_amd64.whl", hash = "sha256:203a48d1fb583fc7d78a4c6655692963b860a417c0528492a6bc21f1aaefab25", size = 185650, upload-time = "2025-09-08T23:23:45.848Z" }, + { url = "https://files.pythonhosted.org/packages/9f/2c/98ece204b9d35a7366b5b2c6539c350313ca13932143e79dc133ba757104/cffi-2.0.0-cp314-cp314-win_arm64.whl", hash = "sha256:dbd5c7a25a7cb98f5ca55d258b103a2054f859a46ae11aaf23134f9cc0d356ad", size = 180687, upload-time = "2025-09-08T23:23:47.105Z" }, + { url = "https://files.pythonhosted.org/packages/3e/61/c768e4d548bfa607abcda77423448df8c471f25dbe64fb2ef6d555eae006/cffi-2.0.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:9a67fc9e8eb39039280526379fb3a70023d77caec1852002b4da7e8b270c4dd9", size = 188773, upload-time = "2025-09-08T23:23:29.347Z" }, + { url = "https://files.pythonhosted.org/packages/2c/ea/5f76bce7cf6fcd0ab1a1058b5af899bfbef198bea4d5686da88471ea0336/cffi-2.0.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7a66c7204d8869299919db4d5069a82f1561581af12b11b3c9f48c584eb8743d", size = 185013, upload-time = "2025-09-08T23:23:30.63Z" }, + { url = "https://files.pythonhosted.org/packages/be/b4/c56878d0d1755cf9caa54ba71e5d049479c52f9e4afc230f06822162ab2f/cffi-2.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7cc09976e8b56f8cebd752f7113ad07752461f48a58cbba644139015ac24954c", size = 221593, upload-time = "2025-09-08T23:23:31.91Z" }, + { url = "https://files.pythonhosted.org/packages/e0/0d/eb704606dfe8033e7128df5e90fee946bbcb64a04fcdaa97321309004000/cffi-2.0.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:92b68146a71df78564e4ef48af17551a5ddd142e5190cdf2c5624d0c3ff5b2e8", size = 209354, upload-time = "2025-09-08T23:23:33.214Z" }, + { url = "https://files.pythonhosted.org/packages/d8/19/3c435d727b368ca475fb8742ab97c9cb13a0de600ce86f62eab7fa3eea60/cffi-2.0.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b1e74d11748e7e98e2f426ab176d4ed720a64412b6a15054378afdb71e0f37dc", size = 208480, upload-time = "2025-09-08T23:23:34.495Z" }, + { url = "https://files.pythonhosted.org/packages/d0/44/681604464ed9541673e486521497406fadcc15b5217c3e326b061696899a/cffi-2.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:28a3a209b96630bca57cce802da70c266eb08c6e97e5afd61a75611ee6c64592", size = 221584, upload-time = "2025-09-08T23:23:36.096Z" }, + { url = "https://files.pythonhosted.org/packages/25/8e/342a504ff018a2825d395d44d63a767dd8ebc927ebda557fecdaca3ac33a/cffi-2.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7553fb2090d71822f02c629afe6042c299edf91ba1bf94951165613553984512", size = 224443, upload-time = "2025-09-08T23:23:37.328Z" }, + { url = "https://files.pythonhosted.org/packages/e1/5e/b666bacbbc60fbf415ba9988324a132c9a7a0448a9a8f125074671c0f2c3/cffi-2.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6c6c373cfc5c83a975506110d17457138c8c63016b563cc9ed6e056a82f13ce4", size = 223437, upload-time = "2025-09-08T23:23:38.945Z" }, + { url = "https://files.pythonhosted.org/packages/a0/1d/ec1a60bd1a10daa292d3cd6bb0b359a81607154fb8165f3ec95fe003b85c/cffi-2.0.0-cp314-cp314t-win32.whl", hash = "sha256:1fc9ea04857caf665289b7a75923f2c6ed559b8298a1b8c49e59f7dd95c8481e", size = 180487, upload-time = "2025-09-08T23:23:40.423Z" }, + { url = "https://files.pythonhosted.org/packages/bf/41/4c1168c74fac325c0c8156f04b6749c8b6a8f405bbf91413ba088359f60d/cffi-2.0.0-cp314-cp314t-win_amd64.whl", hash = "sha256:d68b6cef7827e8641e8ef16f4494edda8b36104d79773a334beaa1e3521430f6", size = 191726, upload-time = "2025-09-08T23:23:41.742Z" }, + { url = "https://files.pythonhosted.org/packages/ae/3a/dbeec9d1ee0844c679f6bb5d6ad4e9f198b1224f4e7a32825f47f6192b0c/cffi-2.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:0a1527a803f0a659de1af2e1fd700213caba79377e27e4693648c2923da066f9", size = 184195, upload-time = "2025-09-08T23:23:43.004Z" }, +] + +[[package]] +name = "chardet" +version = "6.0.0.post1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7f/42/fb9436c103a881a377e34b9f58d77b5f503461c702ff654ebe86151bcfe9/chardet-6.0.0.post1.tar.gz", hash = "sha256:6b78048c3c97c7b2ed1fbad7a18f76f5a6547f7d34dbab536cc13887c9a92fa4", size = 12521798, upload-time = "2026-02-22T15:09:17.925Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/66/42/5de54f632c2de53cd3415b3703383d5fff43a94cbc0567ef362515261a21/chardet-6.0.0.post1-py3-none-any.whl", hash = "sha256:c894a36800549adf7bb5f2af47033281b75fdfcd2aa0f0243be0ad22a52e2dcb", size = 627245, upload-time = "2026-02-22T15:09:15.876Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz", hash = "sha256:94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a", size = 129418, upload-time = "2025-10-14T04:42:32.879Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1f/b8/6d51fc1d52cbd52cd4ccedd5b5b2f0f6a11bbf6765c782298b0f3e808541/charset_normalizer-3.4.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e824f1492727fa856dd6eda4f7cee25f8518a12f3c4a56a74e8095695089cf6d", size = 209709, upload-time = "2025-10-14T04:40:11.385Z" }, + { url = "https://files.pythonhosted.org/packages/5c/af/1f9d7f7faafe2ddfb6f72a2e07a548a629c61ad510fe60f9630309908fef/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4bd5d4137d500351a30687c2d3971758aac9a19208fc110ccb9d7188fbe709e8", size = 148814, upload-time = "2025-10-14T04:40:13.135Z" }, + { url = "https://files.pythonhosted.org/packages/79/3d/f2e3ac2bbc056ca0c204298ea4e3d9db9b4afe437812638759db2c976b5f/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:027f6de494925c0ab2a55eab46ae5129951638a49a34d87f4c3eda90f696b4ad", size = 144467, upload-time = "2025-10-14T04:40:14.728Z" }, + { url = "https://files.pythonhosted.org/packages/ec/85/1bf997003815e60d57de7bd972c57dc6950446a3e4ccac43bc3070721856/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f820802628d2694cb7e56db99213f930856014862f3fd943d290ea8438d07ca8", size = 162280, upload-time = "2025-10-14T04:40:16.14Z" }, + { url = "https://files.pythonhosted.org/packages/3e/8e/6aa1952f56b192f54921c436b87f2aaf7c7a7c3d0d1a765547d64fd83c13/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:798d75d81754988d2565bff1b97ba5a44411867c0cf32b77a7e8f8d84796b10d", size = 159454, upload-time = "2025-10-14T04:40:17.567Z" }, + { url = "https://files.pythonhosted.org/packages/36/3b/60cbd1f8e93aa25d1c669c649b7a655b0b5fb4c571858910ea9332678558/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d1bb833febdff5c8927f922386db610b49db6e0d4f4ee29601d71e7c2694313", size = 153609, upload-time = "2025-10-14T04:40:19.08Z" }, + { url = "https://files.pythonhosted.org/packages/64/91/6a13396948b8fd3c4b4fd5bc74d045f5637d78c9675585e8e9fbe5636554/charset_normalizer-3.4.4-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9cd98cdc06614a2f768d2b7286d66805f94c48cde050acdbbb7db2600ab3197e", size = 151849, upload-time = "2025-10-14T04:40:20.607Z" }, + { url = "https://files.pythonhosted.org/packages/b7/7a/59482e28b9981d105691e968c544cc0df3b7d6133152fb3dcdc8f135da7a/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:077fbb858e903c73f6c9db43374fd213b0b6a778106bc7032446a8e8b5b38b93", size = 151586, upload-time = "2025-10-14T04:40:21.719Z" }, + { url = "https://files.pythonhosted.org/packages/92/59/f64ef6a1c4bdd2baf892b04cd78792ed8684fbc48d4c2afe467d96b4df57/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:244bfb999c71b35de57821b8ea746b24e863398194a4014e4c76adc2bbdfeff0", size = 145290, upload-time = "2025-10-14T04:40:23.069Z" }, + { url = "https://files.pythonhosted.org/packages/6b/63/3bf9f279ddfa641ffa1962b0db6a57a9c294361cc2f5fcac997049a00e9c/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:64b55f9dce520635f018f907ff1b0df1fdc31f2795a922fb49dd14fbcdf48c84", size = 163663, upload-time = "2025-10-14T04:40:24.17Z" }, + { url = "https://files.pythonhosted.org/packages/ed/09/c9e38fc8fa9e0849b172b581fd9803bdf6e694041127933934184e19f8c3/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:faa3a41b2b66b6e50f84ae4a68c64fcd0c44355741c6374813a800cd6695db9e", size = 151964, upload-time = "2025-10-14T04:40:25.368Z" }, + { url = "https://files.pythonhosted.org/packages/d2/d1/d28b747e512d0da79d8b6a1ac18b7ab2ecfd81b2944c4c710e166d8dd09c/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6515f3182dbe4ea06ced2d9e8666d97b46ef4c75e326b79bb624110f122551db", size = 161064, upload-time = "2025-10-14T04:40:26.806Z" }, + { url = "https://files.pythonhosted.org/packages/bb/9a/31d62b611d901c3b9e5500c36aab0ff5eb442043fb3a1c254200d3d397d9/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:cc00f04ed596e9dc0da42ed17ac5e596c6ccba999ba6bd92b0e0aef2f170f2d6", size = 155015, upload-time = "2025-10-14T04:40:28.284Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f3/107e008fa2bff0c8b9319584174418e5e5285fef32f79d8ee6a430d0039c/charset_normalizer-3.4.4-cp310-cp310-win32.whl", hash = "sha256:f34be2938726fc13801220747472850852fe6b1ea75869a048d6f896838c896f", size = 99792, upload-time = "2025-10-14T04:40:29.613Z" }, + { url = "https://files.pythonhosted.org/packages/eb/66/e396e8a408843337d7315bab30dbf106c38966f1819f123257f5520f8a96/charset_normalizer-3.4.4-cp310-cp310-win_amd64.whl", hash = "sha256:a61900df84c667873b292c3de315a786dd8dac506704dea57bc957bd31e22c7d", size = 107198, upload-time = "2025-10-14T04:40:30.644Z" }, + { url = "https://files.pythonhosted.org/packages/b5/58/01b4f815bf0312704c267f2ccb6e5d42bcc7752340cd487bc9f8c3710597/charset_normalizer-3.4.4-cp310-cp310-win_arm64.whl", hash = "sha256:cead0978fc57397645f12578bfd2d5ea9138ea0fac82b2f63f7f7c6877986a69", size = 100262, upload-time = "2025-10-14T04:40:32.108Z" }, + { url = "https://files.pythonhosted.org/packages/ed/27/c6491ff4954e58a10f69ad90aca8a1b6fe9c5d3c6f380907af3c37435b59/charset_normalizer-3.4.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e1fcf0720908f200cd21aa4e6750a48ff6ce4afe7ff5a79a90d5ed8a08296f8", size = 206988, upload-time = "2025-10-14T04:40:33.79Z" }, + { url = "https://files.pythonhosted.org/packages/94/59/2e87300fe67ab820b5428580a53cad894272dbb97f38a7a814a2a1ac1011/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f819d5fe9234f9f82d75bdfa9aef3a3d72c4d24a6e57aeaebba32a704553aa0", size = 147324, upload-time = "2025-10-14T04:40:34.961Z" }, + { url = "https://files.pythonhosted.org/packages/07/fb/0cf61dc84b2b088391830f6274cb57c82e4da8bbc2efeac8c025edb88772/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a59cb51917aa591b1c4e6a43c132f0cdc3c76dbad6155df4e28ee626cc77a0a3", size = 142742, upload-time = "2025-10-14T04:40:36.105Z" }, + { url = "https://files.pythonhosted.org/packages/62/8b/171935adf2312cd745d290ed93cf16cf0dfe320863ab7cbeeae1dcd6535f/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8ef3c867360f88ac904fd3f5e1f902f13307af9052646963ee08ff4f131adafc", size = 160863, upload-time = "2025-10-14T04:40:37.188Z" }, + { url = "https://files.pythonhosted.org/packages/09/73/ad875b192bda14f2173bfc1bc9a55e009808484a4b256748d931b6948442/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d9e45d7faa48ee908174d8fe84854479ef838fc6a705c9315372eacbc2f02897", size = 157837, upload-time = "2025-10-14T04:40:38.435Z" }, + { url = "https://files.pythonhosted.org/packages/6d/fc/de9cce525b2c5b94b47c70a4b4fb19f871b24995c728e957ee68ab1671ea/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:840c25fb618a231545cbab0564a799f101b63b9901f2569faecd6b222ac72381", size = 151550, upload-time = "2025-10-14T04:40:40.053Z" }, + { url = "https://files.pythonhosted.org/packages/55/c2/43edd615fdfba8c6f2dfbd459b25a6b3b551f24ea21981e23fb768503ce1/charset_normalizer-3.4.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ca5862d5b3928c4940729dacc329aa9102900382fea192fc5e52eb69d6093815", size = 149162, upload-time = "2025-10-14T04:40:41.163Z" }, + { url = "https://files.pythonhosted.org/packages/03/86/bde4ad8b4d0e9429a4e82c1e8f5c659993a9a863ad62c7df05cf7b678d75/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d9c7f57c3d666a53421049053eaacdd14bbd0a528e2186fcb2e672effd053bb0", size = 150019, upload-time = "2025-10-14T04:40:42.276Z" }, + { url = "https://files.pythonhosted.org/packages/1f/86/a151eb2af293a7e7bac3a739b81072585ce36ccfb4493039f49f1d3cae8c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:277e970e750505ed74c832b4bf75dac7476262ee2a013f5574dd49075879e161", size = 143310, upload-time = "2025-10-14T04:40:43.439Z" }, + { url = "https://files.pythonhosted.org/packages/b5/fe/43dae6144a7e07b87478fdfc4dbe9efd5defb0e7ec29f5f58a55aeef7bf7/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:31fd66405eaf47bb62e8cd575dc621c56c668f27d46a61d975a249930dd5e2a4", size = 162022, upload-time = "2025-10-14T04:40:44.547Z" }, + { url = "https://files.pythonhosted.org/packages/80/e6/7aab83774f5d2bca81f42ac58d04caf44f0cc2b65fc6db2b3b2e8a05f3b3/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:0d3d8f15c07f86e9ff82319b3d9ef6f4bf907608f53fe9d92b28ea9ae3d1fd89", size = 149383, upload-time = "2025-10-14T04:40:46.018Z" }, + { url = "https://files.pythonhosted.org/packages/4f/e8/b289173b4edae05c0dde07f69f8db476a0b511eac556dfe0d6bda3c43384/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9f7fcd74d410a36883701fafa2482a6af2ff5ba96b9a620e9e0721e28ead5569", size = 159098, upload-time = "2025-10-14T04:40:47.081Z" }, + { url = "https://files.pythonhosted.org/packages/d8/df/fe699727754cae3f8478493c7f45f777b17c3ef0600e28abfec8619eb49c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ebf3e58c7ec8a8bed6d66a75d7fb37b55e5015b03ceae72a8e7c74495551e224", size = 152991, upload-time = "2025-10-14T04:40:48.246Z" }, + { url = "https://files.pythonhosted.org/packages/1a/86/584869fe4ddb6ffa3bd9f491b87a01568797fb9bd8933f557dba9771beaf/charset_normalizer-3.4.4-cp311-cp311-win32.whl", hash = "sha256:eecbc200c7fd5ddb9a7f16c7decb07b566c29fa2161a16cf67b8d068bd21690a", size = 99456, upload-time = "2025-10-14T04:40:49.376Z" }, + { url = "https://files.pythonhosted.org/packages/65/f6/62fdd5feb60530f50f7e38b4f6a1d5203f4d16ff4f9f0952962c044e919a/charset_normalizer-3.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:5ae497466c7901d54b639cf42d5b8c1b6a4fead55215500d2f486d34db48d016", size = 106978, upload-time = "2025-10-14T04:40:50.844Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9d/0710916e6c82948b3be62d9d398cb4fcf4e97b56d6a6aeccd66c4b2f2bd5/charset_normalizer-3.4.4-cp311-cp311-win_arm64.whl", hash = "sha256:65e2befcd84bc6f37095f5961e68a6f077bf44946771354a28ad434c2cce0ae1", size = 99969, upload-time = "2025-10-14T04:40:52.272Z" }, + { url = "https://files.pythonhosted.org/packages/f3/85/1637cd4af66fa687396e757dec650f28025f2a2f5a5531a3208dc0ec43f2/charset_normalizer-3.4.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0a98e6759f854bd25a58a73fa88833fba3b7c491169f86ce1180c948ab3fd394", size = 208425, upload-time = "2025-10-14T04:40:53.353Z" }, + { url = "https://files.pythonhosted.org/packages/9d/6a/04130023fef2a0d9c62d0bae2649b69f7b7d8d24ea5536feef50551029df/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b5b290ccc2a263e8d185130284f8501e3e36c5e02750fc6b6bdeb2e9e96f1e25", size = 148162, upload-time = "2025-10-14T04:40:54.558Z" }, + { url = "https://files.pythonhosted.org/packages/78/29/62328d79aa60da22c9e0b9a66539feae06ca0f5a4171ac4f7dc285b83688/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74bb723680f9f7a6234dcf67aea57e708ec1fbdf5699fb91dfd6f511b0a320ef", size = 144558, upload-time = "2025-10-14T04:40:55.677Z" }, + { url = "https://files.pythonhosted.org/packages/86/bb/b32194a4bf15b88403537c2e120b817c61cd4ecffa9b6876e941c3ee38fe/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f1e34719c6ed0b92f418c7c780480b26b5d9c50349e9a9af7d76bf757530350d", size = 161497, upload-time = "2025-10-14T04:40:57.217Z" }, + { url = "https://files.pythonhosted.org/packages/19/89/a54c82b253d5b9b111dc74aca196ba5ccfcca8242d0fb64146d4d3183ff1/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2437418e20515acec67d86e12bf70056a33abdacb5cb1655042f6538d6b085a8", size = 159240, upload-time = "2025-10-14T04:40:58.358Z" }, + { url = "https://files.pythonhosted.org/packages/c0/10/d20b513afe03acc89ec33948320a5544d31f21b05368436d580dec4e234d/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:11d694519d7f29d6cd09f6ac70028dba10f92f6cdd059096db198c283794ac86", size = 153471, upload-time = "2025-10-14T04:40:59.468Z" }, + { url = "https://files.pythonhosted.org/packages/61/fa/fbf177b55bdd727010f9c0a3c49eefa1d10f960e5f09d1d887bf93c2e698/charset_normalizer-3.4.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ac1c4a689edcc530fc9d9aa11f5774b9e2f33f9a0c6a57864e90908f5208d30a", size = 150864, upload-time = "2025-10-14T04:41:00.623Z" }, + { url = "https://files.pythonhosted.org/packages/05/12/9fbc6a4d39c0198adeebbde20b619790e9236557ca59fc40e0e3cebe6f40/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:21d142cc6c0ec30d2efee5068ca36c128a30b0f2c53c1c07bd78cb6bc1d3be5f", size = 150647, upload-time = "2025-10-14T04:41:01.754Z" }, + { url = "https://files.pythonhosted.org/packages/ad/1f/6a9a593d52e3e8c5d2b167daf8c6b968808efb57ef4c210acb907c365bc4/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5dbe56a36425d26d6cfb40ce79c314a2e4dd6211d51d6d2191c00bed34f354cc", size = 145110, upload-time = "2025-10-14T04:41:03.231Z" }, + { url = "https://files.pythonhosted.org/packages/30/42/9a52c609e72471b0fc54386dc63c3781a387bb4fe61c20231a4ebcd58bdd/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5bfbb1b9acf3334612667b61bd3002196fe2a1eb4dd74d247e0f2a4d50ec9bbf", size = 162839, upload-time = "2025-10-14T04:41:04.715Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5b/c0682bbf9f11597073052628ddd38344a3d673fda35a36773f7d19344b23/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d055ec1e26e441f6187acf818b73564e6e6282709e9bcb5b63f5b23068356a15", size = 150667, upload-time = "2025-10-14T04:41:05.827Z" }, + { url = "https://files.pythonhosted.org/packages/e4/24/a41afeab6f990cf2daf6cb8c67419b63b48cf518e4f56022230840c9bfb2/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:af2d8c67d8e573d6de5bc30cdb27e9b95e49115cd9baad5ddbd1a6207aaa82a9", size = 160535, upload-time = "2025-10-14T04:41:06.938Z" }, + { url = "https://files.pythonhosted.org/packages/2a/e5/6a4ce77ed243c4a50a1fecca6aaaab419628c818a49434be428fe24c9957/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:780236ac706e66881f3b7f2f32dfe90507a09e67d1d454c762cf642e6e1586e0", size = 154816, upload-time = "2025-10-14T04:41:08.101Z" }, + { url = "https://files.pythonhosted.org/packages/a8/ef/89297262b8092b312d29cdb2517cb1237e51db8ecef2e9af5edbe7b683b1/charset_normalizer-3.4.4-cp312-cp312-win32.whl", hash = "sha256:5833d2c39d8896e4e19b689ffc198f08ea58116bee26dea51e362ecc7cd3ed26", size = 99694, upload-time = "2025-10-14T04:41:09.23Z" }, + { url = "https://files.pythonhosted.org/packages/3d/2d/1e5ed9dd3b3803994c155cd9aacb60c82c331bad84daf75bcb9c91b3295e/charset_normalizer-3.4.4-cp312-cp312-win_amd64.whl", hash = "sha256:a79cfe37875f822425b89a82333404539ae63dbdddf97f84dcbc3d339aae9525", size = 107131, upload-time = "2025-10-14T04:41:10.467Z" }, + { url = "https://files.pythonhosted.org/packages/d0/d9/0ed4c7098a861482a7b6a95603edce4c0d9db2311af23da1fb2b75ec26fc/charset_normalizer-3.4.4-cp312-cp312-win_arm64.whl", hash = "sha256:376bec83a63b8021bb5c8ea75e21c4ccb86e7e45ca4eb81146091b56599b80c3", size = 100390, upload-time = "2025-10-14T04:41:11.915Z" }, + { url = "https://files.pythonhosted.org/packages/97/45/4b3a1239bbacd321068ea6e7ac28875b03ab8bc0aa0966452db17cd36714/charset_normalizer-3.4.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:e1f185f86a6f3403aa2420e815904c67b2f9ebc443f045edd0de921108345794", size = 208091, upload-time = "2025-10-14T04:41:13.346Z" }, + { url = "https://files.pythonhosted.org/packages/7d/62/73a6d7450829655a35bb88a88fca7d736f9882a27eacdca2c6d505b57e2e/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b39f987ae8ccdf0d2642338faf2abb1862340facc796048b604ef14919e55ed", size = 147936, upload-time = "2025-10-14T04:41:14.461Z" }, + { url = "https://files.pythonhosted.org/packages/89/c5/adb8c8b3d6625bef6d88b251bbb0d95f8205831b987631ab0c8bb5d937c2/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3162d5d8ce1bb98dd51af660f2121c55d0fa541b46dff7bb9b9f86ea1d87de72", size = 144180, upload-time = "2025-10-14T04:41:15.588Z" }, + { url = "https://files.pythonhosted.org/packages/91/ed/9706e4070682d1cc219050b6048bfd293ccf67b3d4f5a4f39207453d4b99/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:81d5eb2a312700f4ecaa977a8235b634ce853200e828fbadf3a9c50bab278328", size = 161346, upload-time = "2025-10-14T04:41:16.738Z" }, + { url = "https://files.pythonhosted.org/packages/d5/0d/031f0d95e4972901a2f6f09ef055751805ff541511dc1252ba3ca1f80cf5/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5bd2293095d766545ec1a8f612559f6b40abc0eb18bb2f5d1171872d34036ede", size = 158874, upload-time = "2025-10-14T04:41:17.923Z" }, + { url = "https://files.pythonhosted.org/packages/f5/83/6ab5883f57c9c801ce5e5677242328aa45592be8a00644310a008d04f922/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a8a8b89589086a25749f471e6a900d3f662d1d3b6e2e59dcecf787b1cc3a1894", size = 153076, upload-time = "2025-10-14T04:41:19.106Z" }, + { url = "https://files.pythonhosted.org/packages/75/1e/5ff781ddf5260e387d6419959ee89ef13878229732732ee73cdae01800f2/charset_normalizer-3.4.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc7637e2f80d8530ee4a78e878bce464f70087ce73cf7c1caf142416923b98f1", size = 150601, upload-time = "2025-10-14T04:41:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/d7/57/71be810965493d3510a6ca79b90c19e48696fb1ff964da319334b12677f0/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f8bf04158c6b607d747e93949aa60618b61312fe647a6369f88ce2ff16043490", size = 150376, upload-time = "2025-10-14T04:41:21.398Z" }, + { url = "https://files.pythonhosted.org/packages/e5/d5/c3d057a78c181d007014feb7e9f2e65905a6c4ef182c0ddf0de2924edd65/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:554af85e960429cf30784dd47447d5125aaa3b99a6f0683589dbd27e2f45da44", size = 144825, upload-time = "2025-10-14T04:41:22.583Z" }, + { url = "https://files.pythonhosted.org/packages/e6/8c/d0406294828d4976f275ffbe66f00266c4b3136b7506941d87c00cab5272/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:74018750915ee7ad843a774364e13a3db91682f26142baddf775342c3f5b1133", size = 162583, upload-time = "2025-10-14T04:41:23.754Z" }, + { url = "https://files.pythonhosted.org/packages/d7/24/e2aa1f18c8f15c4c0e932d9287b8609dd30ad56dbe41d926bd846e22fb8d/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c0463276121fdee9c49b98908b3a89c39be45d86d1dbaa22957e38f6321d4ce3", size = 150366, upload-time = "2025-10-14T04:41:25.27Z" }, + { url = "https://files.pythonhosted.org/packages/e4/5b/1e6160c7739aad1e2df054300cc618b06bf784a7a164b0f238360721ab86/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:362d61fd13843997c1c446760ef36f240cf81d3ebf74ac62652aebaf7838561e", size = 160300, upload-time = "2025-10-14T04:41:26.725Z" }, + { url = "https://files.pythonhosted.org/packages/7a/10/f882167cd207fbdd743e55534d5d9620e095089d176d55cb22d5322f2afd/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9a26f18905b8dd5d685d6d07b0cdf98a79f3c7a918906af7cc143ea2e164c8bc", size = 154465, upload-time = "2025-10-14T04:41:28.322Z" }, + { url = "https://files.pythonhosted.org/packages/89/66/c7a9e1b7429be72123441bfdbaf2bc13faab3f90b933f664db506dea5915/charset_normalizer-3.4.4-cp313-cp313-win32.whl", hash = "sha256:9b35f4c90079ff2e2edc5b26c0c77925e5d2d255c42c74fdb70fb49b172726ac", size = 99404, upload-time = "2025-10-14T04:41:29.95Z" }, + { url = "https://files.pythonhosted.org/packages/c4/26/b9924fa27db384bdcd97ab83b4f0a8058d96ad9626ead570674d5e737d90/charset_normalizer-3.4.4-cp313-cp313-win_amd64.whl", hash = "sha256:b435cba5f4f750aa6c0a0d92c541fb79f69a387c91e61f1795227e4ed9cece14", size = 107092, upload-time = "2025-10-14T04:41:31.188Z" }, + { url = "https://files.pythonhosted.org/packages/af/8f/3ed4bfa0c0c72a7ca17f0380cd9e4dd842b09f664e780c13cff1dcf2ef1b/charset_normalizer-3.4.4-cp313-cp313-win_arm64.whl", hash = "sha256:542d2cee80be6f80247095cc36c418f7bddd14f4a6de45af91dfad36d817bba2", size = 100408, upload-time = "2025-10-14T04:41:32.624Z" }, + { url = "https://files.pythonhosted.org/packages/2a/35/7051599bd493e62411d6ede36fd5af83a38f37c4767b92884df7301db25d/charset_normalizer-3.4.4-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:da3326d9e65ef63a817ecbcc0df6e94463713b754fe293eaa03da99befb9a5bd", size = 207746, upload-time = "2025-10-14T04:41:33.773Z" }, + { url = "https://files.pythonhosted.org/packages/10/9a/97c8d48ef10d6cd4fcead2415523221624bf58bcf68a802721a6bc807c8f/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8af65f14dc14a79b924524b1e7fffe304517b2bff5a58bf64f30b98bbc5079eb", size = 147889, upload-time = "2025-10-14T04:41:34.897Z" }, + { url = "https://files.pythonhosted.org/packages/10/bf/979224a919a1b606c82bd2c5fa49b5c6d5727aa47b4312bb27b1734f53cd/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74664978bb272435107de04e36db5a9735e78232b85b77d45cfb38f758efd33e", size = 143641, upload-time = "2025-10-14T04:41:36.116Z" }, + { url = "https://files.pythonhosted.org/packages/ba/33/0ad65587441fc730dc7bd90e9716b30b4702dc7b617e6ba4997dc8651495/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:752944c7ffbfdd10c074dc58ec2d5a8a4cd9493b314d367c14d24c17684ddd14", size = 160779, upload-time = "2025-10-14T04:41:37.229Z" }, + { url = "https://files.pythonhosted.org/packages/67/ed/331d6b249259ee71ddea93f6f2f0a56cfebd46938bde6fcc6f7b9a3d0e09/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d1f13550535ad8cff21b8d757a3257963e951d96e20ec82ab44bc64aeb62a191", size = 159035, upload-time = "2025-10-14T04:41:38.368Z" }, + { url = "https://files.pythonhosted.org/packages/67/ff/f6b948ca32e4f2a4576aa129d8bed61f2e0543bf9f5f2b7fc3758ed005c9/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecaae4149d99b1c9e7b88bb03e3221956f68fd6d50be2ef061b2381b61d20838", size = 152542, upload-time = "2025-10-14T04:41:39.862Z" }, + { url = "https://files.pythonhosted.org/packages/16/85/276033dcbcc369eb176594de22728541a925b2632f9716428c851b149e83/charset_normalizer-3.4.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cb6254dc36b47a990e59e1068afacdcd02958bdcce30bb50cc1700a8b9d624a6", size = 149524, upload-time = "2025-10-14T04:41:41.319Z" }, + { url = "https://files.pythonhosted.org/packages/9e/f2/6a2a1f722b6aba37050e626530a46a68f74e63683947a8acff92569f979a/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c8ae8a0f02f57a6e61203a31428fa1d677cbe50c93622b4149d5c0f319c1d19e", size = 150395, upload-time = "2025-10-14T04:41:42.539Z" }, + { url = "https://files.pythonhosted.org/packages/60/bb/2186cb2f2bbaea6338cad15ce23a67f9b0672929744381e28b0592676824/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:47cc91b2f4dd2833fddaedd2893006b0106129d4b94fdb6af1f4ce5a9965577c", size = 143680, upload-time = "2025-10-14T04:41:43.661Z" }, + { url = "https://files.pythonhosted.org/packages/7d/a5/bf6f13b772fbb2a90360eb620d52ed8f796f3c5caee8398c3b2eb7b1c60d/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:82004af6c302b5d3ab2cfc4cc5f29db16123b1a8417f2e25f9066f91d4411090", size = 162045, upload-time = "2025-10-14T04:41:44.821Z" }, + { url = "https://files.pythonhosted.org/packages/df/c5/d1be898bf0dc3ef9030c3825e5d3b83f2c528d207d246cbabe245966808d/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:2b7d8f6c26245217bd2ad053761201e9f9680f8ce52f0fcd8d0755aeae5b2152", size = 149687, upload-time = "2025-10-14T04:41:46.442Z" }, + { url = "https://files.pythonhosted.org/packages/a5/42/90c1f7b9341eef50c8a1cb3f098ac43b0508413f33affd762855f67a410e/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:799a7a5e4fb2d5898c60b640fd4981d6a25f1c11790935a44ce38c54e985f828", size = 160014, upload-time = "2025-10-14T04:41:47.631Z" }, + { url = "https://files.pythonhosted.org/packages/76/be/4d3ee471e8145d12795ab655ece37baed0929462a86e72372fd25859047c/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:99ae2cffebb06e6c22bdc25801d7b30f503cc87dbd283479e7b606f70aff57ec", size = 154044, upload-time = "2025-10-14T04:41:48.81Z" }, + { url = "https://files.pythonhosted.org/packages/b0/6f/8f7af07237c34a1defe7defc565a9bc1807762f672c0fde711a4b22bf9c0/charset_normalizer-3.4.4-cp314-cp314-win32.whl", hash = "sha256:f9d332f8c2a2fcbffe1378594431458ddbef721c1769d78e2cbc06280d8155f9", size = 99940, upload-time = "2025-10-14T04:41:49.946Z" }, + { url = "https://files.pythonhosted.org/packages/4b/51/8ade005e5ca5b0d80fb4aff72a3775b325bdc3d27408c8113811a7cbe640/charset_normalizer-3.4.4-cp314-cp314-win_amd64.whl", hash = "sha256:8a6562c3700cce886c5be75ade4a5db4214fda19fede41d9792d100288d8f94c", size = 107104, upload-time = "2025-10-14T04:41:51.051Z" }, + { url = "https://files.pythonhosted.org/packages/da/5f/6b8f83a55bb8278772c5ae54a577f3099025f9ade59d0136ac24a0df4bde/charset_normalizer-3.4.4-cp314-cp314-win_arm64.whl", hash = "sha256:de00632ca48df9daf77a2c65a484531649261ec9f25489917f09e455cb09ddb2", size = 100743, upload-time = "2025-10-14T04:41:52.122Z" }, + { url = "https://files.pythonhosted.org/packages/0a/4c/925909008ed5a988ccbb72dcc897407e5d6d3bd72410d69e051fc0c14647/charset_normalizer-3.4.4-py3-none-any.whl", hash = "sha256:7a32c560861a02ff789ad905a2fe94e3f840803362c84fecf1851cb4cf3dc37f", size = 53402, upload-time = "2025-10-14T04:42:31.76Z" }, +] + +[[package]] +name = "click" +version = "8.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a", size = 295065, upload-time = "2025-11-15T20:45:42.706Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6", size = 108274, upload-time = "2025-11-15T20:45:41.139Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "cryptography" +version = "46.0.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9f/33/c00162f49c0e2fe8064a62cb92b93e50c74a72bc370ab92f86112b33ff62/cryptography-46.0.3.tar.gz", hash = "sha256:a8b17438104fed022ce745b362294d9ce35b4c2e45c1d958ad4a4b019285f4a1", size = 749258, upload-time = "2025-10-15T23:18:31.74Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1d/42/9c391dd801d6cf0d561b5890549d4b27bafcc53b39c31a817e69d87c625b/cryptography-46.0.3-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:109d4ddfadf17e8e7779c39f9b18111a09efb969a301a31e987416a0191ed93a", size = 7225004, upload-time = "2025-10-15T23:16:52.239Z" }, + { url = "https://files.pythonhosted.org/packages/1c/67/38769ca6b65f07461eb200e85fc1639b438bdc667be02cf7f2cd6a64601c/cryptography-46.0.3-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:09859af8466b69bc3c27bdf4f5d84a665e0f7ab5088412e9e2ec49758eca5cbc", size = 4296667, upload-time = "2025-10-15T23:16:54.369Z" }, + { url = "https://files.pythonhosted.org/packages/5c/49/498c86566a1d80e978b42f0d702795f69887005548c041636df6ae1ca64c/cryptography-46.0.3-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:01ca9ff2885f3acc98c29f1860552e37f6d7c7d013d7334ff2a9de43a449315d", size = 4450807, upload-time = "2025-10-15T23:16:56.414Z" }, + { url = "https://files.pythonhosted.org/packages/4b/0a/863a3604112174c8624a2ac3c038662d9e59970c7f926acdcfaed8d61142/cryptography-46.0.3-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:6eae65d4c3d33da080cff9c4ab1f711b15c1d9760809dad6ea763f3812d254cb", size = 4299615, upload-time = "2025-10-15T23:16:58.442Z" }, + { url = "https://files.pythonhosted.org/packages/64/02/b73a533f6b64a69f3cd3872acb6ebc12aef924d8d103133bb3ea750dc703/cryptography-46.0.3-cp311-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e5bf0ed4490068a2e72ac03d786693adeb909981cc596425d09032d372bcc849", size = 4016800, upload-time = "2025-10-15T23:17:00.378Z" }, + { url = "https://files.pythonhosted.org/packages/25/d5/16e41afbfa450cde85a3b7ec599bebefaef16b5c6ba4ec49a3532336ed72/cryptography-46.0.3-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:5ecfccd2329e37e9b7112a888e76d9feca2347f12f37918facbb893d7bb88ee8", size = 4984707, upload-time = "2025-10-15T23:17:01.98Z" }, + { url = "https://files.pythonhosted.org/packages/c9/56/e7e69b427c3878352c2fb9b450bd0e19ed552753491d39d7d0a2f5226d41/cryptography-46.0.3-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:a2c0cd47381a3229c403062f764160d57d4d175e022c1df84e168c6251a22eec", size = 4482541, upload-time = "2025-10-15T23:17:04.078Z" }, + { url = "https://files.pythonhosted.org/packages/78/f6/50736d40d97e8483172f1bb6e698895b92a223dba513b0ca6f06b2365339/cryptography-46.0.3-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:549e234ff32571b1f4076ac269fcce7a808d3bf98b76c8dd560e42dbc66d7d91", size = 4299464, upload-time = "2025-10-15T23:17:05.483Z" }, + { url = "https://files.pythonhosted.org/packages/00/de/d8e26b1a855f19d9994a19c702fa2e93b0456beccbcfe437eda00e0701f2/cryptography-46.0.3-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:c0a7bb1a68a5d3471880e264621346c48665b3bf1c3759d682fc0864c540bd9e", size = 4950838, upload-time = "2025-10-15T23:17:07.425Z" }, + { url = "https://files.pythonhosted.org/packages/8f/29/798fc4ec461a1c9e9f735f2fc58741b0daae30688f41b2497dcbc9ed1355/cryptography-46.0.3-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:10b01676fc208c3e6feeb25a8b83d81767e8059e1fe86e1dc62d10a3018fa926", size = 4481596, upload-time = "2025-10-15T23:17:09.343Z" }, + { url = "https://files.pythonhosted.org/packages/15/8d/03cd48b20a573adfff7652b76271078e3045b9f49387920e7f1f631d125e/cryptography-46.0.3-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:0abf1ffd6e57c67e92af68330d05760b7b7efb243aab8377e583284dbab72c71", size = 4426782, upload-time = "2025-10-15T23:17:11.22Z" }, + { url = "https://files.pythonhosted.org/packages/fa/b1/ebacbfe53317d55cf33165bda24c86523497a6881f339f9aae5c2e13e57b/cryptography-46.0.3-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a04bee9ab6a4da801eb9b51f1b708a1b5b5c9eb48c03f74198464c66f0d344ac", size = 4698381, upload-time = "2025-10-15T23:17:12.829Z" }, + { url = "https://files.pythonhosted.org/packages/96/92/8a6a9525893325fc057a01f654d7efc2c64b9de90413adcf605a85744ff4/cryptography-46.0.3-cp311-abi3-win32.whl", hash = "sha256:f260d0d41e9b4da1ed1e0f1ce571f97fe370b152ab18778e9e8f67d6af432018", size = 3055988, upload-time = "2025-10-15T23:17:14.65Z" }, + { url = "https://files.pythonhosted.org/packages/7e/bf/80fbf45253ea585a1e492a6a17efcb93467701fa79e71550a430c5e60df0/cryptography-46.0.3-cp311-abi3-win_amd64.whl", hash = "sha256:a9a3008438615669153eb86b26b61e09993921ebdd75385ddd748702c5adfddb", size = 3514451, upload-time = "2025-10-15T23:17:16.142Z" }, + { url = "https://files.pythonhosted.org/packages/2e/af/9b302da4c87b0beb9db4e756386a7c6c5b8003cd0e742277888d352ae91d/cryptography-46.0.3-cp311-abi3-win_arm64.whl", hash = "sha256:5d7f93296ee28f68447397bf5198428c9aeeab45705a55d53a6343455dcb2c3c", size = 2928007, upload-time = "2025-10-15T23:17:18.04Z" }, + { url = "https://files.pythonhosted.org/packages/f5/e2/a510aa736755bffa9d2f75029c229111a1d02f8ecd5de03078f4c18d91a3/cryptography-46.0.3-cp314-cp314t-macosx_10_9_universal2.whl", hash = "sha256:00a5e7e87938e5ff9ff5447ab086a5706a957137e6e433841e9d24f38a065217", size = 7158012, upload-time = "2025-10-15T23:17:19.982Z" }, + { url = "https://files.pythonhosted.org/packages/73/dc/9aa866fbdbb95b02e7f9d086f1fccfeebf8953509b87e3f28fff927ff8a0/cryptography-46.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c8daeb2d2174beb4575b77482320303f3d39b8e81153da4f0fb08eb5fe86a6c5", size = 4288728, upload-time = "2025-10-15T23:17:21.527Z" }, + { url = "https://files.pythonhosted.org/packages/c5/fd/bc1daf8230eaa075184cbbf5f8cd00ba9db4fd32d63fb83da4671b72ed8a/cryptography-46.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:39b6755623145ad5eff1dab323f4eae2a32a77a7abef2c5089a04a3d04366715", size = 4435078, upload-time = "2025-10-15T23:17:23.042Z" }, + { url = "https://files.pythonhosted.org/packages/82/98/d3bd5407ce4c60017f8ff9e63ffee4200ab3e23fe05b765cab805a7db008/cryptography-46.0.3-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:db391fa7c66df6762ee3f00c95a89e6d428f4d60e7abc8328f4fe155b5ac6e54", size = 4293460, upload-time = "2025-10-15T23:17:24.885Z" }, + { url = "https://files.pythonhosted.org/packages/26/e9/e23e7900983c2b8af7a08098db406cf989d7f09caea7897e347598d4cd5b/cryptography-46.0.3-cp314-cp314t-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:78a97cf6a8839a48c49271cdcbd5cf37ca2c1d6b7fdd86cc864f302b5e9bf459", size = 3995237, upload-time = "2025-10-15T23:17:26.449Z" }, + { url = "https://files.pythonhosted.org/packages/91/15/af68c509d4a138cfe299d0d7ddb14afba15233223ebd933b4bbdbc7155d3/cryptography-46.0.3-cp314-cp314t-manylinux_2_28_ppc64le.whl", hash = "sha256:dfb781ff7eaa91a6f7fd41776ec37c5853c795d3b358d4896fdbb5df168af422", size = 4967344, upload-time = "2025-10-15T23:17:28.06Z" }, + { url = "https://files.pythonhosted.org/packages/ca/e3/8643d077c53868b681af077edf6b3cb58288b5423610f21c62aadcbe99f4/cryptography-46.0.3-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:6f61efb26e76c45c4a227835ddeae96d83624fb0d29eb5df5b96e14ed1a0afb7", size = 4466564, upload-time = "2025-10-15T23:17:29.665Z" }, + { url = "https://files.pythonhosted.org/packages/0e/43/c1e8726fa59c236ff477ff2b5dc071e54b21e5a1e51aa2cee1676f1c986f/cryptography-46.0.3-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:23b1a8f26e43f47ceb6d6a43115f33a5a37d57df4ea0ca295b780ae8546e8044", size = 4292415, upload-time = "2025-10-15T23:17:31.686Z" }, + { url = "https://files.pythonhosted.org/packages/42/f9/2f8fefdb1aee8a8e3256a0568cffc4e6d517b256a2fe97a029b3f1b9fe7e/cryptography-46.0.3-cp314-cp314t-manylinux_2_34_ppc64le.whl", hash = "sha256:b419ae593c86b87014b9be7396b385491ad7f320bde96826d0dd174459e54665", size = 4931457, upload-time = "2025-10-15T23:17:33.478Z" }, + { url = "https://files.pythonhosted.org/packages/79/30/9b54127a9a778ccd6d27c3da7563e9f2d341826075ceab89ae3b41bf5be2/cryptography-46.0.3-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:50fc3343ac490c6b08c0cf0d704e881d0d660be923fd3076db3e932007e726e3", size = 4466074, upload-time = "2025-10-15T23:17:35.158Z" }, + { url = "https://files.pythonhosted.org/packages/ac/68/b4f4a10928e26c941b1b6a179143af9f4d27d88fe84a6a3c53592d2e76bf/cryptography-46.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:22d7e97932f511d6b0b04f2bfd818d73dcd5928db509460aaf48384778eb6d20", size = 4420569, upload-time = "2025-10-15T23:17:37.188Z" }, + { url = "https://files.pythonhosted.org/packages/a3/49/3746dab4c0d1979888f125226357d3262a6dd40e114ac29e3d2abdf1ec55/cryptography-46.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:d55f3dffadd674514ad19451161118fd010988540cee43d8bc20675e775925de", size = 4681941, upload-time = "2025-10-15T23:17:39.236Z" }, + { url = "https://files.pythonhosted.org/packages/fd/30/27654c1dbaf7e4a3531fa1fc77986d04aefa4d6d78259a62c9dc13d7ad36/cryptography-46.0.3-cp314-cp314t-win32.whl", hash = "sha256:8a6e050cb6164d3f830453754094c086ff2d0b2f3a897a1d9820f6139a1f0914", size = 3022339, upload-time = "2025-10-15T23:17:40.888Z" }, + { url = "https://files.pythonhosted.org/packages/f6/30/640f34ccd4d2a1bc88367b54b926b781b5a018d65f404d409aba76a84b1c/cryptography-46.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:760f83faa07f8b64e9c33fc963d790a2edb24efb479e3520c14a45741cd9b2db", size = 3494315, upload-time = "2025-10-15T23:17:42.769Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8b/88cc7e3bd0a8e7b861f26981f7b820e1f46aa9d26cc482d0feba0ecb4919/cryptography-46.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:516ea134e703e9fe26bcd1277a4b59ad30586ea90c365a87781d7887a646fe21", size = 2919331, upload-time = "2025-10-15T23:17:44.468Z" }, + { url = "https://files.pythonhosted.org/packages/fd/23/45fe7f376a7df8daf6da3556603b36f53475a99ce4faacb6ba2cf3d82021/cryptography-46.0.3-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:cb3d760a6117f621261d662bccc8ef5bc32ca673e037c83fbe565324f5c46936", size = 7218248, upload-time = "2025-10-15T23:17:46.294Z" }, + { url = "https://files.pythonhosted.org/packages/27/32/b68d27471372737054cbd34c84981f9edbc24fe67ca225d389799614e27f/cryptography-46.0.3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:4b7387121ac7d15e550f5cb4a43aef2559ed759c35df7336c402bb8275ac9683", size = 4294089, upload-time = "2025-10-15T23:17:48.269Z" }, + { url = "https://files.pythonhosted.org/packages/26/42/fa8389d4478368743e24e61eea78846a0006caffaf72ea24a15159215a14/cryptography-46.0.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:15ab9b093e8f09daab0f2159bb7e47532596075139dd74365da52ecc9cb46c5d", size = 4440029, upload-time = "2025-10-15T23:17:49.837Z" }, + { url = "https://files.pythonhosted.org/packages/5f/eb/f483db0ec5ac040824f269e93dd2bd8a21ecd1027e77ad7bdf6914f2fd80/cryptography-46.0.3-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:46acf53b40ea38f9c6c229599a4a13f0d46a6c3fa9ef19fc1a124d62e338dfa0", size = 4297222, upload-time = "2025-10-15T23:17:51.357Z" }, + { url = "https://files.pythonhosted.org/packages/fd/cf/da9502c4e1912cb1da3807ea3618a6829bee8207456fbbeebc361ec38ba3/cryptography-46.0.3-cp38-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:10ca84c4668d066a9878890047f03546f3ae0a6b8b39b697457b7757aaf18dbc", size = 4012280, upload-time = "2025-10-15T23:17:52.964Z" }, + { url = "https://files.pythonhosted.org/packages/6b/8f/9adb86b93330e0df8b3dcf03eae67c33ba89958fc2e03862ef1ac2b42465/cryptography-46.0.3-cp38-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:36e627112085bb3b81b19fed209c05ce2a52ee8b15d161b7c643a7d5a88491f3", size = 4978958, upload-time = "2025-10-15T23:17:54.965Z" }, + { url = "https://files.pythonhosted.org/packages/d1/a0/5fa77988289c34bdb9f913f5606ecc9ada1adb5ae870bd0d1054a7021cc4/cryptography-46.0.3-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:1000713389b75c449a6e979ffc7dcc8ac90b437048766cef052d4d30b8220971", size = 4473714, upload-time = "2025-10-15T23:17:56.754Z" }, + { url = "https://files.pythonhosted.org/packages/14/e5/fc82d72a58d41c393697aa18c9abe5ae1214ff6f2a5c18ac470f92777895/cryptography-46.0.3-cp38-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:b02cf04496f6576afffef5ddd04a0cb7d49cf6be16a9059d793a30b035f6b6ac", size = 4296970, upload-time = "2025-10-15T23:17:58.588Z" }, + { url = "https://files.pythonhosted.org/packages/78/06/5663ed35438d0b09056973994f1aec467492b33bd31da36e468b01ec1097/cryptography-46.0.3-cp38-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:71e842ec9bc7abf543b47cf86b9a743baa95f4677d22baa4c7d5c69e49e9bc04", size = 4940236, upload-time = "2025-10-15T23:18:00.897Z" }, + { url = "https://files.pythonhosted.org/packages/fc/59/873633f3f2dcd8a053b8dd1d38f783043b5fce589c0f6988bf55ef57e43e/cryptography-46.0.3-cp38-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:402b58fc32614f00980b66d6e56a5b4118e6cb362ae8f3fda141ba4689bd4506", size = 4472642, upload-time = "2025-10-15T23:18:02.749Z" }, + { url = "https://files.pythonhosted.org/packages/3d/39/8e71f3930e40f6877737d6f69248cf74d4e34b886a3967d32f919cc50d3b/cryptography-46.0.3-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ef639cb3372f69ec44915fafcd6698b6cc78fbe0c2ea41be867f6ed612811963", size = 4423126, upload-time = "2025-10-15T23:18:04.85Z" }, + { url = "https://files.pythonhosted.org/packages/cd/c7/f65027c2810e14c3e7268353b1681932b87e5a48e65505d8cc17c99e36ae/cryptography-46.0.3-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3b51b8ca4f1c6453d8829e1eb7299499ca7f313900dd4d89a24b8b87c0a780d4", size = 4686573, upload-time = "2025-10-15T23:18:06.908Z" }, + { url = "https://files.pythonhosted.org/packages/0a/6e/1c8331ddf91ca4730ab3086a0f1be19c65510a33b5a441cb334e7a2d2560/cryptography-46.0.3-cp38-abi3-win32.whl", hash = "sha256:6276eb85ef938dc035d59b87c8a7dc559a232f954962520137529d77b18ff1df", size = 3036695, upload-time = "2025-10-15T23:18:08.672Z" }, + { url = "https://files.pythonhosted.org/packages/90/45/b0d691df20633eff80955a0fc7695ff9051ffce8b69741444bd9ed7bd0db/cryptography-46.0.3-cp38-abi3-win_amd64.whl", hash = "sha256:416260257577718c05135c55958b674000baef9a1c7d9e8f306ec60d71db850f", size = 3501720, upload-time = "2025-10-15T23:18:10.632Z" }, + { url = "https://files.pythonhosted.org/packages/e8/cb/2da4cc83f5edb9c3257d09e1e7ab7b23f049c7962cae8d842bbef0a9cec9/cryptography-46.0.3-cp38-abi3-win_arm64.whl", hash = "sha256:d89c3468de4cdc4f08a57e214384d0471911a3830fcdaf7a8cc587e42a866372", size = 2918740, upload-time = "2025-10-15T23:18:12.277Z" }, + { url = "https://files.pythonhosted.org/packages/d9/cd/1a8633802d766a0fa46f382a77e096d7e209e0817892929655fe0586ae32/cryptography-46.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:a23582810fedb8c0bc47524558fb6c56aac3fc252cb306072fd2815da2a47c32", size = 3689163, upload-time = "2025-10-15T23:18:13.821Z" }, + { url = "https://files.pythonhosted.org/packages/4c/59/6b26512964ace6480c3e54681a9859c974172fb141c38df11eadd8416947/cryptography-46.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e7aec276d68421f9574040c26e2a7c3771060bc0cff408bae1dcb19d3ab1e63c", size = 3429474, upload-time = "2025-10-15T23:18:15.477Z" }, + { url = "https://files.pythonhosted.org/packages/06/8a/e60e46adab4362a682cf142c7dcb5bf79b782ab2199b0dcb81f55970807f/cryptography-46.0.3-pp311-pypy311_pp73-macosx_10_9_x86_64.whl", hash = "sha256:7ce938a99998ed3c8aa7e7272dca1a610401ede816d36d0693907d863b10d9ea", size = 3698132, upload-time = "2025-10-15T23:18:17.056Z" }, + { url = "https://files.pythonhosted.org/packages/da/38/f59940ec4ee91e93d3311f7532671a5cef5570eb04a144bf203b58552d11/cryptography-46.0.3-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:191bb60a7be5e6f54e30ba16fdfae78ad3a342a0599eb4193ba88e3f3d6e185b", size = 4243992, upload-time = "2025-10-15T23:18:18.695Z" }, + { url = "https://files.pythonhosted.org/packages/b0/0c/35b3d92ddebfdfda76bb485738306545817253d0a3ded0bfe80ef8e67aa5/cryptography-46.0.3-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c70cc23f12726be8f8bc72e41d5065d77e4515efae3690326764ea1b07845cfb", size = 4409944, upload-time = "2025-10-15T23:18:20.597Z" }, + { url = "https://files.pythonhosted.org/packages/99/55/181022996c4063fc0e7666a47049a1ca705abb9c8a13830f074edb347495/cryptography-46.0.3-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:9394673a9f4de09e28b5356e7fff97d778f8abad85c9d5ac4a4b7e25a0de7717", size = 4242957, upload-time = "2025-10-15T23:18:22.18Z" }, + { url = "https://files.pythonhosted.org/packages/ba/af/72cd6ef29f9c5f731251acadaeb821559fe25f10852f44a63374c9ca08c1/cryptography-46.0.3-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:94cd0549accc38d1494e1f8de71eca837d0509d0d44bf11d158524b0e12cebf9", size = 4409447, upload-time = "2025-10-15T23:18:24.209Z" }, + { url = "https://files.pythonhosted.org/packages/0d/c3/e90f4a4feae6410f914f8ebac129b9ae7a8c92eb60a638012dde42030a9d/cryptography-46.0.3-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:6b5063083824e5509fdba180721d55909ffacccc8adbec85268b48439423d78c", size = 3438528, upload-time = "2025-10-15T23:18:26.227Z" }, +] + +[[package]] +name = "dill" +version = "0.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/12/80/630b4b88364e9a8c8c5797f4602d0f76ef820909ee32f0bacb9f90654042/dill-0.4.0.tar.gz", hash = "sha256:0633f1d2df477324f53a895b02c901fb961bdbf65a17122586ea7019292cbcf0", size = 186976, upload-time = "2025-04-16T00:41:48.867Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/3d/9373ad9c56321fdab5b41197068e1d8c25883b3fea29dd361f9b55116869/dill-0.4.0-py3-none-any.whl", hash = "sha256:44f54bf6412c2c8464c14e8243eb163690a9800dbe2c367330883b19c7561049", size = 119668, upload-time = "2025-04-16T00:41:47.671Z" }, +] + +[[package]] +name = "eval-type-backport" +version = "0.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fb/a3/cafafb4558fd638aadfe4121dc6cefb8d743368c085acb2f521df0f3d9d7/eval_type_backport-0.3.1.tar.gz", hash = "sha256:57e993f7b5b69d271e37482e62f74e76a0276c82490cf8e4f0dffeb6b332d5ed", size = 9445, upload-time = "2025-12-02T11:51:42.987Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cf/22/fdc2e30d43ff853720042fa15baa3e6122722be1a7950a98233ebb55cd71/eval_type_backport-0.3.1-py3-none-any.whl", hash = "sha256:279ab641905e9f11129f56a8a78f493518515b83402b860f6f06dd7c011fdfa8", size = 6063, upload-time = "2025-12-02T11:51:41.665Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "frozenlist" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2d/f5/c831fac6cc817d26fd54c7eaccd04ef7e0288806943f7cc5bbf69f3ac1f0/frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad", size = 45875, upload-time = "2025-10-06T05:38:17.865Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/83/4a/557715d5047da48d54e659203b9335be7bfaafda2c3f627b7c47e0b3aaf3/frozenlist-1.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b37f6d31b3dcea7deb5e9696e529a6aa4a898adc33db82da12e4c60a7c4d2011", size = 86230, upload-time = "2025-10-06T05:35:23.699Z" }, + { url = "https://files.pythonhosted.org/packages/a2/fb/c85f9fed3ea8fe8740e5b46a59cc141c23b842eca617da8876cfce5f760e/frozenlist-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ef2b7b394f208233e471abc541cc6991f907ffd47dc72584acee3147899d6565", size = 49621, upload-time = "2025-10-06T05:35:25.341Z" }, + { url = "https://files.pythonhosted.org/packages/63/70/26ca3f06aace16f2352796b08704338d74b6d1a24ca38f2771afbb7ed915/frozenlist-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a88f062f072d1589b7b46e951698950e7da00442fc1cacbe17e19e025dc327ad", size = 49889, upload-time = "2025-10-06T05:35:26.797Z" }, + { url = "https://files.pythonhosted.org/packages/5d/ed/c7895fd2fde7f3ee70d248175f9b6cdf792fb741ab92dc59cd9ef3bd241b/frozenlist-1.8.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f57fb59d9f385710aa7060e89410aeb5058b99e62f4d16b08b91986b9a2140c2", size = 219464, upload-time = "2025-10-06T05:35:28.254Z" }, + { url = "https://files.pythonhosted.org/packages/6b/83/4d587dccbfca74cb8b810472392ad62bfa100bf8108c7223eb4c4fa2f7b3/frozenlist-1.8.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:799345ab092bee59f01a915620b5d014698547afd011e691a208637312db9186", size = 221649, upload-time = "2025-10-06T05:35:29.454Z" }, + { url = "https://files.pythonhosted.org/packages/6a/c6/fd3b9cd046ec5fff9dab66831083bc2077006a874a2d3d9247dea93ddf7e/frozenlist-1.8.0-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c23c3ff005322a6e16f71bf8692fcf4d5a304aaafe1e262c98c6d4adc7be863e", size = 219188, upload-time = "2025-10-06T05:35:30.951Z" }, + { url = "https://files.pythonhosted.org/packages/ce/80/6693f55eb2e085fc8afb28cf611448fb5b90e98e068fa1d1b8d8e66e5c7d/frozenlist-1.8.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8a76ea0f0b9dfa06f254ee06053d93a600865b3274358ca48a352ce4f0798450", size = 231748, upload-time = "2025-10-06T05:35:32.101Z" }, + { url = "https://files.pythonhosted.org/packages/97/d6/e9459f7c5183854abd989ba384fe0cc1a0fb795a83c033f0571ec5933ca4/frozenlist-1.8.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c7366fe1418a6133d5aa824ee53d406550110984de7637d65a178010f759c6ef", size = 236351, upload-time = "2025-10-06T05:35:33.834Z" }, + { url = "https://files.pythonhosted.org/packages/97/92/24e97474b65c0262e9ecd076e826bfd1d3074adcc165a256e42e7b8a7249/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:13d23a45c4cebade99340c4165bd90eeb4a56c6d8a9d8aa49568cac19a6d0dc4", size = 218767, upload-time = "2025-10-06T05:35:35.205Z" }, + { url = "https://files.pythonhosted.org/packages/ee/bf/dc394a097508f15abff383c5108cb8ad880d1f64a725ed3b90d5c2fbf0bb/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:e4a3408834f65da56c83528fb52ce7911484f0d1eaf7b761fc66001db1646eff", size = 235887, upload-time = "2025-10-06T05:35:36.354Z" }, + { url = "https://files.pythonhosted.org/packages/40/90/25b201b9c015dbc999a5baf475a257010471a1fa8c200c843fd4abbee725/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:42145cd2748ca39f32801dad54aeea10039da6f86e303659db90db1c4b614c8c", size = 228785, upload-time = "2025-10-06T05:35:37.949Z" }, + { url = "https://files.pythonhosted.org/packages/84/f4/b5bc148df03082f05d2dd30c089e269acdbe251ac9a9cf4e727b2dbb8a3d/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:e2de870d16a7a53901e41b64ffdf26f2fbb8917b3e6ebf398098d72c5b20bd7f", size = 230312, upload-time = "2025-10-06T05:35:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/db/4b/87e95b5d15097c302430e647136b7d7ab2398a702390cf4c8601975709e7/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:20e63c9493d33ee48536600d1a5c95eefc870cd71e7ab037763d1fbb89cc51e7", size = 217650, upload-time = "2025-10-06T05:35:40.377Z" }, + { url = "https://files.pythonhosted.org/packages/e5/70/78a0315d1fea97120591a83e0acd644da638c872f142fd72a6cebee825f3/frozenlist-1.8.0-cp310-cp310-win32.whl", hash = "sha256:adbeebaebae3526afc3c96fad434367cafbfd1b25d72369a9e5858453b1bb71a", size = 39659, upload-time = "2025-10-06T05:35:41.863Z" }, + { url = "https://files.pythonhosted.org/packages/66/aa/3f04523fb189a00e147e60c5b2205126118f216b0aa908035c45336e27e4/frozenlist-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:667c3777ca571e5dbeb76f331562ff98b957431df140b54c85fd4d52eea8d8f6", size = 43837, upload-time = "2025-10-06T05:35:43.205Z" }, + { url = "https://files.pythonhosted.org/packages/39/75/1135feecdd7c336938bd55b4dc3b0dfc46d85b9be12ef2628574b28de776/frozenlist-1.8.0-cp310-cp310-win_arm64.whl", hash = "sha256:80f85f0a7cc86e7a54c46d99c9e1318ff01f4687c172ede30fd52d19d1da1c8e", size = 39989, upload-time = "2025-10-06T05:35:44.596Z" }, + { url = "https://files.pythonhosted.org/packages/bc/03/077f869d540370db12165c0aa51640a873fb661d8b315d1d4d67b284d7ac/frozenlist-1.8.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:09474e9831bc2b2199fad6da3c14c7b0fbdd377cce9d3d77131be28906cb7d84", size = 86912, upload-time = "2025-10-06T05:35:45.98Z" }, + { url = "https://files.pythonhosted.org/packages/df/b5/7610b6bd13e4ae77b96ba85abea1c8cb249683217ef09ac9e0ae93f25a91/frozenlist-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:17c883ab0ab67200b5f964d2b9ed6b00971917d5d8a92df149dc2c9779208ee9", size = 50046, upload-time = "2025-10-06T05:35:47.009Z" }, + { url = "https://files.pythonhosted.org/packages/6e/ef/0e8f1fe32f8a53dd26bdd1f9347efe0778b0fddf62789ea683f4cc7d787d/frozenlist-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fa47e444b8ba08fffd1c18e8cdb9a75db1b6a27f17507522834ad13ed5922b93", size = 50119, upload-time = "2025-10-06T05:35:48.38Z" }, + { url = "https://files.pythonhosted.org/packages/11/b1/71a477adc7c36e5fb628245dfbdea2166feae310757dea848d02bd0689fd/frozenlist-1.8.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2552f44204b744fba866e573be4c1f9048d6a324dfe14475103fd51613eb1d1f", size = 231067, upload-time = "2025-10-06T05:35:49.97Z" }, + { url = "https://files.pythonhosted.org/packages/45/7e/afe40eca3a2dc19b9904c0f5d7edfe82b5304cb831391edec0ac04af94c2/frozenlist-1.8.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:957e7c38f250991e48a9a73e6423db1bb9dd14e722a10f6b8bb8e16a0f55f695", size = 233160, upload-time = "2025-10-06T05:35:51.729Z" }, + { url = "https://files.pythonhosted.org/packages/a6/aa/7416eac95603ce428679d273255ffc7c998d4132cfae200103f164b108aa/frozenlist-1.8.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8585e3bb2cdea02fc88ffa245069c36555557ad3609e83be0ec71f54fd4abb52", size = 228544, upload-time = "2025-10-06T05:35:53.246Z" }, + { url = "https://files.pythonhosted.org/packages/8b/3d/2a2d1f683d55ac7e3875e4263d28410063e738384d3adc294f5ff3d7105e/frozenlist-1.8.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:edee74874ce20a373d62dc28b0b18b93f645633c2943fd90ee9d898550770581", size = 243797, upload-time = "2025-10-06T05:35:54.497Z" }, + { url = "https://files.pythonhosted.org/packages/78/1e/2d5565b589e580c296d3bb54da08d206e797d941a83a6fdea42af23be79c/frozenlist-1.8.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c9a63152fe95756b85f31186bddf42e4c02c6321207fd6601a1c89ebac4fe567", size = 247923, upload-time = "2025-10-06T05:35:55.861Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c3/65872fcf1d326a7f101ad4d86285c403c87be7d832b7470b77f6d2ed5ddc/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b6db2185db9be0a04fecf2f241c70b63b1a242e2805be291855078f2b404dd6b", size = 230886, upload-time = "2025-10-06T05:35:57.399Z" }, + { url = "https://files.pythonhosted.org/packages/a0/76/ac9ced601d62f6956f03cc794f9e04c81719509f85255abf96e2510f4265/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:f4be2e3d8bc8aabd566f8d5b8ba7ecc09249d74ba3c9ed52e54dc23a293f0b92", size = 245731, upload-time = "2025-10-06T05:35:58.563Z" }, + { url = "https://files.pythonhosted.org/packages/b9/49/ecccb5f2598daf0b4a1415497eba4c33c1e8ce07495eb07d2860c731b8d5/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c8d1634419f39ea6f5c427ea2f90ca85126b54b50837f31497f3bf38266e853d", size = 241544, upload-time = "2025-10-06T05:35:59.719Z" }, + { url = "https://files.pythonhosted.org/packages/53/4b/ddf24113323c0bbcc54cb38c8b8916f1da7165e07b8e24a717b4a12cbf10/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:1a7fa382a4a223773ed64242dbe1c9c326ec09457e6b8428efb4118c685c3dfd", size = 241806, upload-time = "2025-10-06T05:36:00.959Z" }, + { url = "https://files.pythonhosted.org/packages/a7/fb/9b9a084d73c67175484ba2789a59f8eebebd0827d186a8102005ce41e1ba/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:11847b53d722050808926e785df837353bd4d75f1d494377e59b23594d834967", size = 229382, upload-time = "2025-10-06T05:36:02.22Z" }, + { url = "https://files.pythonhosted.org/packages/95/a3/c8fb25aac55bf5e12dae5c5aa6a98f85d436c1dc658f21c3ac73f9fa95e5/frozenlist-1.8.0-cp311-cp311-win32.whl", hash = "sha256:27c6e8077956cf73eadd514be8fb04d77fc946a7fe9f7fe167648b0b9085cc25", size = 39647, upload-time = "2025-10-06T05:36:03.409Z" }, + { url = "https://files.pythonhosted.org/packages/0a/f5/603d0d6a02cfd4c8f2a095a54672b3cf967ad688a60fb9faf04fc4887f65/frozenlist-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:ac913f8403b36a2c8610bbfd25b8013488533e71e62b4b4adce9c86c8cea905b", size = 44064, upload-time = "2025-10-06T05:36:04.368Z" }, + { url = "https://files.pythonhosted.org/packages/5d/16/c2c9ab44e181f043a86f9a8f84d5124b62dbcb3a02c0977ec72b9ac1d3e0/frozenlist-1.8.0-cp311-cp311-win_arm64.whl", hash = "sha256:d4d3214a0f8394edfa3e303136d0575eece0745ff2b47bd2cb2e66dd92d4351a", size = 39937, upload-time = "2025-10-06T05:36:05.669Z" }, + { url = "https://files.pythonhosted.org/packages/69/29/948b9aa87e75820a38650af445d2ef2b6b8a6fab1a23b6bb9e4ef0be2d59/frozenlist-1.8.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:78f7b9e5d6f2fdb88cdde9440dc147259b62b9d3b019924def9f6478be254ac1", size = 87782, upload-time = "2025-10-06T05:36:06.649Z" }, + { url = "https://files.pythonhosted.org/packages/64/80/4f6e318ee2a7c0750ed724fa33a4bdf1eacdc5a39a7a24e818a773cd91af/frozenlist-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:229bf37d2e4acdaf808fd3f06e854a4a7a3661e871b10dc1f8f1896a3b05f18b", size = 50594, upload-time = "2025-10-06T05:36:07.69Z" }, + { url = "https://files.pythonhosted.org/packages/2b/94/5c8a2b50a496b11dd519f4a24cb5496cf125681dd99e94c604ccdea9419a/frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f833670942247a14eafbb675458b4e61c82e002a148f49e68257b79296e865c4", size = 50448, upload-time = "2025-10-06T05:36:08.78Z" }, + { url = "https://files.pythonhosted.org/packages/6a/bd/d91c5e39f490a49df14320f4e8c80161cfcce09f1e2cde1edd16a551abb3/frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:494a5952b1c597ba44e0e78113a7266e656b9794eec897b19ead706bd7074383", size = 242411, upload-time = "2025-10-06T05:36:09.801Z" }, + { url = "https://files.pythonhosted.org/packages/8f/83/f61505a05109ef3293dfb1ff594d13d64a2324ac3482be2cedc2be818256/frozenlist-1.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96f423a119f4777a4a056b66ce11527366a8bb92f54e541ade21f2374433f6d4", size = 243014, upload-time = "2025-10-06T05:36:11.394Z" }, + { url = "https://files.pythonhosted.org/packages/d8/cb/cb6c7b0f7d4023ddda30cf56b8b17494eb3a79e3fda666bf735f63118b35/frozenlist-1.8.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3462dd9475af2025c31cc61be6652dfa25cbfb56cbbf52f4ccfe029f38decaf8", size = 234909, upload-time = "2025-10-06T05:36:12.598Z" }, + { url = "https://files.pythonhosted.org/packages/31/c5/cd7a1f3b8b34af009fb17d4123c5a778b44ae2804e3ad6b86204255f9ec5/frozenlist-1.8.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c4c800524c9cd9bac5166cd6f55285957fcfc907db323e193f2afcd4d9abd69b", size = 250049, upload-time = "2025-10-06T05:36:14.065Z" }, + { url = "https://files.pythonhosted.org/packages/c0/01/2f95d3b416c584a1e7f0e1d6d31998c4a795f7544069ee2e0962a4b60740/frozenlist-1.8.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d6a5df73acd3399d893dafc71663ad22534b5aa4f94e8a2fabfe856c3c1b6a52", size = 256485, upload-time = "2025-10-06T05:36:15.39Z" }, + { url = "https://files.pythonhosted.org/packages/ce/03/024bf7720b3abaebcff6d0793d73c154237b85bdf67b7ed55e5e9596dc9a/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:405e8fe955c2280ce66428b3ca55e12b3c4e9c336fb2103a4937e891c69a4a29", size = 237619, upload-time = "2025-10-06T05:36:16.558Z" }, + { url = "https://files.pythonhosted.org/packages/69/fa/f8abdfe7d76b731f5d8bd217827cf6764d4f1d9763407e42717b4bed50a0/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:908bd3f6439f2fef9e85031b59fd4f1297af54415fb60e4254a95f75b3cab3f3", size = 250320, upload-time = "2025-10-06T05:36:17.821Z" }, + { url = "https://files.pythonhosted.org/packages/f5/3c/b051329f718b463b22613e269ad72138cc256c540f78a6de89452803a47d/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:294e487f9ec720bd8ffcebc99d575f7eff3568a08a253d1ee1a0378754b74143", size = 246820, upload-time = "2025-10-06T05:36:19.046Z" }, + { url = "https://files.pythonhosted.org/packages/0f/ae/58282e8f98e444b3f4dd42448ff36fa38bef29e40d40f330b22e7108f565/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:74c51543498289c0c43656701be6b077f4b265868fa7f8a8859c197006efb608", size = 250518, upload-time = "2025-10-06T05:36:20.763Z" }, + { url = "https://files.pythonhosted.org/packages/8f/96/007e5944694d66123183845a106547a15944fbbb7154788cbf7272789536/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:776f352e8329135506a1d6bf16ac3f87bc25b28e765949282dcc627af36123aa", size = 239096, upload-time = "2025-10-06T05:36:22.129Z" }, + { url = "https://files.pythonhosted.org/packages/66/bb/852b9d6db2fa40be96f29c0d1205c306288f0684df8fd26ca1951d461a56/frozenlist-1.8.0-cp312-cp312-win32.whl", hash = "sha256:433403ae80709741ce34038da08511d4a77062aa924baf411ef73d1146e74faf", size = 39985, upload-time = "2025-10-06T05:36:23.661Z" }, + { url = "https://files.pythonhosted.org/packages/b8/af/38e51a553dd66eb064cdf193841f16f077585d4d28394c2fa6235cb41765/frozenlist-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:34187385b08f866104f0c0617404c8eb08165ab1272e884abc89c112e9c00746", size = 44591, upload-time = "2025-10-06T05:36:24.958Z" }, + { url = "https://files.pythonhosted.org/packages/a7/06/1dc65480ab147339fecc70797e9c2f69d9cea9cf38934ce08df070fdb9cb/frozenlist-1.8.0-cp312-cp312-win_arm64.whl", hash = "sha256:fe3c58d2f5db5fbd18c2987cba06d51b0529f52bc3a6cdc33d3f4eab725104bd", size = 40102, upload-time = "2025-10-06T05:36:26.333Z" }, + { url = "https://files.pythonhosted.org/packages/2d/40/0832c31a37d60f60ed79e9dfb5a92e1e2af4f40a16a29abcc7992af9edff/frozenlist-1.8.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8d92f1a84bb12d9e56f818b3a746f3efba93c1b63c8387a73dde655e1e42282a", size = 85717, upload-time = "2025-10-06T05:36:27.341Z" }, + { url = "https://files.pythonhosted.org/packages/30/ba/b0b3de23f40bc55a7057bd38434e25c34fa48e17f20ee273bbde5e0650f3/frozenlist-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:96153e77a591c8adc2ee805756c61f59fef4cf4073a9275ee86fe8cba41241f7", size = 49651, upload-time = "2025-10-06T05:36:28.855Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ab/6e5080ee374f875296c4243c381bbdef97a9ac39c6e3ce1d5f7d42cb78d6/frozenlist-1.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f21f00a91358803399890ab167098c131ec2ddd5f8f5fd5fe9c9f2c6fcd91e40", size = 49417, upload-time = "2025-10-06T05:36:29.877Z" }, + { url = "https://files.pythonhosted.org/packages/d5/4e/e4691508f9477ce67da2015d8c00acd751e6287739123113a9fca6f1604e/frozenlist-1.8.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fb30f9626572a76dfe4293c7194a09fb1fe93ba94c7d4f720dfae3b646b45027", size = 234391, upload-time = "2025-10-06T05:36:31.301Z" }, + { url = "https://files.pythonhosted.org/packages/40/76/c202df58e3acdf12969a7895fd6f3bc016c642e6726aa63bd3025e0fc71c/frozenlist-1.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eaa352d7047a31d87dafcacbabe89df0aa506abb5b1b85a2fb91bc3faa02d822", size = 233048, upload-time = "2025-10-06T05:36:32.531Z" }, + { url = "https://files.pythonhosted.org/packages/f9/c0/8746afb90f17b73ca5979c7a3958116e105ff796e718575175319b5bb4ce/frozenlist-1.8.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:03ae967b4e297f58f8c774c7eabcce57fe3c2434817d4385c50661845a058121", size = 226549, upload-time = "2025-10-06T05:36:33.706Z" }, + { url = "https://files.pythonhosted.org/packages/7e/eb/4c7eefc718ff72f9b6c4893291abaae5fbc0c82226a32dcd8ef4f7a5dbef/frozenlist-1.8.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f6292f1de555ffcc675941d65fffffb0a5bcd992905015f85d0592201793e0e5", size = 239833, upload-time = "2025-10-06T05:36:34.947Z" }, + { url = "https://files.pythonhosted.org/packages/c2/4e/e5c02187cf704224f8b21bee886f3d713ca379535f16893233b9d672ea71/frozenlist-1.8.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29548f9b5b5e3460ce7378144c3010363d8035cea44bc0bf02d57f5a685e084e", size = 245363, upload-time = "2025-10-06T05:36:36.534Z" }, + { url = "https://files.pythonhosted.org/packages/1f/96/cb85ec608464472e82ad37a17f844889c36100eed57bea094518bf270692/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ec3cc8c5d4084591b4237c0a272cc4f50a5b03396a47d9caaf76f5d7b38a4f11", size = 229314, upload-time = "2025-10-06T05:36:38.582Z" }, + { url = "https://files.pythonhosted.org/packages/5d/6f/4ae69c550e4cee66b57887daeebe006fe985917c01d0fff9caab9883f6d0/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:517279f58009d0b1f2e7c1b130b377a349405da3f7621ed6bfae50b10adf20c1", size = 243365, upload-time = "2025-10-06T05:36:40.152Z" }, + { url = "https://files.pythonhosted.org/packages/7a/58/afd56de246cf11780a40a2c28dc7cbabbf06337cc8ddb1c780a2d97e88d8/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:db1e72ede2d0d7ccb213f218df6a078a9c09a7de257c2fe8fcef16d5925230b1", size = 237763, upload-time = "2025-10-06T05:36:41.355Z" }, + { url = "https://files.pythonhosted.org/packages/cb/36/cdfaf6ed42e2644740d4a10452d8e97fa1c062e2a8006e4b09f1b5fd7d63/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b4dec9482a65c54a5044486847b8a66bf10c9cb4926d42927ec4e8fd5db7fed8", size = 240110, upload-time = "2025-10-06T05:36:42.716Z" }, + { url = "https://files.pythonhosted.org/packages/03/a8/9ea226fbefad669f11b52e864c55f0bd57d3c8d7eb07e9f2e9a0b39502e1/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:21900c48ae04d13d416f0e1e0c4d81f7931f73a9dfa0b7a8746fb2fe7dd970ed", size = 233717, upload-time = "2025-10-06T05:36:44.251Z" }, + { url = "https://files.pythonhosted.org/packages/1e/0b/1b5531611e83ba7d13ccc9988967ea1b51186af64c42b7a7af465dcc9568/frozenlist-1.8.0-cp313-cp313-win32.whl", hash = "sha256:8b7b94a067d1c504ee0b16def57ad5738701e4ba10cec90529f13fa03c833496", size = 39628, upload-time = "2025-10-06T05:36:45.423Z" }, + { url = "https://files.pythonhosted.org/packages/d8/cf/174c91dbc9cc49bc7b7aab74d8b734e974d1faa8f191c74af9b7e80848e6/frozenlist-1.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:878be833caa6a3821caf85eb39c5ba92d28e85df26d57afb06b35b2efd937231", size = 43882, upload-time = "2025-10-06T05:36:46.796Z" }, + { url = "https://files.pythonhosted.org/packages/c1/17/502cd212cbfa96eb1388614fe39a3fc9ab87dbbe042b66f97acb57474834/frozenlist-1.8.0-cp313-cp313-win_arm64.whl", hash = "sha256:44389d135b3ff43ba8cc89ff7f51f5a0bb6b63d829c8300f79a2fe4fe61bcc62", size = 39676, upload-time = "2025-10-06T05:36:47.8Z" }, + { url = "https://files.pythonhosted.org/packages/d2/5c/3bbfaa920dfab09e76946a5d2833a7cbdf7b9b4a91c714666ac4855b88b4/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:e25ac20a2ef37e91c1b39938b591457666a0fa835c7783c3a8f33ea42870db94", size = 89235, upload-time = "2025-10-06T05:36:48.78Z" }, + { url = "https://files.pythonhosted.org/packages/d2/d6/f03961ef72166cec1687e84e8925838442b615bd0b8854b54923ce5b7b8a/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07cdca25a91a4386d2e76ad992916a85038a9b97561bf7a3fd12d5d9ce31870c", size = 50742, upload-time = "2025-10-06T05:36:49.837Z" }, + { url = "https://files.pythonhosted.org/packages/1e/bb/a6d12b7ba4c3337667d0e421f7181c82dda448ce4e7ad7ecd249a16fa806/frozenlist-1.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4e0c11f2cc6717e0a741f84a527c52616140741cd812a50422f83dc31749fb52", size = 51725, upload-time = "2025-10-06T05:36:50.851Z" }, + { url = "https://files.pythonhosted.org/packages/bc/71/d1fed0ffe2c2ccd70b43714c6cab0f4188f09f8a67a7914a6b46ee30f274/frozenlist-1.8.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b3210649ee28062ea6099cfda39e147fa1bc039583c8ee4481cb7811e2448c51", size = 284533, upload-time = "2025-10-06T05:36:51.898Z" }, + { url = "https://files.pythonhosted.org/packages/c9/1f/fb1685a7b009d89f9bf78a42d94461bc06581f6e718c39344754a5d9bada/frozenlist-1.8.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:581ef5194c48035a7de2aefc72ac6539823bb71508189e5de01d60c9dcd5fa65", size = 292506, upload-time = "2025-10-06T05:36:53.101Z" }, + { url = "https://files.pythonhosted.org/packages/e6/3b/b991fe1612703f7e0d05c0cf734c1b77aaf7c7d321df4572e8d36e7048c8/frozenlist-1.8.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3ef2d026f16a2b1866e1d86fc4e1291e1ed8a387b2c333809419a2f8b3a77b82", size = 274161, upload-time = "2025-10-06T05:36:54.309Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ec/c5c618767bcdf66e88945ec0157d7f6c4a1322f1473392319b7a2501ded7/frozenlist-1.8.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5500ef82073f599ac84d888e3a8c1f77ac831183244bfd7f11eaa0289fb30714", size = 294676, upload-time = "2025-10-06T05:36:55.566Z" }, + { url = "https://files.pythonhosted.org/packages/7c/ce/3934758637d8f8a88d11f0585d6495ef54b2044ed6ec84492a91fa3b27aa/frozenlist-1.8.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:50066c3997d0091c411a66e710f4e11752251e6d2d73d70d8d5d4c76442a199d", size = 300638, upload-time = "2025-10-06T05:36:56.758Z" }, + { url = "https://files.pythonhosted.org/packages/fc/4f/a7e4d0d467298f42de4b41cbc7ddaf19d3cfeabaf9ff97c20c6c7ee409f9/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:5c1c8e78426e59b3f8005e9b19f6ff46e5845895adbde20ece9218319eca6506", size = 283067, upload-time = "2025-10-06T05:36:57.965Z" }, + { url = "https://files.pythonhosted.org/packages/dc/48/c7b163063d55a83772b268e6d1affb960771b0e203b632cfe09522d67ea5/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:eefdba20de0d938cec6a89bd4d70f346a03108a19b9df4248d3cf0d88f1b0f51", size = 292101, upload-time = "2025-10-06T05:36:59.237Z" }, + { url = "https://files.pythonhosted.org/packages/9f/d0/2366d3c4ecdc2fd391e0afa6e11500bfba0ea772764d631bbf82f0136c9d/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:cf253e0e1c3ceb4aaff6df637ce033ff6535fb8c70a764a8f46aafd3d6ab798e", size = 289901, upload-time = "2025-10-06T05:37:00.811Z" }, + { url = "https://files.pythonhosted.org/packages/b8/94/daff920e82c1b70e3618a2ac39fbc01ae3e2ff6124e80739ce5d71c9b920/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:032efa2674356903cd0261c4317a561a6850f3ac864a63fc1583147fb05a79b0", size = 289395, upload-time = "2025-10-06T05:37:02.115Z" }, + { url = "https://files.pythonhosted.org/packages/e3/20/bba307ab4235a09fdcd3cc5508dbabd17c4634a1af4b96e0f69bfe551ebd/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6da155091429aeba16851ecb10a9104a108bcd32f6c1642867eadaee401c1c41", size = 283659, upload-time = "2025-10-06T05:37:03.711Z" }, + { url = "https://files.pythonhosted.org/packages/fd/00/04ca1c3a7a124b6de4f8a9a17cc2fcad138b4608e7a3fc5877804b8715d7/frozenlist-1.8.0-cp313-cp313t-win32.whl", hash = "sha256:0f96534f8bfebc1a394209427d0f8a63d343c9779cda6fc25e8e121b5fd8555b", size = 43492, upload-time = "2025-10-06T05:37:04.915Z" }, + { url = "https://files.pythonhosted.org/packages/59/5e/c69f733a86a94ab10f68e496dc6b7e8bc078ebb415281d5698313e3af3a1/frozenlist-1.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5d63a068f978fc69421fb0e6eb91a9603187527c86b7cd3f534a5b77a592b888", size = 48034, upload-time = "2025-10-06T05:37:06.343Z" }, + { url = "https://files.pythonhosted.org/packages/16/6c/be9d79775d8abe79b05fa6d23da99ad6e7763a1d080fbae7290b286093fd/frozenlist-1.8.0-cp313-cp313t-win_arm64.whl", hash = "sha256:bf0a7e10b077bf5fb9380ad3ae8ce20ef919a6ad93b4552896419ac7e1d8e042", size = 41749, upload-time = "2025-10-06T05:37:07.431Z" }, + { url = "https://files.pythonhosted.org/packages/f1/c8/85da824b7e7b9b6e7f7705b2ecaf9591ba6f79c1177f324c2735e41d36a2/frozenlist-1.8.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cee686f1f4cadeb2136007ddedd0aaf928ab95216e7691c63e50a8ec066336d0", size = 86127, upload-time = "2025-10-06T05:37:08.438Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e8/a1185e236ec66c20afd72399522f142c3724c785789255202d27ae992818/frozenlist-1.8.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:119fb2a1bd47307e899c2fac7f28e85b9a543864df47aa7ec9d3c1b4545f096f", size = 49698, upload-time = "2025-10-06T05:37:09.48Z" }, + { url = "https://files.pythonhosted.org/packages/a1/93/72b1736d68f03fda5fdf0f2180fb6caaae3894f1b854d006ac61ecc727ee/frozenlist-1.8.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4970ece02dbc8c3a92fcc5228e36a3e933a01a999f7094ff7c23fbd2beeaa67c", size = 49749, upload-time = "2025-10-06T05:37:10.569Z" }, + { url = "https://files.pythonhosted.org/packages/a7/b2/fabede9fafd976b991e9f1b9c8c873ed86f202889b864756f240ce6dd855/frozenlist-1.8.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cba69cb73723c3f329622e34bdbf5ce1f80c21c290ff04256cff1cd3c2036ed2", size = 231298, upload-time = "2025-10-06T05:37:11.993Z" }, + { url = "https://files.pythonhosted.org/packages/3a/3b/d9b1e0b0eed36e70477ffb8360c49c85c8ca8ef9700a4e6711f39a6e8b45/frozenlist-1.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:778a11b15673f6f1df23d9586f83c4846c471a8af693a22e066508b77d201ec8", size = 232015, upload-time = "2025-10-06T05:37:13.194Z" }, + { url = "https://files.pythonhosted.org/packages/dc/94/be719d2766c1138148564a3960fc2c06eb688da592bdc25adcf856101be7/frozenlist-1.8.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0325024fe97f94c41c08872db482cf8ac4800d80e79222c6b0b7b162d5b13686", size = 225038, upload-time = "2025-10-06T05:37:14.577Z" }, + { url = "https://files.pythonhosted.org/packages/e4/09/6712b6c5465f083f52f50cf74167b92d4ea2f50e46a9eea0523d658454ae/frozenlist-1.8.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:97260ff46b207a82a7567b581ab4190bd4dfa09f4db8a8b49d1a958f6aa4940e", size = 240130, upload-time = "2025-10-06T05:37:15.781Z" }, + { url = "https://files.pythonhosted.org/packages/f8/d4/cd065cdcf21550b54f3ce6a22e143ac9e4836ca42a0de1022da8498eac89/frozenlist-1.8.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:54b2077180eb7f83dd52c40b2750d0a9f175e06a42e3213ce047219de902717a", size = 242845, upload-time = "2025-10-06T05:37:17.037Z" }, + { url = "https://files.pythonhosted.org/packages/62/c3/f57a5c8c70cd1ead3d5d5f776f89d33110b1addae0ab010ad774d9a44fb9/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2f05983daecab868a31e1da44462873306d3cbfd76d1f0b5b69c473d21dbb128", size = 229131, upload-time = "2025-10-06T05:37:18.221Z" }, + { url = "https://files.pythonhosted.org/packages/6c/52/232476fe9cb64f0742f3fde2b7d26c1dac18b6d62071c74d4ded55e0ef94/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:33f48f51a446114bc5d251fb2954ab0164d5be02ad3382abcbfe07e2531d650f", size = 240542, upload-time = "2025-10-06T05:37:19.771Z" }, + { url = "https://files.pythonhosted.org/packages/5f/85/07bf3f5d0fb5414aee5f47d33c6f5c77bfe49aac680bfece33d4fdf6a246/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:154e55ec0655291b5dd1b8731c637ecdb50975a2ae70c606d100750a540082f7", size = 237308, upload-time = "2025-10-06T05:37:20.969Z" }, + { url = "https://files.pythonhosted.org/packages/11/99/ae3a33d5befd41ac0ca2cc7fd3aa707c9c324de2e89db0e0f45db9a64c26/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:4314debad13beb564b708b4a496020e5306c7333fa9a3ab90374169a20ffab30", size = 238210, upload-time = "2025-10-06T05:37:22.252Z" }, + { url = "https://files.pythonhosted.org/packages/b2/60/b1d2da22f4970e7a155f0adde9b1435712ece01b3cd45ba63702aea33938/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:073f8bf8becba60aa931eb3bc420b217bb7d5b8f4750e6f8b3be7f3da85d38b7", size = 231972, upload-time = "2025-10-06T05:37:23.5Z" }, + { url = "https://files.pythonhosted.org/packages/3f/ab/945b2f32de889993b9c9133216c068b7fcf257d8595a0ac420ac8677cab0/frozenlist-1.8.0-cp314-cp314-win32.whl", hash = "sha256:bac9c42ba2ac65ddc115d930c78d24ab8d4f465fd3fc473cdedfccadb9429806", size = 40536, upload-time = "2025-10-06T05:37:25.581Z" }, + { url = "https://files.pythonhosted.org/packages/59/ad/9caa9b9c836d9ad6f067157a531ac48b7d36499f5036d4141ce78c230b1b/frozenlist-1.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:3e0761f4d1a44f1d1a47996511752cf3dcec5bbdd9cc2b4fe595caf97754b7a0", size = 44330, upload-time = "2025-10-06T05:37:26.928Z" }, + { url = "https://files.pythonhosted.org/packages/82/13/e6950121764f2676f43534c555249f57030150260aee9dcf7d64efda11dd/frozenlist-1.8.0-cp314-cp314-win_arm64.whl", hash = "sha256:d1eaff1d00c7751b7c6662e9c5ba6eb2c17a2306ba5e2a37f24ddf3cc953402b", size = 40627, upload-time = "2025-10-06T05:37:28.075Z" }, + { url = "https://files.pythonhosted.org/packages/c0/c7/43200656ecc4e02d3f8bc248df68256cd9572b3f0017f0a0c4e93440ae23/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:d3bb933317c52d7ea5004a1c442eef86f426886fba134ef8cf4226ea6ee1821d", size = 89238, upload-time = "2025-10-06T05:37:29.373Z" }, + { url = "https://files.pythonhosted.org/packages/d1/29/55c5f0689b9c0fb765055629f472c0de484dcaf0acee2f7707266ae3583c/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8009897cdef112072f93a0efdce29cd819e717fd2f649ee3016efd3cd885a7ed", size = 50738, upload-time = "2025-10-06T05:37:30.792Z" }, + { url = "https://files.pythonhosted.org/packages/ba/7d/b7282a445956506fa11da8c2db7d276adcbf2b17d8bb8407a47685263f90/frozenlist-1.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2c5dcbbc55383e5883246d11fd179782a9d07a986c40f49abe89ddf865913930", size = 51739, upload-time = "2025-10-06T05:37:32.127Z" }, + { url = "https://files.pythonhosted.org/packages/62/1c/3d8622e60d0b767a5510d1d3cf21065b9db874696a51ea6d7a43180a259c/frozenlist-1.8.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:39ecbc32f1390387d2aa4f5a995e465e9e2f79ba3adcac92d68e3e0afae6657c", size = 284186, upload-time = "2025-10-06T05:37:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/2d/14/aa36d5f85a89679a85a1d44cd7a6657e0b1c75f61e7cad987b203d2daca8/frozenlist-1.8.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92db2bf818d5cc8d9c1f1fc56b897662e24ea5adb36ad1f1d82875bd64e03c24", size = 292196, upload-time = "2025-10-06T05:37:36.107Z" }, + { url = "https://files.pythonhosted.org/packages/05/23/6bde59eb55abd407d34f77d39a5126fb7b4f109a3f611d3929f14b700c66/frozenlist-1.8.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2dc43a022e555de94c3b68a4ef0b11c4f747d12c024a520c7101709a2144fb37", size = 273830, upload-time = "2025-10-06T05:37:37.663Z" }, + { url = "https://files.pythonhosted.org/packages/d2/3f/22cff331bfad7a8afa616289000ba793347fcd7bc275f3b28ecea2a27909/frozenlist-1.8.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cb89a7f2de3602cfed448095bab3f178399646ab7c61454315089787df07733a", size = 294289, upload-time = "2025-10-06T05:37:39.261Z" }, + { url = "https://files.pythonhosted.org/packages/a4/89/5b057c799de4838b6c69aa82b79705f2027615e01be996d2486a69ca99c4/frozenlist-1.8.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33139dc858c580ea50e7e60a1b0ea003efa1fd42e6ec7fdbad78fff65fad2fd2", size = 300318, upload-time = "2025-10-06T05:37:43.213Z" }, + { url = "https://files.pythonhosted.org/packages/30/de/2c22ab3eb2a8af6d69dc799e48455813bab3690c760de58e1bf43b36da3e/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:168c0969a329b416119507ba30b9ea13688fafffac1b7822802537569a1cb0ef", size = 282814, upload-time = "2025-10-06T05:37:45.337Z" }, + { url = "https://files.pythonhosted.org/packages/59/f7/970141a6a8dbd7f556d94977858cfb36fa9b66e0892c6dd780d2219d8cd8/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:28bd570e8e189d7f7b001966435f9dac6718324b5be2990ac496cf1ea9ddb7fe", size = 291762, upload-time = "2025-10-06T05:37:46.657Z" }, + { url = "https://files.pythonhosted.org/packages/c1/15/ca1adae83a719f82df9116d66f5bb28bb95557b3951903d39135620ef157/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b2a095d45c5d46e5e79ba1e5b9cb787f541a8dee0433836cea4b96a2c439dcd8", size = 289470, upload-time = "2025-10-06T05:37:47.946Z" }, + { url = "https://files.pythonhosted.org/packages/ac/83/dca6dc53bf657d371fbc88ddeb21b79891e747189c5de990b9dfff2ccba1/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:eab8145831a0d56ec9c4139b6c3e594c7a83c2c8be25d5bcf2d86136a532287a", size = 289042, upload-time = "2025-10-06T05:37:49.499Z" }, + { url = "https://files.pythonhosted.org/packages/96/52/abddd34ca99be142f354398700536c5bd315880ed0a213812bc491cff5e4/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:974b28cf63cc99dfb2188d8d222bc6843656188164848c4f679e63dae4b0708e", size = 283148, upload-time = "2025-10-06T05:37:50.745Z" }, + { url = "https://files.pythonhosted.org/packages/af/d3/76bd4ed4317e7119c2b7f57c3f6934aba26d277acc6309f873341640e21f/frozenlist-1.8.0-cp314-cp314t-win32.whl", hash = "sha256:342c97bf697ac5480c0a7ec73cd700ecfa5a8a40ac923bd035484616efecc2df", size = 44676, upload-time = "2025-10-06T05:37:52.222Z" }, + { url = "https://files.pythonhosted.org/packages/89/76/c615883b7b521ead2944bb3480398cbb07e12b7b4e4d073d3752eb721558/frozenlist-1.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:06be8f67f39c8b1dc671f5d83aaefd3358ae5cdcf8314552c57e7ed3e6475bdd", size = 49451, upload-time = "2025-10-06T05:37:53.425Z" }, + { url = "https://files.pythonhosted.org/packages/e0/a3/5982da14e113d07b325230f95060e2169f5311b1017ea8af2a29b374c289/frozenlist-1.8.0-cp314-cp314t-win_arm64.whl", hash = "sha256:102e6314ca4da683dca92e3b1355490fed5f313b768500084fbe6371fddfdb79", size = 42507, upload-time = "2025-10-06T05:37:54.513Z" }, + { url = "https://files.pythonhosted.org/packages/9a/9a/e35b4a917281c0b8419d4207f4334c8e8c5dbf4f3f5f9ada73958d937dcc/frozenlist-1.8.0-py3-none-any.whl", hash = "sha256:0c18a16eab41e82c295618a77502e17b195883241c563b00f0aa5106fc4eaa0d", size = 13409, upload-time = "2025-10-06T05:38:16.721Z" }, +] + +[[package]] +name = "gcloud-aio-auth" +version = "5.4.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiohttp" }, + { name = "backoff" }, + { name = "chardet" }, + { name = "cryptography" }, + { name = "pyjwt" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6e/15/a3acb1393934d4909efe75c69fe94536c592ff5953f03922d20186fe4fb1/gcloud_aio_auth-5.4.4.tar.gz", hash = "sha256:70b8c6edf8655003251905372e6815a24ab839bf201788a903964570e9b4091f", size = 13851, upload-time = "2026-02-26T16:38:55.11Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/62/e25afa9e88260230b654a44a8aed75e43cea0dd1e67e43fb7b9a9a7e49e9/gcloud_aio_auth-5.4.4-py3-none-any.whl", hash = "sha256:aa4795365a1f9fdeec9b30e5616f87a95b00d76db60da530d12487c846d2a419", size = 16353, upload-time = "2026-02-26T16:38:56.151Z" }, +] + +[[package]] +name = "gcloud-aio-storage" +version = "9.6.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiofiles" }, + { name = "gcloud-aio-auth" }, + { name = "pyasn1-modules" }, + { name = "rsa" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cc/05/34fc05ccbdab83962d42227d260157f59255f88becb866433cef7727ce82/gcloud_aio_storage-9.6.4.tar.gz", hash = "sha256:4da741e9e45f0ab5f57aa9ba2d46032dde4b80f3eb0a03de31ac741add420485", size = 14613, upload-time = "2026-02-26T17:47:15.024Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fc/70/b40dd004721f450995b368453e673b6ee23743f9de56fe5570c514622433/gcloud_aio_storage-9.6.4-py3-none-any.whl", hash = "sha256:a3b8af75e98485325cee80443a6f3e74f8efa7ed6ed10697db163682390cc1e4", size = 17383, upload-time = "2026-02-26T17:47:16.006Z" }, +] + +[[package]] +name = "google-auth" +version = "2.45.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cachetools" }, + { name = "pyasn1-modules" }, + { name = "rsa" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e5/00/3c794502a8b892c404b2dea5b3650eb21bfc7069612fbfd15c7f17c1cb0d/google_auth-2.45.0.tar.gz", hash = "sha256:90d3f41b6b72ea72dd9811e765699ee491ab24139f34ebf1ca2b9cc0c38708f3", size = 320708, upload-time = "2025-12-15T22:58:42.889Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c6/97/451d55e05487a5cd6279a01a7e34921858b16f7dc8aa38a2c684743cd2b3/google_auth-2.45.0-py2.py3-none-any.whl", hash = "sha256:82344e86dc00410ef5382d99be677c6043d72e502b625aa4f4afa0bdacca0f36", size = 233312, upload-time = "2025-12-15T22:58:40.777Z" }, +] + +[[package]] +name = "griffe" +version = "1.15.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0d/0c/3a471b6e31951dce2360477420d0a8d1e00dea6cf33b70f3e8c3ab6e28e1/griffe-1.15.0.tar.gz", hash = "sha256:7726e3afd6f298fbc3696e67958803e7ac843c1cfe59734b6251a40cdbfb5eea", size = 424112, upload-time = "2025-11-10T15:03:15.52Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9c/83/3b1d03d36f224edded98e9affd0467630fc09d766c0e56fb1498cbb04a9b/griffe-1.15.0-py3-none-any.whl", hash = "sha256:6f6762661949411031f5fcda9593f586e6ce8340f0ba88921a0f2ef7a81eb9a3", size = 150705, upload-time = "2025-11-10T15:03:13.549Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "httpx-sse" +version = "0.4.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0f/4c/751061ffa58615a32c31b2d82e8482be8dd4a89154f003147acee90f2be9/httpx_sse-0.4.3.tar.gz", hash = "sha256:9b1ed0127459a66014aec3c56bebd93da3c1bc8bb6618c8082039a44889a755d", size = 15943, upload-time = "2025-10-10T21:48:22.271Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960, upload-time = "2025-10-10T21:48:21.158Z" }, +] + +[[package]] +name = "idna" +version = "3.11" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" }, +] + +[[package]] +name = "importlib-metadata" +version = "8.7.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "zipp" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f3/49/3b30cad09e7771a4982d9975a8cbf64f00d4a1ececb53297f1d9a7be1b10/importlib_metadata-8.7.1.tar.gz", hash = "sha256:49fef1ae6440c182052f407c8d34a68f72efc36db9ca90dc0113398f2fdde8bb", size = 57107, upload-time = "2025-12-21T10:00:19.278Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fa/5e/f8e9a1d23b9c20a551a8a02ea3637b4642e22c2626e3a13a9a29cdea99eb/importlib_metadata-8.7.1-py3-none-any.whl", hash = "sha256:5a1f80bf1daa489495071efbb095d75a634cf28a8bc299581244063b53176151", size = 27865, upload-time = "2025-12-21T10:00:18.329Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "invoke" +version = "2.2.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/de/bd/b461d3424a24c80490313fd77feeb666ca4f6a28c7e72713e3d9095719b4/invoke-2.2.1.tar.gz", hash = "sha256:515bf49b4a48932b79b024590348da22f39c4942dff991ad1fb8b8baea1be707", size = 304762, upload-time = "2025-10-11T00:36:35.172Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/4b/b99e37f88336009971405cbb7630610322ed6fbfa31e1d7ab3fbf3049a2d/invoke-2.2.1-py3-none-any.whl", hash = "sha256:2413bc441b376e5cd3f55bb5d364f973ad8bdd7bf87e53c79de3c11bf3feecc8", size = 160287, upload-time = "2025-10-11T00:36:33.703Z" }, +] + +[[package]] +name = "isodate" +version = "0.7.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/54/4d/e940025e2ce31a8ce1202635910747e5a87cc3a6a6bb2d00973375014749/isodate-0.7.2.tar.gz", hash = "sha256:4cd1aa0f43ca76f4a6c6c0292a85f40b35ec2e43e315b59f06e6d32171a953e6", size = 29705, upload-time = "2024-10-08T23:04:11.5Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/15/aa/0aca39a37d3c7eb941ba736ede56d689e7be91cab5d9ca846bde3999eba6/isodate-0.7.2-py3-none-any.whl", hash = "sha256:28009937d8031054830160fce6d409ed342816b543597cece116d966c6d99e15", size = 22320, upload-time = "2024-10-08T23:04:09.501Z" }, +] + +[[package]] +name = "isort" +version = "5.13.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/87/f9/c1eb8635a24e87ade2efce21e3ce8cd6b8630bb685ddc9cdaca1349b2eb5/isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109", size = 175303, upload-time = "2023-12-13T20:37:26.124Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/b3/8def84f539e7d2289a02f0524b944b15d7c75dab7628bedf1c4f0992029c/isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6", size = 92310, upload-time = "2023-12-13T20:37:23.244Z" }, +] + +[[package]] +name = "jmespath" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d3/59/322338183ecda247fb5d1763a6cbe46eff7222eaeebafd9fa65d4bf5cb11/jmespath-1.1.0.tar.gz", hash = "sha256:472c87d80f36026ae83c6ddd0f1d05d4e510134ed462851fd5f754c8c3cbb88d", size = 27377, upload-time = "2026-01-22T16:35:26.279Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/2f/967ba146e6d58cf6a652da73885f52fc68001525b4197effc174321d70b4/jmespath-1.1.0-py3-none-any.whl", hash = "sha256:a5663118de4908c91729bea0acadca56526eb2698e83de10cd116ae0f4e97c64", size = 20419, upload-time = "2026-01-22T16:35:24.919Z" }, +] + +[[package]] +name = "jsonpath-python" +version = "1.1.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2d/db/2f4ecc24da35c6142b39c353d5b7c16eef955cc94b35a48d3fa47996d7c3/jsonpath_python-1.1.5.tar.gz", hash = "sha256:ceea2efd9e56add09330a2c9631ea3d55297b9619348c1055e5bfb9cb0b8c538", size = 87352, upload-time = "2026-03-17T06:16:40.597Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/28/50/1a313fb700526b134c71eb8a225d8b83be0385dbb0204337b4379c698cef/jsonpath_python-1.1.5-py3-none-any.whl", hash = "sha256:a60315404d70a65e76c9a782c84e50600480221d94a58af47b7b4d437351cb4b", size = 14090, upload-time = "2026-03-17T06:16:39.152Z" }, +] + +[[package]] +name = "jsonschema" +version = "4.25.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "jsonschema-specifications" }, + { name = "referencing" }, + { name = "rpds-py" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/74/69/f7185de793a29082a9f3c7728268ffb31cb5095131a9c139a74078e27336/jsonschema-4.25.1.tar.gz", hash = "sha256:e4a9655ce0da0c0b67a085847e00a3a51449e1157f4f75e9fb5aa545e122eb85", size = 357342, upload-time = "2025-08-18T17:03:50.038Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/9c/8c95d856233c1f82500c2450b8c68576b4cf1c871db3afac5c34ff84e6fd/jsonschema-4.25.1-py3-none-any.whl", hash = "sha256:3fba0169e345c7175110351d456342c364814cfcf3b964ba4587f22915230a63", size = 90040, upload-time = "2025-08-18T17:03:48.373Z" }, +] + +[[package]] +name = "jsonschema-specifications" +version = "2025.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "referencing" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/19/74/a633ee74eb36c44aa6d1095e7cc5569bebf04342ee146178e2d36600708b/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d", size = 32855, upload-time = "2025-09-08T01:34:59.186Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", size = 18437, upload-time = "2025-09-08T01:34:57.871Z" }, +] + +[[package]] +name = "mccabe" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e7/ff/0ffefdcac38932a54d2b5eed4e0ba8a408f215002cd178ad1df0f2806ff8/mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", size = 9658, upload-time = "2022-01-24T01:14:51.113Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/27/1a/1f68f9ba0c207934b35b86a8ca3aad8395a3d6dd7921c0686e23853ff5a9/mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e", size = 7350, upload-time = "2022-01-24T01:14:49.62Z" }, +] + +[[package]] +name = "mcp" +version = "1.25.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx" }, + { name = "httpx-sse" }, + { name = "jsonschema" }, + { name = "pydantic" }, + { name = "pydantic-settings" }, + { name = "pyjwt", extra = ["crypto"] }, + { name = "python-multipart" }, + { name = "pywin32", marker = "sys_platform == 'win32'" }, + { name = "sse-starlette" }, + { name = "starlette" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, + { name = "uvicorn", marker = "sys_platform != 'emscripten'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d5/2d/649d80a0ecf6a1f82632ca44bec21c0461a9d9fc8934d38cb5b319f2db5e/mcp-1.25.0.tar.gz", hash = "sha256:56310361ebf0364e2d438e5b45f7668cbb124e158bb358333cd06e49e83a6802", size = 605387, upload-time = "2025-12-19T10:19:56.985Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e2/fc/6dc7659c2ae5ddf280477011f4213a74f806862856b796ef08f028e664bf/mcp-1.25.0-py3-none-any.whl", hash = "sha256:b37c38144a666add0862614cc79ec276e97d72aa8ca26d622818d4e278b9721a", size = 233076, upload-time = "2025-12-19T10:19:55.416Z" }, +] + +[[package]] +name = "mistralai" +version = "2.4.5" +source = { editable = "." } +dependencies = [ + { name = "eval-type-backport" }, + { name = "httpx" }, + { name = "jsonpath-python" }, + { name = "opentelemetry-api" }, + { name = "opentelemetry-semantic-conventions" }, + { name = "pydantic" }, + { name = "python-dateutil" }, + { name = "typing-inspection" }, +] + +[package.optional-dependencies] +agents = [ + { name = "authlib" }, + { name = "griffe" }, + { name = "mcp" }, +] +gcp = [ + { name = "google-auth" }, + { name = "requests" }, +] +realtime = [ + { name = "websockets" }, +] +workflow-payload-encryption = [ + { name = "cryptography" }, +] +workflow-payload-offloading = [ + { name = "aioboto3" }, + { name = "azure-storage-blob", extra = ["aio"] }, + { name = "gcloud-aio-storage" }, +] +workflow-payload-offloading-azure = [ + { name = "azure-storage-blob", extra = ["aio"] }, +] +workflow-payload-offloading-gcs = [ + { name = "gcloud-aio-storage" }, +] +workflow-payload-offloading-s3 = [ + { name = "aioboto3" }, +] + +[package.dev-dependencies] +dev = [ + { name = "authlib" }, + { name = "griffe" }, + { name = "invoke" }, + { name = "mcp" }, + { name = "mypy" }, + { name = "opentelemetry-sdk" }, + { name = "pylint" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "pyyaml" }, + { name = "types-authlib" }, + { name = "types-python-dateutil" }, + { name = "types-pyyaml" }, + { name = "websockets" }, +] +lint = [ + { name = "mypy" }, + { name = "pyright" }, + { name = "ruff" }, +] + +[package.metadata] +requires-dist = [ + { name = "aioboto3", marker = "extra == 'workflow-payload-offloading-s3'", specifier = ">=12.4.0,<13.0.0" }, + { name = "authlib", marker = "extra == 'agents'", specifier = ">=1.5.2,<2.0" }, + { name = "azure-storage-blob", extras = ["aio"], marker = "extra == 'workflow-payload-offloading-azure'", specifier = ">=12.28.0,<13.0.0" }, + { name = "cryptography", marker = "extra == 'workflow-payload-encryption'", specifier = ">=41.0.0,<47.0.0" }, + { name = "eval-type-backport", specifier = ">=0.2.0" }, + { name = "gcloud-aio-storage", marker = "extra == 'workflow-payload-offloading-gcs'", specifier = ">=9.3.0,<10.0.0" }, + { name = "google-auth", marker = "extra == 'gcp'", specifier = ">=2.27.0" }, + { name = "griffe", marker = "extra == 'agents'", specifier = ">=1.7.3,<2.0" }, + { name = "httpx", specifier = ">=0.28.1" }, + { name = "jsonpath-python", specifier = ">=1.0.6" }, + { name = "mcp", marker = "extra == 'agents'", specifier = ">=1.0,<2.0" }, + { name = "mistralai", extras = ["workflow-payload-offloading-azure"], marker = "extra == 'workflow-payload-offloading'" }, + { name = "mistralai", extras = ["workflow-payload-offloading-gcs"], marker = "extra == 'workflow-payload-offloading'" }, + { name = "mistralai", extras = ["workflow-payload-offloading-s3"], marker = "extra == 'workflow-payload-offloading'" }, + { name = "opentelemetry-api", specifier = ">=1.33.1,<2.0.0" }, + { name = "opentelemetry-semantic-conventions", specifier = ">=0.60b1,<0.61" }, + { name = "pydantic", specifier = ">=2.11.2" }, + { name = "python-dateutil", specifier = ">=2.8.2" }, + { name = "requests", marker = "extra == 'gcp'", specifier = ">=2.32.3" }, + { name = "typing-inspection", specifier = ">=0.4.0" }, + { name = "websockets", marker = "extra == 'realtime'", specifier = ">=13.0" }, +] +provides-extras = ["gcp", "agents", "realtime", "workflow-payload-offloading-azure", "workflow-payload-offloading-gcs", "workflow-payload-offloading-s3", "workflow-payload-offloading", "workflow-payload-encryption"] + +[package.metadata.requires-dev] +dev = [ + { name = "authlib", specifier = ">=1.5.2,<2" }, + { name = "griffe", specifier = ">=1.7.3,<2" }, + { name = "invoke", specifier = ">=2.2.0,<3" }, + { name = "mcp", specifier = ">=1.0,<2" }, + { name = "mypy", specifier = "==1.15.0" }, + { name = "opentelemetry-sdk", specifier = ">=1.33.1,<2.0.0" }, + { name = "pylint", specifier = "==3.2.3" }, + { name = "pytest", specifier = ">=8.2.2,<9" }, + { name = "pytest-asyncio", specifier = ">=0.23.7,<0.24" }, + { name = "pyyaml", specifier = ">=6.0.2,<7" }, + { name = "types-authlib", specifier = ">=1.5.0.20250516,<2" }, + { name = "types-python-dateutil", specifier = ">=2.9.0.20240316,<3" }, + { name = "types-pyyaml", specifier = ">=6.0.12.20250516,<7" }, + { name = "websockets", specifier = ">=13.0" }, +] +lint = [ + { name = "mypy", specifier = "==1.15.0" }, + { name = "pyright", specifier = ">=1.1.401,<2" }, + { name = "ruff", specifier = ">=0.11.10,<0.12" }, +] + +[[package]] +name = "multidict" +version = "6.7.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/1a/c2/c2d94cbe6ac1753f3fc980da97b3d930efe1da3af3c9f5125354436c073d/multidict-6.7.1.tar.gz", hash = "sha256:ec6652a1bee61c53a3e5776b6049172c53b6aaba34f18c9ad04f82712bac623d", size = 102010, upload-time = "2026-01-26T02:46:45.979Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/84/0b/19348d4c98980c4851d2f943f8ebafdece2ae7ef737adcfa5994ce8e5f10/multidict-6.7.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c93c3db7ea657dd4637d57e74ab73de31bccefe144d3d4ce370052035bc85fb5", size = 77176, upload-time = "2026-01-26T02:42:59.784Z" }, + { url = "https://files.pythonhosted.org/packages/ef/04/9de3f8077852e3d438215c81e9b691244532d2e05b4270e89ce67b7d103c/multidict-6.7.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:974e72a2474600827abaeda71af0c53d9ebbc3c2eb7da37b37d7829ae31232d8", size = 44996, upload-time = "2026-01-26T02:43:01.674Z" }, + { url = "https://files.pythonhosted.org/packages/31/5c/08c7f7fe311f32e83f7621cd3f99d805f45519cd06fafb247628b861da7d/multidict-6.7.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdea2e7b2456cfb6694fb113066fd0ec7ea4d67e3a35e1f4cbeea0b448bf5872", size = 44631, upload-time = "2026-01-26T02:43:03.169Z" }, + { url = "https://files.pythonhosted.org/packages/b7/7f/0e3b1390ae772f27501199996b94b52ceeb64fe6f9120a32c6c3f6b781be/multidict-6.7.1-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:17207077e29342fdc2c9a82e4b306f1127bf1ea91f8b71e02d4798a70bb99991", size = 242561, upload-time = "2026-01-26T02:43:04.733Z" }, + { url = "https://files.pythonhosted.org/packages/dd/f4/8719f4f167586af317b69dd3e90f913416c91ca610cac79a45c53f590312/multidict-6.7.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d4f49cb5661344764e4c7c7973e92a47a59b8fc19b6523649ec9dc4960e58a03", size = 242223, upload-time = "2026-01-26T02:43:06.695Z" }, + { url = "https://files.pythonhosted.org/packages/47/ab/7c36164cce64a6ad19c6d9a85377b7178ecf3b89f8fd589c73381a5eedfd/multidict-6.7.1-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a9fc4caa29e2e6ae408d1c450ac8bf19892c5fca83ee634ecd88a53332c59981", size = 222322, upload-time = "2026-01-26T02:43:08.472Z" }, + { url = "https://files.pythonhosted.org/packages/f5/79/a25add6fb38035b5337bc5734f296d9afc99163403bbcf56d4170f97eb62/multidict-6.7.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c5f0c21549ab432b57dcc82130f388d84ad8179824cc3f223d5e7cfbfd4143f6", size = 254005, upload-time = "2026-01-26T02:43:10.127Z" }, + { url = "https://files.pythonhosted.org/packages/4a/7b/64a87cf98e12f756fc8bd444b001232ffff2be37288f018ad0d3f0aae931/multidict-6.7.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7dfb78d966b2c906ae1d28ccf6e6712a3cd04407ee5088cd276fe8cb42186190", size = 251173, upload-time = "2026-01-26T02:43:11.731Z" }, + { url = "https://files.pythonhosted.org/packages/4b/ac/b605473de2bb404e742f2cc3583d12aedb2352a70e49ae8fce455b50c5aa/multidict-6.7.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9b0d9b91d1aa44db9c1f1ecd0d9d2ae610b2f4f856448664e01a3b35899f3f92", size = 243273, upload-time = "2026-01-26T02:43:13.063Z" }, + { url = "https://files.pythonhosted.org/packages/03/65/11492d6a0e259783720f3bc1d9ea55579a76f1407e31ed44045c99542004/multidict-6.7.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:dd96c01a9dcd4889dcfcf9eb5544ca0c77603f239e3ffab0524ec17aea9a93ee", size = 238956, upload-time = "2026-01-26T02:43:14.843Z" }, + { url = "https://files.pythonhosted.org/packages/5f/a7/7ee591302af64e7c196fb63fe856c788993c1372df765102bd0448e7e165/multidict-6.7.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:067343c68cd6612d375710f895337b3a98a033c94f14b9a99eff902f205424e2", size = 233477, upload-time = "2026-01-26T02:43:16.025Z" }, + { url = "https://files.pythonhosted.org/packages/9c/99/c109962d58756c35fd9992fed7f2355303846ea2ff054bb5f5e9d6b888de/multidict-6.7.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:5884a04f4ff56c6120f6ccf703bdeb8b5079d808ba604d4d53aec0d55dc33568", size = 243615, upload-time = "2026-01-26T02:43:17.84Z" }, + { url = "https://files.pythonhosted.org/packages/d5/5f/1973e7c771c86e93dcfe1c9cc55a5481b610f6614acfc28c0d326fe6bfad/multidict-6.7.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8affcf1c98b82bc901702eb73b6947a1bfa170823c153fe8a47b5f5f02e48e40", size = 249930, upload-time = "2026-01-26T02:43:19.06Z" }, + { url = "https://files.pythonhosted.org/packages/5d/a5/f170fc2268c3243853580203378cd522446b2df632061e0a5409817854c7/multidict-6.7.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:0d17522c37d03e85c8098ec8431636309b2682cf12e58f4dbc76121fb50e4962", size = 243807, upload-time = "2026-01-26T02:43:20.286Z" }, + { url = "https://files.pythonhosted.org/packages/de/01/73856fab6d125e5bc652c3986b90e8699a95e84b48d72f39ade6c0e74a8c/multidict-6.7.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:24c0cf81544ca5e17cfcb6e482e7a82cd475925242b308b890c9452a074d4505", size = 239103, upload-time = "2026-01-26T02:43:21.508Z" }, + { url = "https://files.pythonhosted.org/packages/e7/46/f1220bd9944d8aa40d8ccff100eeeee19b505b857b6f603d6078cb5315b0/multidict-6.7.1-cp310-cp310-win32.whl", hash = "sha256:d82dd730a95e6643802f4454b8fdecdf08667881a9c5670db85bc5a56693f122", size = 41416, upload-time = "2026-01-26T02:43:22.703Z" }, + { url = "https://files.pythonhosted.org/packages/68/00/9b38e272a770303692fc406c36e1a4c740f401522d5787691eb38a8925a8/multidict-6.7.1-cp310-cp310-win_amd64.whl", hash = "sha256:cf37cbe5ced48d417ba045aca1b21bafca67489452debcde94778a576666a1df", size = 46022, upload-time = "2026-01-26T02:43:23.77Z" }, + { url = "https://files.pythonhosted.org/packages/64/65/d8d42490c02ee07b6bbe00f7190d70bb4738b3cce7629aaf9f213ef730dd/multidict-6.7.1-cp310-cp310-win_arm64.whl", hash = "sha256:59bc83d3f66b41dac1e7460aac1d196edc70c9ba3094965c467715a70ecb46db", size = 43238, upload-time = "2026-01-26T02:43:24.882Z" }, + { url = "https://files.pythonhosted.org/packages/ce/f1/a90635c4f88fb913fbf4ce660b83b7445b7a02615bda034b2f8eb38fd597/multidict-6.7.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7ff981b266af91d7b4b3793ca3382e53229088d193a85dfad6f5f4c27fc73e5d", size = 76626, upload-time = "2026-01-26T02:43:26.485Z" }, + { url = "https://files.pythonhosted.org/packages/a6/9b/267e64eaf6fc637a15b35f5de31a566634a2740f97d8d094a69d34f524a4/multidict-6.7.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:844c5bca0b5444adb44a623fb0a1310c2f4cd41f402126bb269cd44c9b3f3e1e", size = 44706, upload-time = "2026-01-26T02:43:27.607Z" }, + { url = "https://files.pythonhosted.org/packages/dd/a4/d45caf2b97b035c57267791ecfaafbd59c68212004b3842830954bb4b02e/multidict-6.7.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f2a0a924d4c2e9afcd7ec64f9de35fcd96915149b2216e1cb2c10a56df483855", size = 44356, upload-time = "2026-01-26T02:43:28.661Z" }, + { url = "https://files.pythonhosted.org/packages/fd/d2/0a36c8473f0cbaeadd5db6c8b72d15bbceeec275807772bfcd059bef487d/multidict-6.7.1-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8be1802715a8e892c784c0197c2ace276ea52702a0ede98b6310c8f255a5afb3", size = 244355, upload-time = "2026-01-26T02:43:31.165Z" }, + { url = "https://files.pythonhosted.org/packages/5d/16/8c65be997fd7dd311b7d39c7b6e71a0cb449bad093761481eccbbe4b42a2/multidict-6.7.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2e2d2ed645ea29f31c4c7ea1552fcfd7cb7ba656e1eafd4134a6620c9f5fdd9e", size = 246433, upload-time = "2026-01-26T02:43:32.581Z" }, + { url = "https://files.pythonhosted.org/packages/01/fb/4dbd7e848d2799c6a026ec88ad39cf2b8416aa167fcc903baa55ecaa045c/multidict-6.7.1-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:95922cee9a778659e91db6497596435777bd25ed116701a4c034f8e46544955a", size = 225376, upload-time = "2026-01-26T02:43:34.417Z" }, + { url = "https://files.pythonhosted.org/packages/b6/8a/4a3a6341eac3830f6053062f8fbc9a9e54407c80755b3f05bc427295c2d0/multidict-6.7.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6b83cabdc375ffaaa15edd97eb7c0c672ad788e2687004990074d7d6c9b140c8", size = 257365, upload-time = "2026-01-26T02:43:35.741Z" }, + { url = "https://files.pythonhosted.org/packages/f7/a2/dd575a69c1aa206e12d27d0770cdf9b92434b48a9ef0cd0d1afdecaa93c4/multidict-6.7.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:38fb49540705369bab8484db0689d86c0a33a0a9f2c1b197f506b71b4b6c19b0", size = 254747, upload-time = "2026-01-26T02:43:36.976Z" }, + { url = "https://files.pythonhosted.org/packages/5a/56/21b27c560c13822ed93133f08aa6372c53a8e067f11fbed37b4adcdac922/multidict-6.7.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:439cbebd499f92e9aa6793016a8acaa161dfa749ae86d20960189f5398a19144", size = 246293, upload-time = "2026-01-26T02:43:38.258Z" }, + { url = "https://files.pythonhosted.org/packages/5a/a4/23466059dc3854763423d0ad6c0f3683a379d97673b1b89ec33826e46728/multidict-6.7.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6d3bc717b6fe763b8be3f2bee2701d3c8eb1b2a8ae9f60910f1b2860c82b6c49", size = 242962, upload-time = "2026-01-26T02:43:40.034Z" }, + { url = "https://files.pythonhosted.org/packages/1f/67/51dd754a3524d685958001e8fa20a0f5f90a6a856e0a9dcabff69be3dbb7/multidict-6.7.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:619e5a1ac57986dbfec9f0b301d865dddf763696435e2962f6d9cf2fdff2bb71", size = 237360, upload-time = "2026-01-26T02:43:41.752Z" }, + { url = "https://files.pythonhosted.org/packages/64/3f/036dfc8c174934d4b55d86ff4f978e558b0e585cef70cfc1ad01adc6bf18/multidict-6.7.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0b38ebffd9be37c1170d33bc0f36f4f262e0a09bc1aac1c34c7aa51a7293f0b3", size = 245940, upload-time = "2026-01-26T02:43:43.042Z" }, + { url = "https://files.pythonhosted.org/packages/3d/20/6214d3c105928ebc353a1c644a6ef1408bc5794fcb4f170bb524a3c16311/multidict-6.7.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:10ae39c9cfe6adedcdb764f5e8411d4a92b055e35573a2eaa88d3323289ef93c", size = 253502, upload-time = "2026-01-26T02:43:44.371Z" }, + { url = "https://files.pythonhosted.org/packages/b1/e2/c653bc4ae1be70a0f836b82172d643fcf1dade042ba2676ab08ec08bff0f/multidict-6.7.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:25167cc263257660290fba06b9318d2026e3c910be240a146e1f66dd114af2b0", size = 247065, upload-time = "2026-01-26T02:43:45.745Z" }, + { url = "https://files.pythonhosted.org/packages/c8/11/a854b4154cd3bd8b1fd375e8a8ca9d73be37610c361543d56f764109509b/multidict-6.7.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:128441d052254f42989ef98b7b6a6ecb1e6f708aa962c7984235316db59f50fa", size = 241870, upload-time = "2026-01-26T02:43:47.054Z" }, + { url = "https://files.pythonhosted.org/packages/13/bf/9676c0392309b5fdae322333d22a829715b570edb9baa8016a517b55b558/multidict-6.7.1-cp311-cp311-win32.whl", hash = "sha256:d62b7f64ffde3b99d06b707a280db04fb3855b55f5a06df387236051d0668f4a", size = 41302, upload-time = "2026-01-26T02:43:48.753Z" }, + { url = "https://files.pythonhosted.org/packages/c9/68/f16a3a8ba6f7b6dc92a1f19669c0810bd2c43fc5a02da13b1cbf8e253845/multidict-6.7.1-cp311-cp311-win_amd64.whl", hash = "sha256:bdbf9f3b332abd0cdb306e7c2113818ab1e922dc84b8f8fd06ec89ed2a19ab8b", size = 45981, upload-time = "2026-01-26T02:43:49.921Z" }, + { url = "https://files.pythonhosted.org/packages/ac/ad/9dd5305253fa00cd3c7555dbef69d5bf4133debc53b87ab8d6a44d411665/multidict-6.7.1-cp311-cp311-win_arm64.whl", hash = "sha256:b8c990b037d2fff2f4e33d3f21b9b531c5745b33a49a7d6dbe7a177266af44f6", size = 43159, upload-time = "2026-01-26T02:43:51.635Z" }, + { url = "https://files.pythonhosted.org/packages/8d/9c/f20e0e2cf80e4b2e4b1c365bf5fe104ee633c751a724246262db8f1a0b13/multidict-6.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a90f75c956e32891a4eda3639ce6dd86e87105271f43d43442a3aedf3cddf172", size = 76893, upload-time = "2026-01-26T02:43:52.754Z" }, + { url = "https://files.pythonhosted.org/packages/fe/cf/18ef143a81610136d3da8193da9d80bfe1cb548a1e2d1c775f26b23d024a/multidict-6.7.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fccb473e87eaa1382689053e4a4618e7ba7b9b9b8d6adf2027ee474597128cd", size = 45456, upload-time = "2026-01-26T02:43:53.893Z" }, + { url = "https://files.pythonhosted.org/packages/a9/65/1caac9d4cd32e8433908683446eebc953e82d22b03d10d41a5f0fefe991b/multidict-6.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0fa96985700739c4c7853a43c0b3e169360d6855780021bfc6d0f1ce7c123e7", size = 43872, upload-time = "2026-01-26T02:43:55.041Z" }, + { url = "https://files.pythonhosted.org/packages/cf/3b/d6bd75dc4f3ff7c73766e04e705b00ed6dbbaccf670d9e05a12b006f5a21/multidict-6.7.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cb2a55f408c3043e42b40cc8eecd575afa27b7e0b956dfb190de0f8499a57a53", size = 251018, upload-time = "2026-01-26T02:43:56.198Z" }, + { url = "https://files.pythonhosted.org/packages/fd/80/c959c5933adedb9ac15152e4067c702a808ea183a8b64cf8f31af8ad3155/multidict-6.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb0ce7b2a32d09892b3dd6cc44877a0d02a33241fafca5f25c8b6b62374f8b75", size = 258883, upload-time = "2026-01-26T02:43:57.499Z" }, + { url = "https://files.pythonhosted.org/packages/86/85/7ed40adafea3d4f1c8b916e3b5cc3a8e07dfcdcb9cd72800f4ed3ca1b387/multidict-6.7.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c3a32d23520ee37bf327d1e1a656fec76a2edd5c038bf43eddfa0572ec49c60b", size = 242413, upload-time = "2026-01-26T02:43:58.755Z" }, + { url = "https://files.pythonhosted.org/packages/d2/57/b8565ff533e48595503c785f8361ff9a4fde4d67de25c207cd0ba3befd03/multidict-6.7.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9c90fed18bffc0189ba814749fdcc102b536e83a9f738a9003e569acd540a733", size = 268404, upload-time = "2026-01-26T02:44:00.216Z" }, + { url = "https://files.pythonhosted.org/packages/e0/50/9810c5c29350f7258180dfdcb2e52783a0632862eb334c4896ac717cebcb/multidict-6.7.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:da62917e6076f512daccfbbde27f46fed1c98fee202f0559adec8ee0de67f71a", size = 269456, upload-time = "2026-01-26T02:44:02.202Z" }, + { url = "https://files.pythonhosted.org/packages/f3/8d/5e5be3ced1d12966fefb5c4ea3b2a5b480afcea36406559442c6e31d4a48/multidict-6.7.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bfde23ef6ed9db7eaee6c37dcec08524cb43903c60b285b172b6c094711b3961", size = 256322, upload-time = "2026-01-26T02:44:03.56Z" }, + { url = "https://files.pythonhosted.org/packages/31/6e/d8a26d81ac166a5592782d208dd90dfdc0a7a218adaa52b45a672b46c122/multidict-6.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3758692429e4e32f1ba0df23219cd0b4fc0a52f476726fff9337d1a57676a582", size = 253955, upload-time = "2026-01-26T02:44:04.845Z" }, + { url = "https://files.pythonhosted.org/packages/59/4c/7c672c8aad41534ba619bcd4ade7a0dc87ed6b8b5c06149b85d3dd03f0cd/multidict-6.7.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:398c1478926eca669f2fd6a5856b6de9c0acf23a2cb59a14c0ba5844fa38077e", size = 251254, upload-time = "2026-01-26T02:44:06.133Z" }, + { url = "https://files.pythonhosted.org/packages/7b/bd/84c24de512cbafbdbc39439f74e967f19570ce7924e3007174a29c348916/multidict-6.7.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c102791b1c4f3ab36ce4101154549105a53dc828f016356b3e3bcae2e3a039d3", size = 252059, upload-time = "2026-01-26T02:44:07.518Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ba/f5449385510825b73d01c2d4087bf6d2fccc20a2d42ac34df93191d3dd03/multidict-6.7.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a088b62bd733e2ad12c50dad01b7d0166c30287c166e137433d3b410add807a6", size = 263588, upload-time = "2026-01-26T02:44:09.382Z" }, + { url = "https://files.pythonhosted.org/packages/d7/11/afc7c677f68f75c84a69fe37184f0f82fce13ce4b92f49f3db280b7e92b3/multidict-6.7.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3d51ff4785d58d3f6c91bdbffcb5e1f7ddfda557727043aa20d20ec4f65e324a", size = 259642, upload-time = "2026-01-26T02:44:10.73Z" }, + { url = "https://files.pythonhosted.org/packages/2b/17/ebb9644da78c4ab36403739e0e6e0e30ebb135b9caf3440825001a0bddcb/multidict-6.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc5907494fccf3e7d3f94f95c91d6336b092b5fc83811720fae5e2765890dfba", size = 251377, upload-time = "2026-01-26T02:44:12.042Z" }, + { url = "https://files.pythonhosted.org/packages/ca/a4/840f5b97339e27846c46307f2530a2805d9d537d8b8bd416af031cad7fa0/multidict-6.7.1-cp312-cp312-win32.whl", hash = "sha256:28ca5ce2fd9716631133d0e9a9b9a745ad7f60bac2bccafb56aa380fc0b6c511", size = 41887, upload-time = "2026-01-26T02:44:14.245Z" }, + { url = "https://files.pythonhosted.org/packages/80/31/0b2517913687895f5904325c2069d6a3b78f66cc641a86a2baf75a05dcbb/multidict-6.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcee94dfbd638784645b066074b338bc9cc155d4b4bffa4adce1615c5a426c19", size = 46053, upload-time = "2026-01-26T02:44:15.371Z" }, + { url = "https://files.pythonhosted.org/packages/0c/5b/aba28e4ee4006ae4c7df8d327d31025d760ffa992ea23812a601d226e682/multidict-6.7.1-cp312-cp312-win_arm64.whl", hash = "sha256:ba0a9fb644d0c1a2194cf7ffb043bd852cea63a57f66fbd33959f7dae18517bf", size = 43307, upload-time = "2026-01-26T02:44:16.852Z" }, + { url = "https://files.pythonhosted.org/packages/f2/22/929c141d6c0dba87d3e1d38fbdf1ba8baba86b7776469f2bc2d3227a1e67/multidict-6.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:2b41f5fed0ed563624f1c17630cb9941cf2309d4df00e494b551b5f3e3d67a23", size = 76174, upload-time = "2026-01-26T02:44:18.509Z" }, + { url = "https://files.pythonhosted.org/packages/c7/75/bc704ae15fee974f8fccd871305e254754167dce5f9e42d88a2def741a1d/multidict-6.7.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84e61e3af5463c19b67ced91f6c634effb89ef8bfc5ca0267f954451ed4bb6a2", size = 45116, upload-time = "2026-01-26T02:44:19.745Z" }, + { url = "https://files.pythonhosted.org/packages/79/76/55cd7186f498ed080a18440c9013011eb548f77ae1b297206d030eb1180a/multidict-6.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:935434b9853c7c112eee7ac891bc4cb86455aa631269ae35442cb316790c1445", size = 43524, upload-time = "2026-01-26T02:44:21.571Z" }, + { url = "https://files.pythonhosted.org/packages/e9/3c/414842ef8d5a1628d68edee29ba0e5bcf235dbfb3ccd3ea303a7fe8c72ff/multidict-6.7.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:432feb25a1cb67fe82a9680b4d65fb542e4635cb3166cd9c01560651ad60f177", size = 249368, upload-time = "2026-01-26T02:44:22.803Z" }, + { url = "https://files.pythonhosted.org/packages/f6/32/befed7f74c458b4a525e60519fe8d87eef72bb1e99924fa2b0f9d97a221e/multidict-6.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e82d14e3c948952a1a85503817e038cba5905a3352de76b9a465075d072fba23", size = 256952, upload-time = "2026-01-26T02:44:24.306Z" }, + { url = "https://files.pythonhosted.org/packages/03/d6/c878a44ba877f366630c860fdf74bfb203c33778f12b6ac274936853c451/multidict-6.7.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:4cfb48c6ea66c83bcaaf7e4dfa7ec1b6bbcf751b7db85a328902796dfde4c060", size = 240317, upload-time = "2026-01-26T02:44:25.772Z" }, + { url = "https://files.pythonhosted.org/packages/68/49/57421b4d7ad2e9e60e25922b08ceb37e077b90444bde6ead629095327a6f/multidict-6.7.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1d540e51b7e8e170174555edecddbd5538105443754539193e3e1061864d444d", size = 267132, upload-time = "2026-01-26T02:44:27.648Z" }, + { url = "https://files.pythonhosted.org/packages/b7/fe/ec0edd52ddbcea2a2e89e174f0206444a61440b40f39704e64dc807a70bd/multidict-6.7.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:273d23f4b40f3dce4d6c8a821c741a86dec62cded82e1175ba3d99be128147ed", size = 268140, upload-time = "2026-01-26T02:44:29.588Z" }, + { url = "https://files.pythonhosted.org/packages/b0/73/6e1b01cbeb458807aa0831742232dbdd1fa92bfa33f52a3f176b4ff3dc11/multidict-6.7.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d624335fd4fa1c08a53f8b4be7676ebde19cd092b3895c421045ca87895b429", size = 254277, upload-time = "2026-01-26T02:44:30.902Z" }, + { url = "https://files.pythonhosted.org/packages/6a/b2/5fb8c124d7561a4974c342bc8c778b471ebbeb3cc17df696f034a7e9afe7/multidict-6.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:12fad252f8b267cc75b66e8fc51b3079604e8d43a75428ffe193cd9e2195dfd6", size = 252291, upload-time = "2026-01-26T02:44:32.31Z" }, + { url = "https://files.pythonhosted.org/packages/5a/96/51d4e4e06bcce92577fcd488e22600bd38e4fd59c20cb49434d054903bd2/multidict-6.7.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:03ede2a6ffbe8ef936b92cb4529f27f42be7f56afcdab5ab739cd5f27fb1cbf9", size = 250156, upload-time = "2026-01-26T02:44:33.734Z" }, + { url = "https://files.pythonhosted.org/packages/db/6b/420e173eec5fba721a50e2a9f89eda89d9c98fded1124f8d5c675f7a0c0f/multidict-6.7.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:90efbcf47dbe33dcf643a1e400d67d59abeac5db07dc3f27d6bdeae497a2198c", size = 249742, upload-time = "2026-01-26T02:44:35.222Z" }, + { url = "https://files.pythonhosted.org/packages/44/a3/ec5b5bd98f306bc2aa297b8c6f11a46714a56b1e6ef5ebda50a4f5d7c5fb/multidict-6.7.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5c4b9bfc148f5a91be9244d6264c53035c8a0dcd2f51f1c3c6e30e30ebaa1c84", size = 262221, upload-time = "2026-01-26T02:44:36.604Z" }, + { url = "https://files.pythonhosted.org/packages/cd/f7/e8c0d0da0cd1e28d10e624604e1a36bcc3353aaebdfdc3a43c72bc683a12/multidict-6.7.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:401c5a650f3add2472d1d288c26deebc540f99e2fb83e9525007a74cd2116f1d", size = 258664, upload-time = "2026-01-26T02:44:38.008Z" }, + { url = "https://files.pythonhosted.org/packages/52/da/151a44e8016dd33feed44f730bd856a66257c1ee7aed4f44b649fb7edeb3/multidict-6.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:97891f3b1b3ffbded884e2916cacf3c6fc87b66bb0dde46f7357404750559f33", size = 249490, upload-time = "2026-01-26T02:44:39.386Z" }, + { url = "https://files.pythonhosted.org/packages/87/af/a3b86bf9630b732897f6fc3f4c4714b90aa4361983ccbdcd6c0339b21b0c/multidict-6.7.1-cp313-cp313-win32.whl", hash = "sha256:e1c5988359516095535c4301af38d8a8838534158f649c05dd1050222321bcb3", size = 41695, upload-time = "2026-01-26T02:44:41.318Z" }, + { url = "https://files.pythonhosted.org/packages/b2/35/e994121b0e90e46134673422dd564623f93304614f5d11886b1b3e06f503/multidict-6.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:960c83bf01a95b12b08fd54324a4eb1d5b52c88932b5cba5d6e712bb3ed12eb5", size = 45884, upload-time = "2026-01-26T02:44:42.488Z" }, + { url = "https://files.pythonhosted.org/packages/ca/61/42d3e5dbf661242a69c97ea363f2d7b46c567da8eadef8890022be6e2ab0/multidict-6.7.1-cp313-cp313-win_arm64.whl", hash = "sha256:563fe25c678aaba333d5399408f5ec3c383ca5b663e7f774dd179a520b8144df", size = 43122, upload-time = "2026-01-26T02:44:43.664Z" }, + { url = "https://files.pythonhosted.org/packages/6d/b3/e6b21c6c4f314bb956016b0b3ef2162590a529b84cb831c257519e7fde44/multidict-6.7.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:c76c4bec1538375dad9d452d246ca5368ad6e1c9039dadcf007ae59c70619ea1", size = 83175, upload-time = "2026-01-26T02:44:44.894Z" }, + { url = "https://files.pythonhosted.org/packages/fb/76/23ecd2abfe0957b234f6c960f4ade497f55f2c16aeb684d4ecdbf1c95791/multidict-6.7.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:57b46b24b5d5ebcc978da4ec23a819a9402b4228b8a90d9c656422b4bdd8a963", size = 48460, upload-time = "2026-01-26T02:44:46.106Z" }, + { url = "https://files.pythonhosted.org/packages/c4/57/a0ed92b23f3a042c36bc4227b72b97eca803f5f1801c1ab77c8a212d455e/multidict-6.7.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e954b24433c768ce78ab7929e84ccf3422e46deb45a4dc9f93438f8217fa2d34", size = 46930, upload-time = "2026-01-26T02:44:47.278Z" }, + { url = "https://files.pythonhosted.org/packages/b5/66/02ec7ace29162e447f6382c495dc95826bf931d3818799bbef11e8f7df1a/multidict-6.7.1-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3bd231490fa7217cc832528e1cd8752a96f0125ddd2b5749390f7c3ec8721b65", size = 242582, upload-time = "2026-01-26T02:44:48.604Z" }, + { url = "https://files.pythonhosted.org/packages/58/18/64f5a795e7677670e872673aca234162514696274597b3708b2c0d276cce/multidict-6.7.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:253282d70d67885a15c8a7716f3a73edf2d635793ceda8173b9ecc21f2fb8292", size = 250031, upload-time = "2026-01-26T02:44:50.544Z" }, + { url = "https://files.pythonhosted.org/packages/c8/ed/e192291dbbe51a8290c5686f482084d31bcd9d09af24f63358c3d42fd284/multidict-6.7.1-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b4c48648d7649c9335cf1927a8b87fa692de3dcb15faa676c6a6f1f1aabda43", size = 228596, upload-time = "2026-01-26T02:44:51.951Z" }, + { url = "https://files.pythonhosted.org/packages/1e/7e/3562a15a60cf747397e7f2180b0a11dc0c38d9175a650e75fa1b4d325e15/multidict-6.7.1-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:98bc624954ec4d2c7cb074b8eefc2b5d0ce7d482e410df446414355d158fe4ca", size = 257492, upload-time = "2026-01-26T02:44:53.902Z" }, + { url = "https://files.pythonhosted.org/packages/24/02/7d0f9eae92b5249bb50ac1595b295f10e263dd0078ebb55115c31e0eaccd/multidict-6.7.1-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1b99af4d9eec0b49927b4402bcbb58dea89d3e0db8806a4086117019939ad3dd", size = 255899, upload-time = "2026-01-26T02:44:55.316Z" }, + { url = "https://files.pythonhosted.org/packages/00/e3/9b60ed9e23e64c73a5cde95269ef1330678e9c6e34dd4eb6b431b85b5a10/multidict-6.7.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6aac4f16b472d5b7dc6f66a0d49dd57b0e0902090be16594dc9ebfd3d17c47e7", size = 247970, upload-time = "2026-01-26T02:44:56.783Z" }, + { url = "https://files.pythonhosted.org/packages/3e/06/538e58a63ed5cfb0bd4517e346b91da32fde409d839720f664e9a4ae4f9d/multidict-6.7.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:21f830fe223215dffd51f538e78c172ed7c7f60c9b96a2bf05c4848ad49921c3", size = 245060, upload-time = "2026-01-26T02:44:58.195Z" }, + { url = "https://files.pythonhosted.org/packages/b2/2f/d743a3045a97c895d401e9bd29aaa09b94f5cbdf1bd561609e5a6c431c70/multidict-6.7.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:f5dd81c45b05518b9aa4da4aa74e1c93d715efa234fd3e8a179df611cc85e5f4", size = 235888, upload-time = "2026-01-26T02:44:59.57Z" }, + { url = "https://files.pythonhosted.org/packages/38/83/5a325cac191ab28b63c52f14f1131f3b0a55ba3b9aa65a6d0bf2a9b921a0/multidict-6.7.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:eb304767bca2bb92fb9c5bd33cedc95baee5bb5f6c88e63706533a1c06ad08c8", size = 243554, upload-time = "2026-01-26T02:45:01.054Z" }, + { url = "https://files.pythonhosted.org/packages/20/1f/9d2327086bd15da2725ef6aae624208e2ef828ed99892b17f60c344e57ed/multidict-6.7.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c9035dde0f916702850ef66460bc4239d89d08df4d02023a5926e7446724212c", size = 252341, upload-time = "2026-01-26T02:45:02.484Z" }, + { url = "https://files.pythonhosted.org/packages/e8/2c/2a1aa0280cf579d0f6eed8ee5211c4f1730bd7e06c636ba2ee6aafda302e/multidict-6.7.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:af959b9beeb66c822380f222f0e0a1889331597e81f1ded7f374f3ecb0fd6c52", size = 246391, upload-time = "2026-01-26T02:45:03.862Z" }, + { url = "https://files.pythonhosted.org/packages/e5/03/7ca022ffc36c5a3f6e03b179a5ceb829be9da5783e6fe395f347c0794680/multidict-6.7.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:41f2952231456154ee479651491e94118229844dd7226541788be783be2b5108", size = 243422, upload-time = "2026-01-26T02:45:05.296Z" }, + { url = "https://files.pythonhosted.org/packages/dc/1d/b31650eab6c5778aceed46ba735bd97f7c7d2f54b319fa916c0f96e7805b/multidict-6.7.1-cp313-cp313t-win32.whl", hash = "sha256:df9f19c28adcb40b6aae30bbaa1478c389efd50c28d541d76760199fc1037c32", size = 47770, upload-time = "2026-01-26T02:45:06.754Z" }, + { url = "https://files.pythonhosted.org/packages/ac/5b/2d2d1d522e51285bd61b1e20df8f47ae1a9d80839db0b24ea783b3832832/multidict-6.7.1-cp313-cp313t-win_amd64.whl", hash = "sha256:d54ecf9f301853f2c5e802da559604b3e95bb7a3b01a9c295c6ee591b9882de8", size = 53109, upload-time = "2026-01-26T02:45:08.044Z" }, + { url = "https://files.pythonhosted.org/packages/3d/a3/cc409ba012c83ca024a308516703cf339bdc4b696195644a7215a5164a24/multidict-6.7.1-cp313-cp313t-win_arm64.whl", hash = "sha256:5a37ca18e360377cfda1d62f5f382ff41f2b8c4ccb329ed974cc2e1643440118", size = 45573, upload-time = "2026-01-26T02:45:09.349Z" }, + { url = "https://files.pythonhosted.org/packages/91/cc/db74228a8be41884a567e88a62fd589a913708fcf180d029898c17a9a371/multidict-6.7.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8f333ec9c5eb1b7105e3b84b53141e66ca05a19a605368c55450b6ba208cb9ee", size = 75190, upload-time = "2026-01-26T02:45:10.651Z" }, + { url = "https://files.pythonhosted.org/packages/d5/22/492f2246bb5b534abd44804292e81eeaf835388901f0c574bac4eeec73c5/multidict-6.7.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a407f13c188f804c759fc6a9f88286a565c242a76b27626594c133b82883b5c2", size = 44486, upload-time = "2026-01-26T02:45:11.938Z" }, + { url = "https://files.pythonhosted.org/packages/f1/4f/733c48f270565d78b4544f2baddc2fb2a245e5a8640254b12c36ac7ac68e/multidict-6.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0e161ddf326db5577c3a4cc2d8648f81456e8a20d40415541587a71620d7a7d1", size = 43219, upload-time = "2026-01-26T02:45:14.346Z" }, + { url = "https://files.pythonhosted.org/packages/24/bb/2c0c2287963f4259c85e8bcbba9182ced8d7fca65c780c38e99e61629d11/multidict-6.7.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1e3a8bb24342a8201d178c3b4984c26ba81a577c80d4d525727427460a50c22d", size = 245132, upload-time = "2026-01-26T02:45:15.712Z" }, + { url = "https://files.pythonhosted.org/packages/a7/f9/44d4b3064c65079d2467888794dea218d1601898ac50222ab8a9a8094460/multidict-6.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97231140a50f5d447d3164f994b86a0bed7cd016e2682f8650d6a9158e14fd31", size = 252420, upload-time = "2026-01-26T02:45:17.293Z" }, + { url = "https://files.pythonhosted.org/packages/8b/13/78f7275e73fa17b24c9a51b0bd9d73ba64bb32d0ed51b02a746eb876abe7/multidict-6.7.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6b10359683bd8806a200fd2909e7c8ca3a7b24ec1d8132e483d58e791d881048", size = 233510, upload-time = "2026-01-26T02:45:19.356Z" }, + { url = "https://files.pythonhosted.org/packages/4b/25/8167187f62ae3cbd52da7893f58cb036b47ea3fb67138787c76800158982/multidict-6.7.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:283ddac99f7ac25a4acadbf004cb5ae34480bbeb063520f70ce397b281859362", size = 264094, upload-time = "2026-01-26T02:45:20.834Z" }, + { url = "https://files.pythonhosted.org/packages/a1/e7/69a3a83b7b030cf283fb06ce074a05a02322359783424d7edf0f15fe5022/multidict-6.7.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:538cec1e18c067d0e6103aa9a74f9e832904c957adc260e61cd9d8cf0c3b3d37", size = 260786, upload-time = "2026-01-26T02:45:22.818Z" }, + { url = "https://files.pythonhosted.org/packages/fe/3b/8ec5074bcfc450fe84273713b4b0a0dd47c0249358f5d82eb8104ffe2520/multidict-6.7.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7eee46ccb30ff48a1e35bb818cc90846c6be2b68240e42a78599166722cea709", size = 248483, upload-time = "2026-01-26T02:45:24.368Z" }, + { url = "https://files.pythonhosted.org/packages/48/5a/d5a99e3acbca0e29c5d9cba8f92ceb15dce78bab963b308ae692981e3a5d/multidict-6.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:fa263a02f4f2dd2d11a7b1bb4362aa7cb1049f84a9235d31adf63f30143469a0", size = 248403, upload-time = "2026-01-26T02:45:25.982Z" }, + { url = "https://files.pythonhosted.org/packages/35/48/e58cd31f6c7d5102f2a4bf89f96b9cf7e00b6c6f3d04ecc44417c00a5a3c/multidict-6.7.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:2e1425e2f99ec5bd36c15a01b690a1a2456209c5deed58f95469ffb46039ccbb", size = 240315, upload-time = "2026-01-26T02:45:27.487Z" }, + { url = "https://files.pythonhosted.org/packages/94/33/1cd210229559cb90b6786c30676bb0c58249ff42f942765f88793b41fdce/multidict-6.7.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:497394b3239fc6f0e13a78a3e1b61296e72bf1c5f94b4c4eb80b265c37a131cd", size = 245528, upload-time = "2026-01-26T02:45:28.991Z" }, + { url = "https://files.pythonhosted.org/packages/64/f2/6e1107d226278c876c783056b7db43d800bb64c6131cec9c8dfb6903698e/multidict-6.7.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:233b398c29d3f1b9676b4b6f75c518a06fcb2ea0b925119fb2c1bc35c05e1601", size = 258784, upload-time = "2026-01-26T02:45:30.503Z" }, + { url = "https://files.pythonhosted.org/packages/4d/c1/11f664f14d525e4a1b5327a82d4de61a1db604ab34c6603bb3c2cc63ad34/multidict-6.7.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:93b1818e4a6e0930454f0f2af7dfce69307ca03cdcfb3739bf4d91241967b6c1", size = 251980, upload-time = "2026-01-26T02:45:32.603Z" }, + { url = "https://files.pythonhosted.org/packages/e1/9f/75a9ac888121d0c5bbd4ecf4eead45668b1766f6baabfb3b7f66a410e231/multidict-6.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f33dc2a3abe9249ea5d8360f969ec7f4142e7ac45ee7014d8f8d5acddf178b7b", size = 243602, upload-time = "2026-01-26T02:45:34.043Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e7/50bf7b004cc8525d80dbbbedfdc7aed3e4c323810890be4413e589074032/multidict-6.7.1-cp314-cp314-win32.whl", hash = "sha256:3ab8b9d8b75aef9df299595d5388b14530839f6422333357af1339443cff777d", size = 40930, upload-time = "2026-01-26T02:45:36.278Z" }, + { url = "https://files.pythonhosted.org/packages/e0/bf/52f25716bbe93745595800f36fb17b73711f14da59ed0bb2eba141bc9f0f/multidict-6.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:5e01429a929600e7dab7b166062d9bb54a5eed752384c7384c968c2afab8f50f", size = 45074, upload-time = "2026-01-26T02:45:37.546Z" }, + { url = "https://files.pythonhosted.org/packages/97/ab/22803b03285fa3a525f48217963da3a65ae40f6a1b6f6cf2768879e208f9/multidict-6.7.1-cp314-cp314-win_arm64.whl", hash = "sha256:4885cb0e817aef5d00a2e8451d4665c1808378dc27c2705f1bf4ef8505c0d2e5", size = 42471, upload-time = "2026-01-26T02:45:38.889Z" }, + { url = "https://files.pythonhosted.org/packages/e0/6d/f9293baa6146ba9507e360ea0292b6422b016907c393e2f63fc40ab7b7b5/multidict-6.7.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0458c978acd8e6ea53c81eefaddbbee9c6c5e591f41b3f5e8e194780fe026581", size = 82401, upload-time = "2026-01-26T02:45:40.254Z" }, + { url = "https://files.pythonhosted.org/packages/7a/68/53b5494738d83558d87c3c71a486504d8373421c3e0dbb6d0db48ad42ee0/multidict-6.7.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:c0abd12629b0af3cf590982c0b413b1e7395cd4ec026f30986818ab95bfaa94a", size = 48143, upload-time = "2026-01-26T02:45:41.635Z" }, + { url = "https://files.pythonhosted.org/packages/37/e8/5284c53310dcdc99ce5d66563f6e5773531a9b9fe9ec7a615e9bc306b05f/multidict-6.7.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:14525a5f61d7d0c94b368a42cff4c9a4e7ba2d52e2672a7b23d84dc86fb02b0c", size = 46507, upload-time = "2026-01-26T02:45:42.99Z" }, + { url = "https://files.pythonhosted.org/packages/e4/fc/6800d0e5b3875568b4083ecf5f310dcf91d86d52573160834fb4bfcf5e4f/multidict-6.7.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:17307b22c217b4cf05033dabefe68255a534d637c6c9b0cc8382718f87be4262", size = 239358, upload-time = "2026-01-26T02:45:44.376Z" }, + { url = "https://files.pythonhosted.org/packages/41/75/4ad0973179361cdf3a113905e6e088173198349131be2b390f9fa4da5fc6/multidict-6.7.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7a7e590ff876a3eaf1c02a4dfe0724b6e69a9e9de6d8f556816f29c496046e59", size = 246884, upload-time = "2026-01-26T02:45:47.167Z" }, + { url = "https://files.pythonhosted.org/packages/c3/9c/095bb28b5da139bd41fb9a5d5caff412584f377914bd8787c2aa98717130/multidict-6.7.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:5fa6a95dfee63893d80a34758cd0e0c118a30b8dcb46372bf75106c591b77889", size = 225878, upload-time = "2026-01-26T02:45:48.698Z" }, + { url = "https://files.pythonhosted.org/packages/07/d0/c0a72000243756e8f5a277b6b514fa005f2c73d481b7d9e47cd4568aa2e4/multidict-6.7.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a0543217a6a017692aa6ae5cc39adb75e587af0f3a82288b1492eb73dd6cc2a4", size = 253542, upload-time = "2026-01-26T02:45:50.164Z" }, + { url = "https://files.pythonhosted.org/packages/c0/6b/f69da15289e384ecf2a68837ec8b5ad8c33e973aa18b266f50fe55f24b8c/multidict-6.7.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f99fe611c312b3c1c0ace793f92464d8cd263cc3b26b5721950d977b006b6c4d", size = 252403, upload-time = "2026-01-26T02:45:51.779Z" }, + { url = "https://files.pythonhosted.org/packages/a2/76/b9669547afa5a1a25cd93eaca91c0da1c095b06b6d2d8ec25b713588d3a1/multidict-6.7.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9004d8386d133b7e6135679424c91b0b854d2d164af6ea3f289f8f2761064609", size = 244889, upload-time = "2026-01-26T02:45:53.27Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a9/a50d2669e506dad33cfc45b5d574a205587b7b8a5f426f2fbb2e90882588/multidict-6.7.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e628ef0e6859ffd8273c69412a2465c4be4a9517d07261b33334b5ec6f3c7489", size = 241982, upload-time = "2026-01-26T02:45:54.919Z" }, + { url = "https://files.pythonhosted.org/packages/c5/bb/1609558ad8b456b4827d3c5a5b775c93b87878fd3117ed3db3423dfbce1b/multidict-6.7.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:841189848ba629c3552035a6a7f5bf3b02eb304e9fea7492ca220a8eda6b0e5c", size = 232415, upload-time = "2026-01-26T02:45:56.981Z" }, + { url = "https://files.pythonhosted.org/packages/d8/59/6f61039d2aa9261871e03ab9dc058a550d240f25859b05b67fd70f80d4b3/multidict-6.7.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:ce1bbd7d780bb5a0da032e095c951f7014d6b0a205f8318308140f1a6aba159e", size = 240337, upload-time = "2026-01-26T02:45:58.698Z" }, + { url = "https://files.pythonhosted.org/packages/a1/29/fdc6a43c203890dc2ae9249971ecd0c41deaedfe00d25cb6564b2edd99eb/multidict-6.7.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b26684587228afed0d50cf804cc71062cc9c1cdf55051c4c6345d372947b268c", size = 248788, upload-time = "2026-01-26T02:46:00.862Z" }, + { url = "https://files.pythonhosted.org/packages/a9/14/a153a06101323e4cf086ecee3faadba52ff71633d471f9685c42e3736163/multidict-6.7.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9f9af11306994335398293f9958071019e3ab95e9a707dc1383a35613f6abcb9", size = 242842, upload-time = "2026-01-26T02:46:02.824Z" }, + { url = "https://files.pythonhosted.org/packages/41/5f/604ae839e64a4a6efc80db94465348d3b328ee955e37acb24badbcd24d83/multidict-6.7.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b4938326284c4f1224178a560987b6cf8b4d38458b113d9b8c1db1a836e640a2", size = 240237, upload-time = "2026-01-26T02:46:05.898Z" }, + { url = "https://files.pythonhosted.org/packages/5f/60/c3a5187bf66f6fb546ff4ab8fb5a077cbdd832d7b1908d4365c7f74a1917/multidict-6.7.1-cp314-cp314t-win32.whl", hash = "sha256:98655c737850c064a65e006a3df7c997cd3b220be4ec8fe26215760b9697d4d7", size = 48008, upload-time = "2026-01-26T02:46:07.468Z" }, + { url = "https://files.pythonhosted.org/packages/0c/f7/addf1087b860ac60e6f382240f64fb99f8bfb532bb06f7c542b83c29ca61/multidict-6.7.1-cp314-cp314t-win_amd64.whl", hash = "sha256:497bde6223c212ba11d462853cfa4f0ae6ef97465033e7dc9940cdb3ab5b48e5", size = 53542, upload-time = "2026-01-26T02:46:08.809Z" }, + { url = "https://files.pythonhosted.org/packages/4c/81/4629d0aa32302ef7b2ec65c75a728cc5ff4fa410c50096174c1632e70b3e/multidict-6.7.1-cp314-cp314t-win_arm64.whl", hash = "sha256:2bbd113e0d4af5db41d5ebfe9ccaff89de2120578164f86a5d17d5a576d1e5b2", size = 44719, upload-time = "2026-01-26T02:46:11.146Z" }, + { url = "https://files.pythonhosted.org/packages/81/08/7036c080d7117f28a4af526d794aab6a84463126db031b007717c1a6676e/multidict-6.7.1-py3-none-any.whl", hash = "sha256:55d97cc6dae627efa6a6e548885712d4864b81110ac76fa4e534c03819fa4a56", size = 12319, upload-time = "2026-01-26T02:46:44.004Z" }, +] + +[[package]] +name = "mypy" +version = "1.15.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mypy-extensions" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ce/43/d5e49a86afa64bd3839ea0d5b9c7103487007d728e1293f52525d6d5486a/mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43", size = 3239717, upload-time = "2025-02-05T03:50:34.655Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/68/f8/65a7ce8d0e09b6329ad0c8d40330d100ea343bd4dd04c4f8ae26462d0a17/mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13", size = 10738433, upload-time = "2025-02-05T03:49:29.145Z" }, + { url = "https://files.pythonhosted.org/packages/b4/95/9c0ecb8eacfe048583706249439ff52105b3f552ea9c4024166c03224270/mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559", size = 9861472, upload-time = "2025-02-05T03:49:16.986Z" }, + { url = "https://files.pythonhosted.org/packages/84/09/9ec95e982e282e20c0d5407bc65031dfd0f0f8ecc66b69538296e06fcbee/mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b", size = 11611424, upload-time = "2025-02-05T03:49:46.908Z" }, + { url = "https://files.pythonhosted.org/packages/78/13/f7d14e55865036a1e6a0a69580c240f43bc1f37407fe9235c0d4ef25ffb0/mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3", size = 12365450, upload-time = "2025-02-05T03:50:05.89Z" }, + { url = "https://files.pythonhosted.org/packages/48/e1/301a73852d40c241e915ac6d7bcd7fedd47d519246db2d7b86b9d7e7a0cb/mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b", size = 12551765, upload-time = "2025-02-05T03:49:33.56Z" }, + { url = "https://files.pythonhosted.org/packages/77/ba/c37bc323ae5fe7f3f15a28e06ab012cd0b7552886118943e90b15af31195/mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828", size = 9274701, upload-time = "2025-02-05T03:49:38.981Z" }, + { url = "https://files.pythonhosted.org/packages/03/bc/f6339726c627bd7ca1ce0fa56c9ae2d0144604a319e0e339bdadafbbb599/mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f", size = 10662338, upload-time = "2025-02-05T03:50:17.287Z" }, + { url = "https://files.pythonhosted.org/packages/e2/90/8dcf506ca1a09b0d17555cc00cd69aee402c203911410136cd716559efe7/mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5", size = 9787540, upload-time = "2025-02-05T03:49:51.21Z" }, + { url = "https://files.pythonhosted.org/packages/05/05/a10f9479681e5da09ef2f9426f650d7b550d4bafbef683b69aad1ba87457/mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e", size = 11538051, upload-time = "2025-02-05T03:50:20.885Z" }, + { url = "https://files.pythonhosted.org/packages/e9/9a/1f7d18b30edd57441a6411fcbc0c6869448d1a4bacbaee60656ac0fc29c8/mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c", size = 12286751, upload-time = "2025-02-05T03:49:42.408Z" }, + { url = "https://files.pythonhosted.org/packages/72/af/19ff499b6f1dafcaf56f9881f7a965ac2f474f69f6f618b5175b044299f5/mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f", size = 12421783, upload-time = "2025-02-05T03:49:07.707Z" }, + { url = "https://files.pythonhosted.org/packages/96/39/11b57431a1f686c1aed54bf794870efe0f6aeca11aca281a0bd87a5ad42c/mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f", size = 9265618, upload-time = "2025-02-05T03:49:54.581Z" }, + { url = "https://files.pythonhosted.org/packages/98/3a/03c74331c5eb8bd025734e04c9840532226775c47a2c39b56a0c8d4f128d/mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd", size = 10793981, upload-time = "2025-02-05T03:50:28.25Z" }, + { url = "https://files.pythonhosted.org/packages/f0/1a/41759b18f2cfd568848a37c89030aeb03534411eef981df621d8fad08a1d/mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f", size = 9749175, upload-time = "2025-02-05T03:50:13.411Z" }, + { url = "https://files.pythonhosted.org/packages/12/7e/873481abf1ef112c582db832740f4c11b2bfa510e829d6da29b0ab8c3f9c/mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464", size = 11455675, upload-time = "2025-02-05T03:50:31.421Z" }, + { url = "https://files.pythonhosted.org/packages/b3/d0/92ae4cde706923a2d3f2d6c39629134063ff64b9dedca9c1388363da072d/mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee", size = 12410020, upload-time = "2025-02-05T03:48:48.705Z" }, + { url = "https://files.pythonhosted.org/packages/46/8b/df49974b337cce35f828ba6fda228152d6db45fed4c86ba56ffe442434fd/mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e", size = 12498582, upload-time = "2025-02-05T03:49:03.628Z" }, + { url = "https://files.pythonhosted.org/packages/13/50/da5203fcf6c53044a0b699939f31075c45ae8a4cadf538a9069b165c1050/mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22", size = 9366614, upload-time = "2025-02-05T03:50:00.313Z" }, + { url = "https://files.pythonhosted.org/packages/6a/9b/fd2e05d6ffff24d912f150b87db9e364fa8282045c875654ce7e32fffa66/mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445", size = 10788592, upload-time = "2025-02-05T03:48:55.789Z" }, + { url = "https://files.pythonhosted.org/packages/74/37/b246d711c28a03ead1fd906bbc7106659aed7c089d55fe40dd58db812628/mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d", size = 9753611, upload-time = "2025-02-05T03:48:44.581Z" }, + { url = "https://files.pythonhosted.org/packages/a6/ac/395808a92e10cfdac8003c3de9a2ab6dc7cde6c0d2a4df3df1b815ffd067/mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5", size = 11438443, upload-time = "2025-02-05T03:49:25.514Z" }, + { url = "https://files.pythonhosted.org/packages/d2/8b/801aa06445d2de3895f59e476f38f3f8d610ef5d6908245f07d002676cbf/mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036", size = 12402541, upload-time = "2025-02-05T03:49:57.623Z" }, + { url = "https://files.pythonhosted.org/packages/c7/67/5a4268782eb77344cc613a4cf23540928e41f018a9a1ec4c6882baf20ab8/mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357", size = 12494348, upload-time = "2025-02-05T03:48:52.361Z" }, + { url = "https://files.pythonhosted.org/packages/83/3e/57bb447f7bbbfaabf1712d96f9df142624a386d98fb026a761532526057e/mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf", size = 9373648, upload-time = "2025-02-05T03:49:11.395Z" }, + { url = "https://files.pythonhosted.org/packages/09/4e/a7d65c7322c510de2c409ff3828b03354a7c43f5a8ed458a7a131b41c7b9/mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e", size = 2221777, upload-time = "2025-02-05T03:50:08.348Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, +] + +[[package]] +name = "opentelemetry-api" +version = "1.39.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "importlib-metadata" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/97/b9/3161be15bb8e3ad01be8be5a968a9237c3027c5be504362ff800fca3e442/opentelemetry_api-1.39.1.tar.gz", hash = "sha256:fbde8c80e1b937a2c61f20347e91c0c18a1940cecf012d62e65a7caf08967c9c", size = 65767, upload-time = "2025-12-11T13:32:39.182Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cf/df/d3f1ddf4bb4cb50ed9b1139cc7b1c54c34a1e7ce8fd1b9a37c0d1551a6bd/opentelemetry_api-1.39.1-py3-none-any.whl", hash = "sha256:2edd8463432a7f8443edce90972169b195e7d6a05500cd29e6d13898187c9950", size = 66356, upload-time = "2025-12-11T13:32:17.304Z" }, +] + +[[package]] +name = "opentelemetry-sdk" +version = "1.39.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "opentelemetry-api" }, + { name = "opentelemetry-semantic-conventions" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/eb/fb/c76080c9ba07e1e8235d24cdcc4d125ef7aa3edf23eb4e497c2e50889adc/opentelemetry_sdk-1.39.1.tar.gz", hash = "sha256:cf4d4563caf7bff906c9f7967e2be22d0d6b349b908be0d90fb21c8e9c995cc6", size = 171460, upload-time = "2025-12-11T13:32:49.369Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7c/98/e91cf858f203d86f4eccdf763dcf01cf03f1dae80c3750f7e635bfa206b6/opentelemetry_sdk-1.39.1-py3-none-any.whl", hash = "sha256:4d5482c478513ecb0a5d938dcc61394e647066e0cc2676bee9f3af3f3f45f01c", size = 132565, upload-time = "2025-12-11T13:32:35.069Z" }, +] + +[[package]] +name = "opentelemetry-semantic-conventions" +version = "0.60b1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "opentelemetry-api" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/91/df/553f93ed38bf22f4b999d9be9c185adb558982214f33eae539d3b5cd0858/opentelemetry_semantic_conventions-0.60b1.tar.gz", hash = "sha256:87c228b5a0669b748c76d76df6c364c369c28f1c465e50f661e39737e84bc953", size = 137935, upload-time = "2025-12-11T13:32:50.487Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7a/5e/5958555e09635d09b75de3c4f8b9cae7335ca545d77392ffe7331534c402/opentelemetry_semantic_conventions-0.60b1-py3-none-any.whl", hash = "sha256:9fa8c8b0c110da289809292b0591220d3a7b53c1526a23021e977d68597893fb", size = 219982, upload-time = "2025-12-11T13:32:36.955Z" }, +] + +[[package]] +name = "packaging" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cf/86/0248f086a84f01b37aaec0fa567b397df1a119f73c16f6c7a9aac73ea309/platformdirs-4.5.1.tar.gz", hash = "sha256:61d5cdcc6065745cdd94f0f878977f8de9437be93de97c1c12f853c9c0cdcbda", size = 21715, upload-time = "2025-12-05T13:52:58.638Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/28/3bfe2fa5a7b9c46fe7e13c97bda14c895fb10fa2ebf1d0abb90e0cea7ee1/platformdirs-4.5.1-py3-none-any.whl", hash = "sha256:d03afa3963c806a9bed9d5125c8f4cb2fdaf74a55ab60e5d59b3fde758104d31", size = 18731, upload-time = "2025-12-05T13:52:56.823Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "propcache" +version = "0.4.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/9e/da/e9fc233cf63743258bff22b3dfa7ea5baef7b5bc324af47a0ad89b8ffc6f/propcache-0.4.1.tar.gz", hash = "sha256:f48107a8c637e80362555f37ecf49abe20370e557cc4ab374f04ec4423c97c3d", size = 46442, upload-time = "2025-10-08T19:49:02.291Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3c/0e/934b541323035566a9af292dba85a195f7b78179114f2c6ebb24551118a9/propcache-0.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7c2d1fa3201efaf55d730400d945b5b3ab6e672e100ba0f9a409d950ab25d7db", size = 79534, upload-time = "2025-10-08T19:46:02.083Z" }, + { url = "https://files.pythonhosted.org/packages/a1/6b/db0d03d96726d995dc7171286c6ba9d8d14251f37433890f88368951a44e/propcache-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1eb2994229cc8ce7fe9b3db88f5465f5fd8651672840b2e426b88cdb1a30aac8", size = 45526, upload-time = "2025-10-08T19:46:03.884Z" }, + { url = "https://files.pythonhosted.org/packages/e4/c3/82728404aea669e1600f304f2609cde9e665c18df5a11cdd57ed73c1dceb/propcache-0.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:66c1f011f45a3b33d7bcb22daed4b29c0c9e2224758b6be00686731e1b46f925", size = 47263, upload-time = "2025-10-08T19:46:05.405Z" }, + { url = "https://files.pythonhosted.org/packages/df/1b/39313ddad2bf9187a1432654c38249bab4562ef535ef07f5eb6eb04d0b1b/propcache-0.4.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9a52009f2adffe195d0b605c25ec929d26b36ef986ba85244891dee3b294df21", size = 201012, upload-time = "2025-10-08T19:46:07.165Z" }, + { url = "https://files.pythonhosted.org/packages/5b/01/f1d0b57d136f294a142acf97f4ed58c8e5b974c21e543000968357115011/propcache-0.4.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5d4e2366a9c7b837555cf02fb9be2e3167d333aff716332ef1b7c3a142ec40c5", size = 209491, upload-time = "2025-10-08T19:46:08.909Z" }, + { url = "https://files.pythonhosted.org/packages/a1/c8/038d909c61c5bb039070b3fb02ad5cccdb1dde0d714792e251cdb17c9c05/propcache-0.4.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:9d2b6caef873b4f09e26ea7e33d65f42b944837563a47a94719cc3544319a0db", size = 215319, upload-time = "2025-10-08T19:46:10.7Z" }, + { url = "https://files.pythonhosted.org/packages/08/57/8c87e93142b2c1fa2408e45695205a7ba05fb5db458c0bf5c06ba0e09ea6/propcache-0.4.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2b16ec437a8c8a965ecf95739448dd938b5c7f56e67ea009f4300d8df05f32b7", size = 196856, upload-time = "2025-10-08T19:46:12.003Z" }, + { url = "https://files.pythonhosted.org/packages/42/df/5615fec76aa561987a534759b3686008a288e73107faa49a8ae5795a9f7a/propcache-0.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:296f4c8ed03ca7476813fe666c9ea97869a8d7aec972618671b33a38a5182ef4", size = 193241, upload-time = "2025-10-08T19:46:13.495Z" }, + { url = "https://files.pythonhosted.org/packages/d5/21/62949eb3a7a54afe8327011c90aca7e03547787a88fb8bd9726806482fea/propcache-0.4.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:1f0978529a418ebd1f49dad413a2b68af33f85d5c5ca5c6ca2a3bed375a7ac60", size = 190552, upload-time = "2025-10-08T19:46:14.938Z" }, + { url = "https://files.pythonhosted.org/packages/30/ee/ab4d727dd70806e5b4de96a798ae7ac6e4d42516f030ee60522474b6b332/propcache-0.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fd138803047fb4c062b1c1dd95462f5209456bfab55c734458f15d11da288f8f", size = 200113, upload-time = "2025-10-08T19:46:16.695Z" }, + { url = "https://files.pythonhosted.org/packages/8a/0b/38b46208e6711b016aa8966a3ac793eee0d05c7159d8342aa27fc0bc365e/propcache-0.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:8c9b3cbe4584636d72ff556d9036e0c9317fa27b3ac1f0f558e7e84d1c9c5900", size = 200778, upload-time = "2025-10-08T19:46:18.023Z" }, + { url = "https://files.pythonhosted.org/packages/cf/81/5abec54355ed344476bee711e9f04815d4b00a311ab0535599204eecc257/propcache-0.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f93243fdc5657247533273ac4f86ae106cc6445a0efacb9a1bfe982fcfefd90c", size = 193047, upload-time = "2025-10-08T19:46:19.449Z" }, + { url = "https://files.pythonhosted.org/packages/ec/b6/1f237c04e32063cb034acd5f6ef34ef3a394f75502e72703545631ab1ef6/propcache-0.4.1-cp310-cp310-win32.whl", hash = "sha256:a0ee98db9c5f80785b266eb805016e36058ac72c51a064040f2bc43b61101cdb", size = 38093, upload-time = "2025-10-08T19:46:20.643Z" }, + { url = "https://files.pythonhosted.org/packages/a6/67/354aac4e0603a15f76439caf0427781bcd6797f370377f75a642133bc954/propcache-0.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:1cdb7988c4e5ac7f6d175a28a9aa0c94cb6f2ebe52756a3c0cda98d2809a9e37", size = 41638, upload-time = "2025-10-08T19:46:21.935Z" }, + { url = "https://files.pythonhosted.org/packages/e0/e1/74e55b9fd1a4c209ff1a9a824bf6c8b3d1fc5a1ac3eabe23462637466785/propcache-0.4.1-cp310-cp310-win_arm64.whl", hash = "sha256:d82ad62b19645419fe79dd63b3f9253e15b30e955c0170e5cebc350c1844e581", size = 38229, upload-time = "2025-10-08T19:46:23.368Z" }, + { url = "https://files.pythonhosted.org/packages/8c/d4/4e2c9aaf7ac2242b9358f98dccd8f90f2605402f5afeff6c578682c2c491/propcache-0.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:60a8fda9644b7dfd5dece8c61d8a85e271cb958075bfc4e01083c148b61a7caf", size = 80208, upload-time = "2025-10-08T19:46:24.597Z" }, + { url = "https://files.pythonhosted.org/packages/c2/21/d7b68e911f9c8e18e4ae43bdbc1e1e9bbd971f8866eb81608947b6f585ff/propcache-0.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c30b53e7e6bda1d547cabb47c825f3843a0a1a42b0496087bb58d8fedf9f41b5", size = 45777, upload-time = "2025-10-08T19:46:25.733Z" }, + { url = "https://files.pythonhosted.org/packages/d3/1d/11605e99ac8ea9435651ee71ab4cb4bf03f0949586246476a25aadfec54a/propcache-0.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6918ecbd897443087a3b7cd978d56546a812517dcaaca51b49526720571fa93e", size = 47647, upload-time = "2025-10-08T19:46:27.304Z" }, + { url = "https://files.pythonhosted.org/packages/58/1a/3c62c127a8466c9c843bccb503d40a273e5cc69838805f322e2826509e0d/propcache-0.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3d902a36df4e5989763425a8ab9e98cd8ad5c52c823b34ee7ef307fd50582566", size = 214929, upload-time = "2025-10-08T19:46:28.62Z" }, + { url = "https://files.pythonhosted.org/packages/56/b9/8fa98f850960b367c4b8fe0592e7fc341daa7a9462e925228f10a60cf74f/propcache-0.4.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a9695397f85973bb40427dedddf70d8dc4a44b22f1650dd4af9eedf443d45165", size = 221778, upload-time = "2025-10-08T19:46:30.358Z" }, + { url = "https://files.pythonhosted.org/packages/46/a6/0ab4f660eb59649d14b3d3d65c439421cf2f87fe5dd68591cbe3c1e78a89/propcache-0.4.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2bb07ffd7eaad486576430c89f9b215f9e4be68c4866a96e97db9e97fead85dc", size = 228144, upload-time = "2025-10-08T19:46:32.607Z" }, + { url = "https://files.pythonhosted.org/packages/52/6a/57f43e054fb3d3a56ac9fc532bc684fc6169a26c75c353e65425b3e56eef/propcache-0.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fd6f30fdcf9ae2a70abd34da54f18da086160e4d7d9251f81f3da0ff84fc5a48", size = 210030, upload-time = "2025-10-08T19:46:33.969Z" }, + { url = "https://files.pythonhosted.org/packages/40/e2/27e6feebb5f6b8408fa29f5efbb765cd54c153ac77314d27e457a3e993b7/propcache-0.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:fc38cba02d1acba4e2869eef1a57a43dfbd3d49a59bf90dda7444ec2be6a5570", size = 208252, upload-time = "2025-10-08T19:46:35.309Z" }, + { url = "https://files.pythonhosted.org/packages/9e/f8/91c27b22ccda1dbc7967f921c42825564fa5336a01ecd72eb78a9f4f53c2/propcache-0.4.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:67fad6162281e80e882fb3ec355398cf72864a54069d060321f6cd0ade95fe85", size = 202064, upload-time = "2025-10-08T19:46:36.993Z" }, + { url = "https://files.pythonhosted.org/packages/f2/26/7f00bd6bd1adba5aafe5f4a66390f243acab58eab24ff1a08bebb2ef9d40/propcache-0.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f10207adf04d08bec185bae14d9606a1444715bc99180f9331c9c02093e1959e", size = 212429, upload-time = "2025-10-08T19:46:38.398Z" }, + { url = "https://files.pythonhosted.org/packages/84/89/fd108ba7815c1117ddca79c228f3f8a15fc82a73bca8b142eb5de13b2785/propcache-0.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:e9b0d8d0845bbc4cfcdcbcdbf5086886bc8157aa963c31c777ceff7846c77757", size = 216727, upload-time = "2025-10-08T19:46:39.732Z" }, + { url = "https://files.pythonhosted.org/packages/79/37/3ec3f7e3173e73f1d600495d8b545b53802cbf35506e5732dd8578db3724/propcache-0.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:981333cb2f4c1896a12f4ab92a9cc8f09ea664e9b7dbdc4eff74627af3a11c0f", size = 205097, upload-time = "2025-10-08T19:46:41.025Z" }, + { url = "https://files.pythonhosted.org/packages/61/b0/b2631c19793f869d35f47d5a3a56fb19e9160d3c119f15ac7344fc3ccae7/propcache-0.4.1-cp311-cp311-win32.whl", hash = "sha256:f1d2f90aeec838a52f1c1a32fe9a619fefd5e411721a9117fbf82aea638fe8a1", size = 38084, upload-time = "2025-10-08T19:46:42.693Z" }, + { url = "https://files.pythonhosted.org/packages/f4/78/6cce448e2098e9f3bfc91bb877f06aa24b6ccace872e39c53b2f707c4648/propcache-0.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:364426a62660f3f699949ac8c621aad6977be7126c5807ce48c0aeb8e7333ea6", size = 41637, upload-time = "2025-10-08T19:46:43.778Z" }, + { url = "https://files.pythonhosted.org/packages/9c/e9/754f180cccd7f51a39913782c74717c581b9cc8177ad0e949f4d51812383/propcache-0.4.1-cp311-cp311-win_arm64.whl", hash = "sha256:e53f3a38d3510c11953f3e6a33f205c6d1b001129f972805ca9b42fc308bc239", size = 38064, upload-time = "2025-10-08T19:46:44.872Z" }, + { url = "https://files.pythonhosted.org/packages/a2/0f/f17b1b2b221d5ca28b4b876e8bb046ac40466513960646bda8e1853cdfa2/propcache-0.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e153e9cd40cc8945138822807139367f256f89c6810c2634a4f6902b52d3b4e2", size = 80061, upload-time = "2025-10-08T19:46:46.075Z" }, + { url = "https://files.pythonhosted.org/packages/76/47/8ccf75935f51448ba9a16a71b783eb7ef6b9ee60f5d14c7f8a8a79fbeed7/propcache-0.4.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cd547953428f7abb73c5ad82cbb32109566204260d98e41e5dfdc682eb7f8403", size = 46037, upload-time = "2025-10-08T19:46:47.23Z" }, + { url = "https://files.pythonhosted.org/packages/0a/b6/5c9a0e42df4d00bfb4a3cbbe5cf9f54260300c88a0e9af1f47ca5ce17ac0/propcache-0.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f048da1b4f243fc44f205dfd320933a951b8d89e0afd4c7cacc762a8b9165207", size = 47324, upload-time = "2025-10-08T19:46:48.384Z" }, + { url = "https://files.pythonhosted.org/packages/9e/d3/6c7ee328b39a81ee877c962469f1e795f9db87f925251efeb0545e0020d0/propcache-0.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ec17c65562a827bba85e3872ead335f95405ea1674860d96483a02f5c698fa72", size = 225505, upload-time = "2025-10-08T19:46:50.055Z" }, + { url = "https://files.pythonhosted.org/packages/01/5d/1c53f4563490b1d06a684742cc6076ef944bc6457df6051b7d1a877c057b/propcache-0.4.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:405aac25c6394ef275dee4c709be43745d36674b223ba4eb7144bf4d691b7367", size = 230242, upload-time = "2025-10-08T19:46:51.815Z" }, + { url = "https://files.pythonhosted.org/packages/20/e1/ce4620633b0e2422207c3cb774a0ee61cac13abc6217763a7b9e2e3f4a12/propcache-0.4.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0013cb6f8dde4b2a2f66903b8ba740bdfe378c943c4377a200551ceb27f379e4", size = 238474, upload-time = "2025-10-08T19:46:53.208Z" }, + { url = "https://files.pythonhosted.org/packages/46/4b/3aae6835b8e5f44ea6a68348ad90f78134047b503765087be2f9912140ea/propcache-0.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:15932ab57837c3368b024473a525e25d316d8353016e7cc0e5ba9eb343fbb1cf", size = 221575, upload-time = "2025-10-08T19:46:54.511Z" }, + { url = "https://files.pythonhosted.org/packages/6e/a5/8a5e8678bcc9d3a1a15b9a29165640d64762d424a16af543f00629c87338/propcache-0.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:031dce78b9dc099f4c29785d9cf5577a3faf9ebf74ecbd3c856a7b92768c3df3", size = 216736, upload-time = "2025-10-08T19:46:56.212Z" }, + { url = "https://files.pythonhosted.org/packages/f1/63/b7b215eddeac83ca1c6b934f89d09a625aa9ee4ba158338854c87210cc36/propcache-0.4.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:ab08df6c9a035bee56e31af99be621526bd237bea9f32def431c656b29e41778", size = 213019, upload-time = "2025-10-08T19:46:57.595Z" }, + { url = "https://files.pythonhosted.org/packages/57/74/f580099a58c8af587cac7ba19ee7cb418506342fbbe2d4a4401661cca886/propcache-0.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4d7af63f9f93fe593afbf104c21b3b15868efb2c21d07d8732c0c4287e66b6a6", size = 220376, upload-time = "2025-10-08T19:46:59.067Z" }, + { url = "https://files.pythonhosted.org/packages/c4/ee/542f1313aff7eaf19c2bb758c5d0560d2683dac001a1c96d0774af799843/propcache-0.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:cfc27c945f422e8b5071b6e93169679e4eb5bf73bbcbf1ba3ae3a83d2f78ebd9", size = 226988, upload-time = "2025-10-08T19:47:00.544Z" }, + { url = "https://files.pythonhosted.org/packages/8f/18/9c6b015dd9c6930f6ce2229e1f02fb35298b847f2087ea2b436a5bfa7287/propcache-0.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:35c3277624a080cc6ec6f847cbbbb5b49affa3598c4535a0a4682a697aaa5c75", size = 215615, upload-time = "2025-10-08T19:47:01.968Z" }, + { url = "https://files.pythonhosted.org/packages/80/9e/e7b85720b98c45a45e1fca6a177024934dc9bc5f4d5dd04207f216fc33ed/propcache-0.4.1-cp312-cp312-win32.whl", hash = "sha256:671538c2262dadb5ba6395e26c1731e1d52534bfe9ae56d0b5573ce539266aa8", size = 38066, upload-time = "2025-10-08T19:47:03.503Z" }, + { url = "https://files.pythonhosted.org/packages/54/09/d19cff2a5aaac632ec8fc03737b223597b1e347416934c1b3a7df079784c/propcache-0.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:cb2d222e72399fcf5890d1d5cc1060857b9b236adff2792ff48ca2dfd46c81db", size = 41655, upload-time = "2025-10-08T19:47:04.973Z" }, + { url = "https://files.pythonhosted.org/packages/68/ab/6b5c191bb5de08036a8c697b265d4ca76148efb10fa162f14af14fb5f076/propcache-0.4.1-cp312-cp312-win_arm64.whl", hash = "sha256:204483131fb222bdaaeeea9f9e6c6ed0cac32731f75dfc1d4a567fc1926477c1", size = 37789, upload-time = "2025-10-08T19:47:06.077Z" }, + { url = "https://files.pythonhosted.org/packages/bf/df/6d9c1b6ac12b003837dde8a10231a7344512186e87b36e855bef32241942/propcache-0.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:43eedf29202c08550aac1d14e0ee619b0430aaef78f85864c1a892294fbc28cf", size = 77750, upload-time = "2025-10-08T19:47:07.648Z" }, + { url = "https://files.pythonhosted.org/packages/8b/e8/677a0025e8a2acf07d3418a2e7ba529c9c33caf09d3c1f25513023c1db56/propcache-0.4.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d62cdfcfd89ccb8de04e0eda998535c406bf5e060ffd56be6c586cbcc05b3311", size = 44780, upload-time = "2025-10-08T19:47:08.851Z" }, + { url = "https://files.pythonhosted.org/packages/89/a4/92380f7ca60f99ebae761936bc48a72a639e8a47b29050615eef757cb2a7/propcache-0.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cae65ad55793da34db5f54e4029b89d3b9b9490d8abe1b4c7ab5d4b8ec7ebf74", size = 46308, upload-time = "2025-10-08T19:47:09.982Z" }, + { url = "https://files.pythonhosted.org/packages/2d/48/c5ac64dee5262044348d1d78a5f85dd1a57464a60d30daee946699963eb3/propcache-0.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:333ddb9031d2704a301ee3e506dc46b1fe5f294ec198ed6435ad5b6a085facfe", size = 208182, upload-time = "2025-10-08T19:47:11.319Z" }, + { url = "https://files.pythonhosted.org/packages/c6/0c/cd762dd011a9287389a6a3eb43aa30207bde253610cca06824aeabfe9653/propcache-0.4.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:fd0858c20f078a32cf55f7e81473d96dcf3b93fd2ccdb3d40fdf54b8573df3af", size = 211215, upload-time = "2025-10-08T19:47:13.146Z" }, + { url = "https://files.pythonhosted.org/packages/30/3e/49861e90233ba36890ae0ca4c660e95df565b2cd15d4a68556ab5865974e/propcache-0.4.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:678ae89ebc632c5c204c794f8dab2837c5f159aeb59e6ed0539500400577298c", size = 218112, upload-time = "2025-10-08T19:47:14.913Z" }, + { url = "https://files.pythonhosted.org/packages/f1/8b/544bc867e24e1bd48f3118cecd3b05c694e160a168478fa28770f22fd094/propcache-0.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d472aeb4fbf9865e0c6d622d7f4d54a4e101a89715d8904282bb5f9a2f476c3f", size = 204442, upload-time = "2025-10-08T19:47:16.277Z" }, + { url = "https://files.pythonhosted.org/packages/50/a6/4282772fd016a76d3e5c0df58380a5ea64900afd836cec2c2f662d1b9bb3/propcache-0.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4d3df5fa7e36b3225954fba85589da77a0fe6a53e3976de39caf04a0db4c36f1", size = 199398, upload-time = "2025-10-08T19:47:17.962Z" }, + { url = "https://files.pythonhosted.org/packages/3e/ec/d8a7cd406ee1ddb705db2139f8a10a8a427100347bd698e7014351c7af09/propcache-0.4.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:ee17f18d2498f2673e432faaa71698032b0127ebf23ae5974eeaf806c279df24", size = 196920, upload-time = "2025-10-08T19:47:19.355Z" }, + { url = "https://files.pythonhosted.org/packages/f6/6c/f38ab64af3764f431e359f8baf9e0a21013e24329e8b85d2da32e8ed07ca/propcache-0.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:580e97762b950f993ae618e167e7be9256b8353c2dcd8b99ec100eb50f5286aa", size = 203748, upload-time = "2025-10-08T19:47:21.338Z" }, + { url = "https://files.pythonhosted.org/packages/d6/e3/fa846bd70f6534d647886621388f0a265254d30e3ce47e5c8e6e27dbf153/propcache-0.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:501d20b891688eb8e7aa903021f0b72d5a55db40ffaab27edefd1027caaafa61", size = 205877, upload-time = "2025-10-08T19:47:23.059Z" }, + { url = "https://files.pythonhosted.org/packages/e2/39/8163fc6f3133fea7b5f2827e8eba2029a0277ab2c5beee6c1db7b10fc23d/propcache-0.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9a0bd56e5b100aef69bd8562b74b46254e7c8812918d3baa700c8a8009b0af66", size = 199437, upload-time = "2025-10-08T19:47:24.445Z" }, + { url = "https://files.pythonhosted.org/packages/93/89/caa9089970ca49c7c01662bd0eeedfe85494e863e8043565aeb6472ce8fe/propcache-0.4.1-cp313-cp313-win32.whl", hash = "sha256:bcc9aaa5d80322bc2fb24bb7accb4a30f81e90ab8d6ba187aec0744bc302ad81", size = 37586, upload-time = "2025-10-08T19:47:25.736Z" }, + { url = "https://files.pythonhosted.org/packages/f5/ab/f76ec3c3627c883215b5c8080debb4394ef5a7a29be811f786415fc1e6fd/propcache-0.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:381914df18634f5494334d201e98245c0596067504b9372d8cf93f4bb23e025e", size = 40790, upload-time = "2025-10-08T19:47:26.847Z" }, + { url = "https://files.pythonhosted.org/packages/59/1b/e71ae98235f8e2ba5004d8cb19765a74877abf189bc53fc0c80d799e56c3/propcache-0.4.1-cp313-cp313-win_arm64.whl", hash = "sha256:8873eb4460fd55333ea49b7d189749ecf6e55bf85080f11b1c4530ed3034cba1", size = 37158, upload-time = "2025-10-08T19:47:27.961Z" }, + { url = "https://files.pythonhosted.org/packages/83/ce/a31bbdfc24ee0dcbba458c8175ed26089cf109a55bbe7b7640ed2470cfe9/propcache-0.4.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:92d1935ee1f8d7442da9c0c4fa7ac20d07e94064184811b685f5c4fada64553b", size = 81451, upload-time = "2025-10-08T19:47:29.445Z" }, + { url = "https://files.pythonhosted.org/packages/25/9c/442a45a470a68456e710d96cacd3573ef26a1d0a60067e6a7d5e655621ed/propcache-0.4.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:473c61b39e1460d386479b9b2f337da492042447c9b685f28be4f74d3529e566", size = 46374, upload-time = "2025-10-08T19:47:30.579Z" }, + { url = "https://files.pythonhosted.org/packages/f4/bf/b1d5e21dbc3b2e889ea4327044fb16312a736d97640fb8b6aa3f9c7b3b65/propcache-0.4.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:c0ef0aaafc66fbd87842a3fe3902fd889825646bc21149eafe47be6072725835", size = 48396, upload-time = "2025-10-08T19:47:31.79Z" }, + { url = "https://files.pythonhosted.org/packages/f4/04/5b4c54a103d480e978d3c8a76073502b18db0c4bc17ab91b3cb5092ad949/propcache-0.4.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95393b4d66bfae908c3ca8d169d5f79cd65636ae15b5e7a4f6e67af675adb0e", size = 275950, upload-time = "2025-10-08T19:47:33.481Z" }, + { url = "https://files.pythonhosted.org/packages/b4/c1/86f846827fb969c4b78b0af79bba1d1ea2156492e1b83dea8b8a6ae27395/propcache-0.4.1-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c07fda85708bc48578467e85099645167a955ba093be0a2dcba962195676e859", size = 273856, upload-time = "2025-10-08T19:47:34.906Z" }, + { url = "https://files.pythonhosted.org/packages/36/1d/fc272a63c8d3bbad6878c336c7a7dea15e8f2d23a544bda43205dfa83ada/propcache-0.4.1-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:af223b406d6d000830c6f65f1e6431783fc3f713ba3e6cc8c024d5ee96170a4b", size = 280420, upload-time = "2025-10-08T19:47:36.338Z" }, + { url = "https://files.pythonhosted.org/packages/07/0c/01f2219d39f7e53d52e5173bcb09c976609ba30209912a0680adfb8c593a/propcache-0.4.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a78372c932c90ee474559c5ddfffd718238e8673c340dc21fe45c5b8b54559a0", size = 263254, upload-time = "2025-10-08T19:47:37.692Z" }, + { url = "https://files.pythonhosted.org/packages/2d/18/cd28081658ce597898f0c4d174d4d0f3c5b6d4dc27ffafeef835c95eb359/propcache-0.4.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:564d9f0d4d9509e1a870c920a89b2fec951b44bf5ba7d537a9e7c1ccec2c18af", size = 261205, upload-time = "2025-10-08T19:47:39.659Z" }, + { url = "https://files.pythonhosted.org/packages/7a/71/1f9e22eb8b8316701c2a19fa1f388c8a3185082607da8e406a803c9b954e/propcache-0.4.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:17612831fda0138059cc5546f4d12a2aacfb9e47068c06af35c400ba58ba7393", size = 247873, upload-time = "2025-10-08T19:47:41.084Z" }, + { url = "https://files.pythonhosted.org/packages/4a/65/3d4b61f36af2b4eddba9def857959f1016a51066b4f1ce348e0cf7881f58/propcache-0.4.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:41a89040cb10bd345b3c1a873b2bf36413d48da1def52f268a055f7398514874", size = 262739, upload-time = "2025-10-08T19:47:42.51Z" }, + { url = "https://files.pythonhosted.org/packages/2a/42/26746ab087faa77c1c68079b228810436ccd9a5ce9ac85e2b7307195fd06/propcache-0.4.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:e35b88984e7fa64aacecea39236cee32dd9bd8c55f57ba8a75cf2399553f9bd7", size = 263514, upload-time = "2025-10-08T19:47:43.927Z" }, + { url = "https://files.pythonhosted.org/packages/94/13/630690fe201f5502d2403dd3cfd451ed8858fe3c738ee88d095ad2ff407b/propcache-0.4.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6f8b465489f927b0df505cbe26ffbeed4d6d8a2bbc61ce90eb074ff129ef0ab1", size = 257781, upload-time = "2025-10-08T19:47:45.448Z" }, + { url = "https://files.pythonhosted.org/packages/92/f7/1d4ec5841505f423469efbfc381d64b7b467438cd5a4bbcbb063f3b73d27/propcache-0.4.1-cp313-cp313t-win32.whl", hash = "sha256:2ad890caa1d928c7c2965b48f3a3815c853180831d0e5503d35cf00c472f4717", size = 41396, upload-time = "2025-10-08T19:47:47.202Z" }, + { url = "https://files.pythonhosted.org/packages/48/f0/615c30622316496d2cbbc29f5985f7777d3ada70f23370608c1d3e081c1f/propcache-0.4.1-cp313-cp313t-win_amd64.whl", hash = "sha256:f7ee0e597f495cf415bcbd3da3caa3bd7e816b74d0d52b8145954c5e6fd3ff37", size = 44897, upload-time = "2025-10-08T19:47:48.336Z" }, + { url = "https://files.pythonhosted.org/packages/fd/ca/6002e46eccbe0e33dcd4069ef32f7f1c9e243736e07adca37ae8c4830ec3/propcache-0.4.1-cp313-cp313t-win_arm64.whl", hash = "sha256:929d7cbe1f01bb7baffb33dc14eb5691c95831450a26354cd210a8155170c93a", size = 39789, upload-time = "2025-10-08T19:47:49.876Z" }, + { url = "https://files.pythonhosted.org/packages/8e/5c/bca52d654a896f831b8256683457ceddd490ec18d9ec50e97dfd8fc726a8/propcache-0.4.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3f7124c9d820ba5548d431afb4632301acf965db49e666aa21c305cbe8c6de12", size = 78152, upload-time = "2025-10-08T19:47:51.051Z" }, + { url = "https://files.pythonhosted.org/packages/65/9b/03b04e7d82a5f54fb16113d839f5ea1ede58a61e90edf515f6577c66fa8f/propcache-0.4.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:c0d4b719b7da33599dfe3b22d3db1ef789210a0597bc650b7cee9c77c2be8c5c", size = 44869, upload-time = "2025-10-08T19:47:52.594Z" }, + { url = "https://files.pythonhosted.org/packages/b2/fa/89a8ef0468d5833a23fff277b143d0573897cf75bd56670a6d28126c7d68/propcache-0.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:9f302f4783709a78240ebc311b793f123328716a60911d667e0c036bc5dcbded", size = 46596, upload-time = "2025-10-08T19:47:54.073Z" }, + { url = "https://files.pythonhosted.org/packages/86/bd/47816020d337f4a746edc42fe8d53669965138f39ee117414c7d7a340cfe/propcache-0.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c80ee5802e3fb9ea37938e7eecc307fb984837091d5fd262bb37238b1ae97641", size = 206981, upload-time = "2025-10-08T19:47:55.715Z" }, + { url = "https://files.pythonhosted.org/packages/df/f6/c5fa1357cc9748510ee55f37173eb31bfde6d94e98ccd9e6f033f2fc06e1/propcache-0.4.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ed5a841e8bb29a55fb8159ed526b26adc5bdd7e8bd7bf793ce647cb08656cdf4", size = 211490, upload-time = "2025-10-08T19:47:57.499Z" }, + { url = "https://files.pythonhosted.org/packages/80/1e/e5889652a7c4a3846683401a48f0f2e5083ce0ec1a8a5221d8058fbd1adf/propcache-0.4.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:55c72fd6ea2da4c318e74ffdf93c4fe4e926051133657459131a95c846d16d44", size = 215371, upload-time = "2025-10-08T19:47:59.317Z" }, + { url = "https://files.pythonhosted.org/packages/b2/f2/889ad4b2408f72fe1a4f6a19491177b30ea7bf1a0fd5f17050ca08cfc882/propcache-0.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8326e144341460402713f91df60ade3c999d601e7eb5ff8f6f7862d54de0610d", size = 201424, upload-time = "2025-10-08T19:48:00.67Z" }, + { url = "https://files.pythonhosted.org/packages/27/73/033d63069b57b0812c8bd19f311faebeceb6ba31b8f32b73432d12a0b826/propcache-0.4.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:060b16ae65bc098da7f6d25bf359f1f31f688384858204fe5d652979e0015e5b", size = 197566, upload-time = "2025-10-08T19:48:02.604Z" }, + { url = "https://files.pythonhosted.org/packages/dc/89/ce24f3dc182630b4e07aa6d15f0ff4b14ed4b9955fae95a0b54c58d66c05/propcache-0.4.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:89eb3fa9524f7bec9de6e83cf3faed9d79bffa560672c118a96a171a6f55831e", size = 193130, upload-time = "2025-10-08T19:48:04.499Z" }, + { url = "https://files.pythonhosted.org/packages/a9/24/ef0d5fd1a811fb5c609278d0209c9f10c35f20581fcc16f818da959fc5b4/propcache-0.4.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:dee69d7015dc235f526fe80a9c90d65eb0039103fe565776250881731f06349f", size = 202625, upload-time = "2025-10-08T19:48:06.213Z" }, + { url = "https://files.pythonhosted.org/packages/f5/02/98ec20ff5546f68d673df2f7a69e8c0d076b5abd05ca882dc7ee3a83653d/propcache-0.4.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:5558992a00dfd54ccbc64a32726a3357ec93825a418a401f5cc67df0ac5d9e49", size = 204209, upload-time = "2025-10-08T19:48:08.432Z" }, + { url = "https://files.pythonhosted.org/packages/a0/87/492694f76759b15f0467a2a93ab68d32859672b646aa8a04ce4864e7932d/propcache-0.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:c9b822a577f560fbd9554812526831712c1436d2c046cedee4c3796d3543b144", size = 197797, upload-time = "2025-10-08T19:48:09.968Z" }, + { url = "https://files.pythonhosted.org/packages/ee/36/66367de3575db1d2d3f3d177432bd14ee577a39d3f5d1b3d5df8afe3b6e2/propcache-0.4.1-cp314-cp314-win32.whl", hash = "sha256:ab4c29b49d560fe48b696cdcb127dd36e0bc2472548f3bf56cc5cb3da2b2984f", size = 38140, upload-time = "2025-10-08T19:48:11.232Z" }, + { url = "https://files.pythonhosted.org/packages/0c/2a/a758b47de253636e1b8aef181c0b4f4f204bf0dd964914fb2af90a95b49b/propcache-0.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:5a103c3eb905fcea0ab98be99c3a9a5ab2de60228aa5aceedc614c0281cf6153", size = 41257, upload-time = "2025-10-08T19:48:12.707Z" }, + { url = "https://files.pythonhosted.org/packages/34/5e/63bd5896c3fec12edcbd6f12508d4890d23c265df28c74b175e1ef9f4f3b/propcache-0.4.1-cp314-cp314-win_arm64.whl", hash = "sha256:74c1fb26515153e482e00177a1ad654721bf9207da8a494a0c05e797ad27b992", size = 38097, upload-time = "2025-10-08T19:48:13.923Z" }, + { url = "https://files.pythonhosted.org/packages/99/85/9ff785d787ccf9bbb3f3106f79884a130951436f58392000231b4c737c80/propcache-0.4.1-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:824e908bce90fb2743bd6b59db36eb4f45cd350a39637c9f73b1c1ea66f5b75f", size = 81455, upload-time = "2025-10-08T19:48:15.16Z" }, + { url = "https://files.pythonhosted.org/packages/90/85/2431c10c8e7ddb1445c1f7c4b54d886e8ad20e3c6307e7218f05922cad67/propcache-0.4.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:c2b5e7db5328427c57c8e8831abda175421b709672f6cfc3d630c3b7e2146393", size = 46372, upload-time = "2025-10-08T19:48:16.424Z" }, + { url = "https://files.pythonhosted.org/packages/01/20/b0972d902472da9bcb683fa595099911f4d2e86e5683bcc45de60dd05dc3/propcache-0.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6f6ff873ed40292cd4969ef5310179afd5db59fdf055897e282485043fc80ad0", size = 48411, upload-time = "2025-10-08T19:48:17.577Z" }, + { url = "https://files.pythonhosted.org/packages/e2/e3/7dc89f4f21e8f99bad3d5ddb3a3389afcf9da4ac69e3deb2dcdc96e74169/propcache-0.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49a2dc67c154db2c1463013594c458881a069fcf98940e61a0569016a583020a", size = 275712, upload-time = "2025-10-08T19:48:18.901Z" }, + { url = "https://files.pythonhosted.org/packages/20/67/89800c8352489b21a8047c773067644e3897f02ecbbd610f4d46b7f08612/propcache-0.4.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:005f08e6a0529984491e37d8dbc3dd86f84bd78a8ceb5fa9a021f4c48d4984be", size = 273557, upload-time = "2025-10-08T19:48:20.762Z" }, + { url = "https://files.pythonhosted.org/packages/e2/a1/b52b055c766a54ce6d9c16d9aca0cad8059acd9637cdf8aa0222f4a026ef/propcache-0.4.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5c3310452e0d31390da9035c348633b43d7e7feb2e37be252be6da45abd1abcc", size = 280015, upload-time = "2025-10-08T19:48:22.592Z" }, + { url = "https://files.pythonhosted.org/packages/48/c8/33cee30bd890672c63743049f3c9e4be087e6780906bfc3ec58528be59c1/propcache-0.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4c3c70630930447f9ef1caac7728c8ad1c56bc5015338b20fed0d08ea2480b3a", size = 262880, upload-time = "2025-10-08T19:48:23.947Z" }, + { url = "https://files.pythonhosted.org/packages/0c/b1/8f08a143b204b418285c88b83d00edbd61afbc2c6415ffafc8905da7038b/propcache-0.4.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8e57061305815dfc910a3634dcf584f08168a8836e6999983569f51a8544cd89", size = 260938, upload-time = "2025-10-08T19:48:25.656Z" }, + { url = "https://files.pythonhosted.org/packages/cf/12/96e4664c82ca2f31e1c8dff86afb867348979eb78d3cb8546a680287a1e9/propcache-0.4.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:521a463429ef54143092c11a77e04056dd00636f72e8c45b70aaa3140d639726", size = 247641, upload-time = "2025-10-08T19:48:27.207Z" }, + { url = "https://files.pythonhosted.org/packages/18/ed/e7a9cfca28133386ba52278136d42209d3125db08d0a6395f0cba0c0285c/propcache-0.4.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:120c964da3fdc75e3731aa392527136d4ad35868cc556fd09bb6d09172d9a367", size = 262510, upload-time = "2025-10-08T19:48:28.65Z" }, + { url = "https://files.pythonhosted.org/packages/f5/76/16d8bf65e8845dd62b4e2b57444ab81f07f40caa5652b8969b87ddcf2ef6/propcache-0.4.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:d8f353eb14ee3441ee844ade4277d560cdd68288838673273b978e3d6d2c8f36", size = 263161, upload-time = "2025-10-08T19:48:30.133Z" }, + { url = "https://files.pythonhosted.org/packages/e7/70/c99e9edb5d91d5ad8a49fa3c1e8285ba64f1476782fed10ab251ff413ba1/propcache-0.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ab2943be7c652f09638800905ee1bab2c544e537edb57d527997a24c13dc1455", size = 257393, upload-time = "2025-10-08T19:48:31.567Z" }, + { url = "https://files.pythonhosted.org/packages/08/02/87b25304249a35c0915d236575bc3574a323f60b47939a2262b77632a3ee/propcache-0.4.1-cp314-cp314t-win32.whl", hash = "sha256:05674a162469f31358c30bcaa8883cb7829fa3110bf9c0991fe27d7896c42d85", size = 42546, upload-time = "2025-10-08T19:48:32.872Z" }, + { url = "https://files.pythonhosted.org/packages/cb/ef/3c6ecf8b317aa982f309835e8f96987466123c6e596646d4e6a1dfcd080f/propcache-0.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:990f6b3e2a27d683cb7602ed6c86f15ee6b43b1194736f9baaeb93d0016633b1", size = 46259, upload-time = "2025-10-08T19:48:34.226Z" }, + { url = "https://files.pythonhosted.org/packages/c4/2d/346e946d4951f37eca1e4f55be0f0174c52cd70720f84029b02f296f4a38/propcache-0.4.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ecef2343af4cc68e05131e45024ba34f6095821988a9d0a02aa7c73fcc448aa9", size = 40428, upload-time = "2025-10-08T19:48:35.441Z" }, + { url = "https://files.pythonhosted.org/packages/5b/5a/bc7b4a4ef808fa59a816c17b20c4bef6884daebbdf627ff2a161da67da19/propcache-0.4.1-py3-none-any.whl", hash = "sha256:af2a6052aeb6cf17d3e46ee169099044fd8224cbaf75c76a2ef596e8163e2237", size = 13305, upload-time = "2025-10-08T19:49:00.792Z" }, +] + +[[package]] +name = "pyasn1" +version = "0.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ba/e9/01f1a64245b89f039897cb0130016d79f77d52669aae6ee7b159a6c4c018/pyasn1-0.6.1.tar.gz", hash = "sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034", size = 145322, upload-time = "2024-09-10T22:41:42.55Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c8/f1/d6a797abb14f6283c0ddff96bbdd46937f64122b8c925cab503dd37f8214/pyasn1-0.6.1-py3-none-any.whl", hash = "sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629", size = 83135, upload-time = "2024-09-11T16:00:36.122Z" }, +] + +[[package]] +name = "pyasn1-modules" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyasn1" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e9/e6/78ebbb10a8c8e4b61a59249394a4a594c1a7af95593dc933a349c8d00964/pyasn1_modules-0.4.2.tar.gz", hash = "sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6", size = 307892, upload-time = "2025-03-28T02:41:22.17Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/47/8d/d529b5d697919ba8c11ad626e835d4039be708a35b0d22de83a269a6682c/pyasn1_modules-0.4.2-py3-none-any.whl", hash = "sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a", size = 181259, upload-time = "2025-03-28T02:41:19.028Z" }, +] + +[[package]] +name = "pycparser" +version = "2.23" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fe/cf/d2d3b9f5699fb1e4615c8e32ff220203e43b248e1dfcc6736ad9057731ca/pycparser-2.23.tar.gz", hash = "sha256:78816d4f24add8f10a06d6f05b4d424ad9e96cfebf68a4ddc99c65c0720d00c2", size = 173734, upload-time = "2025-09-09T13:23:47.91Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/e3/59cd50310fc9b59512193629e1984c1f95e5c8ae6e5d8c69532ccc65a7fe/pycparser-2.23-py3-none-any.whl", hash = "sha256:e5c6e8d3fbad53479cab09ac03729e0a9faf2bee3db8208a550daf5af81a5934", size = 118140, upload-time = "2025-09-09T13:23:46.651Z" }, +] + +[[package]] +name = "pydantic" +version = "2.12.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.41.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c6/90/32c9941e728d564b411d574d8ee0cf09b12ec978cb22b294995bae5549a5/pydantic_core-2.41.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:77b63866ca88d804225eaa4af3e664c5faf3568cea95360d21f4725ab6e07146", size = 2107298, upload-time = "2025-11-04T13:39:04.116Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a8/61c96a77fe28993d9a6fb0f4127e05430a267b235a124545d79fea46dd65/pydantic_core-2.41.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dfa8a0c812ac681395907e71e1274819dec685fec28273a28905df579ef137e2", size = 1901475, upload-time = "2025-11-04T13:39:06.055Z" }, + { url = "https://files.pythonhosted.org/packages/5d/b6/338abf60225acc18cdc08b4faef592d0310923d19a87fba1faf05af5346e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5921a4d3ca3aee735d9fd163808f5e8dd6c6972101e4adbda9a4667908849b97", size = 1918815, upload-time = "2025-11-04T13:39:10.41Z" }, + { url = "https://files.pythonhosted.org/packages/d1/1c/2ed0433e682983d8e8cba9c8d8ef274d4791ec6a6f24c58935b90e780e0a/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e25c479382d26a2a41b7ebea1043564a937db462816ea07afa8a44c0866d52f9", size = 2065567, upload-time = "2025-11-04T13:39:12.244Z" }, + { url = "https://files.pythonhosted.org/packages/b3/24/cf84974ee7d6eae06b9e63289b7b8f6549d416b5c199ca2d7ce13bbcf619/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f547144f2966e1e16ae626d8ce72b4cfa0caedc7fa28052001c94fb2fcaa1c52", size = 2230442, upload-time = "2025-11-04T13:39:13.962Z" }, + { url = "https://files.pythonhosted.org/packages/fd/21/4e287865504b3edc0136c89c9c09431be326168b1eb7841911cbc877a995/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f52298fbd394f9ed112d56f3d11aabd0d5bd27beb3084cc3d8ad069483b8941", size = 2350956, upload-time = "2025-11-04T13:39:15.889Z" }, + { url = "https://files.pythonhosted.org/packages/a8/76/7727ef2ffa4b62fcab916686a68a0426b9b790139720e1934e8ba797e238/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:100baa204bb412b74fe285fb0f3a385256dad1d1879f0a5cb1499ed2e83d132a", size = 2068253, upload-time = "2025-11-04T13:39:17.403Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8c/a4abfc79604bcb4c748e18975c44f94f756f08fb04218d5cb87eb0d3a63e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:05a2c8852530ad2812cb7914dc61a1125dc4e06252ee98e5638a12da6cc6fb6c", size = 2177050, upload-time = "2025-11-04T13:39:19.351Z" }, + { url = "https://files.pythonhosted.org/packages/67/b1/de2e9a9a79b480f9cb0b6e8b6ba4c50b18d4e89852426364c66aa82bb7b3/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:29452c56df2ed968d18d7e21f4ab0ac55e71dc59524872f6fc57dcf4a3249ed2", size = 2147178, upload-time = "2025-11-04T13:39:21Z" }, + { url = "https://files.pythonhosted.org/packages/16/c1/dfb33f837a47b20417500efaa0378adc6635b3c79e8369ff7a03c494b4ac/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:d5160812ea7a8a2ffbe233d8da666880cad0cbaf5d4de74ae15c313213d62556", size = 2341833, upload-time = "2025-11-04T13:39:22.606Z" }, + { url = "https://files.pythonhosted.org/packages/47/36/00f398642a0f4b815a9a558c4f1dca1b4020a7d49562807d7bc9ff279a6c/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:df3959765b553b9440adfd3c795617c352154e497a4eaf3752555cfb5da8fc49", size = 2321156, upload-time = "2025-11-04T13:39:25.843Z" }, + { url = "https://files.pythonhosted.org/packages/7e/70/cad3acd89fde2010807354d978725ae111ddf6d0ea46d1ea1775b5c1bd0c/pydantic_core-2.41.5-cp310-cp310-win32.whl", hash = "sha256:1f8d33a7f4d5a7889e60dc39856d76d09333d8a6ed0f5f1190635cbec70ec4ba", size = 1989378, upload-time = "2025-11-04T13:39:27.92Z" }, + { url = "https://files.pythonhosted.org/packages/76/92/d338652464c6c367e5608e4488201702cd1cbb0f33f7b6a85a60fe5f3720/pydantic_core-2.41.5-cp310-cp310-win_amd64.whl", hash = "sha256:62de39db01b8d593e45871af2af9e497295db8d73b085f6bfd0b18c83c70a8f9", size = 2013622, upload-time = "2025-11-04T13:39:29.848Z" }, + { url = "https://files.pythonhosted.org/packages/e8/72/74a989dd9f2084b3d9530b0915fdda64ac48831c30dbf7c72a41a5232db8/pydantic_core-2.41.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a3a52f6156e73e7ccb0f8cced536adccb7042be67cb45f9562e12b319c119da6", size = 2105873, upload-time = "2025-11-04T13:39:31.373Z" }, + { url = "https://files.pythonhosted.org/packages/12/44/37e403fd9455708b3b942949e1d7febc02167662bf1a7da5b78ee1ea2842/pydantic_core-2.41.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7f3bf998340c6d4b0c9a2f02d6a400e51f123b59565d74dc60d252ce888c260b", size = 1899826, upload-time = "2025-11-04T13:39:32.897Z" }, + { url = "https://files.pythonhosted.org/packages/33/7f/1d5cab3ccf44c1935a359d51a8a2a9e1a654b744b5e7f80d41b88d501eec/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:378bec5c66998815d224c9ca994f1e14c0c21cb95d2f52b6021cc0b2a58f2a5a", size = 1917869, upload-time = "2025-11-04T13:39:34.469Z" }, + { url = "https://files.pythonhosted.org/packages/6e/6a/30d94a9674a7fe4f4744052ed6c5e083424510be1e93da5bc47569d11810/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b576130c69225432866fe2f4a469a85a54ade141d96fd396dffcf607b558f8", size = 2063890, upload-time = "2025-11-04T13:39:36.053Z" }, + { url = "https://files.pythonhosted.org/packages/50/be/76e5d46203fcb2750e542f32e6c371ffa9b8ad17364cf94bb0818dbfb50c/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6cb58b9c66f7e4179a2d5e0f849c48eff5c1fca560994d6eb6543abf955a149e", size = 2229740, upload-time = "2025-11-04T13:39:37.753Z" }, + { url = "https://files.pythonhosted.org/packages/d3/ee/fed784df0144793489f87db310a6bbf8118d7b630ed07aa180d6067e653a/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88942d3a3dff3afc8288c21e565e476fc278902ae4d6d134f1eeda118cc830b1", size = 2350021, upload-time = "2025-11-04T13:39:40.94Z" }, + { url = "https://files.pythonhosted.org/packages/c8/be/8fed28dd0a180dca19e72c233cbf58efa36df055e5b9d90d64fd1740b828/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f31d95a179f8d64d90f6831d71fa93290893a33148d890ba15de25642c5d075b", size = 2066378, upload-time = "2025-11-04T13:39:42.523Z" }, + { url = "https://files.pythonhosted.org/packages/b0/3b/698cf8ae1d536a010e05121b4958b1257f0b5522085e335360e53a6b1c8b/pydantic_core-2.41.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c1df3d34aced70add6f867a8cf413e299177e0c22660cc767218373d0779487b", size = 2175761, upload-time = "2025-11-04T13:39:44.553Z" }, + { url = "https://files.pythonhosted.org/packages/b8/ba/15d537423939553116dea94ce02f9c31be0fa9d0b806d427e0308ec17145/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4009935984bd36bd2c774e13f9a09563ce8de4abaa7226f5108262fa3e637284", size = 2146303, upload-time = "2025-11-04T13:39:46.238Z" }, + { url = "https://files.pythonhosted.org/packages/58/7f/0de669bf37d206723795f9c90c82966726a2ab06c336deba4735b55af431/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:34a64bc3441dc1213096a20fe27e8e128bd3ff89921706e83c0b1ac971276594", size = 2340355, upload-time = "2025-11-04T13:39:48.002Z" }, + { url = "https://files.pythonhosted.org/packages/e5/de/e7482c435b83d7e3c3ee5ee4451f6e8973cff0eb6007d2872ce6383f6398/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c9e19dd6e28fdcaa5a1de679aec4141f691023916427ef9bae8584f9c2fb3b0e", size = 2319875, upload-time = "2025-11-04T13:39:49.705Z" }, + { url = "https://files.pythonhosted.org/packages/fe/e6/8c9e81bb6dd7560e33b9053351c29f30c8194b72f2d6932888581f503482/pydantic_core-2.41.5-cp311-cp311-win32.whl", hash = "sha256:2c010c6ded393148374c0f6f0bf89d206bf3217f201faa0635dcd56bd1520f6b", size = 1987549, upload-time = "2025-11-04T13:39:51.842Z" }, + { url = "https://files.pythonhosted.org/packages/11/66/f14d1d978ea94d1bc21fc98fcf570f9542fe55bfcc40269d4e1a21c19bf7/pydantic_core-2.41.5-cp311-cp311-win_amd64.whl", hash = "sha256:76ee27c6e9c7f16f47db7a94157112a2f3a00e958bc626e2f4ee8bec5c328fbe", size = 2011305, upload-time = "2025-11-04T13:39:53.485Z" }, + { url = "https://files.pythonhosted.org/packages/56/d8/0e271434e8efd03186c5386671328154ee349ff0354d83c74f5caaf096ed/pydantic_core-2.41.5-cp311-cp311-win_arm64.whl", hash = "sha256:4bc36bbc0b7584de96561184ad7f012478987882ebf9f9c389b23f432ea3d90f", size = 1972902, upload-time = "2025-11-04T13:39:56.488Z" }, + { url = "https://files.pythonhosted.org/packages/5f/5d/5f6c63eebb5afee93bcaae4ce9a898f3373ca23df3ccaef086d0233a35a7/pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7", size = 2110990, upload-time = "2025-11-04T13:39:58.079Z" }, + { url = "https://files.pythonhosted.org/packages/aa/32/9c2e8ccb57c01111e0fd091f236c7b371c1bccea0fa85247ac55b1e2b6b6/pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0", size = 1896003, upload-time = "2025-11-04T13:39:59.956Z" }, + { url = "https://files.pythonhosted.org/packages/68/b8/a01b53cb0e59139fbc9e4fda3e9724ede8de279097179be4ff31f1abb65a/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69", size = 1919200, upload-time = "2025-11-04T13:40:02.241Z" }, + { url = "https://files.pythonhosted.org/packages/38/de/8c36b5198a29bdaade07b5985e80a233a5ac27137846f3bc2d3b40a47360/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75", size = 2052578, upload-time = "2025-11-04T13:40:04.401Z" }, + { url = "https://files.pythonhosted.org/packages/00/b5/0e8e4b5b081eac6cb3dbb7e60a65907549a1ce035a724368c330112adfdd/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05", size = 2208504, upload-time = "2025-11-04T13:40:06.072Z" }, + { url = "https://files.pythonhosted.org/packages/77/56/87a61aad59c7c5b9dc8caad5a41a5545cba3810c3e828708b3d7404f6cef/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc", size = 2335816, upload-time = "2025-11-04T13:40:07.835Z" }, + { url = "https://files.pythonhosted.org/packages/0d/76/941cc9f73529988688a665a5c0ecff1112b3d95ab48f81db5f7606f522d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c", size = 2075366, upload-time = "2025-11-04T13:40:09.804Z" }, + { url = "https://files.pythonhosted.org/packages/d3/43/ebef01f69baa07a482844faaa0a591bad1ef129253ffd0cdaa9d8a7f72d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5", size = 2171698, upload-time = "2025-11-04T13:40:12.004Z" }, + { url = "https://files.pythonhosted.org/packages/b1/87/41f3202e4193e3bacfc2c065fab7706ebe81af46a83d3e27605029c1f5a6/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c", size = 2132603, upload-time = "2025-11-04T13:40:13.868Z" }, + { url = "https://files.pythonhosted.org/packages/49/7d/4c00df99cb12070b6bccdef4a195255e6020a550d572768d92cc54dba91a/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294", size = 2329591, upload-time = "2025-11-04T13:40:15.672Z" }, + { url = "https://files.pythonhosted.org/packages/cc/6a/ebf4b1d65d458f3cda6a7335d141305dfa19bdc61140a884d165a8a1bbc7/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1", size = 2319068, upload-time = "2025-11-04T13:40:17.532Z" }, + { url = "https://files.pythonhosted.org/packages/49/3b/774f2b5cd4192d5ab75870ce4381fd89cf218af999515baf07e7206753f0/pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d", size = 1985908, upload-time = "2025-11-04T13:40:19.309Z" }, + { url = "https://files.pythonhosted.org/packages/86/45/00173a033c801cacf67c190fef088789394feaf88a98a7035b0e40d53dc9/pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815", size = 2020145, upload-time = "2025-11-04T13:40:21.548Z" }, + { url = "https://files.pythonhosted.org/packages/f9/22/91fbc821fa6d261b376a3f73809f907cec5ca6025642c463d3488aad22fb/pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3", size = 1976179, upload-time = "2025-11-04T13:40:23.393Z" }, + { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" }, + { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" }, + { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" }, + { url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" }, + { url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" }, + { url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" }, + { url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" }, + { url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" }, + { url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" }, + { url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" }, + { url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" }, + { url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" }, + { url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" }, + { url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" }, + { url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" }, + { url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" }, + { url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" }, + { url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" }, + { url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" }, + { url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" }, + { url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" }, + { url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" }, + { url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" }, + { url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" }, + { url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" }, + { url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" }, + { url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" }, + { url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" }, + { url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" }, + { url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" }, + { url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" }, + { url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" }, + { url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" }, + { url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" }, + { url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" }, + { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" }, + { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" }, + { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" }, + { url = "https://files.pythonhosted.org/packages/11/72/90fda5ee3b97e51c494938a4a44c3a35a9c96c19bba12372fb9c634d6f57/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:b96d5f26b05d03cc60f11a7761a5ded1741da411e7fe0909e27a5e6a0cb7b034", size = 2115441, upload-time = "2025-11-04T13:42:39.557Z" }, + { url = "https://files.pythonhosted.org/packages/1f/53/8942f884fa33f50794f119012dc6a1a02ac43a56407adaac20463df8e98f/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:634e8609e89ceecea15e2d61bc9ac3718caaaa71963717bf3c8f38bfde64242c", size = 1930291, upload-time = "2025-11-04T13:42:42.169Z" }, + { url = "https://files.pythonhosted.org/packages/79/c8/ecb9ed9cd942bce09fc888ee960b52654fbdbede4ba6c2d6e0d3b1d8b49c/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93e8740d7503eb008aa2df04d3b9735f845d43ae845e6dcd2be0b55a2da43cd2", size = 1948632, upload-time = "2025-11-04T13:42:44.564Z" }, + { url = "https://files.pythonhosted.org/packages/2e/1b/687711069de7efa6af934e74f601e2a4307365e8fdc404703afc453eab26/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15489ba13d61f670dcc96772e733aad1a6f9c429cc27574c6cdaed82d0146ad", size = 2138905, upload-time = "2025-11-04T13:42:47.156Z" }, + { url = "https://files.pythonhosted.org/packages/09/32/59b0c7e63e277fa7911c2fc70ccfb45ce4b98991e7ef37110663437005af/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd", size = 2110495, upload-time = "2025-11-04T13:42:49.689Z" }, + { url = "https://files.pythonhosted.org/packages/aa/81/05e400037eaf55ad400bcd318c05bb345b57e708887f07ddb2d20e3f0e98/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc", size = 1915388, upload-time = "2025-11-04T13:42:52.215Z" }, + { url = "https://files.pythonhosted.org/packages/6e/0d/e3549b2399f71d56476b77dbf3cf8937cec5cd70536bdc0e374a421d0599/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56", size = 1942879, upload-time = "2025-11-04T13:42:56.483Z" }, + { url = "https://files.pythonhosted.org/packages/f7/07/34573da085946b6a313d7c42f82f16e8920bfd730665de2d11c0c37a74b5/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b", size = 2139017, upload-time = "2025-11-04T13:42:59.471Z" }, + { url = "https://files.pythonhosted.org/packages/e6/b0/1a2aa41e3b5a4ba11420aba2d091b2d17959c8d1519ece3627c371951e73/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b5819cd790dbf0c5eb9f82c73c16b39a65dd6dd4d1439dcdea7816ec9adddab8", size = 2103351, upload-time = "2025-11-04T13:43:02.058Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ee/31b1f0020baaf6d091c87900ae05c6aeae101fa4e188e1613c80e4f1ea31/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:5a4e67afbc95fa5c34cf27d9089bca7fcab4e51e57278d710320a70b956d1b9a", size = 1925363, upload-time = "2025-11-04T13:43:05.159Z" }, + { url = "https://files.pythonhosted.org/packages/e1/89/ab8e86208467e467a80deaca4e434adac37b10a9d134cd2f99b28a01e483/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ece5c59f0ce7d001e017643d8d24da587ea1f74f6993467d85ae8a5ef9d4f42b", size = 2135615, upload-time = "2025-11-04T13:43:08.116Z" }, + { url = "https://files.pythonhosted.org/packages/99/0a/99a53d06dd0348b2008f2f30884b34719c323f16c3be4e6cc1203b74a91d/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16f80f7abe3351f8ea6858914ddc8c77e02578544a0ebc15b4c2e1a0e813b0b2", size = 2175369, upload-time = "2025-11-04T13:43:12.49Z" }, + { url = "https://files.pythonhosted.org/packages/6d/94/30ca3b73c6d485b9bb0bc66e611cff4a7138ff9736b7e66bcf0852151636/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:33cb885e759a705b426baada1fe68cbb0a2e68e34c5d0d0289a364cf01709093", size = 2144218, upload-time = "2025-11-04T13:43:15.431Z" }, + { url = "https://files.pythonhosted.org/packages/87/57/31b4f8e12680b739a91f472b5671294236b82586889ef764b5fbc6669238/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:c8d8b4eb992936023be7dee581270af5c6e0697a8559895f527f5b7105ecd36a", size = 2329951, upload-time = "2025-11-04T13:43:18.062Z" }, + { url = "https://files.pythonhosted.org/packages/7d/73/3c2c8edef77b8f7310e6fb012dbc4b8551386ed575b9eb6fb2506e28a7eb/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:242a206cd0318f95cd21bdacff3fcc3aab23e79bba5cac3db5a841c9ef9c6963", size = 2318428, upload-time = "2025-11-04T13:43:20.679Z" }, + { url = "https://files.pythonhosted.org/packages/2f/02/8559b1f26ee0d502c74f9cca5c0d2fd97e967e083e006bbbb4e97f3a043a/pydantic_core-2.41.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d3a978c4f57a597908b7e697229d996d77a6d3c94901e9edee593adada95ce1a", size = 2147009, upload-time = "2025-11-04T13:43:23.286Z" }, + { url = "https://files.pythonhosted.org/packages/5f/9b/1b3f0e9f9305839d7e84912f9e8bfbd191ed1b1ef48083609f0dabde978c/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b2379fa7ed44ddecb5bfe4e48577d752db9fc10be00a6b7446e9663ba143de26", size = 2101980, upload-time = "2025-11-04T13:43:25.97Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ed/d71fefcb4263df0da6a85b5d8a7508360f2f2e9b3bf5814be9c8bccdccc1/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:266fb4cbf5e3cbd0b53669a6d1b039c45e3ce651fd5442eff4d07c2cc8d66808", size = 1923865, upload-time = "2025-11-04T13:43:28.763Z" }, + { url = "https://files.pythonhosted.org/packages/ce/3a/626b38db460d675f873e4444b4bb030453bbe7b4ba55df821d026a0493c4/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58133647260ea01e4d0500089a8c4f07bd7aa6ce109682b1426394988d8aaacc", size = 2134256, upload-time = "2025-11-04T13:43:31.71Z" }, + { url = "https://files.pythonhosted.org/packages/83/d9/8412d7f06f616bbc053d30cb4e5f76786af3221462ad5eee1f202021eb4e/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:287dad91cfb551c363dc62899a80e9e14da1f0e2b6ebde82c806612ca2a13ef1", size = 2174762, upload-time = "2025-11-04T13:43:34.744Z" }, + { url = "https://files.pythonhosted.org/packages/55/4c/162d906b8e3ba3a99354e20faa1b49a85206c47de97a639510a0e673f5da/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:03b77d184b9eb40240ae9fd676ca364ce1085f203e1b1256f8ab9984dca80a84", size = 2143141, upload-time = "2025-11-04T13:43:37.701Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f2/f11dd73284122713f5f89fc940f370d035fa8e1e078d446b3313955157fe/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:a668ce24de96165bb239160b3d854943128f4334822900534f2fe947930e5770", size = 2330317, upload-time = "2025-11-04T13:43:40.406Z" }, + { url = "https://files.pythonhosted.org/packages/88/9d/b06ca6acfe4abb296110fb1273a4d848a0bfb2ff65f3ee92127b3244e16b/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f14f8f046c14563f8eb3f45f499cc658ab8d10072961e07225e507adb700e93f", size = 2316992, upload-time = "2025-11-04T13:43:43.602Z" }, + { url = "https://files.pythonhosted.org/packages/36/c7/cfc8e811f061c841d7990b0201912c3556bfeb99cdcb7ed24adc8d6f8704/pydantic_core-2.41.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56121965f7a4dc965bff783d70b907ddf3d57f6eba29b6d2e5dabfaf07799c51", size = 2145302, upload-time = "2025-11-04T13:43:46.64Z" }, +] + +[[package]] +name = "pydantic-settings" +version = "2.12.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/4b/ac7e0aae12027748076d72a8764ff1c9d82ca75a7a52622e67ed3f765c54/pydantic_settings-2.12.0.tar.gz", hash = "sha256:005538ef951e3c2a68e1c08b292b5f2e71490def8589d4221b95dab00dafcfd0", size = 194184, upload-time = "2025-11-10T14:25:47.013Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c1/60/5d4751ba3f4a40a6891f24eec885f51afd78d208498268c734e256fb13c4/pydantic_settings-2.12.0-py3-none-any.whl", hash = "sha256:fddb9fd99a5b18da837b29710391e945b1e30c135477f484084ee513adb93809", size = 51880, upload-time = "2025-11-10T14:25:45.546Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "pyjwt" +version = "2.10.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e7/46/bd74733ff231675599650d3e47f361794b22ef3e3770998dda30d3b63726/pyjwt-2.10.1.tar.gz", hash = "sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953", size = 87785, upload-time = "2024-11-28T03:43:29.933Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/61/ad/689f02752eeec26aed679477e80e632ef1b682313be70793d798c1d5fc8f/PyJWT-2.10.1-py3-none-any.whl", hash = "sha256:dcdd193e30abefd5debf142f9adfcdd2b58004e644f25406ffaebd50bd98dacb", size = 22997, upload-time = "2024-11-28T03:43:27.893Z" }, +] + +[package.optional-dependencies] +crypto = [ + { name = "cryptography" }, +] + +[[package]] +name = "pylint" +version = "3.2.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "astroid" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "dill" }, + { name = "isort" }, + { name = "mccabe" }, + { name = "platformdirs" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "tomlkit" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9a/e9/60280b14cc1012794120345ce378504cf17409e38cd88f455dc24e0ad6b5/pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60", size = 1506739, upload-time = "2024-06-06T14:19:17.955Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/d3/d346f779cbc9384d8b805a7557b5f2b8ee9f842bffebec9fc6364d6ae183/pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8", size = 519244, upload-time = "2024-06-06T14:19:13.228Z" }, +] + +[[package]] +name = "pyright" +version = "1.1.407" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nodeenv" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a6/1b/0aa08ee42948b61745ac5b5b5ccaec4669e8884b53d31c8ec20b2fcd6b6f/pyright-1.1.407.tar.gz", hash = "sha256:099674dba5c10489832d4a4b2d302636152a9a42d317986c38474c76fe562262", size = 4122872, upload-time = "2025-10-24T23:17:15.145Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/93/b69052907d032b00c40cb656d21438ec00b3a471733de137a3f65a49a0a0/pyright-1.1.407-py3-none-any.whl", hash = "sha256:6dd419f54fcc13f03b52285796d65e639786373f433e243f8b94cf93a7444d21", size = 5997008, upload-time = "2025-10-24T23:17:13.159Z" }, +] + +[[package]] +name = "pytest" +version = "8.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "0.23.8" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/de/b4/0b378b7bf26a8ae161c3890c0b48a91a04106c5713ce81b4b080ea2f4f18/pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3", size = 46920, upload-time = "2024-07-17T17:39:34.617Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ee/82/62e2d63639ecb0fbe8a7ee59ef0bc69a4669ec50f6d3459f74ad4e4189a2/pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2", size = 17663, upload-time = "2024-07-17T17:39:32.478Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "python-dotenv" +version = "1.2.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f0/26/19cadc79a718c5edbec86fd4919a6b6d3f681039a2f6d66d14be94e75fb9/python_dotenv-1.2.1.tar.gz", hash = "sha256:42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6", size = 44221, upload-time = "2025-10-26T15:12:10.434Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/1b/a298b06749107c305e1fe0f814c6c74aea7b2f1e10989cb30f544a1b3253/python_dotenv-1.2.1-py3-none-any.whl", hash = "sha256:b81ee9561e9ca4004139c6cbba3a238c32b03e4894671e181b671e8cb8425d61", size = 21230, upload-time = "2025-10-26T15:12:09.109Z" }, +] + +[[package]] +name = "python-multipart" +version = "0.0.21" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/78/96/804520d0850c7db98e5ccb70282e29208723f0964e88ffd9d0da2f52ea09/python_multipart-0.0.21.tar.gz", hash = "sha256:7137ebd4d3bbf70ea1622998f902b97a29434a9e8dc40eb203bbcf7c2a2cba92", size = 37196, upload-time = "2025-12-17T09:24:22.446Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/aa/76/03af049af4dcee5d27442f71b6924f01f3efb5d2bd34f23fcd563f2cc5f5/python_multipart-0.0.21-py3-none-any.whl", hash = "sha256:cf7a6713e01c87aa35387f4774e812c4361150938d20d232800f75ffcf266090", size = 24541, upload-time = "2025-12-17T09:24:21.153Z" }, +] + +[[package]] +name = "pywin32" +version = "311" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7b/40/44efbb0dfbd33aca6a6483191dae0716070ed99e2ecb0c53683f400a0b4f/pywin32-311-cp310-cp310-win32.whl", hash = "sha256:d03ff496d2a0cd4a5893504789d4a15399133fe82517455e78bad62efbb7f0a3", size = 8760432, upload-time = "2025-07-14T20:13:05.9Z" }, + { url = "https://files.pythonhosted.org/packages/5e/bf/360243b1e953bd254a82f12653974be395ba880e7ec23e3731d9f73921cc/pywin32-311-cp310-cp310-win_amd64.whl", hash = "sha256:797c2772017851984b97180b0bebe4b620bb86328e8a884bb626156295a63b3b", size = 9590103, upload-time = "2025-07-14T20:13:07.698Z" }, + { url = "https://files.pythonhosted.org/packages/57/38/d290720e6f138086fb3d5ffe0b6caa019a791dd57866940c82e4eeaf2012/pywin32-311-cp310-cp310-win_arm64.whl", hash = "sha256:0502d1facf1fed4839a9a51ccbcc63d952cf318f78ffc00a7e78528ac27d7a2b", size = 8778557, upload-time = "2025-07-14T20:13:11.11Z" }, + { url = "https://files.pythonhosted.org/packages/7c/af/449a6a91e5d6db51420875c54f6aff7c97a86a3b13a0b4f1a5c13b988de3/pywin32-311-cp311-cp311-win32.whl", hash = "sha256:184eb5e436dea364dcd3d2316d577d625c0351bf237c4e9a5fabbcfa5a58b151", size = 8697031, upload-time = "2025-07-14T20:13:13.266Z" }, + { url = "https://files.pythonhosted.org/packages/51/8f/9bb81dd5bb77d22243d33c8397f09377056d5c687aa6d4042bea7fbf8364/pywin32-311-cp311-cp311-win_amd64.whl", hash = "sha256:3ce80b34b22b17ccbd937a6e78e7225d80c52f5ab9940fe0506a1a16f3dab503", size = 9508308, upload-time = "2025-07-14T20:13:15.147Z" }, + { url = "https://files.pythonhosted.org/packages/44/7b/9c2ab54f74a138c491aba1b1cd0795ba61f144c711daea84a88b63dc0f6c/pywin32-311-cp311-cp311-win_arm64.whl", hash = "sha256:a733f1388e1a842abb67ffa8e7aad0e70ac519e09b0f6a784e65a136ec7cefd2", size = 8703930, upload-time = "2025-07-14T20:13:16.945Z" }, + { url = "https://files.pythonhosted.org/packages/e7/ab/01ea1943d4eba0f850c3c61e78e8dd59757ff815ff3ccd0a84de5f541f42/pywin32-311-cp312-cp312-win32.whl", hash = "sha256:750ec6e621af2b948540032557b10a2d43b0cee2ae9758c54154d711cc852d31", size = 8706543, upload-time = "2025-07-14T20:13:20.765Z" }, + { url = "https://files.pythonhosted.org/packages/d1/a8/a0e8d07d4d051ec7502cd58b291ec98dcc0c3fff027caad0470b72cfcc2f/pywin32-311-cp312-cp312-win_amd64.whl", hash = "sha256:b8c095edad5c211ff31c05223658e71bf7116daa0ecf3ad85f3201ea3190d067", size = 9495040, upload-time = "2025-07-14T20:13:22.543Z" }, + { url = "https://files.pythonhosted.org/packages/ba/3a/2ae996277b4b50f17d61f0603efd8253cb2d79cc7ae159468007b586396d/pywin32-311-cp312-cp312-win_arm64.whl", hash = "sha256:e286f46a9a39c4a18b319c28f59b61de793654af2f395c102b4f819e584b5852", size = 8710102, upload-time = "2025-07-14T20:13:24.682Z" }, + { url = "https://files.pythonhosted.org/packages/a5/be/3fd5de0979fcb3994bfee0d65ed8ca9506a8a1260651b86174f6a86f52b3/pywin32-311-cp313-cp313-win32.whl", hash = "sha256:f95ba5a847cba10dd8c4d8fefa9f2a6cf283b8b88ed6178fa8a6c1ab16054d0d", size = 8705700, upload-time = "2025-07-14T20:13:26.471Z" }, + { url = "https://files.pythonhosted.org/packages/e3/28/e0a1909523c6890208295a29e05c2adb2126364e289826c0a8bc7297bd5c/pywin32-311-cp313-cp313-win_amd64.whl", hash = "sha256:718a38f7e5b058e76aee1c56ddd06908116d35147e133427e59a3983f703a20d", size = 9494700, upload-time = "2025-07-14T20:13:28.243Z" }, + { url = "https://files.pythonhosted.org/packages/04/bf/90339ac0f55726dce7d794e6d79a18a91265bdf3aa70b6b9ca52f35e022a/pywin32-311-cp313-cp313-win_arm64.whl", hash = "sha256:7b4075d959648406202d92a2310cb990fea19b535c7f4a78d3f5e10b926eeb8a", size = 8709318, upload-time = "2025-07-14T20:13:30.348Z" }, + { url = "https://files.pythonhosted.org/packages/c9/31/097f2e132c4f16d99a22bfb777e0fd88bd8e1c634304e102f313af69ace5/pywin32-311-cp314-cp314-win32.whl", hash = "sha256:b7a2c10b93f8986666d0c803ee19b5990885872a7de910fc460f9b0c2fbf92ee", size = 8840714, upload-time = "2025-07-14T20:13:32.449Z" }, + { url = "https://files.pythonhosted.org/packages/90/4b/07c77d8ba0e01349358082713400435347df8426208171ce297da32c313d/pywin32-311-cp314-cp314-win_amd64.whl", hash = "sha256:3aca44c046bd2ed8c90de9cb8427f581c479e594e99b5c0bb19b29c10fd6cb87", size = 9656800, upload-time = "2025-07-14T20:13:34.312Z" }, + { url = "https://files.pythonhosted.org/packages/c0/d2/21af5c535501a7233e734b8af901574572da66fcc254cb35d0609c9080dd/pywin32-311-cp314-cp314-win_arm64.whl", hash = "sha256:a508e2d9025764a8270f93111a970e1d0fbfc33f4153b388bb649b7eec4f9b42", size = 8932540, upload-time = "2025-07-14T20:13:36.379Z" }, +] + +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/a0/39350dd17dd6d6c6507025c0e53aef67a9293a6d37d3511f23ea510d5800/pyyaml-6.0.3-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b", size = 184227, upload-time = "2025-09-25T21:31:46.04Z" }, + { url = "https://files.pythonhosted.org/packages/05/14/52d505b5c59ce73244f59c7a50ecf47093ce4765f116cdb98286a71eeca2/pyyaml-6.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:02ea2dfa234451bbb8772601d7b8e426c2bfa197136796224e50e35a78777956", size = 174019, upload-time = "2025-09-25T21:31:47.706Z" }, + { url = "https://files.pythonhosted.org/packages/43/f7/0e6a5ae5599c838c696adb4e6330a59f463265bfa1e116cfd1fbb0abaaae/pyyaml-6.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b30236e45cf30d2b8e7b3e85881719e98507abed1011bf463a8fa23e9c3e98a8", size = 740646, upload-time = "2025-09-25T21:31:49.21Z" }, + { url = "https://files.pythonhosted.org/packages/2f/3a/61b9db1d28f00f8fd0ae760459a5c4bf1b941baf714e207b6eb0657d2578/pyyaml-6.0.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:66291b10affd76d76f54fad28e22e51719ef9ba22b29e1d7d03d6777a9174198", size = 840793, upload-time = "2025-09-25T21:31:50.735Z" }, + { url = "https://files.pythonhosted.org/packages/7a/1e/7acc4f0e74c4b3d9531e24739e0ab832a5edf40e64fbae1a9c01941cabd7/pyyaml-6.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b", size = 770293, upload-time = "2025-09-25T21:31:51.828Z" }, + { url = "https://files.pythonhosted.org/packages/8b/ef/abd085f06853af0cd59fa5f913d61a8eab65d7639ff2a658d18a25d6a89d/pyyaml-6.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:418cf3f2111bc80e0933b2cd8cd04f286338bb88bdc7bc8e6dd775ebde60b5e0", size = 732872, upload-time = "2025-09-25T21:31:53.282Z" }, + { url = "https://files.pythonhosted.org/packages/1f/15/2bc9c8faf6450a8b3c9fc5448ed869c599c0a74ba2669772b1f3a0040180/pyyaml-6.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5e0b74767e5f8c593e8c9b5912019159ed0533c70051e9cce3e8b6aa699fcd69", size = 758828, upload-time = "2025-09-25T21:31:54.807Z" }, + { url = "https://files.pythonhosted.org/packages/a3/00/531e92e88c00f4333ce359e50c19b8d1de9fe8d581b1534e35ccfbc5f393/pyyaml-6.0.3-cp310-cp310-win32.whl", hash = "sha256:28c8d926f98f432f88adc23edf2e6d4921ac26fb084b028c733d01868d19007e", size = 142415, upload-time = "2025-09-25T21:31:55.885Z" }, + { url = "https://files.pythonhosted.org/packages/2a/fa/926c003379b19fca39dd4634818b00dec6c62d87faf628d1394e137354d4/pyyaml-6.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:bdb2c67c6c1390b63c6ff89f210c8fd09d9a1217a465701eac7316313c915e4c", size = 158561, upload-time = "2025-09-25T21:31:57.406Z" }, + { url = "https://files.pythonhosted.org/packages/6d/16/a95b6757765b7b031c9374925bb718d55e0a9ba8a1b6a12d25962ea44347/pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e", size = 185826, upload-time = "2025-09-25T21:31:58.655Z" }, + { url = "https://files.pythonhosted.org/packages/16/19/13de8e4377ed53079ee996e1ab0a9c33ec2faf808a4647b7b4c0d46dd239/pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824", size = 175577, upload-time = "2025-09-25T21:32:00.088Z" }, + { url = "https://files.pythonhosted.org/packages/0c/62/d2eb46264d4b157dae1275b573017abec435397aa59cbcdab6fc978a8af4/pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c", size = 775556, upload-time = "2025-09-25T21:32:01.31Z" }, + { url = "https://files.pythonhosted.org/packages/10/cb/16c3f2cf3266edd25aaa00d6c4350381c8b012ed6f5276675b9eba8d9ff4/pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00", size = 882114, upload-time = "2025-09-25T21:32:03.376Z" }, + { url = "https://files.pythonhosted.org/packages/71/60/917329f640924b18ff085ab889a11c763e0b573da888e8404ff486657602/pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d", size = 806638, upload-time = "2025-09-25T21:32:04.553Z" }, + { url = "https://files.pythonhosted.org/packages/dd/6f/529b0f316a9fd167281a6c3826b5583e6192dba792dd55e3203d3f8e655a/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a", size = 767463, upload-time = "2025-09-25T21:32:06.152Z" }, + { url = "https://files.pythonhosted.org/packages/f2/6a/b627b4e0c1dd03718543519ffb2f1deea4a1e6d42fbab8021936a4d22589/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4", size = 794986, upload-time = "2025-09-25T21:32:07.367Z" }, + { url = "https://files.pythonhosted.org/packages/45/91/47a6e1c42d9ee337c4839208f30d9f09caa9f720ec7582917b264defc875/pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b", size = 142543, upload-time = "2025-09-25T21:32:08.95Z" }, + { url = "https://files.pythonhosted.org/packages/da/e3/ea007450a105ae919a72393cb06f122f288ef60bba2dc64b26e2646fa315/pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf", size = 158763, upload-time = "2025-09-25T21:32:09.96Z" }, + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, + { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, + { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, + { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, + { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, + { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, + { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, + { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, + { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, + { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, + { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, + { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, + { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, + { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, + { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, + { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, + { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, + { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, + { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, +] + +[[package]] +name = "referencing" +version = "0.37.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "rpds-py" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", size = 26766, upload-time = "2025-10-13T15:30:47.625Z" }, +] + +[[package]] +name = "requests" +version = "2.32.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c9/74/b3ff8e6c8446842c3f5c837e9c3dfcfe2018ea6ecef224c710c85ef728f4/requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf", size = 134517, upload-time = "2025-08-18T20:46:02.573Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", size = 64738, upload-time = "2025-08-18T20:46:00.542Z" }, +] + +[[package]] +name = "rpds-py" +version = "0.30.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/20/af/3f2f423103f1113b36230496629986e0ef7e199d2aa8392452b484b38ced/rpds_py-0.30.0.tar.gz", hash = "sha256:dd8ff7cf90014af0c0f787eea34794ebf6415242ee1d6fa91eaba725cc441e84", size = 69469, upload-time = "2025-11-30T20:24:38.837Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/06/0c/0c411a0ec64ccb6d104dcabe0e713e05e153a9a2c3c2bd2b32ce412166fe/rpds_py-0.30.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:679ae98e00c0e8d68a7fda324e16b90fd5260945b45d3b824c892cec9eea3288", size = 370490, upload-time = "2025-11-30T20:21:33.256Z" }, + { url = "https://files.pythonhosted.org/packages/19/6a/4ba3d0fb7297ebae71171822554abe48d7cab29c28b8f9f2c04b79988c05/rpds_py-0.30.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4cc2206b76b4f576934f0ed374b10d7ca5f457858b157ca52064bdfc26b9fc00", size = 359751, upload-time = "2025-11-30T20:21:34.591Z" }, + { url = "https://files.pythonhosted.org/packages/cd/7c/e4933565ef7f7a0818985d87c15d9d273f1a649afa6a52ea35ad011195ea/rpds_py-0.30.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:389a2d49eded1896c3d48b0136ead37c48e221b391c052fba3f4055c367f60a6", size = 389696, upload-time = "2025-11-30T20:21:36.122Z" }, + { url = "https://files.pythonhosted.org/packages/5e/01/6271a2511ad0815f00f7ed4390cf2567bec1d4b1da39e2c27a41e6e3b4de/rpds_py-0.30.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:32c8528634e1bf7121f3de08fa85b138f4e0dc47657866630611b03967f041d7", size = 403136, upload-time = "2025-11-30T20:21:37.728Z" }, + { url = "https://files.pythonhosted.org/packages/55/64/c857eb7cd7541e9b4eee9d49c196e833128a55b89a9850a9c9ac33ccf897/rpds_py-0.30.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f207f69853edd6f6700b86efb84999651baf3789e78a466431df1331608e5324", size = 524699, upload-time = "2025-11-30T20:21:38.92Z" }, + { url = "https://files.pythonhosted.org/packages/9c/ed/94816543404078af9ab26159c44f9e98e20fe47e2126d5d32c9d9948d10a/rpds_py-0.30.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:67b02ec25ba7a9e8fa74c63b6ca44cf5707f2fbfadae3ee8e7494297d56aa9df", size = 412022, upload-time = "2025-11-30T20:21:40.407Z" }, + { url = "https://files.pythonhosted.org/packages/61/b5/707f6cf0066a6412aacc11d17920ea2e19e5b2f04081c64526eb35b5c6e7/rpds_py-0.30.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0c0e95f6819a19965ff420f65578bacb0b00f251fefe2c8b23347c37174271f3", size = 390522, upload-time = "2025-11-30T20:21:42.17Z" }, + { url = "https://files.pythonhosted.org/packages/13/4e/57a85fda37a229ff4226f8cbcf09f2a455d1ed20e802ce5b2b4a7f5ed053/rpds_py-0.30.0-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:a452763cc5198f2f98898eb98f7569649fe5da666c2dc6b5ddb10fde5a574221", size = 404579, upload-time = "2025-11-30T20:21:43.769Z" }, + { url = "https://files.pythonhosted.org/packages/f9/da/c9339293513ec680a721e0e16bf2bac3db6e5d7e922488de471308349bba/rpds_py-0.30.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e0b65193a413ccc930671c55153a03ee57cecb49e6227204b04fae512eb657a7", size = 421305, upload-time = "2025-11-30T20:21:44.994Z" }, + { url = "https://files.pythonhosted.org/packages/f9/be/522cb84751114f4ad9d822ff5a1aa3c98006341895d5f084779b99596e5c/rpds_py-0.30.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:858738e9c32147f78b3ac24dc0edb6610000e56dc0f700fd5f651d0a0f0eb9ff", size = 572503, upload-time = "2025-11-30T20:21:46.91Z" }, + { url = "https://files.pythonhosted.org/packages/a2/9b/de879f7e7ceddc973ea6e4629e9b380213a6938a249e94b0cdbcc325bb66/rpds_py-0.30.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:da279aa314f00acbb803da1e76fa18666778e8a8f83484fba94526da5de2cba7", size = 598322, upload-time = "2025-11-30T20:21:48.709Z" }, + { url = "https://files.pythonhosted.org/packages/48/ac/f01fc22efec3f37d8a914fc1b2fb9bcafd56a299edbe96406f3053edea5a/rpds_py-0.30.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7c64d38fb49b6cdeda16ab49e35fe0da2e1e9b34bc38bd78386530f218b37139", size = 560792, upload-time = "2025-11-30T20:21:50.024Z" }, + { url = "https://files.pythonhosted.org/packages/e2/da/4e2b19d0f131f35b6146425f846563d0ce036763e38913d917187307a671/rpds_py-0.30.0-cp310-cp310-win32.whl", hash = "sha256:6de2a32a1665b93233cde140ff8b3467bdb9e2af2b91079f0333a0974d12d464", size = 221901, upload-time = "2025-11-30T20:21:51.32Z" }, + { url = "https://files.pythonhosted.org/packages/96/cb/156d7a5cf4f78a7cc571465d8aec7a3c447c94f6749c5123f08438bcf7bc/rpds_py-0.30.0-cp310-cp310-win_amd64.whl", hash = "sha256:1726859cd0de969f88dc8673bdd954185b9104e05806be64bcd87badbe313169", size = 235823, upload-time = "2025-11-30T20:21:52.505Z" }, + { url = "https://files.pythonhosted.org/packages/4d/6e/f964e88b3d2abee2a82c1ac8366da848fce1c6d834dc2132c3fda3970290/rpds_py-0.30.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a2bffea6a4ca9f01b3f8e548302470306689684e61602aa3d141e34da06cf425", size = 370157, upload-time = "2025-11-30T20:21:53.789Z" }, + { url = "https://files.pythonhosted.org/packages/94/ba/24e5ebb7c1c82e74c4e4f33b2112a5573ddc703915b13a073737b59b86e0/rpds_py-0.30.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dc4f992dfe1e2bc3ebc7444f6c7051b4bc13cd8e33e43511e8ffd13bf407010d", size = 359676, upload-time = "2025-11-30T20:21:55.475Z" }, + { url = "https://files.pythonhosted.org/packages/84/86/04dbba1b087227747d64d80c3b74df946b986c57af0a9f0c98726d4d7a3b/rpds_py-0.30.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:422c3cb9856d80b09d30d2eb255d0754b23e090034e1deb4083f8004bd0761e4", size = 389938, upload-time = "2025-11-30T20:21:57.079Z" }, + { url = "https://files.pythonhosted.org/packages/42/bb/1463f0b1722b7f45431bdd468301991d1328b16cffe0b1c2918eba2c4eee/rpds_py-0.30.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:07ae8a593e1c3c6b82ca3292efbe73c30b61332fd612e05abee07c79359f292f", size = 402932, upload-time = "2025-11-30T20:21:58.47Z" }, + { url = "https://files.pythonhosted.org/packages/99/ee/2520700a5c1f2d76631f948b0736cdf9b0acb25abd0ca8e889b5c62ac2e3/rpds_py-0.30.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:12f90dd7557b6bd57f40abe7747e81e0c0b119bef015ea7726e69fe550e394a4", size = 525830, upload-time = "2025-11-30T20:21:59.699Z" }, + { url = "https://files.pythonhosted.org/packages/e0/ad/bd0331f740f5705cc555a5e17fdf334671262160270962e69a2bdef3bf76/rpds_py-0.30.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:99b47d6ad9a6da00bec6aabe5a6279ecd3c06a329d4aa4771034a21e335c3a97", size = 412033, upload-time = "2025-11-30T20:22:00.991Z" }, + { url = "https://files.pythonhosted.org/packages/f8/1e/372195d326549bb51f0ba0f2ecb9874579906b97e08880e7a65c3bef1a99/rpds_py-0.30.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:33f559f3104504506a44bb666b93a33f5d33133765b0c216a5bf2f1e1503af89", size = 390828, upload-time = "2025-11-30T20:22:02.723Z" }, + { url = "https://files.pythonhosted.org/packages/ab/2b/d88bb33294e3e0c76bc8f351a3721212713629ffca1700fa94979cb3eae8/rpds_py-0.30.0-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:946fe926af6e44f3697abbc305ea168c2c31d3e3ef1058cf68f379bf0335a78d", size = 404683, upload-time = "2025-11-30T20:22:04.367Z" }, + { url = "https://files.pythonhosted.org/packages/50/32/c759a8d42bcb5289c1fac697cd92f6fe01a018dd937e62ae77e0e7f15702/rpds_py-0.30.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:495aeca4b93d465efde585977365187149e75383ad2684f81519f504f5c13038", size = 421583, upload-time = "2025-11-30T20:22:05.814Z" }, + { url = "https://files.pythonhosted.org/packages/2b/81/e729761dbd55ddf5d84ec4ff1f47857f4374b0f19bdabfcf929164da3e24/rpds_py-0.30.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d9a0ca5da0386dee0655b4ccdf46119df60e0f10da268d04fe7cc87886872ba7", size = 572496, upload-time = "2025-11-30T20:22:07.713Z" }, + { url = "https://files.pythonhosted.org/packages/14/f6/69066a924c3557c9c30baa6ec3a0aa07526305684c6f86c696b08860726c/rpds_py-0.30.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8d6d1cc13664ec13c1b84241204ff3b12f9bb82464b8ad6e7a5d3486975c2eed", size = 598669, upload-time = "2025-11-30T20:22:09.312Z" }, + { url = "https://files.pythonhosted.org/packages/5f/48/905896b1eb8a05630d20333d1d8ffd162394127b74ce0b0784ae04498d32/rpds_py-0.30.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3896fa1be39912cf0757753826bc8bdc8ca331a28a7c4ae46b7a21280b06bb85", size = 561011, upload-time = "2025-11-30T20:22:11.309Z" }, + { url = "https://files.pythonhosted.org/packages/22/16/cd3027c7e279d22e5eb431dd3c0fbc677bed58797fe7581e148f3f68818b/rpds_py-0.30.0-cp311-cp311-win32.whl", hash = "sha256:55f66022632205940f1827effeff17c4fa7ae1953d2b74a8581baaefb7d16f8c", size = 221406, upload-time = "2025-11-30T20:22:13.101Z" }, + { url = "https://files.pythonhosted.org/packages/fa/5b/e7b7aa136f28462b344e652ee010d4de26ee9fd16f1bfd5811f5153ccf89/rpds_py-0.30.0-cp311-cp311-win_amd64.whl", hash = "sha256:a51033ff701fca756439d641c0ad09a41d9242fa69121c7d8769604a0a629825", size = 236024, upload-time = "2025-11-30T20:22:14.853Z" }, + { url = "https://files.pythonhosted.org/packages/14/a6/364bba985e4c13658edb156640608f2c9e1d3ea3c81b27aa9d889fff0e31/rpds_py-0.30.0-cp311-cp311-win_arm64.whl", hash = "sha256:47b0ef6231c58f506ef0b74d44e330405caa8428e770fec25329ed2cb971a229", size = 229069, upload-time = "2025-11-30T20:22:16.577Z" }, + { url = "https://files.pythonhosted.org/packages/03/e7/98a2f4ac921d82f33e03f3835f5bf3a4a40aa1bfdc57975e74a97b2b4bdd/rpds_py-0.30.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a161f20d9a43006833cd7068375a94d035714d73a172b681d8881820600abfad", size = 375086, upload-time = "2025-11-30T20:22:17.93Z" }, + { url = "https://files.pythonhosted.org/packages/4d/a1/bca7fd3d452b272e13335db8d6b0b3ecde0f90ad6f16f3328c6fb150c889/rpds_py-0.30.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6abc8880d9d036ecaafe709079969f56e876fcf107f7a8e9920ba6d5a3878d05", size = 359053, upload-time = "2025-11-30T20:22:19.297Z" }, + { url = "https://files.pythonhosted.org/packages/65/1c/ae157e83a6357eceff62ba7e52113e3ec4834a84cfe07fa4b0757a7d105f/rpds_py-0.30.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca28829ae5f5d569bb62a79512c842a03a12576375d5ece7d2cadf8abe96ec28", size = 390763, upload-time = "2025-11-30T20:22:21.661Z" }, + { url = "https://files.pythonhosted.org/packages/d4/36/eb2eb8515e2ad24c0bd43c3ee9cd74c33f7ca6430755ccdb240fd3144c44/rpds_py-0.30.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1010ed9524c73b94d15919ca4d41d8780980e1765babf85f9a2f90d247153dd", size = 408951, upload-time = "2025-11-30T20:22:23.408Z" }, + { url = "https://files.pythonhosted.org/packages/d6/65/ad8dc1784a331fabbd740ef6f71ce2198c7ed0890dab595adb9ea2d775a1/rpds_py-0.30.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f8d1736cfb49381ba528cd5baa46f82fdc65c06e843dab24dd70b63d09121b3f", size = 514622, upload-time = "2025-11-30T20:22:25.16Z" }, + { url = "https://files.pythonhosted.org/packages/63/8e/0cfa7ae158e15e143fe03993b5bcd743a59f541f5952e1546b1ac1b5fd45/rpds_py-0.30.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d948b135c4693daff7bc2dcfc4ec57237a29bd37e60c2fabf5aff2bbacf3e2f1", size = 414492, upload-time = "2025-11-30T20:22:26.505Z" }, + { url = "https://files.pythonhosted.org/packages/60/1b/6f8f29f3f995c7ffdde46a626ddccd7c63aefc0efae881dc13b6e5d5bb16/rpds_py-0.30.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47f236970bccb2233267d89173d3ad2703cd36a0e2a6e92d0560d333871a3d23", size = 394080, upload-time = "2025-11-30T20:22:27.934Z" }, + { url = "https://files.pythonhosted.org/packages/6d/d5/a266341051a7a3ca2f4b750a3aa4abc986378431fc2da508c5034d081b70/rpds_py-0.30.0-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:2e6ecb5a5bcacf59c3f912155044479af1d0b6681280048b338b28e364aca1f6", size = 408680, upload-time = "2025-11-30T20:22:29.341Z" }, + { url = "https://files.pythonhosted.org/packages/10/3b/71b725851df9ab7a7a4e33cf36d241933da66040d195a84781f49c50490c/rpds_py-0.30.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a8fa71a2e078c527c3e9dc9fc5a98c9db40bcc8a92b4e8858e36d329f8684b51", size = 423589, upload-time = "2025-11-30T20:22:31.469Z" }, + { url = "https://files.pythonhosted.org/packages/00/2b/e59e58c544dc9bd8bd8384ecdb8ea91f6727f0e37a7131baeff8d6f51661/rpds_py-0.30.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:73c67f2db7bc334e518d097c6d1e6fed021bbc9b7d678d6cc433478365d1d5f5", size = 573289, upload-time = "2025-11-30T20:22:32.997Z" }, + { url = "https://files.pythonhosted.org/packages/da/3e/a18e6f5b460893172a7d6a680e86d3b6bc87a54c1f0b03446a3c8c7b588f/rpds_py-0.30.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:5ba103fb455be00f3b1c2076c9d4264bfcb037c976167a6047ed82f23153f02e", size = 599737, upload-time = "2025-11-30T20:22:34.419Z" }, + { url = "https://files.pythonhosted.org/packages/5c/e2/714694e4b87b85a18e2c243614974413c60aa107fd815b8cbc42b873d1d7/rpds_py-0.30.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7cee9c752c0364588353e627da8a7e808a66873672bcb5f52890c33fd965b394", size = 563120, upload-time = "2025-11-30T20:22:35.903Z" }, + { url = "https://files.pythonhosted.org/packages/6f/ab/d5d5e3bcedb0a77f4f613706b750e50a5a3ba1c15ccd3665ecc636c968fd/rpds_py-0.30.0-cp312-cp312-win32.whl", hash = "sha256:1ab5b83dbcf55acc8b08fc62b796ef672c457b17dbd7820a11d6c52c06839bdf", size = 223782, upload-time = "2025-11-30T20:22:37.271Z" }, + { url = "https://files.pythonhosted.org/packages/39/3b/f786af9957306fdc38a74cef405b7b93180f481fb48453a114bb6465744a/rpds_py-0.30.0-cp312-cp312-win_amd64.whl", hash = "sha256:a090322ca841abd453d43456ac34db46e8b05fd9b3b4ac0c78bcde8b089f959b", size = 240463, upload-time = "2025-11-30T20:22:39.021Z" }, + { url = "https://files.pythonhosted.org/packages/f3/d2/b91dc748126c1559042cfe41990deb92c4ee3e2b415f6b5234969ffaf0cc/rpds_py-0.30.0-cp312-cp312-win_arm64.whl", hash = "sha256:669b1805bd639dd2989b281be2cfd951c6121b65e729d9b843e9639ef1fd555e", size = 230868, upload-time = "2025-11-30T20:22:40.493Z" }, + { url = "https://files.pythonhosted.org/packages/ed/dc/d61221eb88ff410de3c49143407f6f3147acf2538c86f2ab7ce65ae7d5f9/rpds_py-0.30.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:f83424d738204d9770830d35290ff3273fbb02b41f919870479fab14b9d303b2", size = 374887, upload-time = "2025-11-30T20:22:41.812Z" }, + { url = "https://files.pythonhosted.org/packages/fd/32/55fb50ae104061dbc564ef15cc43c013dc4a9f4527a1f4d99baddf56fe5f/rpds_py-0.30.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e7536cd91353c5273434b4e003cbda89034d67e7710eab8761fd918ec6c69cf8", size = 358904, upload-time = "2025-11-30T20:22:43.479Z" }, + { url = "https://files.pythonhosted.org/packages/58/70/faed8186300e3b9bdd138d0273109784eea2396c68458ed580f885dfe7ad/rpds_py-0.30.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2771c6c15973347f50fece41fc447c054b7ac2ae0502388ce3b6738cd366e3d4", size = 389945, upload-time = "2025-11-30T20:22:44.819Z" }, + { url = "https://files.pythonhosted.org/packages/bd/a8/073cac3ed2c6387df38f71296d002ab43496a96b92c823e76f46b8af0543/rpds_py-0.30.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0a59119fc6e3f460315fe9d08149f8102aa322299deaa5cab5b40092345c2136", size = 407783, upload-time = "2025-11-30T20:22:46.103Z" }, + { url = "https://files.pythonhosted.org/packages/77/57/5999eb8c58671f1c11eba084115e77a8899d6e694d2a18f69f0ba471ec8b/rpds_py-0.30.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:76fec018282b4ead0364022e3c54b60bf368b9d926877957a8624b58419169b7", size = 515021, upload-time = "2025-11-30T20:22:47.458Z" }, + { url = "https://files.pythonhosted.org/packages/e0/af/5ab4833eadc36c0a8ed2bc5c0de0493c04f6c06de223170bd0798ff98ced/rpds_py-0.30.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:692bef75a5525db97318e8cd061542b5a79812d711ea03dbc1f6f8dbb0c5f0d2", size = 414589, upload-time = "2025-11-30T20:22:48.872Z" }, + { url = "https://files.pythonhosted.org/packages/b7/de/f7192e12b21b9e9a68a6d0f249b4af3fdcdff8418be0767a627564afa1f1/rpds_py-0.30.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9027da1ce107104c50c81383cae773ef5c24d296dd11c99e2629dbd7967a20c6", size = 394025, upload-time = "2025-11-30T20:22:50.196Z" }, + { url = "https://files.pythonhosted.org/packages/91/c4/fc70cd0249496493500e7cc2de87504f5aa6509de1e88623431fec76d4b6/rpds_py-0.30.0-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:9cf69cdda1f5968a30a359aba2f7f9aa648a9ce4b580d6826437f2b291cfc86e", size = 408895, upload-time = "2025-11-30T20:22:51.87Z" }, + { url = "https://files.pythonhosted.org/packages/58/95/d9275b05ab96556fefff73a385813eb66032e4c99f411d0795372d9abcea/rpds_py-0.30.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a4796a717bf12b9da9d3ad002519a86063dcac8988b030e405704ef7d74d2d9d", size = 422799, upload-time = "2025-11-30T20:22:53.341Z" }, + { url = "https://files.pythonhosted.org/packages/06/c1/3088fc04b6624eb12a57eb814f0d4997a44b0d208d6cace713033ff1a6ba/rpds_py-0.30.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5d4c2aa7c50ad4728a094ebd5eb46c452e9cb7edbfdb18f9e1221f597a73e1e7", size = 572731, upload-time = "2025-11-30T20:22:54.778Z" }, + { url = "https://files.pythonhosted.org/packages/d8/42/c612a833183b39774e8ac8fecae81263a68b9583ee343db33ab571a7ce55/rpds_py-0.30.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ba81a9203d07805435eb06f536d95a266c21e5b2dfbf6517748ca40c98d19e31", size = 599027, upload-time = "2025-11-30T20:22:56.212Z" }, + { url = "https://files.pythonhosted.org/packages/5f/60/525a50f45b01d70005403ae0e25f43c0384369ad24ffe46e8d9068b50086/rpds_py-0.30.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:945dccface01af02675628334f7cf49c2af4c1c904748efc5cf7bbdf0b579f95", size = 563020, upload-time = "2025-11-30T20:22:58.2Z" }, + { url = "https://files.pythonhosted.org/packages/0b/5d/47c4655e9bcd5ca907148535c10e7d489044243cc9941c16ed7cd53be91d/rpds_py-0.30.0-cp313-cp313-win32.whl", hash = "sha256:b40fb160a2db369a194cb27943582b38f79fc4887291417685f3ad693c5a1d5d", size = 223139, upload-time = "2025-11-30T20:23:00.209Z" }, + { url = "https://files.pythonhosted.org/packages/f2/e1/485132437d20aa4d3e1d8b3fb5a5e65aa8139f1e097080c2a8443201742c/rpds_py-0.30.0-cp313-cp313-win_amd64.whl", hash = "sha256:806f36b1b605e2d6a72716f321f20036b9489d29c51c91f4dd29a3e3afb73b15", size = 240224, upload-time = "2025-11-30T20:23:02.008Z" }, + { url = "https://files.pythonhosted.org/packages/24/95/ffd128ed1146a153d928617b0ef673960130be0009c77d8fbf0abe306713/rpds_py-0.30.0-cp313-cp313-win_arm64.whl", hash = "sha256:d96c2086587c7c30d44f31f42eae4eac89b60dabbac18c7669be3700f13c3ce1", size = 230645, upload-time = "2025-11-30T20:23:03.43Z" }, + { url = "https://files.pythonhosted.org/packages/ff/1b/b10de890a0def2a319a2626334a7f0ae388215eb60914dbac8a3bae54435/rpds_py-0.30.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:eb0b93f2e5c2189ee831ee43f156ed34e2a89a78a66b98cadad955972548be5a", size = 364443, upload-time = "2025-11-30T20:23:04.878Z" }, + { url = "https://files.pythonhosted.org/packages/0d/bf/27e39f5971dc4f305a4fb9c672ca06f290f7c4e261c568f3dea16a410d47/rpds_py-0.30.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:922e10f31f303c7c920da8981051ff6d8c1a56207dbdf330d9047f6d30b70e5e", size = 353375, upload-time = "2025-11-30T20:23:06.342Z" }, + { url = "https://files.pythonhosted.org/packages/40/58/442ada3bba6e8e6615fc00483135c14a7538d2ffac30e2d933ccf6852232/rpds_py-0.30.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cdc62c8286ba9bf7f47befdcea13ea0e26bf294bda99758fd90535cbaf408000", size = 383850, upload-time = "2025-11-30T20:23:07.825Z" }, + { url = "https://files.pythonhosted.org/packages/14/14/f59b0127409a33c6ef6f5c1ebd5ad8e32d7861c9c7adfa9a624fc3889f6c/rpds_py-0.30.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:47f9a91efc418b54fb8190a6b4aa7813a23fb79c51f4bb84e418f5476c38b8db", size = 392812, upload-time = "2025-11-30T20:23:09.228Z" }, + { url = "https://files.pythonhosted.org/packages/b3/66/e0be3e162ac299b3a22527e8913767d869e6cc75c46bd844aa43fb81ab62/rpds_py-0.30.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1f3587eb9b17f3789ad50824084fa6f81921bbf9a795826570bda82cb3ed91f2", size = 517841, upload-time = "2025-11-30T20:23:11.186Z" }, + { url = "https://files.pythonhosted.org/packages/3d/55/fa3b9cf31d0c963ecf1ba777f7cf4b2a2c976795ac430d24a1f43d25a6ba/rpds_py-0.30.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:39c02563fc592411c2c61d26b6c5fe1e51eaa44a75aa2c8735ca88b0d9599daa", size = 408149, upload-time = "2025-11-30T20:23:12.864Z" }, + { url = "https://files.pythonhosted.org/packages/60/ca/780cf3b1a32b18c0f05c441958d3758f02544f1d613abf9488cd78876378/rpds_py-0.30.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51a1234d8febafdfd33a42d97da7a43f5dcb120c1060e352a3fbc0c6d36e2083", size = 383843, upload-time = "2025-11-30T20:23:14.638Z" }, + { url = "https://files.pythonhosted.org/packages/82/86/d5f2e04f2aa6247c613da0c1dd87fcd08fa17107e858193566048a1e2f0a/rpds_py-0.30.0-cp313-cp313t-manylinux_2_31_riscv64.whl", hash = "sha256:eb2c4071ab598733724c08221091e8d80e89064cd472819285a9ab0f24bcedb9", size = 396507, upload-time = "2025-11-30T20:23:16.105Z" }, + { url = "https://files.pythonhosted.org/packages/4b/9a/453255d2f769fe44e07ea9785c8347edaf867f7026872e76c1ad9f7bed92/rpds_py-0.30.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6bdfdb946967d816e6adf9a3d8201bfad269c67efe6cefd7093ef959683c8de0", size = 414949, upload-time = "2025-11-30T20:23:17.539Z" }, + { url = "https://files.pythonhosted.org/packages/a3/31/622a86cdc0c45d6df0e9ccb6becdba5074735e7033c20e401a6d9d0e2ca0/rpds_py-0.30.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:c77afbd5f5250bf27bf516c7c4a016813eb2d3e116139aed0096940c5982da94", size = 565790, upload-time = "2025-11-30T20:23:19.029Z" }, + { url = "https://files.pythonhosted.org/packages/1c/5d/15bbf0fb4a3f58a3b1c67855ec1efcc4ceaef4e86644665fff03e1b66d8d/rpds_py-0.30.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:61046904275472a76c8c90c9ccee9013d70a6d0f73eecefd38c1ae7c39045a08", size = 590217, upload-time = "2025-11-30T20:23:20.885Z" }, + { url = "https://files.pythonhosted.org/packages/6d/61/21b8c41f68e60c8cc3b2e25644f0e3681926020f11d06ab0b78e3c6bbff1/rpds_py-0.30.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4c5f36a861bc4b7da6516dbdf302c55313afa09b81931e8280361a4f6c9a2d27", size = 555806, upload-time = "2025-11-30T20:23:22.488Z" }, + { url = "https://files.pythonhosted.org/packages/f9/39/7e067bb06c31de48de3eb200f9fc7c58982a4d3db44b07e73963e10d3be9/rpds_py-0.30.0-cp313-cp313t-win32.whl", hash = "sha256:3d4a69de7a3e50ffc214ae16d79d8fbb0922972da0356dcf4d0fdca2878559c6", size = 211341, upload-time = "2025-11-30T20:23:24.449Z" }, + { url = "https://files.pythonhosted.org/packages/0a/4d/222ef0b46443cf4cf46764d9c630f3fe4abaa7245be9417e56e9f52b8f65/rpds_py-0.30.0-cp313-cp313t-win_amd64.whl", hash = "sha256:f14fc5df50a716f7ece6a80b6c78bb35ea2ca47c499e422aa4463455dd96d56d", size = 225768, upload-time = "2025-11-30T20:23:25.908Z" }, + { url = "https://files.pythonhosted.org/packages/86/81/dad16382ebbd3d0e0328776d8fd7ca94220e4fa0798d1dc5e7da48cb3201/rpds_py-0.30.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:68f19c879420aa08f61203801423f6cd5ac5f0ac4ac82a2368a9fcd6a9a075e0", size = 362099, upload-time = "2025-11-30T20:23:27.316Z" }, + { url = "https://files.pythonhosted.org/packages/2b/60/19f7884db5d5603edf3c6bce35408f45ad3e97e10007df0e17dd57af18f8/rpds_py-0.30.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:ec7c4490c672c1a0389d319b3a9cfcd098dcdc4783991553c332a15acf7249be", size = 353192, upload-time = "2025-11-30T20:23:29.151Z" }, + { url = "https://files.pythonhosted.org/packages/bf/c4/76eb0e1e72d1a9c4703c69607cec123c29028bff28ce41588792417098ac/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f251c812357a3fed308d684a5079ddfb9d933860fc6de89f2b7ab00da481e65f", size = 384080, upload-time = "2025-11-30T20:23:30.785Z" }, + { url = "https://files.pythonhosted.org/packages/72/87/87ea665e92f3298d1b26d78814721dc39ed8d2c74b86e83348d6b48a6f31/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ac98b175585ecf4c0348fd7b29c3864bda53b805c773cbf7bfdaffc8070c976f", size = 394841, upload-time = "2025-11-30T20:23:32.209Z" }, + { url = "https://files.pythonhosted.org/packages/77/ad/7783a89ca0587c15dcbf139b4a8364a872a25f861bdb88ed99f9b0dec985/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3e62880792319dbeb7eb866547f2e35973289e7d5696c6e295476448f5b63c87", size = 516670, upload-time = "2025-11-30T20:23:33.742Z" }, + { url = "https://files.pythonhosted.org/packages/5b/3c/2882bdac942bd2172f3da574eab16f309ae10a3925644e969536553cb4ee/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4e7fc54e0900ab35d041b0601431b0a0eb495f0851a0639b6ef90f7741b39a18", size = 408005, upload-time = "2025-11-30T20:23:35.253Z" }, + { url = "https://files.pythonhosted.org/packages/ce/81/9a91c0111ce1758c92516a3e44776920b579d9a7c09b2b06b642d4de3f0f/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47e77dc9822d3ad616c3d5759ea5631a75e5809d5a28707744ef79d7a1bcfcad", size = 382112, upload-time = "2025-11-30T20:23:36.842Z" }, + { url = "https://files.pythonhosted.org/packages/cf/8e/1da49d4a107027e5fbc64daeab96a0706361a2918da10cb41769244b805d/rpds_py-0.30.0-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:b4dc1a6ff022ff85ecafef7979a2c6eb423430e05f1165d6688234e62ba99a07", size = 399049, upload-time = "2025-11-30T20:23:38.343Z" }, + { url = "https://files.pythonhosted.org/packages/df/5a/7ee239b1aa48a127570ec03becbb29c9d5a9eb092febbd1699d567cae859/rpds_py-0.30.0-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4559c972db3a360808309e06a74628b95eaccbf961c335c8fe0d590cf587456f", size = 415661, upload-time = "2025-11-30T20:23:40.263Z" }, + { url = "https://files.pythonhosted.org/packages/70/ea/caa143cf6b772f823bc7929a45da1fa83569ee49b11d18d0ada7f5ee6fd6/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:0ed177ed9bded28f8deb6ab40c183cd1192aa0de40c12f38be4d59cd33cb5c65", size = 565606, upload-time = "2025-11-30T20:23:42.186Z" }, + { url = "https://files.pythonhosted.org/packages/64/91/ac20ba2d69303f961ad8cf55bf7dbdb4763f627291ba3d0d7d67333cced9/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:ad1fa8db769b76ea911cb4e10f049d80bf518c104f15b3edb2371cc65375c46f", size = 591126, upload-time = "2025-11-30T20:23:44.086Z" }, + { url = "https://files.pythonhosted.org/packages/21/20/7ff5f3c8b00c8a95f75985128c26ba44503fb35b8e0259d812766ea966c7/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:46e83c697b1f1c72b50e5ee5adb4353eef7406fb3f2043d64c33f20ad1c2fc53", size = 553371, upload-time = "2025-11-30T20:23:46.004Z" }, + { url = "https://files.pythonhosted.org/packages/72/c7/81dadd7b27c8ee391c132a6b192111ca58d866577ce2d9b0ca157552cce0/rpds_py-0.30.0-cp314-cp314-win32.whl", hash = "sha256:ee454b2a007d57363c2dfd5b6ca4a5d7e2c518938f8ed3b706e37e5d470801ed", size = 215298, upload-time = "2025-11-30T20:23:47.696Z" }, + { url = "https://files.pythonhosted.org/packages/3e/d2/1aaac33287e8cfb07aab2e6b8ac1deca62f6f65411344f1433c55e6f3eb8/rpds_py-0.30.0-cp314-cp314-win_amd64.whl", hash = "sha256:95f0802447ac2d10bcc69f6dc28fe95fdf17940367b21d34e34c737870758950", size = 228604, upload-time = "2025-11-30T20:23:49.501Z" }, + { url = "https://files.pythonhosted.org/packages/e8/95/ab005315818cc519ad074cb7784dae60d939163108bd2b394e60dc7b5461/rpds_py-0.30.0-cp314-cp314-win_arm64.whl", hash = "sha256:613aa4771c99f03346e54c3f038e4cc574ac09a3ddfb0e8878487335e96dead6", size = 222391, upload-time = "2025-11-30T20:23:50.96Z" }, + { url = "https://files.pythonhosted.org/packages/9e/68/154fe0194d83b973cdedcdcc88947a2752411165930182ae41d983dcefa6/rpds_py-0.30.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:7e6ecfcb62edfd632e56983964e6884851786443739dbfe3582947e87274f7cb", size = 364868, upload-time = "2025-11-30T20:23:52.494Z" }, + { url = "https://files.pythonhosted.org/packages/83/69/8bbc8b07ec854d92a8b75668c24d2abcb1719ebf890f5604c61c9369a16f/rpds_py-0.30.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a1d0bc22a7cdc173fedebb73ef81e07faef93692b8c1ad3733b67e31e1b6e1b8", size = 353747, upload-time = "2025-11-30T20:23:54.036Z" }, + { url = "https://files.pythonhosted.org/packages/ab/00/ba2e50183dbd9abcce9497fa5149c62b4ff3e22d338a30d690f9af970561/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d08f00679177226c4cb8c5265012eea897c8ca3b93f429e546600c971bcbae7", size = 383795, upload-time = "2025-11-30T20:23:55.556Z" }, + { url = "https://files.pythonhosted.org/packages/05/6f/86f0272b84926bcb0e4c972262f54223e8ecc556b3224d281e6598fc9268/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5965af57d5848192c13534f90f9dd16464f3c37aaf166cc1da1cae1fd5a34898", size = 393330, upload-time = "2025-11-30T20:23:57.033Z" }, + { url = "https://files.pythonhosted.org/packages/cb/e9/0e02bb2e6dc63d212641da45df2b0bf29699d01715913e0d0f017ee29438/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a4e86e34e9ab6b667c27f3211ca48f73dba7cd3d90f8d5b11be56e5dbc3fb4e", size = 518194, upload-time = "2025-11-30T20:23:58.637Z" }, + { url = "https://files.pythonhosted.org/packages/ee/ca/be7bca14cf21513bdf9c0606aba17d1f389ea2b6987035eb4f62bd923f25/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5d3e6b26f2c785d65cc25ef1e5267ccbe1b069c5c21b8cc724efee290554419", size = 408340, upload-time = "2025-11-30T20:24:00.2Z" }, + { url = "https://files.pythonhosted.org/packages/c2/c7/736e00ebf39ed81d75544c0da6ef7b0998f8201b369acf842f9a90dc8fce/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:626a7433c34566535b6e56a1b39a7b17ba961e97ce3b80ec62e6f1312c025551", size = 383765, upload-time = "2025-11-30T20:24:01.759Z" }, + { url = "https://files.pythonhosted.org/packages/4a/3f/da50dfde9956aaf365c4adc9533b100008ed31aea635f2b8d7b627e25b49/rpds_py-0.30.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:acd7eb3f4471577b9b5a41baf02a978e8bdeb08b4b355273994f8b87032000a8", size = 396834, upload-time = "2025-11-30T20:24:03.687Z" }, + { url = "https://files.pythonhosted.org/packages/4e/00/34bcc2565b6020eab2623349efbdec810676ad571995911f1abdae62a3a0/rpds_py-0.30.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fe5fa731a1fa8a0a56b0977413f8cacac1768dad38d16b3a296712709476fbd5", size = 415470, upload-time = "2025-11-30T20:24:05.232Z" }, + { url = "https://files.pythonhosted.org/packages/8c/28/882e72b5b3e6f718d5453bd4d0d9cf8df36fddeb4ddbbab17869d5868616/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:74a3243a411126362712ee1524dfc90c650a503502f135d54d1b352bd01f2404", size = 565630, upload-time = "2025-11-30T20:24:06.878Z" }, + { url = "https://files.pythonhosted.org/packages/3b/97/04a65539c17692de5b85c6e293520fd01317fd878ea1995f0367d4532fb1/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:3e8eeb0544f2eb0d2581774be4c3410356eba189529a6b3e36bbbf9696175856", size = 591148, upload-time = "2025-11-30T20:24:08.445Z" }, + { url = "https://files.pythonhosted.org/packages/85/70/92482ccffb96f5441aab93e26c4d66489eb599efdcf96fad90c14bbfb976/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:dbd936cde57abfee19ab3213cf9c26be06d60750e60a8e4dd85d1ab12c8b1f40", size = 556030, upload-time = "2025-11-30T20:24:10.956Z" }, + { url = "https://files.pythonhosted.org/packages/20/53/7c7e784abfa500a2b6b583b147ee4bb5a2b3747a9166bab52fec4b5b5e7d/rpds_py-0.30.0-cp314-cp314t-win32.whl", hash = "sha256:dc824125c72246d924f7f796b4f63c1e9dc810c7d9e2355864b3c3a73d59ade0", size = 211570, upload-time = "2025-11-30T20:24:12.735Z" }, + { url = "https://files.pythonhosted.org/packages/d0/02/fa464cdfbe6b26e0600b62c528b72d8608f5cc49f96b8d6e38c95d60c676/rpds_py-0.30.0-cp314-cp314t-win_amd64.whl", hash = "sha256:27f4b0e92de5bfbc6f86e43959e6edd1425c33b5e69aab0984a72047f2bcf1e3", size = 226532, upload-time = "2025-11-30T20:24:14.634Z" }, + { url = "https://files.pythonhosted.org/packages/69/71/3f34339ee70521864411f8b6992e7ab13ac30d8e4e3309e07c7361767d91/rpds_py-0.30.0-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c2262bdba0ad4fc6fb5545660673925c2d2a5d9e2e0fb603aad545427be0fc58", size = 372292, upload-time = "2025-11-30T20:24:16.537Z" }, + { url = "https://files.pythonhosted.org/packages/57/09/f183df9b8f2d66720d2ef71075c59f7e1b336bec7ee4c48f0a2b06857653/rpds_py-0.30.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:ee6af14263f25eedc3bb918a3c04245106a42dfd4f5c2285ea6f997b1fc3f89a", size = 362128, upload-time = "2025-11-30T20:24:18.086Z" }, + { url = "https://files.pythonhosted.org/packages/7a/68/5c2594e937253457342e078f0cc1ded3dd7b2ad59afdbf2d354869110a02/rpds_py-0.30.0-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3adbb8179ce342d235c31ab8ec511e66c73faa27a47e076ccc92421add53e2bb", size = 391542, upload-time = "2025-11-30T20:24:20.092Z" }, + { url = "https://files.pythonhosted.org/packages/49/5c/31ef1afd70b4b4fbdb2800249f34c57c64beb687495b10aec0365f53dfc4/rpds_py-0.30.0-pp311-pypy311_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:250fa00e9543ac9b97ac258bd37367ff5256666122c2d0f2bc97577c60a1818c", size = 404004, upload-time = "2025-11-30T20:24:22.231Z" }, + { url = "https://files.pythonhosted.org/packages/e3/63/0cfbea38d05756f3440ce6534d51a491d26176ac045e2707adc99bb6e60a/rpds_py-0.30.0-pp311-pypy311_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9854cf4f488b3d57b9aaeb105f06d78e5529d3145b1e4a41750167e8c213c6d3", size = 527063, upload-time = "2025-11-30T20:24:24.302Z" }, + { url = "https://files.pythonhosted.org/packages/42/e6/01e1f72a2456678b0f618fc9a1a13f882061690893c192fcad9f2926553a/rpds_py-0.30.0-pp311-pypy311_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:993914b8e560023bc0a8bf742c5f303551992dcb85e247b1e5c7f4a7d145bda5", size = 413099, upload-time = "2025-11-30T20:24:25.916Z" }, + { url = "https://files.pythonhosted.org/packages/b8/25/8df56677f209003dcbb180765520c544525e3ef21ea72279c98b9aa7c7fb/rpds_py-0.30.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58edca431fb9b29950807e301826586e5bbf24163677732429770a697ffe6738", size = 392177, upload-time = "2025-11-30T20:24:27.834Z" }, + { url = "https://files.pythonhosted.org/packages/4a/b4/0a771378c5f16f8115f796d1f437950158679bcd2a7c68cf251cfb00ed5b/rpds_py-0.30.0-pp311-pypy311_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:dea5b552272a944763b34394d04577cf0f9bd013207bc32323b5a89a53cf9c2f", size = 406015, upload-time = "2025-11-30T20:24:29.457Z" }, + { url = "https://files.pythonhosted.org/packages/36/d8/456dbba0af75049dc6f63ff295a2f92766b9d521fa00de67a2bd6427d57a/rpds_py-0.30.0-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ba3af48635eb83d03f6c9735dfb21785303e73d22ad03d489e88adae6eab8877", size = 423736, upload-time = "2025-11-30T20:24:31.22Z" }, + { url = "https://files.pythonhosted.org/packages/13/64/b4d76f227d5c45a7e0b796c674fd81b0a6c4fbd48dc29271857d8219571c/rpds_py-0.30.0-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:dff13836529b921e22f15cb099751209a60009731a68519630a24d61f0b1b30a", size = 573981, upload-time = "2025-11-30T20:24:32.934Z" }, + { url = "https://files.pythonhosted.org/packages/20/91/092bacadeda3edf92bf743cc96a7be133e13a39cdbfd7b5082e7ab638406/rpds_py-0.30.0-pp311-pypy311_pp73-musllinux_1_2_i686.whl", hash = "sha256:1b151685b23929ab7beec71080a8889d4d6d9fa9a983d213f07121205d48e2c4", size = 599782, upload-time = "2025-11-30T20:24:35.169Z" }, + { url = "https://files.pythonhosted.org/packages/d1/b7/b95708304cd49b7b6f82fdd039f1748b66ec2b21d6a45180910802f1abf1/rpds_py-0.30.0-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:ac37f9f516c51e5753f27dfdef11a88330f04de2d564be3991384b2f3535d02e", size = 562191, upload-time = "2025-11-30T20:24:36.853Z" }, +] + +[[package]] +name = "rsa" +version = "4.9.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyasn1" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/da/8a/22b7beea3ee0d44b1916c0c1cb0ee3af23b700b6da9f04991899d0c555d4/rsa-4.9.1.tar.gz", hash = "sha256:e7bdbfdb5497da4c07dfd35530e1a902659db6ff241e39d9953cad06ebd0ae75", size = 29034, upload-time = "2025-04-16T09:51:18.218Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/8d/0133e4eb4beed9e425d9a98ed6e081a55d195481b7632472be1af08d2f6b/rsa-4.9.1-py3-none-any.whl", hash = "sha256:68635866661c6836b8d39430f97a996acbd61bfa49406748ea243539fe239762", size = 34696, upload-time = "2025-04-16T09:51:17.142Z" }, +] + +[[package]] +name = "ruff" +version = "0.11.13" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ed/da/9c6f995903b4d9474b39da91d2d626659af3ff1eeb43e9ae7c119349dba6/ruff-0.11.13.tar.gz", hash = "sha256:26fa247dc68d1d4e72c179e08889a25ac0c7ba4d78aecfc835d49cbfd60bf514", size = 4282054, upload-time = "2025-06-05T21:00:15.721Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7d/ce/a11d381192966e0b4290842cc8d4fac7dc9214ddf627c11c1afff87da29b/ruff-0.11.13-py3-none-linux_armv6l.whl", hash = "sha256:4bdfbf1240533f40042ec00c9e09a3aade6f8c10b6414cf11b519488d2635d46", size = 10292516, upload-time = "2025-06-05T20:59:32.944Z" }, + { url = "https://files.pythonhosted.org/packages/78/db/87c3b59b0d4e753e40b6a3b4a2642dfd1dcaefbff121ddc64d6c8b47ba00/ruff-0.11.13-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:aef9c9ed1b5ca28bb15c7eac83b8670cf3b20b478195bd49c8d756ba0a36cf48", size = 11106083, upload-time = "2025-06-05T20:59:37.03Z" }, + { url = "https://files.pythonhosted.org/packages/77/79/d8cec175856ff810a19825d09ce700265f905c643c69f45d2b737e4a470a/ruff-0.11.13-py3-none-macosx_11_0_arm64.whl", hash = "sha256:53b15a9dfdce029c842e9a5aebc3855e9ab7771395979ff85b7c1dedb53ddc2b", size = 10436024, upload-time = "2025-06-05T20:59:39.741Z" }, + { url = "https://files.pythonhosted.org/packages/8b/5b/f6d94f2980fa1ee854b41568368a2e1252681b9238ab2895e133d303538f/ruff-0.11.13-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ab153241400789138d13f362c43f7edecc0edfffce2afa6a68434000ecd8f69a", size = 10646324, upload-time = "2025-06-05T20:59:42.185Z" }, + { url = "https://files.pythonhosted.org/packages/6c/9c/b4c2acf24ea4426016d511dfdc787f4ce1ceb835f3c5fbdbcb32b1c63bda/ruff-0.11.13-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6c51f93029d54a910d3d24f7dd0bb909e31b6cd989a5e4ac513f4eb41629f0dc", size = 10174416, upload-time = "2025-06-05T20:59:44.319Z" }, + { url = "https://files.pythonhosted.org/packages/f3/10/e2e62f77c65ede8cd032c2ca39c41f48feabedb6e282bfd6073d81bb671d/ruff-0.11.13-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1808b3ed53e1a777c2ef733aca9051dc9bf7c99b26ece15cb59a0320fbdbd629", size = 11724197, upload-time = "2025-06-05T20:59:46.935Z" }, + { url = "https://files.pythonhosted.org/packages/bb/f0/466fe8469b85c561e081d798c45f8a1d21e0b4a5ef795a1d7f1a9a9ec182/ruff-0.11.13-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d28ce58b5ecf0f43c1b71edffabe6ed7f245d5336b17805803312ec9bc665933", size = 12511615, upload-time = "2025-06-05T20:59:49.534Z" }, + { url = "https://files.pythonhosted.org/packages/17/0e/cefe778b46dbd0cbcb03a839946c8f80a06f7968eb298aa4d1a4293f3448/ruff-0.11.13-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55e4bc3a77842da33c16d55b32c6cac1ec5fb0fbec9c8c513bdce76c4f922165", size = 12117080, upload-time = "2025-06-05T20:59:51.654Z" }, + { url = "https://files.pythonhosted.org/packages/5d/2c/caaeda564cbe103bed145ea557cb86795b18651b0f6b3ff6a10e84e5a33f/ruff-0.11.13-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:633bf2c6f35678c56ec73189ba6fa19ff1c5e4807a78bf60ef487b9dd272cc71", size = 11326315, upload-time = "2025-06-05T20:59:54.469Z" }, + { url = "https://files.pythonhosted.org/packages/75/f0/782e7d681d660eda8c536962920c41309e6dd4ebcea9a2714ed5127d44bd/ruff-0.11.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ffbc82d70424b275b089166310448051afdc6e914fdab90e08df66c43bb5ca9", size = 11555640, upload-time = "2025-06-05T20:59:56.986Z" }, + { url = "https://files.pythonhosted.org/packages/5d/d4/3d580c616316c7f07fb3c99dbecfe01fbaea7b6fd9a82b801e72e5de742a/ruff-0.11.13-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4a9ddd3ec62a9a89578c85842b836e4ac832d4a2e0bfaad3b02243f930ceafcc", size = 10507364, upload-time = "2025-06-05T20:59:59.154Z" }, + { url = "https://files.pythonhosted.org/packages/5a/dc/195e6f17d7b3ea6b12dc4f3e9de575db7983db187c378d44606e5d503319/ruff-0.11.13-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d237a496e0778d719efb05058c64d28b757c77824e04ffe8796c7436e26712b7", size = 10141462, upload-time = "2025-06-05T21:00:01.481Z" }, + { url = "https://files.pythonhosted.org/packages/f4/8e/39a094af6967faa57ecdeacb91bedfb232474ff8c3d20f16a5514e6b3534/ruff-0.11.13-py3-none-musllinux_1_2_i686.whl", hash = "sha256:26816a218ca6ef02142343fd24c70f7cd8c5aa6c203bca284407adf675984432", size = 11121028, upload-time = "2025-06-05T21:00:04.06Z" }, + { url = "https://files.pythonhosted.org/packages/5a/c0/b0b508193b0e8a1654ec683ebab18d309861f8bd64e3a2f9648b80d392cb/ruff-0.11.13-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:51c3f95abd9331dc5b87c47ac7f376db5616041173826dfd556cfe3d4977f492", size = 11602992, upload-time = "2025-06-05T21:00:06.249Z" }, + { url = "https://files.pythonhosted.org/packages/7c/91/263e33ab93ab09ca06ce4f8f8547a858cc198072f873ebc9be7466790bae/ruff-0.11.13-py3-none-win32.whl", hash = "sha256:96c27935418e4e8e77a26bb05962817f28b8ef3843a6c6cc49d8783b5507f250", size = 10474944, upload-time = "2025-06-05T21:00:08.459Z" }, + { url = "https://files.pythonhosted.org/packages/46/f4/7c27734ac2073aae8efb0119cae6931b6fb48017adf048fdf85c19337afc/ruff-0.11.13-py3-none-win_amd64.whl", hash = "sha256:29c3189895a8a6a657b7af4e97d330c8a3afd2c9c8f46c81e2fc5a31866517e3", size = 11548669, upload-time = "2025-06-05T21:00:11.147Z" }, + { url = "https://files.pythonhosted.org/packages/ec/bf/b273dd11673fed8a6bd46032c0ea2a04b2ac9bfa9c628756a5856ba113b0/ruff-0.11.13-py3-none-win_arm64.whl", hash = "sha256:b4385285e9179d608ff1d2fb9922062663c658605819a6876d8beef0c30b7f3b", size = 10683928, upload-time = "2025-06-05T21:00:13.758Z" }, +] + +[[package]] +name = "s3transfer" +version = "0.10.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "botocore" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c0/0a/1cdbabf9edd0ea7747efdf6c9ab4e7061b085aa7f9bfc36bb1601563b069/s3transfer-0.10.4.tar.gz", hash = "sha256:29edc09801743c21eb5ecbc617a152df41d3c287f67b615f73e5f750583666a7", size = 145287, upload-time = "2024-11-20T21:06:05.981Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/66/05/7957af15543b8c9799209506df4660cba7afc4cf94bfb60513827e96bed6/s3transfer-0.10.4-py3-none-any.whl", hash = "sha256:244a76a24355363a68164241438de1b72f8781664920260c48465896b712a41e", size = 83175, upload-time = "2024-11-20T21:06:03.961Z" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "sse-starlette" +version = "3.1.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "starlette" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/da/34/f5df66cb383efdbf4f2db23cabb27f51b1dcb737efaf8a558f6f1d195134/sse_starlette-3.1.2.tar.gz", hash = "sha256:55eff034207a83a0eb86de9a68099bd0157838f0b8b999a1b742005c71e33618", size = 26303, upload-time = "2025-12-31T08:02:20.023Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/95/8c4b76eec9ae574474e5d2997557cebf764bcd3586458956c30631ae08f4/sse_starlette-3.1.2-py3-none-any.whl", hash = "sha256:cd800dd349f4521b317b9391d3796fa97b71748a4da9b9e00aafab32dda375c8", size = 12484, upload-time = "2025-12-31T08:02:18.894Z" }, +] + +[[package]] +name = "starlette" +version = "0.50.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ba/b8/73a0e6a6e079a9d9cfa64113d771e421640b6f679a52eeb9b32f72d871a1/starlette-0.50.0.tar.gz", hash = "sha256:a2a17b22203254bcbc2e1f926d2d55f3f9497f769416b3190768befe598fa3ca", size = 2646985, upload-time = "2025-11-01T15:25:27.516Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d9/52/1064f510b141bd54025f9b55105e26d1fa970b9be67ad766380a3c9b74b0/starlette-0.50.0-py3-none-any.whl", hash = "sha256:9e5391843ec9b6e472eed1365a78c8098cfceb7a74bfd4d6b1c0c0095efb3bca", size = 74033, upload-time = "2025-11-01T15:25:25.461Z" }, +] + +[[package]] +name = "tomli" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/ed/3f73f72945444548f33eba9a87fc7a6e969915e7b1acc8260b30e1f76a2f/tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549", size = 17392, upload-time = "2025-10-08T22:01:47.119Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/2e/299f62b401438d5fe1624119c723f5d877acc86a4c2492da405626665f12/tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45", size = 153236, upload-time = "2025-10-08T22:01:00.137Z" }, + { url = "https://files.pythonhosted.org/packages/86/7f/d8fffe6a7aefdb61bced88fcb5e280cfd71e08939da5894161bd71bea022/tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba", size = 148084, upload-time = "2025-10-08T22:01:01.63Z" }, + { url = "https://files.pythonhosted.org/packages/47/5c/24935fb6a2ee63e86d80e4d3b58b222dafaf438c416752c8b58537c8b89a/tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf", size = 234832, upload-time = "2025-10-08T22:01:02.543Z" }, + { url = "https://files.pythonhosted.org/packages/89/da/75dfd804fc11e6612846758a23f13271b76d577e299592b4371a4ca4cd09/tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441", size = 242052, upload-time = "2025-10-08T22:01:03.836Z" }, + { url = "https://files.pythonhosted.org/packages/70/8c/f48ac899f7b3ca7eb13af73bacbc93aec37f9c954df3c08ad96991c8c373/tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845", size = 239555, upload-time = "2025-10-08T22:01:04.834Z" }, + { url = "https://files.pythonhosted.org/packages/ba/28/72f8afd73f1d0e7829bfc093f4cb98ce0a40ffc0cc997009ee1ed94ba705/tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c", size = 245128, upload-time = "2025-10-08T22:01:05.84Z" }, + { url = "https://files.pythonhosted.org/packages/b6/eb/a7679c8ac85208706d27436e8d421dfa39d4c914dcf5fa8083a9305f58d9/tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456", size = 96445, upload-time = "2025-10-08T22:01:06.896Z" }, + { url = "https://files.pythonhosted.org/packages/0a/fe/3d3420c4cb1ad9cb462fb52967080575f15898da97e21cb6f1361d505383/tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be", size = 107165, upload-time = "2025-10-08T22:01:08.107Z" }, + { url = "https://files.pythonhosted.org/packages/ff/b7/40f36368fcabc518bb11c8f06379a0fd631985046c038aca08c6d6a43c6e/tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac", size = 154891, upload-time = "2025-10-08T22:01:09.082Z" }, + { url = "https://files.pythonhosted.org/packages/f9/3f/d9dd692199e3b3aab2e4e4dd948abd0f790d9ded8cd10cbaae276a898434/tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22", size = 148796, upload-time = "2025-10-08T22:01:10.266Z" }, + { url = "https://files.pythonhosted.org/packages/60/83/59bff4996c2cf9f9387a0f5a3394629c7efa5ef16142076a23a90f1955fa/tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f", size = 242121, upload-time = "2025-10-08T22:01:11.332Z" }, + { url = "https://files.pythonhosted.org/packages/45/e5/7c5119ff39de8693d6baab6c0b6dcb556d192c165596e9fc231ea1052041/tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52", size = 250070, upload-time = "2025-10-08T22:01:12.498Z" }, + { url = "https://files.pythonhosted.org/packages/45/12/ad5126d3a278f27e6701abde51d342aa78d06e27ce2bb596a01f7709a5a2/tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8", size = 245859, upload-time = "2025-10-08T22:01:13.551Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a1/4d6865da6a71c603cfe6ad0e6556c73c76548557a8d658f9e3b142df245f/tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6", size = 250296, upload-time = "2025-10-08T22:01:14.614Z" }, + { url = "https://files.pythonhosted.org/packages/a0/b7/a7a7042715d55c9ba6e8b196d65d2cb662578b4d8cd17d882d45322b0d78/tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876", size = 97124, upload-time = "2025-10-08T22:01:15.629Z" }, + { url = "https://files.pythonhosted.org/packages/06/1e/f22f100db15a68b520664eb3328fb0ae4e90530887928558112c8d1f4515/tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878", size = 107698, upload-time = "2025-10-08T22:01:16.51Z" }, + { url = "https://files.pythonhosted.org/packages/89/48/06ee6eabe4fdd9ecd48bf488f4ac783844fd777f547b8d1b61c11939974e/tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b", size = 154819, upload-time = "2025-10-08T22:01:17.964Z" }, + { url = "https://files.pythonhosted.org/packages/f1/01/88793757d54d8937015c75dcdfb673c65471945f6be98e6a0410fba167ed/tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae", size = 148766, upload-time = "2025-10-08T22:01:18.959Z" }, + { url = "https://files.pythonhosted.org/packages/42/17/5e2c956f0144b812e7e107f94f1cc54af734eb17b5191c0bbfb72de5e93e/tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b", size = 240771, upload-time = "2025-10-08T22:01:20.106Z" }, + { url = "https://files.pythonhosted.org/packages/d5/f4/0fbd014909748706c01d16824eadb0307115f9562a15cbb012cd9b3512c5/tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf", size = 248586, upload-time = "2025-10-08T22:01:21.164Z" }, + { url = "https://files.pythonhosted.org/packages/30/77/fed85e114bde5e81ecf9bc5da0cc69f2914b38f4708c80ae67d0c10180c5/tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f", size = 244792, upload-time = "2025-10-08T22:01:22.417Z" }, + { url = "https://files.pythonhosted.org/packages/55/92/afed3d497f7c186dc71e6ee6d4fcb0acfa5f7d0a1a2878f8beae379ae0cc/tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05", size = 248909, upload-time = "2025-10-08T22:01:23.859Z" }, + { url = "https://files.pythonhosted.org/packages/f8/84/ef50c51b5a9472e7265ce1ffc7f24cd4023d289e109f669bdb1553f6a7c2/tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606", size = 96946, upload-time = "2025-10-08T22:01:24.893Z" }, + { url = "https://files.pythonhosted.org/packages/b2/b7/718cd1da0884f281f95ccfa3a6cc572d30053cba64603f79d431d3c9b61b/tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999", size = 107705, upload-time = "2025-10-08T22:01:26.153Z" }, + { url = "https://files.pythonhosted.org/packages/19/94/aeafa14a52e16163008060506fcb6aa1949d13548d13752171a755c65611/tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e", size = 154244, upload-time = "2025-10-08T22:01:27.06Z" }, + { url = "https://files.pythonhosted.org/packages/db/e4/1e58409aa78eefa47ccd19779fc6f36787edbe7d4cd330eeeedb33a4515b/tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3", size = 148637, upload-time = "2025-10-08T22:01:28.059Z" }, + { url = "https://files.pythonhosted.org/packages/26/b6/d1eccb62f665e44359226811064596dd6a366ea1f985839c566cd61525ae/tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc", size = 241925, upload-time = "2025-10-08T22:01:29.066Z" }, + { url = "https://files.pythonhosted.org/packages/70/91/7cdab9a03e6d3d2bb11beae108da5bdc1c34bdeb06e21163482544ddcc90/tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0", size = 249045, upload-time = "2025-10-08T22:01:31.98Z" }, + { url = "https://files.pythonhosted.org/packages/15/1b/8c26874ed1f6e4f1fcfeb868db8a794cbe9f227299402db58cfcc858766c/tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879", size = 245835, upload-time = "2025-10-08T22:01:32.989Z" }, + { url = "https://files.pythonhosted.org/packages/fd/42/8e3c6a9a4b1a1360c1a2a39f0b972cef2cc9ebd56025168c4137192a9321/tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005", size = 253109, upload-time = "2025-10-08T22:01:34.052Z" }, + { url = "https://files.pythonhosted.org/packages/22/0c/b4da635000a71b5f80130937eeac12e686eefb376b8dee113b4a582bba42/tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463", size = 97930, upload-time = "2025-10-08T22:01:35.082Z" }, + { url = "https://files.pythonhosted.org/packages/b9/74/cb1abc870a418ae99cd5c9547d6bce30701a954e0e721821df483ef7223c/tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8", size = 107964, upload-time = "2025-10-08T22:01:36.057Z" }, + { url = "https://files.pythonhosted.org/packages/54/78/5c46fff6432a712af9f792944f4fcd7067d8823157949f4e40c56b8b3c83/tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77", size = 163065, upload-time = "2025-10-08T22:01:37.27Z" }, + { url = "https://files.pythonhosted.org/packages/39/67/f85d9bd23182f45eca8939cd2bc7050e1f90c41f4a2ecbbd5963a1d1c486/tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf", size = 159088, upload-time = "2025-10-08T22:01:38.235Z" }, + { url = "https://files.pythonhosted.org/packages/26/5a/4b546a0405b9cc0659b399f12b6adb750757baf04250b148d3c5059fc4eb/tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530", size = 268193, upload-time = "2025-10-08T22:01:39.712Z" }, + { url = "https://files.pythonhosted.org/packages/42/4f/2c12a72ae22cf7b59a7fe75b3465b7aba40ea9145d026ba41cb382075b0e/tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b", size = 275488, upload-time = "2025-10-08T22:01:40.773Z" }, + { url = "https://files.pythonhosted.org/packages/92/04/a038d65dbe160c3aa5a624e93ad98111090f6804027d474ba9c37c8ae186/tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67", size = 272669, upload-time = "2025-10-08T22:01:41.824Z" }, + { url = "https://files.pythonhosted.org/packages/be/2f/8b7c60a9d1612a7cbc39ffcca4f21a73bf368a80fc25bccf8253e2563267/tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f", size = 279709, upload-time = "2025-10-08T22:01:43.177Z" }, + { url = "https://files.pythonhosted.org/packages/7e/46/cc36c679f09f27ded940281c38607716c86cf8ba4a518d524e349c8b4874/tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0", size = 107563, upload-time = "2025-10-08T22:01:44.233Z" }, + { url = "https://files.pythonhosted.org/packages/84/ff/426ca8683cf7b753614480484f6437f568fd2fda2edbdf57a2d3d8b27a0b/tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba", size = 119756, upload-time = "2025-10-08T22:01:45.234Z" }, + { url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" }, +] + +[[package]] +name = "tomlkit" +version = "0.13.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cc/18/0bbf3884e9eaa38819ebe46a7bd25dcd56b67434402b66a58c4b8e552575/tomlkit-0.13.3.tar.gz", hash = "sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1", size = 185207, upload-time = "2025-06-05T07:13:44.947Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/75/8539d011f6be8e29f339c42e633aae3cb73bffa95dd0f9adec09b9c58e85/tomlkit-0.13.3-py3-none-any.whl", hash = "sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0", size = 38901, upload-time = "2025-06-05T07:13:43.546Z" }, +] + +[[package]] +name = "types-authlib" +version = "1.6.6.20251220" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/46/c5/ed668b28a66b847903cc94362bf05171a01473e3782e60b362f246c160fe/types_authlib-1.6.6.20251220.tar.gz", hash = "sha256:a2369f23732fe88d5087ed720864f40d0319c19e8411d85a4930e31018996f90", size = 45595, upload-time = "2025-12-20T03:07:43.241Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/ef/e783f3d0d489f7bf66557c3f26cd620e4bae1cba43a59e69c4ced25853bc/types_authlib-1.6.6.20251220-py3-none-any.whl", hash = "sha256:dd1d545fe4c498686c0285d59dc950d87d977d294fc430617c91e0a11f6f4f2b", size = 102884, upload-time = "2025-12-20T03:07:42.028Z" }, +] + +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20251115" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/36/06d01fb52c0d57e9ad0c237654990920fa41195e4b3d640830dabf9eeb2f/types_python_dateutil-2.9.0.20251115.tar.gz", hash = "sha256:8a47f2c3920f52a994056b8786309b43143faa5a64d4cbb2722d6addabdf1a58", size = 16363, upload-time = "2025-11-15T03:00:13.717Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/0b/56961d3ba517ed0df9b3a27bfda6514f3d01b28d499d1bce9068cfe4edd1/types_python_dateutil-2.9.0.20251115-py3-none-any.whl", hash = "sha256:9cf9c1c582019753b8639a081deefd7e044b9fa36bd8217f565c6c4e36ee0624", size = 18251, upload-time = "2025-11-15T03:00:12.317Z" }, +] + +[[package]] +name = "types-pyyaml" +version = "6.0.12.20250915" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/69/3c51b36d04da19b92f9e815be12753125bd8bc247ba0470a982e6979e71c/types_pyyaml-6.0.12.20250915.tar.gz", hash = "sha256:0f8b54a528c303f0e6f7165687dd33fafa81c807fcac23f632b63aa624ced1d3", size = 17522, upload-time = "2025-09-15T03:01:00.728Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/e0/1eed384f02555dde685fff1a1ac805c1c7dcb6dd019c916fe659b1c1f9ec/types_pyyaml-6.0.12.20250915-py3-none-any.whl", hash = "sha256:e7d4d9e064e89a3b3cae120b4990cd370874d2bf12fa5f46c97018dd5d3c9ab6", size = 20338, upload-time = "2025-09-15T03:00:59.218Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, +] + +[[package]] +name = "urllib3" +version = "2.6.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/24/a2a2ed9addd907787d7aa0355ba36a6cadf1768b934c652ea78acbd59dcd/urllib3-2.6.2.tar.gz", hash = "sha256:016f9c98bb7e98085cb2b4b17b87d2c702975664e4f060c6532e64d1c1a5e797", size = 432930, upload-time = "2025-12-11T15:56:40.252Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/b9/4095b668ea3678bf6a0af005527f39de12fb026516fb3df17495a733b7f8/urllib3-2.6.2-py3-none-any.whl", hash = "sha256:ec21cddfe7724fc7cb4ba4bea7aa8e2ef36f607a4bab81aa6ce42a13dc3f03dd", size = 131182, upload-time = "2025-12-11T15:56:38.584Z" }, +] + +[[package]] +name = "uvicorn" +version = "0.40.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "h11" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c3/d1/8f3c683c9561a4e6689dd3b1d345c815f10f86acd044ee1fb9a4dcd0b8c5/uvicorn-0.40.0.tar.gz", hash = "sha256:839676675e87e73694518b5574fd0f24c9d97b46bea16df7b8c05ea1a51071ea", size = 81761, upload-time = "2025-12-21T14:16:22.45Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3d/d8/2083a1daa7439a66f3a48589a57d576aa117726762618f6bb09fe3798796/uvicorn-0.40.0-py3-none-any.whl", hash = "sha256:c6c8f55bc8bf13eb6fa9ff87ad62308bbbc33d0b67f84293151efe87e0d5f2ee", size = 68502, upload-time = "2025-12-21T14:16:21.041Z" }, +] + +[[package]] +name = "websockets" +version = "16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/04/24/4b2031d72e840ce4c1ccb255f693b15c334757fc50023e4db9537080b8c4/websockets-16.0.tar.gz", hash = "sha256:5f6261a5e56e8d5c42a4497b364ea24d94d9563e8fbd44e78ac40879c60179b5", size = 179346, upload-time = "2026-01-10T09:23:47.181Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/74/221f58decd852f4b59cc3354cccaf87e8ef695fede361d03dc9a7396573b/websockets-16.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:04cdd5d2d1dacbad0a7bf36ccbcd3ccd5a30ee188f2560b7a62a30d14107b31a", size = 177343, upload-time = "2026-01-10T09:22:21.28Z" }, + { url = "https://files.pythonhosted.org/packages/19/0f/22ef6107ee52ab7f0b710d55d36f5a5d3ef19e8a205541a6d7ffa7994e5a/websockets-16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8ff32bb86522a9e5e31439a58addbb0166f0204d64066fb955265c4e214160f0", size = 175021, upload-time = "2026-01-10T09:22:22.696Z" }, + { url = "https://files.pythonhosted.org/packages/10/40/904a4cb30d9b61c0e278899bf36342e9b0208eb3c470324a9ecbaac2a30f/websockets-16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:583b7c42688636f930688d712885cf1531326ee05effd982028212ccc13e5957", size = 175320, upload-time = "2026-01-10T09:22:23.94Z" }, + { url = "https://files.pythonhosted.org/packages/9d/2f/4b3ca7e106bc608744b1cdae041e005e446124bebb037b18799c2d356864/websockets-16.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7d837379b647c0c4c2355c2499723f82f1635fd2c26510e1f587d89bc2199e72", size = 183815, upload-time = "2026-01-10T09:22:25.469Z" }, + { url = "https://files.pythonhosted.org/packages/86/26/d40eaa2a46d4302becec8d15b0fc5e45bdde05191e7628405a19cf491ccd/websockets-16.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:df57afc692e517a85e65b72e165356ed1df12386ecb879ad5693be08fac65dde", size = 185054, upload-time = "2026-01-10T09:22:27.101Z" }, + { url = "https://files.pythonhosted.org/packages/b0/ba/6500a0efc94f7373ee8fefa8c271acdfd4dca8bd49a90d4be7ccabfc397e/websockets-16.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2b9f1e0d69bc60a4a87349d50c09a037a2607918746f07de04df9e43252c77a3", size = 184565, upload-time = "2026-01-10T09:22:28.293Z" }, + { url = "https://files.pythonhosted.org/packages/04/b4/96bf2cee7c8d8102389374a2616200574f5f01128d1082f44102140344cc/websockets-16.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:335c23addf3d5e6a8633f9f8eda77efad001671e80b95c491dd0924587ece0b3", size = 183848, upload-time = "2026-01-10T09:22:30.394Z" }, + { url = "https://files.pythonhosted.org/packages/02/8e/81f40fb00fd125357814e8c3025738fc4ffc3da4b6b4a4472a82ba304b41/websockets-16.0-cp310-cp310-win32.whl", hash = "sha256:37b31c1623c6605e4c00d466c9d633f9b812ea430c11c8a278774a1fde1acfa9", size = 178249, upload-time = "2026-01-10T09:22:32.083Z" }, + { url = "https://files.pythonhosted.org/packages/b4/5f/7e40efe8df57db9b91c88a43690ac66f7b7aa73a11aa6a66b927e44f26fa/websockets-16.0-cp310-cp310-win_amd64.whl", hash = "sha256:8e1dab317b6e77424356e11e99a432b7cb2f3ec8c5ab4dabbcee6add48f72b35", size = 178685, upload-time = "2026-01-10T09:22:33.345Z" }, + { url = "https://files.pythonhosted.org/packages/f2/db/de907251b4ff46ae804ad0409809504153b3f30984daf82a1d84a9875830/websockets-16.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:31a52addea25187bde0797a97d6fc3d2f92b6f72a9370792d65a6e84615ac8a8", size = 177340, upload-time = "2026-01-10T09:22:34.539Z" }, + { url = "https://files.pythonhosted.org/packages/f3/fa/abe89019d8d8815c8781e90d697dec52523fb8ebe308bf11664e8de1877e/websockets-16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:417b28978cdccab24f46400586d128366313e8a96312e4b9362a4af504f3bbad", size = 175022, upload-time = "2026-01-10T09:22:36.332Z" }, + { url = "https://files.pythonhosted.org/packages/58/5d/88ea17ed1ded2079358b40d31d48abe90a73c9e5819dbcde1606e991e2ad/websockets-16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:af80d74d4edfa3cb9ed973a0a5ba2b2a549371f8a741e0800cb07becdd20f23d", size = 175319, upload-time = "2026-01-10T09:22:37.602Z" }, + { url = "https://files.pythonhosted.org/packages/d2/ae/0ee92b33087a33632f37a635e11e1d99d429d3d323329675a6022312aac2/websockets-16.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:08d7af67b64d29823fed316505a89b86705f2b7981c07848fb5e3ea3020c1abe", size = 184631, upload-time = "2026-01-10T09:22:38.789Z" }, + { url = "https://files.pythonhosted.org/packages/c8/c5/27178df583b6c5b31b29f526ba2da5e2f864ecc79c99dae630a85d68c304/websockets-16.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7be95cfb0a4dae143eaed2bcba8ac23f4892d8971311f1b06f3c6b78952ee70b", size = 185870, upload-time = "2026-01-10T09:22:39.893Z" }, + { url = "https://files.pythonhosted.org/packages/87/05/536652aa84ddc1c018dbb7e2c4cbcd0db884580bf8e95aece7593fde526f/websockets-16.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d6297ce39ce5c2e6feb13c1a996a2ded3b6832155fcfc920265c76f24c7cceb5", size = 185361, upload-time = "2026-01-10T09:22:41.016Z" }, + { url = "https://files.pythonhosted.org/packages/6d/e2/d5332c90da12b1e01f06fb1b85c50cfc489783076547415bf9f0a659ec19/websockets-16.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1c1b30e4f497b0b354057f3467f56244c603a79c0d1dafce1d16c283c25f6e64", size = 184615, upload-time = "2026-01-10T09:22:42.442Z" }, + { url = "https://files.pythonhosted.org/packages/77/fb/d3f9576691cae9253b51555f841bc6600bf0a983a461c79500ace5a5b364/websockets-16.0-cp311-cp311-win32.whl", hash = "sha256:5f451484aeb5cafee1ccf789b1b66f535409d038c56966d6101740c1614b86c6", size = 178246, upload-time = "2026-01-10T09:22:43.654Z" }, + { url = "https://files.pythonhosted.org/packages/54/67/eaff76b3dbaf18dcddabc3b8c1dba50b483761cccff67793897945b37408/websockets-16.0-cp311-cp311-win_amd64.whl", hash = "sha256:8d7f0659570eefb578dacde98e24fb60af35350193e4f56e11190787bee77dac", size = 178684, upload-time = "2026-01-10T09:22:44.941Z" }, + { url = "https://files.pythonhosted.org/packages/84/7b/bac442e6b96c9d25092695578dda82403c77936104b5682307bd4deb1ad4/websockets-16.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:71c989cbf3254fbd5e84d3bff31e4da39c43f884e64f2551d14bb3c186230f00", size = 177365, upload-time = "2026-01-10T09:22:46.787Z" }, + { url = "https://files.pythonhosted.org/packages/b0/fe/136ccece61bd690d9c1f715baaeefd953bb2360134de73519d5df19d29ca/websockets-16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:8b6e209ffee39ff1b6d0fa7bfef6de950c60dfb91b8fcead17da4ee539121a79", size = 175038, upload-time = "2026-01-10T09:22:47.999Z" }, + { url = "https://files.pythonhosted.org/packages/40/1e/9771421ac2286eaab95b8575b0cb701ae3663abf8b5e1f64f1fd90d0a673/websockets-16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:86890e837d61574c92a97496d590968b23c2ef0aeb8a9bc9421d174cd378ae39", size = 175328, upload-time = "2026-01-10T09:22:49.809Z" }, + { url = "https://files.pythonhosted.org/packages/18/29/71729b4671f21e1eaa5d6573031ab810ad2936c8175f03f97f3ff164c802/websockets-16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9b5aca38b67492ef518a8ab76851862488a478602229112c4b0d58d63a7a4d5c", size = 184915, upload-time = "2026-01-10T09:22:51.071Z" }, + { url = "https://files.pythonhosted.org/packages/97/bb/21c36b7dbbafc85d2d480cd65df02a1dc93bf76d97147605a8e27ff9409d/websockets-16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e0334872c0a37b606418ac52f6ab9cfd17317ac26365f7f65e203e2d0d0d359f", size = 186152, upload-time = "2026-01-10T09:22:52.224Z" }, + { url = "https://files.pythonhosted.org/packages/4a/34/9bf8df0c0cf88fa7bfe36678dc7b02970c9a7d5e065a3099292db87b1be2/websockets-16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a0b31e0b424cc6b5a04b8838bbaec1688834b2383256688cf47eb97412531da1", size = 185583, upload-time = "2026-01-10T09:22:53.443Z" }, + { url = "https://files.pythonhosted.org/packages/47/88/4dd516068e1a3d6ab3c7c183288404cd424a9a02d585efbac226cb61ff2d/websockets-16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:485c49116d0af10ac698623c513c1cc01c9446c058a4e61e3bf6c19dff7335a2", size = 184880, upload-time = "2026-01-10T09:22:55.033Z" }, + { url = "https://files.pythonhosted.org/packages/91/d6/7d4553ad4bf1c0421e1ebd4b18de5d9098383b5caa1d937b63df8d04b565/websockets-16.0-cp312-cp312-win32.whl", hash = "sha256:eaded469f5e5b7294e2bdca0ab06becb6756ea86894a47806456089298813c89", size = 178261, upload-time = "2026-01-10T09:22:56.251Z" }, + { url = "https://files.pythonhosted.org/packages/c3/f0/f3a17365441ed1c27f850a80b2bc680a0fa9505d733fe152fdf5e98c1c0b/websockets-16.0-cp312-cp312-win_amd64.whl", hash = "sha256:5569417dc80977fc8c2d43a86f78e0a5a22fee17565d78621b6bb264a115d4ea", size = 178693, upload-time = "2026-01-10T09:22:57.478Z" }, + { url = "https://files.pythonhosted.org/packages/cc/9c/baa8456050d1c1b08dd0ec7346026668cbc6f145ab4e314d707bb845bf0d/websockets-16.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:878b336ac47938b474c8f982ac2f7266a540adc3fa4ad74ae96fea9823a02cc9", size = 177364, upload-time = "2026-01-10T09:22:59.333Z" }, + { url = "https://files.pythonhosted.org/packages/7e/0c/8811fc53e9bcff68fe7de2bcbe75116a8d959ac699a3200f4847a8925210/websockets-16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:52a0fec0e6c8d9a784c2c78276a48a2bdf099e4ccc2a4cad53b27718dbfd0230", size = 175039, upload-time = "2026-01-10T09:23:01.171Z" }, + { url = "https://files.pythonhosted.org/packages/aa/82/39a5f910cb99ec0b59e482971238c845af9220d3ab9fa76dd9162cda9d62/websockets-16.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e6578ed5b6981005df1860a56e3617f14a6c307e6a71b4fff8c48fdc50f3ed2c", size = 175323, upload-time = "2026-01-10T09:23:02.341Z" }, + { url = "https://files.pythonhosted.org/packages/bd/28/0a25ee5342eb5d5f297d992a77e56892ecb65e7854c7898fb7d35e9b33bd/websockets-16.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95724e638f0f9c350bb1c2b0a7ad0e83d9cc0c9259f3ea94e40d7b02a2179ae5", size = 184975, upload-time = "2026-01-10T09:23:03.756Z" }, + { url = "https://files.pythonhosted.org/packages/f9/66/27ea52741752f5107c2e41fda05e8395a682a1e11c4e592a809a90c6a506/websockets-16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c0204dc62a89dc9d50d682412c10b3542d748260d743500a85c13cd1ee4bde82", size = 186203, upload-time = "2026-01-10T09:23:05.01Z" }, + { url = "https://files.pythonhosted.org/packages/37/e5/8e32857371406a757816a2b471939d51c463509be73fa538216ea52b792a/websockets-16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:52ac480f44d32970d66763115edea932f1c5b1312de36df06d6b219f6741eed8", size = 185653, upload-time = "2026-01-10T09:23:06.301Z" }, + { url = "https://files.pythonhosted.org/packages/9b/67/f926bac29882894669368dc73f4da900fcdf47955d0a0185d60103df5737/websockets-16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6e5a82b677f8f6f59e8dfc34ec06ca6b5b48bc4fcda346acd093694cc2c24d8f", size = 184920, upload-time = "2026-01-10T09:23:07.492Z" }, + { url = "https://files.pythonhosted.org/packages/3c/a1/3d6ccdcd125b0a42a311bcd15a7f705d688f73b2a22d8cf1c0875d35d34a/websockets-16.0-cp313-cp313-win32.whl", hash = "sha256:abf050a199613f64c886ea10f38b47770a65154dc37181bfaff70c160f45315a", size = 178255, upload-time = "2026-01-10T09:23:09.245Z" }, + { url = "https://files.pythonhosted.org/packages/6b/ae/90366304d7c2ce80f9b826096a9e9048b4bb760e44d3b873bb272cba696b/websockets-16.0-cp313-cp313-win_amd64.whl", hash = "sha256:3425ac5cf448801335d6fdc7ae1eb22072055417a96cc6b31b3861f455fbc156", size = 178689, upload-time = "2026-01-10T09:23:10.483Z" }, + { url = "https://files.pythonhosted.org/packages/f3/1d/e88022630271f5bd349ed82417136281931e558d628dd52c4d8621b4a0b2/websockets-16.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8cc451a50f2aee53042ac52d2d053d08bf89bcb31ae799cb4487587661c038a0", size = 177406, upload-time = "2026-01-10T09:23:12.178Z" }, + { url = "https://files.pythonhosted.org/packages/f2/78/e63be1bf0724eeb4616efb1ae1c9044f7c3953b7957799abb5915bffd38e/websockets-16.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:daa3b6ff70a9241cf6c7fc9e949d41232d9d7d26fd3522b1ad2b4d62487e9904", size = 175085, upload-time = "2026-01-10T09:23:13.511Z" }, + { url = "https://files.pythonhosted.org/packages/bb/f4/d3c9220d818ee955ae390cf319a7c7a467beceb24f05ee7aaaa2414345ba/websockets-16.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:fd3cb4adb94a2a6e2b7c0d8d05cb94e6f1c81a0cf9dc2694fb65c7e8d94c42e4", size = 175328, upload-time = "2026-01-10T09:23:14.727Z" }, + { url = "https://files.pythonhosted.org/packages/63/bc/d3e208028de777087e6fb2b122051a6ff7bbcca0d6df9d9c2bf1dd869ae9/websockets-16.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:781caf5e8eee67f663126490c2f96f40906594cb86b408a703630f95550a8c3e", size = 185044, upload-time = "2026-01-10T09:23:15.939Z" }, + { url = "https://files.pythonhosted.org/packages/ad/6e/9a0927ac24bd33a0a9af834d89e0abc7cfd8e13bed17a86407a66773cc0e/websockets-16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caab51a72c51973ca21fa8a18bd8165e1a0183f1ac7066a182ff27107b71e1a4", size = 186279, upload-time = "2026-01-10T09:23:17.148Z" }, + { url = "https://files.pythonhosted.org/packages/b9/ca/bf1c68440d7a868180e11be653c85959502efd3a709323230314fda6e0b3/websockets-16.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:19c4dc84098e523fd63711e563077d39e90ec6702aff4b5d9e344a60cb3c0cb1", size = 185711, upload-time = "2026-01-10T09:23:18.372Z" }, + { url = "https://files.pythonhosted.org/packages/c4/f8/fdc34643a989561f217bb477cbc47a3a07212cbda91c0e4389c43c296ebf/websockets-16.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a5e18a238a2b2249c9a9235466b90e96ae4795672598a58772dd806edc7ac6d3", size = 184982, upload-time = "2026-01-10T09:23:19.652Z" }, + { url = "https://files.pythonhosted.org/packages/dd/d1/574fa27e233764dbac9c52730d63fcf2823b16f0856b3329fc6268d6ae4f/websockets-16.0-cp314-cp314-win32.whl", hash = "sha256:a069d734c4a043182729edd3e9f247c3b2a4035415a9172fd0f1b71658a320a8", size = 177915, upload-time = "2026-01-10T09:23:21.458Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f1/ae6b937bf3126b5134ce1f482365fde31a357c784ac51852978768b5eff4/websockets-16.0-cp314-cp314-win_amd64.whl", hash = "sha256:c0ee0e63f23914732c6d7e0cce24915c48f3f1512ec1d079ed01fc629dab269d", size = 178381, upload-time = "2026-01-10T09:23:22.715Z" }, + { url = "https://files.pythonhosted.org/packages/06/9b/f791d1db48403e1f0a27577a6beb37afae94254a8c6f08be4a23e4930bc0/websockets-16.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:a35539cacc3febb22b8f4d4a99cc79b104226a756aa7400adc722e83b0d03244", size = 177737, upload-time = "2026-01-10T09:23:24.523Z" }, + { url = "https://files.pythonhosted.org/packages/bd/40/53ad02341fa33b3ce489023f635367a4ac98b73570102ad2cdd770dacc9a/websockets-16.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b784ca5de850f4ce93ec85d3269d24d4c82f22b7212023c974c401d4980ebc5e", size = 175268, upload-time = "2026-01-10T09:23:25.781Z" }, + { url = "https://files.pythonhosted.org/packages/74/9b/6158d4e459b984f949dcbbb0c5d270154c7618e11c01029b9bbd1bb4c4f9/websockets-16.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:569d01a4e7fba956c5ae4fc988f0d4e187900f5497ce46339c996dbf24f17641", size = 175486, upload-time = "2026-01-10T09:23:27.033Z" }, + { url = "https://files.pythonhosted.org/packages/e5/2d/7583b30208b639c8090206f95073646c2c9ffd66f44df967981a64f849ad/websockets-16.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:50f23cdd8343b984957e4077839841146f67a3d31ab0d00e6b824e74c5b2f6e8", size = 185331, upload-time = "2026-01-10T09:23:28.259Z" }, + { url = "https://files.pythonhosted.org/packages/45/b0/cce3784eb519b7b5ad680d14b9673a31ab8dcb7aad8b64d81709d2430aa8/websockets-16.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:152284a83a00c59b759697b7f9e9cddf4e3c7861dd0d964b472b70f78f89e80e", size = 186501, upload-time = "2026-01-10T09:23:29.449Z" }, + { url = "https://files.pythonhosted.org/packages/19/60/b8ebe4c7e89fb5f6cdf080623c9d92789a53636950f7abacfc33fe2b3135/websockets-16.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bc59589ab64b0022385f429b94697348a6a234e8ce22544e3681b2e9331b5944", size = 186062, upload-time = "2026-01-10T09:23:31.368Z" }, + { url = "https://files.pythonhosted.org/packages/88/a8/a080593f89b0138b6cba1b28f8df5673b5506f72879322288b031337c0b8/websockets-16.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:32da954ffa2814258030e5a57bc73a3635463238e797c7375dc8091327434206", size = 185356, upload-time = "2026-01-10T09:23:32.627Z" }, + { url = "https://files.pythonhosted.org/packages/c2/b6/b9afed2afadddaf5ebb2afa801abf4b0868f42f8539bfe4b071b5266c9fe/websockets-16.0-cp314-cp314t-win32.whl", hash = "sha256:5a4b4cc550cb665dd8a47f868c8d04c8230f857363ad3c9caf7a0c3bf8c61ca6", size = 178085, upload-time = "2026-01-10T09:23:33.816Z" }, + { url = "https://files.pythonhosted.org/packages/9f/3e/28135a24e384493fa804216b79a6a6759a38cc4ff59118787b9fb693df93/websockets-16.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b14dc141ed6d2dde437cddb216004bcac6a1df0935d79656387bd41632ba0bbd", size = 178531, upload-time = "2026-01-10T09:23:35.016Z" }, + { url = "https://files.pythonhosted.org/packages/72/07/c98a68571dcf256e74f1f816b8cc5eae6eb2d3d5cfa44d37f801619d9166/websockets-16.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:349f83cd6c9a415428ee1005cadb5c2c56f4389bc06a9af16103c3bc3dcc8b7d", size = 174947, upload-time = "2026-01-10T09:23:36.166Z" }, + { url = "https://files.pythonhosted.org/packages/7e/52/93e166a81e0305b33fe416338be92ae863563fe7bce446b0f687b9df5aea/websockets-16.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:4a1aba3340a8dca8db6eb5a7986157f52eb9e436b74813764241981ca4888f03", size = 175260, upload-time = "2026-01-10T09:23:37.409Z" }, + { url = "https://files.pythonhosted.org/packages/56/0c/2dbf513bafd24889d33de2ff0368190a0e69f37bcfa19009ef819fe4d507/websockets-16.0-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f4a32d1bd841d4bcbffdcb3d2ce50c09c3909fbead375ab28d0181af89fd04da", size = 176071, upload-time = "2026-01-10T09:23:39.158Z" }, + { url = "https://files.pythonhosted.org/packages/a5/8f/aea9c71cc92bf9b6cc0f7f70df8f0b420636b6c96ef4feee1e16f80f75dd/websockets-16.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0298d07ee155e2e9fda5be8a9042200dd2e3bb0b8a38482156576f863a9d457c", size = 176968, upload-time = "2026-01-10T09:23:41.031Z" }, + { url = "https://files.pythonhosted.org/packages/9a/3f/f70e03f40ffc9a30d817eef7da1be72ee4956ba8d7255c399a01b135902a/websockets-16.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:a653aea902e0324b52f1613332ddf50b00c06fdaf7e92624fbf8c77c78fa5767", size = 178735, upload-time = "2026-01-10T09:23:42.259Z" }, + { url = "https://files.pythonhosted.org/packages/6f/28/258ebab549c2bf3e64d2b0217b973467394a9cea8c42f70418ca2c5d0d2e/websockets-16.0-py3-none-any.whl", hash = "sha256:1637db62fad1dc833276dded54215f2c7fa46912301a24bd94d45d46a011ceec", size = 171598, upload-time = "2026-01-10T09:23:45.395Z" }, +] + +[[package]] +name = "wrapt" +version = "1.17.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/95/8f/aeb76c5b46e273670962298c23e7ddde79916cb74db802131d49a85e4b7d/wrapt-1.17.3.tar.gz", hash = "sha256:f66eb08feaa410fe4eebd17f2a2c8e2e46d3476e9f8c783daa8e09e0faa666d0", size = 55547, upload-time = "2025-08-12T05:53:21.714Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3f/23/bb82321b86411eb51e5a5db3fb8f8032fd30bd7c2d74bfe936136b2fa1d6/wrapt-1.17.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:88bbae4d40d5a46142e70d58bf664a89b6b4befaea7b2ecc14e03cedb8e06c04", size = 53482, upload-time = "2025-08-12T05:51:44.467Z" }, + { url = "https://files.pythonhosted.org/packages/45/69/f3c47642b79485a30a59c63f6d739ed779fb4cc8323205d047d741d55220/wrapt-1.17.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6b13af258d6a9ad602d57d889f83b9d5543acd471eee12eb51f5b01f8eb1bc2", size = 38676, upload-time = "2025-08-12T05:51:32.636Z" }, + { url = "https://files.pythonhosted.org/packages/d1/71/e7e7f5670c1eafd9e990438e69d8fb46fa91a50785332e06b560c869454f/wrapt-1.17.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd341868a4b6714a5962c1af0bd44f7c404ef78720c7de4892901e540417111c", size = 38957, upload-time = "2025-08-12T05:51:54.655Z" }, + { url = "https://files.pythonhosted.org/packages/de/17/9f8f86755c191d6779d7ddead1a53c7a8aa18bccb7cea8e7e72dfa6a8a09/wrapt-1.17.3-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f9b2601381be482f70e5d1051a5965c25fb3625455a2bf520b5a077b22afb775", size = 81975, upload-time = "2025-08-12T05:52:30.109Z" }, + { url = "https://files.pythonhosted.org/packages/f2/15/dd576273491f9f43dd09fce517f6c2ce6eb4fe21681726068db0d0467096/wrapt-1.17.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:343e44b2a8e60e06a7e0d29c1671a0d9951f59174f3709962b5143f60a2a98bd", size = 83149, upload-time = "2025-08-12T05:52:09.316Z" }, + { url = "https://files.pythonhosted.org/packages/0c/c4/5eb4ce0d4814521fee7aa806264bf7a114e748ad05110441cd5b8a5c744b/wrapt-1.17.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:33486899acd2d7d3066156b03465b949da3fd41a5da6e394ec49d271baefcf05", size = 82209, upload-time = "2025-08-12T05:52:10.331Z" }, + { url = "https://files.pythonhosted.org/packages/31/4b/819e9e0eb5c8dc86f60dfc42aa4e2c0d6c3db8732bce93cc752e604bb5f5/wrapt-1.17.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e6f40a8aa5a92f150bdb3e1c44b7e98fb7113955b2e5394122fa5532fec4b418", size = 81551, upload-time = "2025-08-12T05:52:31.137Z" }, + { url = "https://files.pythonhosted.org/packages/f8/83/ed6baf89ba3a56694700139698cf703aac9f0f9eb03dab92f57551bd5385/wrapt-1.17.3-cp310-cp310-win32.whl", hash = "sha256:a36692b8491d30a8c75f1dfee65bef119d6f39ea84ee04d9f9311f83c5ad9390", size = 36464, upload-time = "2025-08-12T05:53:01.204Z" }, + { url = "https://files.pythonhosted.org/packages/2f/90/ee61d36862340ad7e9d15a02529df6b948676b9a5829fd5e16640156627d/wrapt-1.17.3-cp310-cp310-win_amd64.whl", hash = "sha256:afd964fd43b10c12213574db492cb8f73b2f0826c8df07a68288f8f19af2ebe6", size = 38748, upload-time = "2025-08-12T05:53:00.209Z" }, + { url = "https://files.pythonhosted.org/packages/bd/c3/cefe0bd330d389c9983ced15d326f45373f4073c9f4a8c2f99b50bfea329/wrapt-1.17.3-cp310-cp310-win_arm64.whl", hash = "sha256:af338aa93554be859173c39c85243970dc6a289fa907402289eeae7543e1ae18", size = 36810, upload-time = "2025-08-12T05:52:51.906Z" }, + { url = "https://files.pythonhosted.org/packages/52/db/00e2a219213856074a213503fdac0511203dceefff26e1daa15250cc01a0/wrapt-1.17.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:273a736c4645e63ac582c60a56b0acb529ef07f78e08dc6bfadf6a46b19c0da7", size = 53482, upload-time = "2025-08-12T05:51:45.79Z" }, + { url = "https://files.pythonhosted.org/packages/5e/30/ca3c4a5eba478408572096fe9ce36e6e915994dd26a4e9e98b4f729c06d9/wrapt-1.17.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5531d911795e3f935a9c23eb1c8c03c211661a5060aab167065896bbf62a5f85", size = 38674, upload-time = "2025-08-12T05:51:34.629Z" }, + { url = "https://files.pythonhosted.org/packages/31/25/3e8cc2c46b5329c5957cec959cb76a10718e1a513309c31399a4dad07eb3/wrapt-1.17.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0610b46293c59a3adbae3dee552b648b984176f8562ee0dba099a56cfbe4df1f", size = 38959, upload-time = "2025-08-12T05:51:56.074Z" }, + { url = "https://files.pythonhosted.org/packages/5d/8f/a32a99fc03e4b37e31b57cb9cefc65050ea08147a8ce12f288616b05ef54/wrapt-1.17.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b32888aad8b6e68f83a8fdccbf3165f5469702a7544472bdf41f582970ed3311", size = 82376, upload-time = "2025-08-12T05:52:32.134Z" }, + { url = "https://files.pythonhosted.org/packages/31/57/4930cb8d9d70d59c27ee1332a318c20291749b4fba31f113c2f8ac49a72e/wrapt-1.17.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cccf4f81371f257440c88faed6b74f1053eef90807b77e31ca057b2db74edb1", size = 83604, upload-time = "2025-08-12T05:52:11.663Z" }, + { url = "https://files.pythonhosted.org/packages/a8/f3/1afd48de81d63dd66e01b263a6fbb86e1b5053b419b9b33d13e1f6d0f7d0/wrapt-1.17.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8a210b158a34164de8bb68b0e7780041a903d7b00c87e906fb69928bf7890d5", size = 82782, upload-time = "2025-08-12T05:52:12.626Z" }, + { url = "https://files.pythonhosted.org/packages/1e/d7/4ad5327612173b144998232f98a85bb24b60c352afb73bc48e3e0d2bdc4e/wrapt-1.17.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:79573c24a46ce11aab457b472efd8d125e5a51da2d1d24387666cd85f54c05b2", size = 82076, upload-time = "2025-08-12T05:52:33.168Z" }, + { url = "https://files.pythonhosted.org/packages/bb/59/e0adfc831674a65694f18ea6dc821f9fcb9ec82c2ce7e3d73a88ba2e8718/wrapt-1.17.3-cp311-cp311-win32.whl", hash = "sha256:c31eebe420a9a5d2887b13000b043ff6ca27c452a9a22fa71f35f118e8d4bf89", size = 36457, upload-time = "2025-08-12T05:53:03.936Z" }, + { url = "https://files.pythonhosted.org/packages/83/88/16b7231ba49861b6f75fc309b11012ede4d6b0a9c90969d9e0db8d991aeb/wrapt-1.17.3-cp311-cp311-win_amd64.whl", hash = "sha256:0b1831115c97f0663cb77aa27d381237e73ad4f721391a9bfb2fe8bc25fa6e77", size = 38745, upload-time = "2025-08-12T05:53:02.885Z" }, + { url = "https://files.pythonhosted.org/packages/9a/1e/c4d4f3398ec073012c51d1c8d87f715f56765444e1a4b11e5180577b7e6e/wrapt-1.17.3-cp311-cp311-win_arm64.whl", hash = "sha256:5a7b3c1ee8265eb4c8f1b7d29943f195c00673f5ab60c192eba2d4a7eae5f46a", size = 36806, upload-time = "2025-08-12T05:52:53.368Z" }, + { url = "https://files.pythonhosted.org/packages/9f/41/cad1aba93e752f1f9268c77270da3c469883d56e2798e7df6240dcb2287b/wrapt-1.17.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:ab232e7fdb44cdfbf55fc3afa31bcdb0d8980b9b95c38b6405df2acb672af0e0", size = 53998, upload-time = "2025-08-12T05:51:47.138Z" }, + { url = "https://files.pythonhosted.org/packages/60/f8/096a7cc13097a1869fe44efe68dace40d2a16ecb853141394047f0780b96/wrapt-1.17.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:9baa544e6acc91130e926e8c802a17f3b16fbea0fd441b5a60f5cf2cc5c3deba", size = 39020, upload-time = "2025-08-12T05:51:35.906Z" }, + { url = "https://files.pythonhosted.org/packages/33/df/bdf864b8997aab4febb96a9ae5c124f700a5abd9b5e13d2a3214ec4be705/wrapt-1.17.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6b538e31eca1a7ea4605e44f81a48aa24c4632a277431a6ed3f328835901f4fd", size = 39098, upload-time = "2025-08-12T05:51:57.474Z" }, + { url = "https://files.pythonhosted.org/packages/9f/81/5d931d78d0eb732b95dc3ddaeeb71c8bb572fb01356e9133916cd729ecdd/wrapt-1.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:042ec3bb8f319c147b1301f2393bc19dba6e176b7da446853406d041c36c7828", size = 88036, upload-time = "2025-08-12T05:52:34.784Z" }, + { url = "https://files.pythonhosted.org/packages/ca/38/2e1785df03b3d72d34fc6252d91d9d12dc27a5c89caef3335a1bbb8908ca/wrapt-1.17.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3af60380ba0b7b5aeb329bc4e402acd25bd877e98b3727b0135cb5c2efdaefe9", size = 88156, upload-time = "2025-08-12T05:52:13.599Z" }, + { url = "https://files.pythonhosted.org/packages/b3/8b/48cdb60fe0603e34e05cffda0b2a4adab81fd43718e11111a4b0100fd7c1/wrapt-1.17.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0b02e424deef65c9f7326d8c19220a2c9040c51dc165cddb732f16198c168396", size = 87102, upload-time = "2025-08-12T05:52:14.56Z" }, + { url = "https://files.pythonhosted.org/packages/3c/51/d81abca783b58f40a154f1b2c56db1d2d9e0d04fa2d4224e357529f57a57/wrapt-1.17.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:74afa28374a3c3a11b3b5e5fca0ae03bef8450d6aa3ab3a1e2c30e3a75d023dc", size = 87732, upload-time = "2025-08-12T05:52:36.165Z" }, + { url = "https://files.pythonhosted.org/packages/9e/b1/43b286ca1392a006d5336412d41663eeef1ad57485f3e52c767376ba7e5a/wrapt-1.17.3-cp312-cp312-win32.whl", hash = "sha256:4da9f45279fff3543c371d5ababc57a0384f70be244de7759c85a7f989cb4ebe", size = 36705, upload-time = "2025-08-12T05:53:07.123Z" }, + { url = "https://files.pythonhosted.org/packages/28/de/49493f962bd3c586ab4b88066e967aa2e0703d6ef2c43aa28cb83bf7b507/wrapt-1.17.3-cp312-cp312-win_amd64.whl", hash = "sha256:e71d5c6ebac14875668a1e90baf2ea0ef5b7ac7918355850c0908ae82bcb297c", size = 38877, upload-time = "2025-08-12T05:53:05.436Z" }, + { url = "https://files.pythonhosted.org/packages/f1/48/0f7102fe9cb1e8a5a77f80d4f0956d62d97034bbe88d33e94699f99d181d/wrapt-1.17.3-cp312-cp312-win_arm64.whl", hash = "sha256:604d076c55e2fdd4c1c03d06dc1a31b95130010517b5019db15365ec4a405fc6", size = 36885, upload-time = "2025-08-12T05:52:54.367Z" }, + { url = "https://files.pythonhosted.org/packages/fc/f6/759ece88472157acb55fc195e5b116e06730f1b651b5b314c66291729193/wrapt-1.17.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a47681378a0439215912ef542c45a783484d4dd82bac412b71e59cf9c0e1cea0", size = 54003, upload-time = "2025-08-12T05:51:48.627Z" }, + { url = "https://files.pythonhosted.org/packages/4f/a9/49940b9dc6d47027dc850c116d79b4155f15c08547d04db0f07121499347/wrapt-1.17.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:54a30837587c6ee3cd1a4d1c2ec5d24e77984d44e2f34547e2323ddb4e22eb77", size = 39025, upload-time = "2025-08-12T05:51:37.156Z" }, + { url = "https://files.pythonhosted.org/packages/45/35/6a08de0f2c96dcdd7fe464d7420ddb9a7655a6561150e5fc4da9356aeaab/wrapt-1.17.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:16ecf15d6af39246fe33e507105d67e4b81d8f8d2c6598ff7e3ca1b8a37213f7", size = 39108, upload-time = "2025-08-12T05:51:58.425Z" }, + { url = "https://files.pythonhosted.org/packages/0c/37/6faf15cfa41bf1f3dba80cd3f5ccc6622dfccb660ab26ed79f0178c7497f/wrapt-1.17.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:6fd1ad24dc235e4ab88cda009e19bf347aabb975e44fd5c2fb22a3f6e4141277", size = 88072, upload-time = "2025-08-12T05:52:37.53Z" }, + { url = "https://files.pythonhosted.org/packages/78/f2/efe19ada4a38e4e15b6dff39c3e3f3f73f5decf901f66e6f72fe79623a06/wrapt-1.17.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0ed61b7c2d49cee3c027372df5809a59d60cf1b6c2f81ee980a091f3afed6a2d", size = 88214, upload-time = "2025-08-12T05:52:15.886Z" }, + { url = "https://files.pythonhosted.org/packages/40/90/ca86701e9de1622b16e09689fc24b76f69b06bb0150990f6f4e8b0eeb576/wrapt-1.17.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:423ed5420ad5f5529db9ce89eac09c8a2f97da18eb1c870237e84c5a5c2d60aa", size = 87105, upload-time = "2025-08-12T05:52:17.914Z" }, + { url = "https://files.pythonhosted.org/packages/fd/e0/d10bd257c9a3e15cbf5523025252cc14d77468e8ed644aafb2d6f54cb95d/wrapt-1.17.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e01375f275f010fcbf7f643b4279896d04e571889b8a5b3f848423d91bf07050", size = 87766, upload-time = "2025-08-12T05:52:39.243Z" }, + { url = "https://files.pythonhosted.org/packages/e8/cf/7d848740203c7b4b27eb55dbfede11aca974a51c3d894f6cc4b865f42f58/wrapt-1.17.3-cp313-cp313-win32.whl", hash = "sha256:53e5e39ff71b3fc484df8a522c933ea2b7cdd0d5d15ae82e5b23fde87d44cbd8", size = 36711, upload-time = "2025-08-12T05:53:10.074Z" }, + { url = "https://files.pythonhosted.org/packages/57/54/35a84d0a4d23ea675994104e667ceff49227ce473ba6a59ba2c84f250b74/wrapt-1.17.3-cp313-cp313-win_amd64.whl", hash = "sha256:1f0b2f40cf341ee8cc1a97d51ff50dddb9fcc73241b9143ec74b30fc4f44f6cb", size = 38885, upload-time = "2025-08-12T05:53:08.695Z" }, + { url = "https://files.pythonhosted.org/packages/01/77/66e54407c59d7b02a3c4e0af3783168fff8e5d61def52cda8728439d86bc/wrapt-1.17.3-cp313-cp313-win_arm64.whl", hash = "sha256:7425ac3c54430f5fc5e7b6f41d41e704db073309acfc09305816bc6a0b26bb16", size = 36896, upload-time = "2025-08-12T05:52:55.34Z" }, + { url = "https://files.pythonhosted.org/packages/02/a2/cd864b2a14f20d14f4c496fab97802001560f9f41554eef6df201cd7f76c/wrapt-1.17.3-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cf30f6e3c077c8e6a9a7809c94551203c8843e74ba0c960f4a98cd80d4665d39", size = 54132, upload-time = "2025-08-12T05:51:49.864Z" }, + { url = "https://files.pythonhosted.org/packages/d5/46/d011725b0c89e853dc44cceb738a307cde5d240d023d6d40a82d1b4e1182/wrapt-1.17.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:e228514a06843cae89621384cfe3a80418f3c04aadf8a3b14e46a7be704e4235", size = 39091, upload-time = "2025-08-12T05:51:38.935Z" }, + { url = "https://files.pythonhosted.org/packages/2e/9e/3ad852d77c35aae7ddebdbc3b6d35ec8013af7d7dddad0ad911f3d891dae/wrapt-1.17.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:5ea5eb3c0c071862997d6f3e02af1d055f381b1d25b286b9d6644b79db77657c", size = 39172, upload-time = "2025-08-12T05:51:59.365Z" }, + { url = "https://files.pythonhosted.org/packages/c3/f7/c983d2762bcce2326c317c26a6a1e7016f7eb039c27cdf5c4e30f4160f31/wrapt-1.17.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:281262213373b6d5e4bb4353bc36d1ba4084e6d6b5d242863721ef2bf2c2930b", size = 87163, upload-time = "2025-08-12T05:52:40.965Z" }, + { url = "https://files.pythonhosted.org/packages/e4/0f/f673f75d489c7f22d17fe0193e84b41540d962f75fce579cf6873167c29b/wrapt-1.17.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dc4a8d2b25efb6681ecacad42fca8859f88092d8732b170de6a5dddd80a1c8fa", size = 87963, upload-time = "2025-08-12T05:52:20.326Z" }, + { url = "https://files.pythonhosted.org/packages/df/61/515ad6caca68995da2fac7a6af97faab8f78ebe3bf4f761e1b77efbc47b5/wrapt-1.17.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:373342dd05b1d07d752cecbec0c41817231f29f3a89aa8b8843f7b95992ed0c7", size = 86945, upload-time = "2025-08-12T05:52:21.581Z" }, + { url = "https://files.pythonhosted.org/packages/d3/bd/4e70162ce398462a467bc09e768bee112f1412e563620adc353de9055d33/wrapt-1.17.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d40770d7c0fd5cbed9d84b2c3f2e156431a12c9a37dc6284060fb4bec0b7ffd4", size = 86857, upload-time = "2025-08-12T05:52:43.043Z" }, + { url = "https://files.pythonhosted.org/packages/2b/b8/da8560695e9284810b8d3df8a19396a6e40e7518059584a1a394a2b35e0a/wrapt-1.17.3-cp314-cp314-win32.whl", hash = "sha256:fbd3c8319de8e1dc79d346929cd71d523622da527cca14e0c1d257e31c2b8b10", size = 37178, upload-time = "2025-08-12T05:53:12.605Z" }, + { url = "https://files.pythonhosted.org/packages/db/c8/b71eeb192c440d67a5a0449aaee2310a1a1e8eca41676046f99ed2487e9f/wrapt-1.17.3-cp314-cp314-win_amd64.whl", hash = "sha256:e1a4120ae5705f673727d3253de3ed0e016f7cd78dc463db1b31e2463e1f3cf6", size = 39310, upload-time = "2025-08-12T05:53:11.106Z" }, + { url = "https://files.pythonhosted.org/packages/45/20/2cda20fd4865fa40f86f6c46ed37a2a8356a7a2fde0773269311f2af56c7/wrapt-1.17.3-cp314-cp314-win_arm64.whl", hash = "sha256:507553480670cab08a800b9463bdb881b2edeed77dc677b0a5915e6106e91a58", size = 37266, upload-time = "2025-08-12T05:52:56.531Z" }, + { url = "https://files.pythonhosted.org/packages/77/ed/dd5cf21aec36c80443c6f900449260b80e2a65cf963668eaef3b9accce36/wrapt-1.17.3-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:ed7c635ae45cfbc1a7371f708727bf74690daedc49b4dba310590ca0bd28aa8a", size = 56544, upload-time = "2025-08-12T05:51:51.109Z" }, + { url = "https://files.pythonhosted.org/packages/8d/96/450c651cc753877ad100c7949ab4d2e2ecc4d97157e00fa8f45df682456a/wrapt-1.17.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:249f88ed15503f6492a71f01442abddd73856a0032ae860de6d75ca62eed8067", size = 40283, upload-time = "2025-08-12T05:51:39.912Z" }, + { url = "https://files.pythonhosted.org/packages/d1/86/2fcad95994d9b572db57632acb6f900695a648c3e063f2cd344b3f5c5a37/wrapt-1.17.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5a03a38adec8066d5a37bea22f2ba6bbf39fcdefbe2d91419ab864c3fb515454", size = 40366, upload-time = "2025-08-12T05:52:00.693Z" }, + { url = "https://files.pythonhosted.org/packages/64/0e/f4472f2fdde2d4617975144311f8800ef73677a159be7fe61fa50997d6c0/wrapt-1.17.3-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:5d4478d72eb61c36e5b446e375bbc49ed002430d17cdec3cecb36993398e1a9e", size = 108571, upload-time = "2025-08-12T05:52:44.521Z" }, + { url = "https://files.pythonhosted.org/packages/cc/01/9b85a99996b0a97c8a17484684f206cbb6ba73c1ce6890ac668bcf3838fb/wrapt-1.17.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:223db574bb38637e8230eb14b185565023ab624474df94d2af18f1cdb625216f", size = 113094, upload-time = "2025-08-12T05:52:22.618Z" }, + { url = "https://files.pythonhosted.org/packages/25/02/78926c1efddcc7b3aa0bc3d6b33a822f7d898059f7cd9ace8c8318e559ef/wrapt-1.17.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e405adefb53a435f01efa7ccdec012c016b5a1d3f35459990afc39b6be4d5056", size = 110659, upload-time = "2025-08-12T05:52:24.057Z" }, + { url = "https://files.pythonhosted.org/packages/dc/ee/c414501ad518ac3e6fe184753632fe5e5ecacdcf0effc23f31c1e4f7bfcf/wrapt-1.17.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:88547535b787a6c9ce4086917b6e1d291aa8ed914fdd3a838b3539dc95c12804", size = 106946, upload-time = "2025-08-12T05:52:45.976Z" }, + { url = "https://files.pythonhosted.org/packages/be/44/a1bd64b723d13bb151d6cc91b986146a1952385e0392a78567e12149c7b4/wrapt-1.17.3-cp314-cp314t-win32.whl", hash = "sha256:41b1d2bc74c2cac6f9074df52b2efbef2b30bdfe5f40cb78f8ca22963bc62977", size = 38717, upload-time = "2025-08-12T05:53:15.214Z" }, + { url = "https://files.pythonhosted.org/packages/79/d9/7cfd5a312760ac4dd8bf0184a6ee9e43c33e47f3dadc303032ce012b8fa3/wrapt-1.17.3-cp314-cp314t-win_amd64.whl", hash = "sha256:73d496de46cd2cdbdbcce4ae4bcdb4afb6a11234a1df9c085249d55166b95116", size = 41334, upload-time = "2025-08-12T05:53:14.178Z" }, + { url = "https://files.pythonhosted.org/packages/46/78/10ad9781128ed2f99dbc474f43283b13fea8ba58723e98844367531c18e9/wrapt-1.17.3-cp314-cp314t-win_arm64.whl", hash = "sha256:f38e60678850c42461d4202739f9bf1e3a737c7ad283638251e79cc49effb6b6", size = 38471, upload-time = "2025-08-12T05:52:57.784Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f6/a933bd70f98e9cf3e08167fc5cd7aaaca49147e48411c0bd5ae701bb2194/wrapt-1.17.3-py3-none-any.whl", hash = "sha256:7171ae35d2c33d326ac19dd8facb1e82e5fd04ef8c6c0e394d7af55a55051c22", size = 23591, upload-time = "2025-08-12T05:53:20.674Z" }, +] + +[[package]] +name = "yarl" +version = "1.23.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "multidict" }, + { name = "propcache" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/23/6e/beb1beec874a72f23815c1434518bfc4ed2175065173fb138c3705f658d4/yarl-1.23.0.tar.gz", hash = "sha256:53b1ea6ca88ebd4420379c330aea57e258408dd0df9af0992e5de2078dc9f5d5", size = 194676, upload-time = "2026-03-01T22:07:53.373Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8b/0d/9cc638702f6fc3c7a3685bcc8cf2a9ed7d6206e932a49f5242658047ef51/yarl-1.23.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cff6d44cb13d39db2663a22b22305d10855efa0fa8015ddeacc40bc59b9d8107", size = 123764, upload-time = "2026-03-01T22:04:09.7Z" }, + { url = "https://files.pythonhosted.org/packages/7a/35/5a553687c5793df5429cd1db45909d4f3af7eee90014888c208d086a44f0/yarl-1.23.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e4c53f8347cd4200f0d70a48ad059cabaf24f5adc6ba08622a23423bc7efa10d", size = 86282, upload-time = "2026-03-01T22:04:11.892Z" }, + { url = "https://files.pythonhosted.org/packages/68/2e/c5a2234238f8ce37a8312b52801ee74117f576b1539eec8404a480434acc/yarl-1.23.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2a6940a074fb3c48356ed0158a3ca5699c955ee4185b4d7d619be3c327143e05", size = 86053, upload-time = "2026-03-01T22:04:13.292Z" }, + { url = "https://files.pythonhosted.org/packages/74/3f/bbd8ff36fb038622797ffbaf7db314918bb4d76f1cc8a4f9ca7a55fe5195/yarl-1.23.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ed5f69ce7be7902e5c70ea19eb72d20abf7d725ab5d49777d696e32d4fc1811d", size = 99395, upload-time = "2026-03-01T22:04:15.133Z" }, + { url = "https://files.pythonhosted.org/packages/77/04/9516bc4e269d2a3ec9c6779fcdeac51ce5b3a9b0156f06ac7152e5bba864/yarl-1.23.0-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:389871e65468400d6283c0308e791a640b5ab5c83bcee02a2f51295f95e09748", size = 92143, upload-time = "2026-03-01T22:04:16.829Z" }, + { url = "https://files.pythonhosted.org/packages/c7/63/88802d1f6b1cb1fc67d67a58cd0cf8a1790de4ce7946e434240f1d60ab4a/yarl-1.23.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:dda608c88cf709b1d406bdfcd84d8d63cff7c9e577a403c6108ce8ce9dcc8764", size = 107643, upload-time = "2026-03-01T22:04:18.519Z" }, + { url = "https://files.pythonhosted.org/packages/8e/db/4f9b838f4d8bdd6f0f385aed8bbf21c71ed11a0b9983305c302cbd557815/yarl-1.23.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8c4fe09e0780c6c3bf2b7d4af02ee2394439d11a523bbcf095cf4747c2932007", size = 108700, upload-time = "2026-03-01T22:04:20.373Z" }, + { url = "https://files.pythonhosted.org/packages/50/12/95a1d33f04a79c402664070d43b8b9f72dc18914e135b345b611b0b1f8cc/yarl-1.23.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:31c9921eb8bd12633b41ad27686bbb0b1a2a9b8452bfdf221e34f311e9942ed4", size = 102769, upload-time = "2026-03-01T22:04:23.055Z" }, + { url = "https://files.pythonhosted.org/packages/86/65/91a0285f51321369fd1a8308aa19207520c5f0587772cfc2e03fc2467e90/yarl-1.23.0-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5f10fd85e4b75967468af655228fbfd212bdf66db1c0d135065ce288982eda26", size = 101114, upload-time = "2026-03-01T22:04:25.031Z" }, + { url = "https://files.pythonhosted.org/packages/58/80/c7c8244fc3e5bc483dc71a09560f43b619fab29301a0f0a8f936e42865c7/yarl-1.23.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:dbf507e9ef5688bada447a24d68b4b58dd389ba93b7afc065a2ba892bea54769", size = 98883, upload-time = "2026-03-01T22:04:27.281Z" }, + { url = "https://files.pythonhosted.org/packages/86/e7/71ca9cc9ca79c0b7d491216177d1aed559d632947b8ffb0ee60f7d8b23e3/yarl-1.23.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:85e9beda1f591bc73e77ea1c51965c68e98dafd0fec72cdd745f77d727466716", size = 94172, upload-time = "2026-03-01T22:04:28.554Z" }, + { url = "https://files.pythonhosted.org/packages/6a/3f/6c6c8a0fe29c26fb2db2e8d32195bb84ec1bfb8f1d32e7f73b787fcf349b/yarl-1.23.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0e1fdaa14ef51366d7757b45bde294e95f6c8c049194e793eedb8387c86d5993", size = 107010, upload-time = "2026-03-01T22:04:30.385Z" }, + { url = "https://files.pythonhosted.org/packages/56/38/12730c05e5ad40a76374d440ed8b0899729a96c250516d91c620a6e38fc2/yarl-1.23.0-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:75e3026ab649bf48f9a10c0134512638725b521340293f202a69b567518d94e0", size = 100285, upload-time = "2026-03-01T22:04:31.752Z" }, + { url = "https://files.pythonhosted.org/packages/34/92/6a7be9239f2347234e027284e7a5f74b1140cc86575e7b469d13fba1ebfe/yarl-1.23.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:80e6d33a3d42a7549b409f199857b4fb54e2103fc44fb87605b6663b7a7ff750", size = 108230, upload-time = "2026-03-01T22:04:33.844Z" }, + { url = "https://files.pythonhosted.org/packages/5e/81/4aebccfa9376bd98b9d8bfad20621a57d3e8cfc5b8631c1fa5f62cdd03f4/yarl-1.23.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5ec2f42d41ccbd5df0270d7df31618a8ee267bfa50997f5d720ddba86c4a83a6", size = 103008, upload-time = "2026-03-01T22:04:35.856Z" }, + { url = "https://files.pythonhosted.org/packages/38/0f/0b4e3edcec794a86b853b0c6396c0a888d72dfce19b2d88c02ac289fb6c1/yarl-1.23.0-cp310-cp310-win32.whl", hash = "sha256:debe9c4f41c32990771be5c22b56f810659f9ddf3d63f67abfdcaa2c6c9c5c1d", size = 83073, upload-time = "2026-03-01T22:04:38.268Z" }, + { url = "https://files.pythonhosted.org/packages/a0/71/ad95c33da18897e4c636528bbc24a1dd23fe16797de8bc4ec667b8db0ba4/yarl-1.23.0-cp310-cp310-win_amd64.whl", hash = "sha256:ab5f043cb8a2d71c981c09c510da013bc79fd661f5c60139f00dd3c3cc4f2ffb", size = 87328, upload-time = "2026-03-01T22:04:39.558Z" }, + { url = "https://files.pythonhosted.org/packages/e2/14/dfa369523c79bccf9c9c746b0a63eb31f65db9418ac01275f7950962e504/yarl-1.23.0-cp310-cp310-win_arm64.whl", hash = "sha256:263cd4f47159c09b8b685890af949195b51d1aa82ba451c5847ca9bc6413c220", size = 82463, upload-time = "2026-03-01T22:04:41.454Z" }, + { url = "https://files.pythonhosted.org/packages/a2/aa/60da938b8f0997ba3a911263c40d82b6f645a67902a490b46f3355e10fae/yarl-1.23.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b35d13d549077713e4414f927cdc388d62e543987c572baee613bf82f11a4b99", size = 123641, upload-time = "2026-03-01T22:04:42.841Z" }, + { url = "https://files.pythonhosted.org/packages/24/84/e237607faf4e099dbb8a4f511cfd5efcb5f75918baad200ff7380635631b/yarl-1.23.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cbb0fef01f0c6b38cb0f39b1f78fc90b807e0e3c86a7ff3ce74ad77ce5c7880c", size = 86248, upload-time = "2026-03-01T22:04:44.757Z" }, + { url = "https://files.pythonhosted.org/packages/b2/0d/71ceabc14c146ba8ee3804ca7b3d42b1664c8440439de5214d366fec7d3a/yarl-1.23.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dc52310451fc7c629e13c4e061cbe2dd01684d91f2f8ee2821b083c58bd72432", size = 85988, upload-time = "2026-03-01T22:04:46.365Z" }, + { url = "https://files.pythonhosted.org/packages/8c/6c/4a90d59c572e46b270ca132aca66954f1175abd691f74c1ef4c6711828e2/yarl-1.23.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b2c6b50c7b0464165472b56b42d4c76a7b864597007d9c085e8b63e185cf4a7a", size = 100566, upload-time = "2026-03-01T22:04:47.639Z" }, + { url = "https://files.pythonhosted.org/packages/49/fb/c438fb5108047e629f6282a371e6e91cf3f97ee087c4fb748a1f32ceef55/yarl-1.23.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:aafe5dcfda86c8af00386d7781d4c2181b5011b7be3f2add5e99899ea925df05", size = 92079, upload-time = "2026-03-01T22:04:48.925Z" }, + { url = "https://files.pythonhosted.org/packages/d9/13/d269aa1aed3e4f50a5a103f96327210cc5fa5dd2d50882778f13c7a14606/yarl-1.23.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9ee33b875f0b390564c1fb7bc528abf18c8ee6073b201c6ae8524aca778e2d83", size = 108741, upload-time = "2026-03-01T22:04:50.838Z" }, + { url = "https://files.pythonhosted.org/packages/85/fb/115b16f22c37ea4437d323e472945bea97301c8ec6089868fa560abab590/yarl-1.23.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4c41e021bc6d7affb3364dc1e1e5fa9582b470f283748784bd6ea0558f87f42c", size = 108099, upload-time = "2026-03-01T22:04:52.499Z" }, + { url = "https://files.pythonhosted.org/packages/9a/64/c53487d9f4968045b8afa51aed7ca44f58b2589e772f32745f3744476c82/yarl-1.23.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:99c8a9ed30f4164bc4c14b37a90208836cbf50d4ce2a57c71d0f52c7fb4f7598", size = 102678, upload-time = "2026-03-01T22:04:55.176Z" }, + { url = "https://files.pythonhosted.org/packages/85/59/cd98e556fbb2bf8fab29c1a722f67ad45c5f3447cac798ab85620d1e70af/yarl-1.23.0-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f2af5c81a1f124609d5f33507082fc3f739959d4719b56877ab1ee7e7b3d602b", size = 100803, upload-time = "2026-03-01T22:04:56.588Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c0/b39770b56d4a9f0bb5f77e2f1763cd2d75cc2f6c0131e3b4c360348fcd65/yarl-1.23.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6b41389c19b07c760c7e427a3462e8ab83c4bb087d127f0e854c706ce1b9215c", size = 100163, upload-time = "2026-03-01T22:04:58.492Z" }, + { url = "https://files.pythonhosted.org/packages/e7/64/6980f99ab00e1f0ff67cb84766c93d595b067eed07439cfccfc8fb28c1a6/yarl-1.23.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:1dc702e42d0684f42d6519c8d581e49c96cefaaab16691f03566d30658ee8788", size = 93859, upload-time = "2026-03-01T22:05:00.268Z" }, + { url = "https://files.pythonhosted.org/packages/38/69/912e6c5e146793e5d4b5fe39ff5b00f4d22463dfd5a162bec565ac757673/yarl-1.23.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:0e40111274f340d32ebcc0a5668d54d2b552a6cca84c9475859d364b380e3222", size = 108202, upload-time = "2026-03-01T22:05:02.273Z" }, + { url = "https://files.pythonhosted.org/packages/59/97/35ca6767524687ad64e5f5c31ad54bc76d585585a9fcb40f649e7e82ffed/yarl-1.23.0-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:4764a6a7588561a9aef92f65bda2c4fb58fe7c675c0883862e6df97559de0bfb", size = 99866, upload-time = "2026-03-01T22:05:03.597Z" }, + { url = "https://files.pythonhosted.org/packages/d3/1c/1a3387ee6d73589f6f2a220ae06f2984f6c20b40c734989b0a44f5987308/yarl-1.23.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:03214408cfa590df47728b84c679ae4ef00be2428e11630277be0727eba2d7cc", size = 107852, upload-time = "2026-03-01T22:05:04.986Z" }, + { url = "https://files.pythonhosted.org/packages/a4/b8/35c0750fcd5a3f781058bfd954515dd4b1eab45e218cbb85cf11132215f1/yarl-1.23.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:170e26584b060879e29fac213e4228ef063f39128723807a312e5c7fec28eff2", size = 102919, upload-time = "2026-03-01T22:05:06.397Z" }, + { url = "https://files.pythonhosted.org/packages/e5/1c/9a1979aec4a81896d597bcb2177827f2dbee3f5b7cc48b2d0dadb644b41d/yarl-1.23.0-cp311-cp311-win32.whl", hash = "sha256:51430653db848d258336cfa0244427b17d12db63d42603a55f0d4546f50f25b5", size = 82602, upload-time = "2026-03-01T22:05:08.444Z" }, + { url = "https://files.pythonhosted.org/packages/93/22/b85eca6fa2ad9491af48c973e4c8cf6b103a73dbb271fe3346949449fca0/yarl-1.23.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf49a3ae946a87083ef3a34c8f677ae4243f5b824bfc4c69672e72b3d6719d46", size = 87461, upload-time = "2026-03-01T22:05:10.145Z" }, + { url = "https://files.pythonhosted.org/packages/93/95/07e3553fe6f113e6864a20bdc53a78113cda3b9ced8784ee52a52c9f80d8/yarl-1.23.0-cp311-cp311-win_arm64.whl", hash = "sha256:b39cb32a6582750b6cc77bfb3c49c0f8760dc18dc96ec9fb55fbb0f04e08b928", size = 82336, upload-time = "2026-03-01T22:05:11.554Z" }, + { url = "https://files.pythonhosted.org/packages/88/8a/94615bc31022f711add374097ad4144d569e95ff3c38d39215d07ac153a0/yarl-1.23.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1932b6b8bba8d0160a9d1078aae5838a66039e8832d41d2992daa9a3a08f7860", size = 124737, upload-time = "2026-03-01T22:05:12.897Z" }, + { url = "https://files.pythonhosted.org/packages/e3/6f/c6554045d59d64052698add01226bc867b52fe4a12373415d7991fdca95d/yarl-1.23.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:411225bae281f114067578891bc75534cfb3d92a3b4dfef7a6ca78ba354e6069", size = 87029, upload-time = "2026-03-01T22:05:14.376Z" }, + { url = "https://files.pythonhosted.org/packages/19/2a/725ecc166d53438bc88f76822ed4b1e3b10756e790bafd7b523fe97c322d/yarl-1.23.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:13a563739ae600a631c36ce096615fe307f131344588b0bc0daec108cdb47b25", size = 86310, upload-time = "2026-03-01T22:05:15.71Z" }, + { url = "https://files.pythonhosted.org/packages/99/30/58260ed98e6ff7f90ba84442c1ddd758c9170d70327394a6227b310cd60f/yarl-1.23.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9cbf44c5cb4a7633d078788e1b56387e3d3cf2b8139a3be38040b22d6c3221c8", size = 97587, upload-time = "2026-03-01T22:05:17.384Z" }, + { url = "https://files.pythonhosted.org/packages/76/0a/8b08aac08b50682e65759f7f8dde98ae8168f72487e7357a5d684c581ef9/yarl-1.23.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:53ad387048f6f09a8969631e4de3f1bf70c50e93545d64af4f751b2498755072", size = 92528, upload-time = "2026-03-01T22:05:18.804Z" }, + { url = "https://files.pythonhosted.org/packages/52/07/0b7179101fe5f8385ec6c6bb5d0cb9f76bd9fb4a769591ab6fb5cdbfc69a/yarl-1.23.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4a59ba56f340334766f3a4442e0efd0af895fae9e2b204741ef885c446b3a1a8", size = 105339, upload-time = "2026-03-01T22:05:20.235Z" }, + { url = "https://files.pythonhosted.org/packages/d3/8a/36d82869ab5ec829ca8574dfcb92b51286fcfb1e9c7a73659616362dc880/yarl-1.23.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:803a3c3ce4acc62eaf01eaca1208dcf0783025ef27572c3336502b9c232005e7", size = 105061, upload-time = "2026-03-01T22:05:22.268Z" }, + { url = "https://files.pythonhosted.org/packages/66/3e/868e5c3364b6cee19ff3e1a122194fa4ce51def02c61023970442162859e/yarl-1.23.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a3d2bff8f37f8d0f96c7ec554d16945050d54462d6e95414babaa18bfafc7f51", size = 100132, upload-time = "2026-03-01T22:05:23.638Z" }, + { url = "https://files.pythonhosted.org/packages/cf/26/9c89acf82f08a52cb52d6d39454f8d18af15f9d386a23795389d1d423823/yarl-1.23.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c75eb09e8d55bceb4367e83496ff8ef2bc7ea6960efb38e978e8073ea59ecb67", size = 99289, upload-time = "2026-03-01T22:05:25.749Z" }, + { url = "https://files.pythonhosted.org/packages/6f/54/5b0db00d2cb056922356104468019c0a132e89c8d3ab67d8ede9f4483d2a/yarl-1.23.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:877b0738624280e34c55680d6054a307aa94f7d52fa0e3034a9cc6e790871da7", size = 96950, upload-time = "2026-03-01T22:05:27.318Z" }, + { url = "https://files.pythonhosted.org/packages/f6/40/10fa93811fd439341fad7e0718a86aca0de9548023bbb403668d6555acab/yarl-1.23.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:b5405bb8f0e783a988172993cfc627e4d9d00432d6bbac65a923041edacf997d", size = 93960, upload-time = "2026-03-01T22:05:28.738Z" }, + { url = "https://files.pythonhosted.org/packages/bc/d2/8ae2e6cd77d0805f4526e30ec43b6f9a3dfc542d401ac4990d178e4bf0cf/yarl-1.23.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:1c3a3598a832590c5a3ce56ab5576361b5688c12cb1d39429cf5dba30b510760", size = 104703, upload-time = "2026-03-01T22:05:30.438Z" }, + { url = "https://files.pythonhosted.org/packages/2f/0c/b3ceacf82c3fe21183ce35fa2acf5320af003d52bc1fcf5915077681142e/yarl-1.23.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:8419ebd326430d1cbb7efb5292330a2cf39114e82df5cc3d83c9a0d5ebeaf2f2", size = 98325, upload-time = "2026-03-01T22:05:31.835Z" }, + { url = "https://files.pythonhosted.org/packages/9d/e0/12900edd28bdab91a69bd2554b85ad7b151f64e8b521fe16f9ad2f56477a/yarl-1.23.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:be61f6fff406ca40e3b1d84716fde398fc08bc63dd96d15f3a14230a0973ed86", size = 105067, upload-time = "2026-03-01T22:05:33.358Z" }, + { url = "https://files.pythonhosted.org/packages/15/61/74bb1182cf79c9bbe4eb6b1f14a57a22d7a0be5e9cedf8e2d5c2086474c3/yarl-1.23.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3ceb13c5c858d01321b5d9bb65e4cf37a92169ea470b70fec6f236b2c9dd7e34", size = 100285, upload-time = "2026-03-01T22:05:35.4Z" }, + { url = "https://files.pythonhosted.org/packages/69/7f/cd5ef733f2550de6241bd8bd8c3febc78158b9d75f197d9c7baa113436af/yarl-1.23.0-cp312-cp312-win32.whl", hash = "sha256:fffc45637bcd6538de8b85f51e3df3223e4ad89bccbfca0481c08c7fc8b7ed7d", size = 82359, upload-time = "2026-03-01T22:05:36.811Z" }, + { url = "https://files.pythonhosted.org/packages/f5/be/25216a49daeeb7af2bec0db22d5e7df08ed1d7c9f65d78b14f3b74fd72fc/yarl-1.23.0-cp312-cp312-win_amd64.whl", hash = "sha256:f69f57305656a4852f2a7203efc661d8c042e6cc67f7acd97d8667fb448a426e", size = 87674, upload-time = "2026-03-01T22:05:38.171Z" }, + { url = "https://files.pythonhosted.org/packages/d2/35/aeab955d6c425b227d5b7247eafb24f2653fedc32f95373a001af5dfeb9e/yarl-1.23.0-cp312-cp312-win_arm64.whl", hash = "sha256:6e87a6e8735b44816e7db0b2fbc9686932df473c826b0d9743148432e10bb9b9", size = 81879, upload-time = "2026-03-01T22:05:40.006Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4b/a0a6e5d0ee8a2f3a373ddef8a4097d74ac901ac363eea1440464ccbe0898/yarl-1.23.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:16c6994ac35c3e74fb0ae93323bf8b9c2a9088d55946109489667c510a7d010e", size = 123796, upload-time = "2026-03-01T22:05:41.412Z" }, + { url = "https://files.pythonhosted.org/packages/67/b6/8925d68af039b835ae876db5838e82e76ec87b9782ecc97e192b809c4831/yarl-1.23.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4a42e651629dafb64fd5b0286a3580613702b5809ad3f24934ea87595804f2c5", size = 86547, upload-time = "2026-03-01T22:05:42.841Z" }, + { url = "https://files.pythonhosted.org/packages/ae/50/06d511cc4b8e0360d3c94af051a768e84b755c5eb031b12adaaab6dec6e5/yarl-1.23.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7c6b9461a2a8b47c65eef63bb1c76a4f1c119618ffa99ea79bc5bb1e46c5821b", size = 85854, upload-time = "2026-03-01T22:05:44.85Z" }, + { url = "https://files.pythonhosted.org/packages/c4/f4/4e30b250927ffdab4db70da08b9b8d2194d7c7b400167b8fbeca1e4701ca/yarl-1.23.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2569b67d616eab450d262ca7cb9f9e19d2f718c70a8b88712859359d0ab17035", size = 98351, upload-time = "2026-03-01T22:05:46.836Z" }, + { url = "https://files.pythonhosted.org/packages/86/fc/4118c5671ea948208bdb1492d8b76bdf1453d3e73df051f939f563e7dcc5/yarl-1.23.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e9d9a4d06d3481eab79803beb4d9bd6f6a8e781ec078ac70d7ef2dcc29d1bea5", size = 92711, upload-time = "2026-03-01T22:05:48.316Z" }, + { url = "https://files.pythonhosted.org/packages/56/11/1ed91d42bd9e73c13dc9e7eb0dd92298d75e7ac4dd7f046ad0c472e231cd/yarl-1.23.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f514f6474e04179d3d33175ed3f3e31434d3130d42ec153540d5b157deefd735", size = 106014, upload-time = "2026-03-01T22:05:50.028Z" }, + { url = "https://files.pythonhosted.org/packages/ce/c9/74e44e056a23fbc33aca71779ef450ca648a5bc472bdad7a82339918f818/yarl-1.23.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fda207c815b253e34f7e1909840fd14299567b1c0eb4908f8c2ce01a41265401", size = 105557, upload-time = "2026-03-01T22:05:51.416Z" }, + { url = "https://files.pythonhosted.org/packages/66/fe/b1e10b08d287f518994f1e2ff9b6d26f0adeecd8dd7d533b01bab29a3eda/yarl-1.23.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34b6cf500e61c90f305094911f9acc9c86da1a05a7a3f5be9f68817043f486e4", size = 101559, upload-time = "2026-03-01T22:05:52.872Z" }, + { url = "https://files.pythonhosted.org/packages/72/59/c5b8d94b14e3d3c2a9c20cb100119fd534ab5a14b93673ab4cc4a4141ea5/yarl-1.23.0-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d7504f2b476d21653e4d143f44a175f7f751cd41233525312696c76aa3dbb23f", size = 100502, upload-time = "2026-03-01T22:05:54.954Z" }, + { url = "https://files.pythonhosted.org/packages/77/4f/96976cb54cbfc5c9fd73ed4c51804f92f209481d1fb190981c0f8a07a1d7/yarl-1.23.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:578110dd426f0d209d1509244e6d4a3f1a3e9077655d98c5f22583d63252a08a", size = 98027, upload-time = "2026-03-01T22:05:56.409Z" }, + { url = "https://files.pythonhosted.org/packages/63/6e/904c4f476471afdbad6b7e5b70362fb5810e35cd7466529a97322b6f5556/yarl-1.23.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:609d3614d78d74ebe35f54953c5bbd2ac647a7ddb9c30a5d877580f5e86b22f2", size = 95369, upload-time = "2026-03-01T22:05:58.141Z" }, + { url = "https://files.pythonhosted.org/packages/9d/40/acfcdb3b5f9d68ef499e39e04d25e141fe90661f9d54114556cf83be8353/yarl-1.23.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4966242ec68afc74c122f8459abd597afd7d8a60dc93d695c1334c5fd25f762f", size = 105565, upload-time = "2026-03-01T22:06:00.286Z" }, + { url = "https://files.pythonhosted.org/packages/5e/c6/31e28f3a6ba2869c43d124f37ea5260cac9c9281df803c354b31f4dd1f3c/yarl-1.23.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:e0fd068364a6759bc794459f0a735ab151d11304346332489c7972bacbe9e72b", size = 99813, upload-time = "2026-03-01T22:06:01.712Z" }, + { url = "https://files.pythonhosted.org/packages/08/1f/6f65f59e72d54aa467119b63fc0b0b1762eff0232db1f4720cd89e2f4a17/yarl-1.23.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:39004f0ad156da43e86aa71f44e033de68a44e5a31fc53507b36dd253970054a", size = 105632, upload-time = "2026-03-01T22:06:03.188Z" }, + { url = "https://files.pythonhosted.org/packages/a3/c4/18b178a69935f9e7a338127d5b77d868fdc0f0e49becd286d51b3a18c61d/yarl-1.23.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e5723c01a56c5028c807c701aa66722916d2747ad737a046853f6c46f4875543", size = 101895, upload-time = "2026-03-01T22:06:04.651Z" }, + { url = "https://files.pythonhosted.org/packages/8f/54/f5b870b5505663911dba950a8e4776a0dbd51c9c54c0ae88e823e4b874a0/yarl-1.23.0-cp313-cp313-win32.whl", hash = "sha256:1b6b572edd95b4fa8df75de10b04bc81acc87c1c7d16bcdd2035b09d30acc957", size = 82356, upload-time = "2026-03-01T22:06:06.04Z" }, + { url = "https://files.pythonhosted.org/packages/7a/84/266e8da36879c6edcd37b02b547e2d9ecdfea776be49598e75696e3316e1/yarl-1.23.0-cp313-cp313-win_amd64.whl", hash = "sha256:baaf55442359053c7d62f6f8413a62adba3205119bcb6f49594894d8be47e5e3", size = 87515, upload-time = "2026-03-01T22:06:08.107Z" }, + { url = "https://files.pythonhosted.org/packages/00/fd/7e1c66efad35e1649114fa13f17485f62881ad58edeeb7f49f8c5e748bf9/yarl-1.23.0-cp313-cp313-win_arm64.whl", hash = "sha256:fb4948814a2a98e3912505f09c9e7493b1506226afb1f881825368d6fb776ee3", size = 81785, upload-time = "2026-03-01T22:06:10.181Z" }, + { url = "https://files.pythonhosted.org/packages/9c/fc/119dd07004f17ea43bb91e3ece6587759edd7519d6b086d16bfbd3319982/yarl-1.23.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:aecfed0b41aa72b7881712c65cf764e39ce2ec352324f5e0837c7048d9e6daaa", size = 130719, upload-time = "2026-03-01T22:06:11.708Z" }, + { url = "https://files.pythonhosted.org/packages/e6/0d/9f2348502fbb3af409e8f47730282cd6bc80dec6630c1e06374d882d6eb2/yarl-1.23.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:a41bcf68efd19073376eb8cf948b8d9be0af26256403e512bb18f3966f1f9120", size = 89690, upload-time = "2026-03-01T22:06:13.429Z" }, + { url = "https://files.pythonhosted.org/packages/50/93/e88f3c80971b42cfc83f50a51b9d165a1dbf154b97005f2994a79f212a07/yarl-1.23.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:cde9a2ecd91668bcb7f077c4966d8ceddb60af01b52e6e3e2680e4cf00ad1a59", size = 89851, upload-time = "2026-03-01T22:06:15.53Z" }, + { url = "https://files.pythonhosted.org/packages/1c/07/61c9dd8ba8f86473263b4036f70fb594c09e99c0d9737a799dfd8bc85651/yarl-1.23.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5023346c4ee7992febc0068e7593de5fa2bf611848c08404b35ebbb76b1b0512", size = 95874, upload-time = "2026-03-01T22:06:17.553Z" }, + { url = "https://files.pythonhosted.org/packages/9e/e9/f9ff8ceefba599eac6abddcfb0b3bee9b9e636e96dbf54342a8577252379/yarl-1.23.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d1009abedb49ae95b136a8904a3f71b342f849ffeced2d3747bf29caeda218c4", size = 88710, upload-time = "2026-03-01T22:06:19.004Z" }, + { url = "https://files.pythonhosted.org/packages/eb/78/0231bfcc5d4c8eec220bc2f9ef82cb4566192ea867a7c5b4148f44f6cbcd/yarl-1.23.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a8d00f29b42f534cc8aa3931cfe773b13b23e561e10d2b26f27a8d309b0e82a1", size = 101033, upload-time = "2026-03-01T22:06:21.203Z" }, + { url = "https://files.pythonhosted.org/packages/cd/9b/30ea5239a61786f18fd25797151a17fbb3be176977187a48d541b5447dd4/yarl-1.23.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:95451e6ce06c3e104556d73b559f5da6c34a069b6b62946d3ad66afcd51642ea", size = 100817, upload-time = "2026-03-01T22:06:22.738Z" }, + { url = "https://files.pythonhosted.org/packages/62/e2/a4980481071791bc83bce2b7a1a1f7adcabfa366007518b4b845e92eeee3/yarl-1.23.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:531ef597132086b6cf96faa7c6c1dcd0361dd5f1694e5cc30375907b9b7d3ea9", size = 97482, upload-time = "2026-03-01T22:06:24.21Z" }, + { url = "https://files.pythonhosted.org/packages/e5/1e/304a00cf5f6100414c4b5a01fc7ff9ee724b62158a08df2f8170dfc72a2d/yarl-1.23.0-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:88f9fb0116fbfcefcab70f85cf4b74a2b6ce5d199c41345296f49d974ddb4123", size = 95949, upload-time = "2026-03-01T22:06:25.697Z" }, + { url = "https://files.pythonhosted.org/packages/68/03/093f4055ed4cae649ac53bca3d180bd37102e9e11d048588e9ab0c0108d0/yarl-1.23.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:e7b0460976dc75cb87ad9cc1f9899a4b97751e7d4e77ab840fc9b6d377b8fd24", size = 95839, upload-time = "2026-03-01T22:06:27.309Z" }, + { url = "https://files.pythonhosted.org/packages/b9/28/4c75ebb108f322aa8f917ae10a8ffa4f07cae10a8a627b64e578617df6a0/yarl-1.23.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:115136c4a426f9da976187d238e84139ff6b51a20839aa6e3720cd1026d768de", size = 90696, upload-time = "2026-03-01T22:06:29.048Z" }, + { url = "https://files.pythonhosted.org/packages/23/9c/42c2e2dd91c1a570402f51bdf066bfdb1241c2240ba001967bad778e77b7/yarl-1.23.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:ead11956716a940c1abc816b7df3fa2b84d06eaed8832ca32f5c5e058c65506b", size = 100865, upload-time = "2026-03-01T22:06:30.525Z" }, + { url = "https://files.pythonhosted.org/packages/74/05/1bcd60a8a0a914d462c305137246b6f9d167628d73568505fce3f1cb2e65/yarl-1.23.0-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:fe8f8f5e70e6dbdfca9882cd9deaac058729bcf323cf7a58660901e55c9c94f6", size = 96234, upload-time = "2026-03-01T22:06:32.692Z" }, + { url = "https://files.pythonhosted.org/packages/90/b2/f52381aac396d6778ce516b7bc149c79e65bfc068b5de2857ab69eeea3b7/yarl-1.23.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:a0e317df055958a0c1e79e5d2aa5a5eaa4a6d05a20d4b0c9c3f48918139c9fc6", size = 100295, upload-time = "2026-03-01T22:06:34.268Z" }, + { url = "https://files.pythonhosted.org/packages/e5/e8/638bae5bbf1113a659b2435d8895474598afe38b4a837103764f603aba56/yarl-1.23.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6f0fd84de0c957b2d280143522c4f91a73aada1923caee763e24a2b3fda9f8a5", size = 97784, upload-time = "2026-03-01T22:06:35.864Z" }, + { url = "https://files.pythonhosted.org/packages/80/25/a3892b46182c586c202629fc2159aa13975d3741d52ebd7347fd501d48d5/yarl-1.23.0-cp313-cp313t-win32.whl", hash = "sha256:93a784271881035ab4406a172edb0faecb6e7d00f4b53dc2f55919d6c9688595", size = 88313, upload-time = "2026-03-01T22:06:37.39Z" }, + { url = "https://files.pythonhosted.org/packages/43/68/8c5b36aa5178900b37387937bc2c2fe0e9505537f713495472dcf6f6fccc/yarl-1.23.0-cp313-cp313t-win_amd64.whl", hash = "sha256:dd00607bffbf30250fe108065f07453ec124dbf223420f57f5e749b04295e090", size = 94932, upload-time = "2026-03-01T22:06:39.579Z" }, + { url = "https://files.pythonhosted.org/packages/c6/cc/d79ba8292f51f81f4dc533a8ccfb9fc6992cabf0998ed3245de7589dc07c/yarl-1.23.0-cp313-cp313t-win_arm64.whl", hash = "sha256:ac09d42f48f80c9ee1635b2fcaa819496a44502737660d3c0f2ade7526d29144", size = 84786, upload-time = "2026-03-01T22:06:41.988Z" }, + { url = "https://files.pythonhosted.org/packages/90/98/b85a038d65d1b92c3903ab89444f48d3cee490a883477b716d7a24b1a78c/yarl-1.23.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:21d1b7305a71a15b4794b5ff22e8eef96ff4a6d7f9657155e5aa419444b28912", size = 124455, upload-time = "2026-03-01T22:06:43.615Z" }, + { url = "https://files.pythonhosted.org/packages/39/54/bc2b45559f86543d163b6e294417a107bb87557609007c007ad889afec18/yarl-1.23.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:85610b4f27f69984932a7abbe52703688de3724d9f72bceb1cca667deff27474", size = 86752, upload-time = "2026-03-01T22:06:45.425Z" }, + { url = "https://files.pythonhosted.org/packages/24/f9/e8242b68362bffe6fb536c8db5076861466fc780f0f1b479fc4ffbebb128/yarl-1.23.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:23f371bd662cf44a7630d4d113101eafc0cfa7518a2760d20760b26021454719", size = 86291, upload-time = "2026-03-01T22:06:46.974Z" }, + { url = "https://files.pythonhosted.org/packages/ea/d8/d1cb2378c81dd729e98c716582b1ccb08357e8488e4c24714658cc6630e8/yarl-1.23.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4a80f77dc1acaaa61f0934176fccca7096d9b1ff08c8ba9cddf5ae034a24319", size = 99026, upload-time = "2026-03-01T22:06:48.459Z" }, + { url = "https://files.pythonhosted.org/packages/0a/ff/7196790538f31debe3341283b5b0707e7feb947620fc5e8236ef28d44f72/yarl-1.23.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:bd654fad46d8d9e823afbb4f87c79160b5a374ed1ff5bde24e542e6ba8f41434", size = 92355, upload-time = "2026-03-01T22:06:50.306Z" }, + { url = "https://files.pythonhosted.org/packages/c1/56/25d58c3eddde825890a5fe6aa1866228377354a3c39262235234ab5f616b/yarl-1.23.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:682bae25f0a0dd23a056739f23a134db9f52a63e2afd6bfb37ddc76292bbd723", size = 106417, upload-time = "2026-03-01T22:06:52.1Z" }, + { url = "https://files.pythonhosted.org/packages/51/8a/882c0e7bc8277eb895b31bce0138f51a1ba551fc2e1ec6753ffc1e7c1377/yarl-1.23.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a82836cab5f197a0514235aaf7ffccdc886ccdaa2324bc0aafdd4ae898103039", size = 106422, upload-time = "2026-03-01T22:06:54.424Z" }, + { url = "https://files.pythonhosted.org/packages/42/2b/fef67d616931055bf3d6764885990a3ac647d68734a2d6a9e1d13de437a2/yarl-1.23.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c57676bdedc94cd3bc37724cf6f8cd2779f02f6aba48de45feca073e714fe52", size = 101915, upload-time = "2026-03-01T22:06:55.895Z" }, + { url = "https://files.pythonhosted.org/packages/18/6a/530e16aebce27c5937920f3431c628a29a4b6b430fab3fd1c117b26ff3f6/yarl-1.23.0-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c7f8dc16c498ff06497c015642333219871effba93e4a2e8604a06264aca5c5c", size = 100690, upload-time = "2026-03-01T22:06:58.21Z" }, + { url = "https://files.pythonhosted.org/packages/88/08/93749219179a45e27b036e03260fda05190b911de8e18225c294ac95bbc9/yarl-1.23.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:5ee586fb17ff8f90c91cf73c6108a434b02d69925f44f5f8e0d7f2f260607eae", size = 98750, upload-time = "2026-03-01T22:06:59.794Z" }, + { url = "https://files.pythonhosted.org/packages/d9/cf/ea424a004969f5d81a362110a6ac1496d79efdc6d50c2c4b2e3ea0fc2519/yarl-1.23.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:17235362f580149742739cc3828b80e24029d08cbb9c4bda0242c7b5bc610a8e", size = 94685, upload-time = "2026-03-01T22:07:01.375Z" }, + { url = "https://files.pythonhosted.org/packages/e2/b7/14341481fe568e2b0408bcf1484c652accafe06a0ade9387b5d3fd9df446/yarl-1.23.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:0793e2bd0cf14234983bbb371591e6bea9e876ddf6896cdcc93450996b0b5c85", size = 106009, upload-time = "2026-03-01T22:07:03.151Z" }, + { url = "https://files.pythonhosted.org/packages/0a/e6/5c744a9b54f4e8007ad35bce96fbc9218338e84812d36f3390cea616881a/yarl-1.23.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:3650dc2480f94f7116c364096bc84b1d602f44224ef7d5c7208425915c0475dd", size = 100033, upload-time = "2026-03-01T22:07:04.701Z" }, + { url = "https://files.pythonhosted.org/packages/0c/23/e3bfc188d0b400f025bc49d99793d02c9abe15752138dcc27e4eaf0c4a9e/yarl-1.23.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:f40e782d49630ad384db66d4d8b73ff4f1b8955dc12e26b09a3e3af064b3b9d6", size = 106483, upload-time = "2026-03-01T22:07:06.231Z" }, + { url = "https://files.pythonhosted.org/packages/72/42/f0505f949a90b3f8b7a363d6cbdf398f6e6c58946d85c6d3a3bc70595b26/yarl-1.23.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:94f8575fbdf81749008d980c17796097e645574a3b8c28ee313931068dad14fe", size = 102175, upload-time = "2026-03-01T22:07:08.4Z" }, + { url = "https://files.pythonhosted.org/packages/aa/65/b39290f1d892a9dd671d1c722014ca062a9c35d60885d57e5375db0404b5/yarl-1.23.0-cp314-cp314-win32.whl", hash = "sha256:c8aa34a5c864db1087d911a0b902d60d203ea3607d91f615acd3f3108ac32169", size = 83871, upload-time = "2026-03-01T22:07:09.968Z" }, + { url = "https://files.pythonhosted.org/packages/a9/5b/9b92f54c784c26e2a422e55a8d2607ab15b7ea3349e28359282f84f01d43/yarl-1.23.0-cp314-cp314-win_amd64.whl", hash = "sha256:63e92247f383c85ab00dd0091e8c3fa331a96e865459f5ee80353c70a4a42d70", size = 89093, upload-time = "2026-03-01T22:07:11.501Z" }, + { url = "https://files.pythonhosted.org/packages/e0/7d/8a84dc9381fd4412d5e7ff04926f9865f6372b4c2fd91e10092e65d29eb8/yarl-1.23.0-cp314-cp314-win_arm64.whl", hash = "sha256:70efd20be968c76ece7baa8dafe04c5be06abc57f754d6f36f3741f7aa7a208e", size = 83384, upload-time = "2026-03-01T22:07:13.069Z" }, + { url = "https://files.pythonhosted.org/packages/dd/8d/d2fad34b1c08aa161b74394183daa7d800141aaaee207317e82c790b418d/yarl-1.23.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:9a18d6f9359e45722c064c97464ec883eb0e0366d33eda61cb19a244bf222679", size = 131019, upload-time = "2026-03-01T22:07:14.903Z" }, + { url = "https://files.pythonhosted.org/packages/19/ff/33009a39d3ccf4b94d7d7880dfe17fb5816c5a4fe0096d9b56abceea9ac7/yarl-1.23.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:2803ed8b21ca47a43da80a6fd1ed3019d30061f7061daa35ac54f63933409412", size = 89894, upload-time = "2026-03-01T22:07:17.372Z" }, + { url = "https://files.pythonhosted.org/packages/0c/f1/dab7ac5e7306fb79c0190766a3c00b4cb8d09a1f390ded68c85a5934faf5/yarl-1.23.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:394906945aa8b19fc14a61cf69743a868bb8c465efe85eee687109cc540b98f4", size = 89979, upload-time = "2026-03-01T22:07:19.361Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b1/08e95f3caee1fad6e65017b9f26c1d79877b502622d60e517de01e72f95d/yarl-1.23.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:71d006bee8397a4a89f469b8deb22469fe7508132d3c17fa6ed871e79832691c", size = 95943, upload-time = "2026-03-01T22:07:21.266Z" }, + { url = "https://files.pythonhosted.org/packages/c0/cc/6409f9018864a6aa186c61175b977131f373f1988e198e031236916e87e4/yarl-1.23.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:62694e275c93d54f7ccedcfef57d42761b2aad5234b6be1f3e3026cae4001cd4", size = 88786, upload-time = "2026-03-01T22:07:23.129Z" }, + { url = "https://files.pythonhosted.org/packages/76/40/cc22d1d7714b717fde2006fad2ced5efe5580606cb059ae42117542122f3/yarl-1.23.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a31de1613658308efdb21ada98cbc86a97c181aa050ba22a808120bb5be3ab94", size = 101307, upload-time = "2026-03-01T22:07:24.689Z" }, + { url = "https://files.pythonhosted.org/packages/8f/0d/476c38e85ddb4c6ec6b20b815bdd779aa386a013f3d8b85516feee55c8dc/yarl-1.23.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fb1e8b8d66c278b21d13b0a7ca22c41dd757a7c209c6b12c313e445c31dd3b28", size = 100904, upload-time = "2026-03-01T22:07:26.287Z" }, + { url = "https://files.pythonhosted.org/packages/72/32/0abe4a76d59adf2081dcb0397168553ece4616ada1c54d1c49d8936c74f8/yarl-1.23.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:50f9d8d531dfb767c565f348f33dd5139a6c43f5cbdf3f67da40d54241df93f6", size = 97728, upload-time = "2026-03-01T22:07:27.906Z" }, + { url = "https://files.pythonhosted.org/packages/b7/35/7b30f4810fba112f60f5a43237545867504e15b1c7647a785fbaf588fac2/yarl-1.23.0-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:575aa4405a656e61a540f4a80eaa5260f2a38fff7bfdc4b5f611840d76e9e277", size = 95964, upload-time = "2026-03-01T22:07:30.198Z" }, + { url = "https://files.pythonhosted.org/packages/2d/86/ed7a73ab85ef00e8bb70b0cb5421d8a2a625b81a333941a469a6f4022828/yarl-1.23.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:041b1a4cefacf65840b4e295c6985f334ba83c30607441ae3cf206a0eed1a2e4", size = 95882, upload-time = "2026-03-01T22:07:32.132Z" }, + { url = "https://files.pythonhosted.org/packages/19/90/d56967f61a29d8498efb7afb651e0b2b422a1e9b47b0ab5f4e40a19b699b/yarl-1.23.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:d38c1e8231722c4ce40d7593f28d92b5fc72f3e9774fe73d7e800ec32299f63a", size = 90797, upload-time = "2026-03-01T22:07:34.404Z" }, + { url = "https://files.pythonhosted.org/packages/72/00/8b8f76909259f56647adb1011d7ed8b321bcf97e464515c65016a47ecdf0/yarl-1.23.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:d53834e23c015ee83a99377db6e5e37d8484f333edb03bd15b4bc312cc7254fb", size = 101023, upload-time = "2026-03-01T22:07:35.953Z" }, + { url = "https://files.pythonhosted.org/packages/ac/e2/cab11b126fb7d440281b7df8e9ddbe4851e70a4dde47a202b6642586b8d9/yarl-1.23.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:2e27c8841126e017dd2a054a95771569e6070b9ee1b133366d8b31beb5018a41", size = 96227, upload-time = "2026-03-01T22:07:37.594Z" }, + { url = "https://files.pythonhosted.org/packages/c2/9b/2c893e16bfc50e6b2edf76c1a9eb6cb0c744346197e74c65e99ad8d634d0/yarl-1.23.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:76855800ac56f878847a09ce6dba727c93ca2d89c9e9d63002d26b916810b0a2", size = 100302, upload-time = "2026-03-01T22:07:39.334Z" }, + { url = "https://files.pythonhosted.org/packages/28/ec/5498c4e3a6d5f1003beb23405671c2eb9cdbf3067d1c80f15eeafe301010/yarl-1.23.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:e09fd068c2e169a7070d83d3bde728a4d48de0549f975290be3c108c02e499b4", size = 98202, upload-time = "2026-03-01T22:07:41.717Z" }, + { url = "https://files.pythonhosted.org/packages/fe/c3/cd737e2d45e70717907f83e146f6949f20cc23cd4bf7b2688727763aa458/yarl-1.23.0-cp314-cp314t-win32.whl", hash = "sha256:73309162a6a571d4cbd3b6a1dcc703c7311843ae0d1578df6f09be4e98df38d4", size = 90558, upload-time = "2026-03-01T22:07:43.433Z" }, + { url = "https://files.pythonhosted.org/packages/e1/19/3774d162f6732d1cfb0b47b4140a942a35ca82bb19b6db1f80e9e7bdc8f8/yarl-1.23.0-cp314-cp314t-win_amd64.whl", hash = "sha256:4503053d296bc6e4cbd1fad61cf3b6e33b939886c4f249ba7c78b602214fabe2", size = 97610, upload-time = "2026-03-01T22:07:45.773Z" }, + { url = "https://files.pythonhosted.org/packages/51/47/3fa2286c3cb162c71cdb34c4224d5745a1ceceb391b2bd9b19b668a8d724/yarl-1.23.0-cp314-cp314t-win_arm64.whl", hash = "sha256:44bb7bef4ea409384e3f8bc36c063d77ea1b8d4a5b2706956c0d6695f07dcc25", size = 86041, upload-time = "2026-03-01T22:07:49.026Z" }, + { url = "https://files.pythonhosted.org/packages/69/68/c8739671f5699c7dc470580a4f821ef37c32c4cb0b047ce223a7f115757f/yarl-1.23.0-py3-none-any.whl", hash = "sha256:a2df6afe50dea8ae15fa34c9f824a3ee958d785fd5d089063d960bae1daa0a3f", size = 48288, upload-time = "2026-03-01T22:07:51.388Z" }, +] + +[[package]] +name = "zipp" +version = "3.23.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e3/02/0f2892c661036d50ede074e376733dca2ae7c6eb617489437771209d4180/zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166", size = 25547, upload-time = "2025-06-08T17:06:39.4Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2e/54/647ade08bf0db230bfea292f893923872fd20be6ac6f53b2b936ba839d75/zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e", size = 10276, upload-time = "2025-06-08T17:06:38.034Z" }, +]